title: Homography from 3D plane to plane parallel to image plane
body: <p>I have an image in which there is a calibration target (known geometry) in a scene (let's say a simple 2" x 2" square lying on a table). I would like to perform a perspective transformation (using <code>warpPerspective()</code>) so that resulting image is an orthogonal view of the table (as if the camera axis was parallel with the table normal). The standard procedure for computing a homography is from a general plane to a different general plane where at least 4 correspondences are known in two images of the same scene (using <code>getPerspectiveTransform()</code>). In this case where I only have one image, is the correct thing to do to simply "make up" a plane and force the correspondences to some arbitrary position on that plane? For example, in this this situation I would simply make correspondences between the 4 detected corners (A,B,C,D) in the image and four points of my choosing (which essentially just define the pixel->real world scale. For example, I could choose A' = (0,0), B' = (20,20), C' = (0,20), D' = (20,0) to indicate in the resulting image there are 10 pixels per inch. Of course I could choose any scale here, and I could also choose any position for the square target to land in the output (i.e. A' = (100,100), B' = (120,120), C' = (100,120), D' = (120,100) ).</p>
  
  <p>Is this the "correct" way to do this? Is there a better way to compute a projective transform that looks directly at a plane defined by a set of points in the image known to be in the plane?</p>