Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Does findContours create duplicates?

$
0
0
Hi, I'm considering a binary image from which I extract its edges using cv::Canny. Consequently, I perform cv::findContours, storing all the contours points coordinates in a > vector < vector < Point >> . I noticed that the number of pixels (Points) in this structure is greater than the number of pixels I get by computing > vector white_pixels; > findNonZero(silhouette, white_pixels); on the same image. Therefore I'm wondering if this happens because findContours includes duplicate points in its result or because findNonZero is less precise. E.g. on a 200x200 sample image with the first method I get 1552 points while with the second I get 877. In case the first hypothesis is correct, is there a way to either ignore the duplicates or remove them?

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>