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.
peak
is returning is in the padding area added bynormxcorr2
. Are you sure you are giving theyoffSet = ypeak-size(onion,1);
call the correct image (i.e. youronion
patch image). $\endgroup$