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 cvResize and with cv::resize. My code looks like this:
warpPerspective(greyImg, warpedImg, homography, Size(6, 6));
Mat bigWarpedImg = Mat(120,120,CV_8UC1);
resize(warpedImg, bigWarpedImg, Size(0,0), 20, 20, INTER_NEAREST);
warpedImg looks like this (I resized it with gimp to make it easier to recognize): http://picasaweb.google.com/103165673068768416583/Opencv#5565090881969794706
bigWarpedImg looks like this: http://picasaweb.google.com/103165673068768416583/Opencv#5565090880773608210
As you can see, in bigWarpedImg 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?