1 | initial version |
So you need only outer contour use CV_RETR_EXTERNAL instead CV_RETR_CCOMP which retrieves only the extreme outer contours. Also see the answer here might be helpful.
2 | No.2 Revision |
So you need only outer contour contour, then instead of CV_RETR_CCOMP use CV_RETR_EXTERNAL instead CV_RETR_CCOMP which retrieves only the extreme outer contours. Also see the answer here might be helpful.