What Does It Mean When Cross Correlation Between Two Images Occur at Negative Coordinates I am using Matlab normxcorr2 to calculate the cross correlation between several images, something like what has been done here: in MATLAB documentation. There are some of the examples that I get negative values for xoffSet and yoffSet, but I am not sure what it means when these values are negative.
Another issue, is practical since I need to give these xoffSet and yoffSet values as an input to coordinates of rectangle in an image, but since these are negative, the function throws an error. I googled it but no success in finding something that can explain such thing. I was thinking of just putting zero instead of negative values, but I'm not sure if that's a right approach.
I would appreciate if someone can explain about the meaning of such negative values and how I can substitute such negative values with appropriate quantities.
It means the best match to template happens outside the image.
For instance, let's say your template is 5 by 5.
And you got answer which is -1, -1. It means the part of the image which best matches you image is centered at [-1, -1] and you only have part of it in your image.
This is really an extreme case.
P. S.
If you share your data (2 Images) we'll be able to assist more.