homography and image scaling in opencv
<p>I am calculating an homography between two images <code>img1</code> and <code>img2</code> (the images contain mostly one planar object, so the homography works well between them) using standard methods in OpenCV in python. Namely, I compute point matches between the images using sift and then call <code>cv2.findHomography</code>.</p>

<p>To make the computation faster I scale down the two images into <code>small1</code> and <code>small2</code> and perform the calculations on these smaller copies, so I calculate the homography matrix <code>H</code>, which maps <code>small1</code> into <code>small2</code>.
However, at the end, I would like to use calculate the homography matrix to project one full-size image <code>img1</code> onto the other the full-size image <code>img2</code>. </p>

<p>I thought I could simply transform the homography matrix <code>H</code> in the following way <code>H_full_size = A * H * A_inverse</code> where <code>A</code> is the matrix representing the scaling from <code>img1</code> to <code>small1</code> and <code>A_inverse</code> is its inverse. 
However, that does not work. If I apply <code>cv2.warpPerspective</code> to the scaled down image <code>small1</code> with <code>H</code>, everything goes as expected and the result (largely) overlaps with <code>small2</code>. If I apply <code>cv2.warpPerspective</code> to the full size image <code>img1</code> with <code>H_full_size</code> the result does not map to <code>img2</code>.</p>

<p>However, if I project the point matches (detected on the scaled down images) using <code>A</code> (using something like <code>projected_pts = cv2.perspectiveTransform(pts, A)</code>) and then I calculate <code>H_full_size</code> from these, everything works fine. </p>

<p>Any idea what I could be doing wrong here?</p>

<p>I think your wrong assumption in this passage </p>

<blockquote>
  <p><code>H_full_size = A * H * A_inverse</code> where <code>A</code> is the matrix representing the scaling from img1 to small1</p>
</blockquote>

<p>derives from humans "love" from symmetry. Out of the joke, your formula is correct after introducing an hypotesis that I am going to expose.
If I start from this consideration (this is quite equivalent of the cv2 function cv2,warpPerspective - the formula is true with respect to a scale factor)</p>

<pre><code>img2 = H_fullsize*img1
</code></pre>

<p>you can derive your own formula. </p>

<pre><code>small2 = B*img2
small1 = A*img1
small2 = H*small1
B*img2 = H*A*img1
</code></pre>

<p>that is quite equivalent (if B is invertible)</p>

<pre><code>img2 = B_inverse*H*A*img1
</code></pre>

<p>and the question became</p>

<pre><code>H_fullsize = B_inverse*H*A
</code></pre>

<p>So the question became: are you sure that the scale matrix from <code>img1</code> to <code>small1</code> is equal to the scale matrix from <code>img2</code> to <code>small2</code>? (or at least they differs of a constant scale factor value) ?</p>

<p>If it is your case, remember that, as you write, homograpy works <strong>only</strong> between planar images (or in a case of pure rotation). Assuming you have 80% SIFT points on a plane and 20% points out of this plane, the homograpy considers all this points as they were in a plane and find the transformation H that minimize errors (<em>and not the perfect one only for the 80% points in a plane</em>). 
Also errors that are evident in a 1080p resolution image could be not so evident in a 320p resolution image (you do not specify <strong>how much</strong> you reduce the images!) </p>

python opencv coordinate-transformation homography