ImageAnalyst wrote:
>
>
> Well one really simple way is to have the user click on a pair of
> landmark points in each image. Then you simply calculate the angle
> between them with basic trigonometry. There are other more
> complicated, more rubust, and more automated ways.
> Regards,
> ImageAnalyst
>
>
> On May 6, 9:13 am, "vijay srini" <vijvalsriniva...@gmail.com>
> wrote:
There might be 3 parameters: coordinates of the rotation
center and the angle. Optimization can help you. I
recommend the correlation to be the object (or cost)
function.
Btw. Some years ago I saw a patent for this (it was
developed for image databases):
e.g.:
<http://www.patentstorm.us/patents/6553136-description.html>
Regards,
Laszlo
This technique works very well
Dave Robinson
http://mathforum.org/kb/thread.jspa?forumID=80&threadID=1535493&messageID=5522026#5522026
This can be used to do what you want. Convert both images to a log polar mapping and correlate them use corr2. A rotation in Cartesian space produces a horizontal shift in the log polar mapping. The correlation peak will therefore be horizontally shifted from the center after correlating the log polar maps. You should be able to work out the angle from the shift of the correlation peak from the center of the correlation plane. The rotation point needs to be at the center of the image for this method to work.
Do you have access to MathCad? if so I can send you an active
document which explains the process in detail. However it is in the
form of a MathCad 2000 file. It will take too long to convert it into
another readable format.
Unfortunately I don't have access to the Matlab image processing
toolbox on this installation, so I can't generate any matlab oriented
code.
Does your EMAIL address above actually work? so I can forward it.
Regards
Dave Robinson
Here's a thread containing code to create a logarithmic polar map.
<http://mathforum.org/kb/thread.jspa?forumID=80&threadID=1535493&messageID=5522026#5522026>
This can be used to do what you want. Convert both images to a log
polar mapping and correlate them using corr2 (or preferably Fourier
transforms so that it's circular). A rotation in Cartesian space
produces a horizontal shift in the log polar mapping. The correlation
peak will therefore be horizontally shifted from the center after
correlating the log polar maps. You should be able to work out the
angle from the shift of the correlation peak from the center of the
correlation plane. The rotation point needs to be at the center of
the image for this method to work.
Using this method also allows you to find the scaling factor between
2 images since this produces a vertical shift of the correlation
peak. If all you want to do is find the angle then you actually only
need a polar map (not logarithmic polar) but I don't know of any code
to do that.
Peter Bone
Regards
Dave Robinson
You helped me in such a situation of crisis Thank you so much and
I have to try coding the rest. I will come upto you in case I find
any difficulty. Hope you don't mind
Thank you once again.. Vijay
Hi Vijay,
This is a problem because using the log polar map gives you rotation
and scale invariance but loses x and y shift invariance. So this
method won't work if there's also a shift since you need to make sure
the log polar maps are created from the images where the rotation
point is at the center. The only way you can include shift detection
with this method is by performing a raster search on one of the
images. This will involve creating a new image centered at the
current xy position in the search. You will then need to create a log
polar map for each iteration. This will unfortunately slow down the
algorithm a lot. One way to speed it up a bit is to raster scan in
steps of 3 pixels. Also, you only need to search over one image. You
can pre-calculate the log polar map for the other image before hand.
Peter Bone
Peter Bone
The translation problem could perhaps be solved by Fourier
transforming first and applying the log-polar transform to the
Fourier amplitudes. There is an implemention of this technique
(Fourier-Mellin transform) in the file exchange, /http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3000&objectType=file).
I haven't tried that code though.