How to use Log polar transformation to recognize scale n rotation invariant images

Hi,
Can any1 explain to how to use log polar transformation to recognize images that are scale and rotation invariant. I’m trying to apply that to image stitching application.
From what I have read so far, it seems that log polar is perform on 2 images then the log polar images is cross correlated to find the similarities. However I do not understand how cross correlation of the log polar images can help me get the transformation information. Or my understanding might be completely wrong.
Please advice.
Thanks

 Accepted Answer

You can't use the log-polar transform on its own to match images where there is translation as well as scale and rotation change. One approach is to use a Fourier spectrum representation which is translation-independent, and use the log-polar representation of this to deal with the scale and rotation. Another is to iterate between estimating the translation in Cartesian space and scale/rotation in log-polar space.
To find scale and rotation correspondence, you cross-correlate the whole of the log-polar sampled images and find the peak (use zero-padding and windowing as necessary). This only works if the centres of the log-polar grids are at (or close to) corresponding points in the two original images, or alternatively if you use some translation-invariant representation such as the power spectrum.
The details go way beyond what I can deal with in a MATLAB answers discussion, I'm afraid. There was already a significant literature when I worked on this over 20 years ago (I think the seminal paper is this one by Weiman and Chaikin) and there is much more since. It may be significant, however, that modern approaches to stitching use discrete features, such as SIFT and SURF, and find correspondences, rather than using log-polar matching.
A more recent paper is here.

4 Comments

Thanks for the paper, David.
From that paper, log polar transformation is done on 2 images. Then, the Cross correlation in the log-polar domain produces
a phase shift that corresponds to a scale and a rotation factor.
I take it as the translation from from cross correlation both log polar images will give me the scale and a rotation factor.(correct me if i'm wrong)
Next question is how the cross correlation is performed?
If i take whole img1(log polar image) and cross corr with img2(log polar image), then the normalize cross corr(max_c) result give a maximum result of less than 1 and the translation information is extract from ypeak and xpeak would not be any used.
>> x_corr = normxcorr2(img1,img2);
>> [max_c, imax] = max(abs(x_corr(:)))
>> [ypeak, xpeak] = ind2sub(size(x_corr),imax(1))
Sorry Kyle, I don't really understand the final part of your comment. ypeak anmd xpeak will, appropriately scaled, give the rotation and scale for the best match (provided the process isn't messed up by the existence of a translation). So I'm not sure what the problem is. I should say, by the way, that in my experience it's quite hard to use the log-polar approach to do image matching - methods based on features like SIFT seem to do much better.
Sorry i think i caused some misunderstanding. For image without scale and rotation invariant, just translation. With the below code ypeak and xpeak will give the location of the overlapping region in img a. Knowing where the image overlap i can know where to start stitching.
%The below code demo how is done more clearly. Assume b is cropped from second image and the cropped section overlaps with first image. ( I made assumption that any 1 of 4 corners of image will overlap with the other image)
a=imread('cameraman.tif');
b=imcrop(a,[1 1 100 100]);
c = normxcorr2(b,a);
[max_c, imax] = max(abs(c(:))) %max_c=1 means the img a contain img b (overlapping)
[ypeak, xpeak] = ind2sub(size(c),imax(1))
max_c =
1.0000
imax =
35701
ypeak =
101
xpeak =
101
However the method above only support stitching image with translation different. I tried SURF method but i had some problem in finding the rotation. Below links shows i get the rotation and scale from SURF.
http://www.mathworks.it/matlabcentral/answers/8934-need-suggestion-on-finding-rotation-angle
Now back to log polar method. I'm trying to know how to perform cross correlation between 2 log polar transformed images(imgA and imgB). So that I can get the scale and rotation information. Did u cropped part of imgA then cross correlation with imgB?
I've edited my answer to give a little more detail - but that's about as far as I can go without starting to write code. I think the key question to ask yourself is whether you'd be better off trying to fix your SURF method - and maybe you should make that a new question.

Sign in to comment.

More Answers (1)

%The below code demo how is done more clearly. Assume b is cropped from second image and the cropped section overlaps with first image. ( I made assumption that any 1 of 4 corners of image will overlap with the other image)
a=imread('cameraman.tif');
b=imcrop(a,[1 1 100 100]);
c = normxcorr2(b,a);
[max_c, imax] = max(abs(c(:))) %max_c=1 means the img a contain img b (overlapping)
[ypeak, xpeak] = ind2sub(size(c),imax(1))
max_c =
1.0000
imax =
35701
ypeak =
101
xpeak =
101

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!