All Questions
43 questions
1
vote
1
answer
84
views
Java error "OpenCV Assertion failed: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S)"
When I try to run this openCV code on an FTC robot:
List<MatOfPoint> contours = new ArrayList<>();
Imgproc.findContours(thresholded, contours, new Mat(), Imgproc....
0
votes
1
answer
424
views
In OpenCV 4.5.0 Java what method returns the number of points in a contour?
In C++ I am doing this: and all is well, now I need to switch to Java For Android.
vector<vector<Point> > contours;
findContours(image, contours,
CV_RETR_EXTERNAL,...
0
votes
0
answers
105
views
How to crop the words in order as they appear in the text image
I have a text image and I have found the contours for every word. Now I want to crop all the contours in the order they appear in the text. I have tried to sort the contours from left to right but did ...
-1
votes
1
answer
970
views
Detect Biggest Rectangle in the Image using Java Opencv [SOLVED]
How can I detect the four corner points of the biggest square (at center of the image) using opencv in java
I have solved this using findContours.
Original Image
Output Image
Please find the code ...
1
vote
1
answer
426
views
opencv contour detection seems to fail when a line crosses
I'm trying to detect a rectangle and it works perfectly when the background is a flat distinctive color. But when it has drawings or lines that cross... things get weird. How can I detect this ...
1
vote
1
answer
134
views
OpenCV 4.1 Java - contourArea() fails assertion depth == CV_32F || depth == CV_32S for hull matrix
I've tried to calculate the hull area from the hull points generated by
convexHull().
I followed the OpenCV Python tutorial (because there's no Java tutorial) and fiddled around with code completion.
...
0
votes
0
answers
288
views
Frequent JVM crash by SIGSEGV on cv::_OutputArray::create at libopencv_java342.so
I am getting frequent JVM crash. Using opencv with Java Imgproc library. It gets called from findContours function of Imgproc library.
Stack: [0x00007febe3875000,0x00007febe38f6000],
sp=...
0
votes
1
answer
2k
views
OpenCV finding corners of contours
I am completely new to OpenCV. For practice I decided to do a "Sudoku Solver". So far I was able to do this :
public Mat processImage(final Mat originalImage, final CvCameraViewFrame frame) {
...
0
votes
1
answer
381
views
Opencv findContour
I am working on a project to detect wounds, the type of wounds are as follow in the attached named(original).
I had tried with the following method to detect the area of wound that is of interest. ...
0
votes
1
answer
73
views
Comparison method violates its general contract! while sorting Image contours in java
I know there might be other similar questions but they still did not resolve my issue. I'm trying to sort Image contours based on their contour area using the following:
contours.sort((Object o1, ...
0
votes
1
answer
811
views
OpenCV - Remove wrong contours
I've got a short question about OpenCV and finding specific shapes. On my PC I've got a pictrue with some shapes but I only want the contours of the rectangles:
Input file:
What my output should be:
...
1
vote
2
answers
384
views
Preserving Character ordering during image processing with OpenCv
In the below code, I am trying to pre-process the image and using findContours I am trying to extract each character as an image.
Mat inImage = Imgcodecs.imread("CaptureMultiLines.jpg", Imgcodecs....
0
votes
0
answers
837
views
Detecting Objects with Opencv java
I am trying to extract contours objects from this:
Which is the S component of a HSV image obtained from this:
My code:
Mat hsvImage = new Mat();
Imgproc.cvtColor(image, hsvImage, Imgproc....
0
votes
0
answers
500
views
Using hierarchy to remove unwanted contours
My question is how I can access the parent value like I do in C++ in Java. In C++ I get an index of the matrix. In my C++ I do if(hierarchy[i][4] == -1) That checks the parent value. When I try to do ...
2
votes
1
answer
5k
views
How to remove overlapping contours
I am working on a program where I am trying to extract the colored squares from a puzzle. I take a frame from a video capture then find the all contours. I then remove contours that aren't in the ...