title: OpenCV 2.4.3 - warpPerspective with reversed homography on a cropped image
body: <p>When finding a reference image in a scene using SURF, I would like to crop the found object in the scene, and &quot;straighten&quot; it back using warpPerspective and the reversed homography matrix.<br />
  <br />
  Meaning, let's say I have this SURF result:<br />
  <img src="https://i.stack.imgur.com/4Uk7b.jpg" alt="enter image description here" />
  <br />
  <br />
  Now, I would like to crop the found object in the scene:<br />
  <img src="https://i.stack.imgur.com/QuGB2.png" alt="enter image description here" />
  <br />
  <br />
  and &quot;straighten&quot; only the cropped image with warpPerspective using the reversed homography matrix. The result I'm aiming at is that I'll get an image containing, roughly, only the object, and some distorted leftovers from the original scene (as the cropping is not a 100% the object alone).
  <br />
  <br />
  Cropping the found object, and finding the homography matrix and reversing it are simple enough. Problem is, I can't seem to understand the results from warpPerspective. Seems like the resulting image contains only a small portion of the cropped image, and in a very large size.
  <br />
  While researching warpPerspective I found that the resulting image is very large due to the nature of the process, but I can't seem to wrap my head around how to do this properly. Seems like I just don't understand the process well enough. Would I need to warpPerspective the original (not cropped) image and than crop the &quot;straightened&quot; object?
  <br />
  <br />
  Any advice?</p>