0
votes

I ran findCountours on the following Image: enter image description here

And got the following contour image (I'm showing only "parent" contours according to the hierarchy):

enter image description here

As you can see, there are many different contours around each object (each one in a different color). Now, I want to unify the contours around the person to obtain one enclosing contour, so I could segment her our from the image.

I'm not sure that it can be done, but I thought I should ask here.

Is there any method to intelligently unify the contours in the image so I could segment different objects out?

Thanks,

Gil.

2
The short answer is probably no, you are trying to achieve image segmentation. You can look here: eecs.berkeley.edu/Research/Projects/CS/vision/bsdsRosa Gronchi
Thanks for your comment.GilLevi

2 Answers

2
votes

First, do you want to achieve the result only on this image or any other image where different people will present in different pose and different dresses?

If you want to segment only this image, then with some color thresholding or with some morphology operations you can achieve it. But to make it work for any image with different persons probably you may need to pursue a PhD in computer vision.

But if your task is segmentation only then I would suggest a Semi-Automatic Segmentation technique like Grab Cut or graph cut. These are very popular segmentation algorithms which are readily available in opencv or matlab. They work very well on all kind of images. Here is the result of grab cut algorithm on your image.

enter image description here

1
votes

There is lots of work on Contour based segmentation in the literature out there. The Ultrametric contour map produces a hierarchy of contours which are segmentations of objects in an input image.

Pub: Contour Detection and Hierarchical Image SegmentationPablo Arbelaez, Michael Maire, Charless Fowlkes, Jitendra Malik