The two functions are not exactly the same. For starters, normxcorr2
has a check to see if it is faster to run the correlation in the time
or frequency domain. This can be handy for large, non-power-of-two
matrices, and usually makes normxcorr2 faster (often MUCH faster).
Another difference is that the output in normxcorr2 is scaled between
zero and one.
For reasons I do not entirely understand, the lag position of the
maximum amplitude peak appears in mirrored locations when the two
functions are compared. The maximum amplitude peak will show up in
the same (x,y) location if you do
cnorm = normxcorr2(a,b);
c = xcorr2(b,a);
I am interested to know what else you find out. You can email me at
wbsmith at its dot caltech dot edu
Bryan
The reference page for normxcorr2:
http://www.mathworks.com/access/helpdesk/help/toolbox/images/normxcorr2.html
gives two references that you may find useful.
--
Steve Eddins
Development Manager, Image Processing Group
The MathWorks, Inc.
Normxcorr2 gives values between -1 and 1!
Cheers!