Fincontours unexpected result [closed]
Hi, I have a binary image, and I though to use findconrours such it may help in feature extraction. After implementing findcontours, when I print len(contours), the answer was 132!
My expectation should be 1 as I only have one object in the image, but I don't know why?
Here I attach the image
I would appreciate any comments.
Thank you
.jpg is a compressed image format and therefore it introduces compression artifacts: if you inspect your image carefully, you will notice that it not only contains 255 pixels and 0 pixels, it also contain values such as 253, 254, 1, 2, etc. in the border area. Such values create small contours all over the image. Binarize your image (
threshold()
) after loading it, and try again.Yes, it works!. Thanks a lot LorenaGdL