title: How to recognize a real square in an image
body: <p>I am using OpenCV for square detection in an image. The squares.c example is a really great help, but my problem is that it recognizes pretty much everything that has 4 corners that are close to 90 degrees.</p>
  
  <p>My goal is it however to only recognize the real squares in an image from a video feed. This means the objects themselves have 4 edges with the same length and 4, 90 degree angles. This sounds rather easy at first, but since an object might be tilted in the image, the angles can vary between something like 45 and 135 degrees and the edges have a different length. If I check these attributes though I am still recognizing rectangles that are no squares. </p>
  
  <p>I've been thinking for a good solution to only recognize real squares for a few days now, but everything I come up with is still flawed. I wonder if any of you knows what the exact relation between the angles of the corners and the edge length is. With my guessing so far I have come pretty far, but sometimes random squares pop up that I don't want to recognize. I really think there is some mathematical relation, but I can't really find a formula for squares in a perspective view.</p>
  
  <p>Any help would really be appreciated!</p>