title: calculating the destination points for OpenCV's findHomography
body: <p><strong>EDIT</strong>:  I've now found this similar question with a very detailed answer:</p>
  
  <p><a href="https://stackoverflow.com/questions/1194352/proportions-of-a-perspective-deformed-rectangle">proportions of a perspective-deformed rectangle</a></p>
  
  <hr>
  
  <p>I'm using OpenCV's <code>findHomography()</code> and <code>warpPerspective()</code> methods to "de skew" a photograph of a sheet of paper.  I have this largely working but I'm stuck on a detail.</p>
  
  <p>The part I don't understand how to do is to calculate the optimum set of destination points to input to <code>findHomography()</code>.  I know that I want my output to be rectangular, but I dont know the ratio of the width to height of the rectangle.  I also want the output rectangle to be sized such that there is minimal scaling of the output image when I apply the transform via <code>warpPerspective()</code>.  All I have are the four points that form the quadrilateral I want to transform in the source image.  How do I calculate an optimum-sized destination rectangle?</p>