[Top][All Lists]

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

cross-correlation for image registration

From: Matt Nicholas
Subject: cross-correlation for image registration
Date: Wed, 15 Feb 2012 16:15:35 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

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,

reply via email to

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