title: How to use findTransformEcc and warpAffine on resized image
body: <p>I'm trying to align two images with <code>findTransfomECC</code> and <code>warpAffine</code>.</p>
  <p>Here is my first attempt which is working fine:</p>
  <pre><code>    cv::Mat m = cv::Mat::eye(2, 3, CV_32F);
      auto criteria = cv::TermCriteria(
              cv::TermCriteria::COUNT + cv::TermCriteria::EPS, 50, 1e-5);
      cv::findTransformECC(prev_image, new_image, m, cv::MOTION_AFFINE, criteria, cv::noArray(), 5);
      cv::warpAffine(new_image, new_image, m, new_image.size(),
              cv::INTER_CUBIC + cv::WARP_INVERSE_MAP, cv::BORDER_CONSTANT, cv::Scalar::all(255));
  </code></pre>
  <p>The only problem is that it takes too much to calculate the warp matrix(m).</p>
  <p>To redeam that, I tried to perform the <code>findTransformEcc</code> on the resized image and perform <code>warpAffine</code> on the original image. Here is the code:</p>
  <pre><code>    cv::Mat _new_image, _prev_image;
      cv::resize(new_image, _new_image, cv::Size(256,256), cv::INTER_AREA);
      cv::resize(prev_image_, _prev_image, cv::Size(256,256), cv::INTER_AREA);
  
      cv::Mat m = cv::Mat::eye(2, 3, CV_32F);
      auto criteria = cv::TermCriteria( 
              cv::TermCriteria::COUNT + cv::TermCriteria::EPS, 50, 1e-5);
      cv::findTransformECC(_prev_image, _new_image, m, cv::MOTION_AFFINE, criteria,
              cv::noArray(), 5);
  
      cv::warpAffine(new_image, _new_image, m, _new_image.size(),
              cv::INTER_CUBIC + cv::WARP_INVERSE_MAP, cv::BORDER_CONSTANT, cv::Scalar::all(255));
      //cv::resize(_new_image, new_image, new_image.size());
  </code></pre>
  <p>with this code, the <code>new_image</code> won't align to the <code>pre_image</code>.
  I also tried to do <code>warpAffine</code> to the resized image and then resize the result to the original size.  But in this way the quality decreases.</p>
  <p>Is there any way to perform <code>findTransfomeECC</code> on the resized(smaller) image instead of the original image?</p>