Matt: The code you provided is really good. What I did is to further sum the columns of P1 and P2 and perform cross-correlation to find the angle of rotation. To be more specific,
%%%%%%%%%%%%%%%% P1=abs(fft(radon(Image1))); P2=abs(fft(radon(Image2))); a = sum(P1); b = sum(P2); a = a-mean(a); b = b-mean(b); [m n] = max(xcorr(a, b)); angle = length(a)-n+1 % The angle of rotation %%%%%%%%%%%%%%%%
The code above worked just fine. However, what is the purpose of "fft" after radon transform? Can we skip the "fft" part? Thanks.
"Matt " <firstname.lastname@example.org> wrote in message <email@example.com>... > "Pradyumna A" <firstname.lastname@example.org> wrote in message <email@example.com>... > > Hello, > > > > I have 2 images. One is the reference image and the other is the rotated version of the reference image. I would like to find what is the angle by which the 2nd image is rotated wrt 1st one. Also in future, the second image will be scaled > ---------- > > In what way will the image be scaled? Do you mean stretched geometrically or do you mean all the pixel values will be scaled? > > ------ > >and translated along with this rotation !. This has to be done automatically (without human interference in selecting feature points etc) > ----- > > One thing you can try is to compute > > P1=abs(fft(radon(Image1))) > P2=abs(fft(radon(Image2))) > > You will see that P1 is shifted with respect to P2 by an amount corresponding to the rotation. You can use your favorite shift measurement technique (e.g. correlation) to calculate the shift, and hence the rotation. Also, translation will not affect P1 and P2.