Iterating over contours of an Image in Java
please how I can Iterate over a list of Contours of an Image in Java for Android . many thanks
please how I can Iterate over a list of Contours of an Image in Java for Android . many thanks
Do you mean something like this
Imgproc.findContours(temp, contours, new Mat(),Imgproc.RETR_LIST,Imgproc.CHAIN_APPROX_NONE);
for(int i =0;i<contours.size();i++)
{
// do something
}
you are right but I would to Iterate over the contours to remove some contours
You can for example ignore some based on their area
if(Imgproc.contourArea(contours.get(i))>max) { // add bigger contours to new list }
Asked: 2015-06-08 21:37:22 -0600
Seen: 510 times
Last updated: Jun 09 '15
e.g. look at the android samples
thanks a lot