Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The difference between corr2 and normxcorr2

1,090 views
Skip to first unread message

David

unread,
Jul 19, 2004, 9:11:18 PM7/19/04
to
Hi, all:
Could anyone tell the difference between corr2 and normxcorr2?
My basic understanding is that corr2(A,B) is to calculate the
correlation coefficient while normxcorr2(A,B) is to calculate the
normalized cross correlation. But the help file on normxcorr2 didn't
tell the formula of normxcorr2.
I am confused with the two functions after I saw the link
http://www.idiom.com/~zilla/Papers/nvisionInterface/nip.html .
Seems to me they are the same?????????
Thanks a lot!

Bryan Smith

unread,
Jul 20, 2004, 1:32:43 AM7/20/04
to
Hi,

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

Steve Eddins

unread,
Jul 27, 2004, 3:54:31 PM7/27/04
to
gobea...@yahoo.com (David) writes:

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.

Miguel Moura

unread,
Jul 27, 2004, 4:01:09 PM7/27/04
to
Hello!

Normxcorr2 gives values between -1 and 1!

Cheers!

0 new messages