countourFinder close holes?

Hi all,

I am working with live video and contourFinder to get only the outline of a body image. The outline works but there are holes or gaps on the edges of the outline, it doesn’t look clean enough.

I know adjusting the camera settings and working with a plain background helps, but I was wondering if there was a way in the code to make the holes go away? This could be something similar to cv.jit.close in jitter.

Any advice would be grateful!

Could you try to blurring the image before detect the countours.

That helps?

image.dilate(), which you can call on the black and white image, is useful for expanding white regions and can be used for filling holes. it’s slow if you do it too any times, but a few times can lead to much cleaner contours.

take care,
zach

Hi,

Sorry for resurrecting the post. Is there any new method for doing this?
Something like this would be great: http://stackoverflow.com/questions/1716274/fill-the-holes-in-opencv
That is for mathlab though. Any C++/ofx way of doing it?

Thanks