[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross-correlation for image registration

From: Carnë Draug
Subject: Re: cross-correlation for image registration
Date: Wed, 15 Feb 2012 22:46:06 +0000

On 15 February 2012 21:15, Matt Nicholas <address@hidden> wrote:
> Hello list,
> I'm a reasonably experienced MATLAB user who is trying to move to Octave.
> One task I frequently need to perform is image registration via cross
> correlation, which I used to do in MATLAB using the normxcorr2. Basically, I
> found the index of the maximum value in the correlation matrix, subtracted
> the width and height of the template image from these coordinates, and this
> gave me the shift of the template relative to the test image.  I have tried
> using xcorr2 in Octave with the 'coeff' flag, but the results are not what I
> would expect, and not very similar to normxcorr2 for the same images in
> MATLAB (to be honest, I am not terribly surprised, because for some reason I
> was never able to get this to work with xcorr2 in MATLAB either, but I
> simply switched to normxcorr2 years ago and forgot about it). So I am a
> little stuck. I've seen some previous discussion of this topic, with one
> user even offering to write an Octave version of normxcorr2, but it doesn't
> seem to have come to completion.
> Just to be clear, this is not a complaint that normxcorr2 is 'missing' in
> Octave. I am happy to change my approach if I can achieve similar results
> with another method. Since it's a common task, I figured I would ask for
> suggestions before trying to reinvent the wheel. Is there some appropriate
> method of normalizing the output of xcorr2 to achieve what I want? Honestly,
> I doubt this is a normalization issue, since the maximum value in the
> correlation matrix is not *located* where I would expect (regardless of its
> absolute magnitude). So a related question might be, does anyone know the
> difference between xcorr2 and normxcorr2 in MATLAB?
> Many thanks in advance for your help,
> Matt

Hi Matt

I had a need for that function a while ago (for exactly the same
purpose, image registration). I have an implementation of it on the
development version of the image package. you can see it here:

This makes the image package dependent on the signal package.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]