Ask Your Question
0

Iterating over contours of an Image in Java

asked 2015-06-08 21:37:22 -0600

ElsayedAwd gravatar image

please how I can Iterate over a list of Contours of an Image in Java for Android . many thanks

edit retag flag offensive close merge delete

Comments

1

e.g. look at the android samples

berak gravatar imageberak ( 2015-06-08 23:51:15 -0600 )edit

thanks a lot

ElsayedAwd gravatar imageElsayedAwd ( 2015-06-09 12:51:18 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-09 15:55:16 -0600

iamprivate gravatar image

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 
     }
edit flag offensive delete link more

Comments

you are right but I would to Iterate over the contours to remove some contours

ElsayedAwd gravatar imageElsayedAwd ( 2015-06-09 21:59:01 -0600 )edit

You can for example ignore some based on their area

if(Imgproc.contourArea(contours.get(i))>max) { // add bigger contours to new list }

iamprivate gravatar imageiamprivate ( 2015-06-10 02:19:04 -0600 )edit

thanks a lot

ElsayedAwd gravatar imageElsayedAwd ( 2015-06-12 21:30:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-08 21:37:22 -0600

Seen: 510 times

Last updated: Jun 09 '15