title: How do I use cvResize/resize correctly?
body: <p>I have trouble resizing a 6x6 image to 120x120. It looks like the resized image is somewhat shifted by 1 pixel. This happens with the <em>cvResize</em> and with <em>cv::resize</em>. My code looks like this:</p>
  
  <pre><code>warpPerspective(greyImg, warpedImg, homography, Size(6, 6));
  Mat bigWarpedImg = Mat(120,120,CV_8UC1);
  resize(warpedImg, bigWarpedImg, Size(0,0), 20, 20, INTER_NEAREST);
  </code></pre>
  
  <p><em>warpedImg</em> looks like this (I resized it with gimp to make it easier to recognize): <a href="http://picasaweb.google.com/103165673068768416583/Opencv#5565090881969794706" rel="nofollow">http://picasaweb.google.com/103165673068768416583/Opencv#5565090881969794706</a></p>
  
  <p><em>bigWarpedImg</em> looks like this: <a href="http://picasaweb.google.com/103165673068768416583/Opencv#5565090880773608210" rel="nofollow">http://picasaweb.google.com/103165673068768416583/Opencv#5565090880773608210</a></p>
  
  <p>As you can see, in <em>bigWarpedImg</em> the left and upper border is to small whereas the right and bottom border is too thick. It looks like a bug in OpenCV. Is this one or do I use this function incorrectly?</p>