I’m using cv2.findContours with cv2.RETR_CCOMP to get the contour hierarchy. Both the circle and the square are detected as contours. Since these are just outlines, each shape has both an inner and an outer contour, meaning the circle has both a parent and a child, and the square does as well.
However, even though the circle is inside the square, it is not recognized as its child in the hierarchy. Has anyone encountered a similar issue and found a solution?