Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
xcorr2 vs. normxcorr2

Subject: xcorr2 vs. normxcorr2

From: Jun

Date: 20 Mar, 2010 20:47:03

Message: 1 of 3

Why normxcorr2 function is much faster than xcorr2 function for processing two images? From my understanding, normxcorrs needs even more computations?

Thanks for any help!

JS

Subject: xcorr2 vs. normxcorr2

From: David Young

Date: 20 Mar, 2010 23:32:04

Message: 2 of 3

I don't have the Signal Processing Toolbox, so I can't be sure, but one possibility is that it is because normxcorr2 makes use of the FFT if it is going to be faster. Perhaps xcorr2 stays in the spatial domain for all sizes of array.

If you are concerned to make correlation/convolution go quickly, you may care to check out this file exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/22619-fast-2-d-convolution . It uses a very different trick to speed the process up.

Subject: xcorr2 vs. normxcorr2

From: Jun

Date: 21 Mar, 2010 05:53:02

Message: 3 of 3

"David Young" <d.s.young.notthisbit@sussex.ac.uk> wrote in message <ho3ltk$4mh$1@fred.mathworks.com>...
> I don't have the Signal Processing Toolbox, so I can't be sure, but one possibility is that it is because normxcorr2 makes use of the FFT if it is going to be faster. Perhaps xcorr2 stays in the spatial domain for all sizes of array.
>
> If you are concerned to make correlation/convolution go quickly, you may care to check out this file exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/22619-fast-2-d-convolution . It uses a very different trick to speed the process up.

Thanks.

Yes. The FFT apparoach can quickly get the cross-correlation. I have tested ifft2 and fft2 for this use.

JS

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us