title: Trying to find an algorithm to detect rectangles in images
body: <p>At the moment I have detected edges in an image and I am planning to extract line segments from the edges using a hough transform. Once I have the segments I am planning on finding corners where two segments cross over. Is there an algorithm that can detect rectangles from the corners? say I have four corners detected, is it possible to get the relative lengths of the sides of the rectangle that the four corners make up knowing a rectangle has 4 right angles? </p>
  
  <p>The reason I want to do this is so I can extract the texture bound by the rectangle and draw it as a flat rectangle on the screen.</p>
  
  <p>Edit:
  Thanks for the answers so far, I think I should explain my problem more clearly as I think I was slightly misinterpreted. I am actually trying to transform a warped rectangle into a flat rectangle. I read through some of the aforge articles and saw this function: <a href="http://www.aforgenet.com/framework/docs/html/7039a71d-a87d-47ef-7907-ad873118e374.htm" rel="nofollow">link</a>. I was wondering if it is possible to determine the ratio between the sides of the rectangle just from the 4 corners?</p>