How do I use findContours to find exact count [closed]

asked 2017-12-14 03:47:28 -0600

Santhosh1 gravatar image

updated 2020-10-23 09:04:49 -0600

This is my original image

image description

I have detected total 6 approximate squares in this image shown below using cv2.findContours if we count as seen on the detected image below with bounding box around them.

image description

I checked this Contours Hierarchy

Tried out all the Hierarchy mentioned in the above link to get only 6 contours but least contour being detected is 10

I just need to detect 6 squares as can be seen and counted, not the entire family GrandFather GrandMother Father Mother etc

Can anyone help me out here?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-23 09:04:36.786426