1 | initial version |
Squares.cpp looks for angles that are approximately 90 degrees between two edges of a given contour. Since you have perspective and camera deformations, it will possible find the contours, but the relations in order to have a square (90° angles and same size borders) form will not get satisfied.
What you could do is define a relation of your own, which could help you detect all objects with 4 linear sides or you could perform segmentation based on color thresholding.