Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Image rotation detection probelm
Replies: 32   Last Post: Aug 8, 2013 10:46 PM

 Messages: [ Previous | Next ]
 Hamid Reza Mohseni Nejad Posts: 19 Registered: 1/16/08
Re: Image rotation detection probelm
Posted: Sep 16, 2009 3:50 AM

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,

%%%%%%%%%%%%%%%%
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.

Y.L. Tang

"Matt " <xys@whatever.com> wrote in message <h1g8gu\$mrc\$1@fred.mathworks.com>...
> "Pradyumna A" <a_pradyumna@yahoo.com> wrote in message <h1fn0q\$aeg\$1@fred.mathworks.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
>
>
> 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.

Date Subject Author
6/19/09 Matt
9/16/09 Hamid Reza Mohseni Nejad
8/2/10 Phillip
12/21/10 chee ali
12/21/10 Phillip
12/21/10 Matt J
12/21/10 Phillip
11/14/12 Darren g
11/14/12 Phillip
11/19/12 Darren g
11/19/12 Phillip
11/20/12 Darren g
11/20/12 Phillip
11/26/12 Darren g
11/26/12 Phillip
11/27/12 Darren g
11/28/12 Phillip
11/29/12 Darren g
12/2/12 Phillip
12/3/12 Darren g
12/4/12 Phillip
12/11/12 Darren g
12/11/12 Phillip
12/12/12 Darren g
12/12/12 Steven Lord
2/6/13 Darren g
12/20/12 Phillip
12/20/12 Kev
12/20/12 Kev
7/7/13 xmlfor
8/8/13 jacaboo