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,


Sorry for resurrecting the post. Is there any new method for doing this?
Something like this would be great:
That is for mathlab though. Any C++/ofx way of doing it?