How to detect concentric squares?
I have vector of approximated 4-point closed contours. How I can determine that some of them are concentric?
I have vector of approximated 4-point closed contours. How I can determine that some of them are concentric?
The way to go I thing is using minAreaRect function that returns a RotatedRect
that has a centre. Based on the distance between the centres, you can define an error of "concentricity" of the two or more rectangles.
I througth about it. But if view angle is too big squares turn into quads and can not be decribed by RotatedRect. But I'll try and let you know.
you have also fitEllipse, but it returns RotatedRect too. (Anyway, what do you mean by quad?)
Worked well for me! To compare whether two contours are nested, and to find the biggest one:
Asked: 2014-09-22 06:04:08 -0600
Seen: 737 times
Last updated: Sep 22 '14
Trouble finding a way to differentiate two shapes
How Does Contour Extraction Work?
Area of a single pixel object in OpenCV
Which is more efficient, use contourArea() or count number of ROI non-zero pixels?
Tricky image segmentation in Python
How to extract only top-level contours?
How to detect square in a video using c++ and opencv?