Ask Your Question

pibbs's profile - activity

2017-04-12 20:06:17 -0600 commented answer How to detect concentric squares?

Worked well for me! To compare whether two contours are nested, and to find the biggest one:

  • minAreaRect(); for both contours
  • pointPolygonTest() for each contour and the other contour's center
  • If the signs of both pointPolygonTest() calls are positive, they are concentric
  • the outermost contour has the largest area, compute with contourArea()