I am not sure if this is the right forum, but I would like to post the following question about cvMatchTemplate.
1) I created an image (say BIGIMG) with square of different intensities on it. The image is grayscale and of type IplImage- IPL_DEPTH_8U. BIGIMG is of size 2500X2500.
2) I select a region in BIG, called TEMPLATE of type IplImage- IPL_DEPTH_8U.
3) I now create three different subimages from BIGIMG each of size (600X600), called FRAME1, FRAME2, FRAME3, so that TEMPLATE is a part of each of these three images. They are also of type IplImage- IPL_DEPTH_8U.
4) convert TEMPLATE, FRAME1, FRAME2 and FRAME3 into CvMat using cvConvert. Call the resultant matrices: mTEMPLATE, mFRAME1, mFRAME2, mFRAME3
5) Do template match (option = CV_TM_SQDIFF): mTEMPLATE on mFRAME1; mTEMPLATE on mFRAME2; mTEMPLATE on mFRAME3. I get the right location for the MinLocation in all three cases. I would expect the minimum value to be zero in all three cases. But I see that they are non-zero and not equal to each other.