Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Probable solutions

  1. You can use Contours Hierarchy to ignore contour inside contour.

  2. Use the same Hierarchy to distinguish closed and open contour, so that you can avoid the lines, dots etc.. See an example here

  3. And one more thing is that in findContours() function use CV_RETR_CCOMP which retrieves all of the contours and organizes them into a two-level hierarchy.