How can rotation angle be determined by phase correlation(using fft) of 2 images? The algorithm given in http://en.wikipedia.org/wiki/Phase_correlation returns linear shift, not angular. It also mentions images have to be converted to log-polar coordinates to compute rotation. How is this conversion achieved in python? And post conversion do the same steps of the algorithm hold?
log polar transformation is actually rotation and scale invariant.. rotation corresponds to shift in y axis and scaling corresponds to shift in x axis in log polar transformation
so simple steps are as follows
for finding an image x in image y
find lpts of both x and y
find fft of x say F(X)
for each lpt in y whos logP is lesser than equal to logP of x find its fft say F(y)
find phase correlation of ffts of x and each of those corresponding images
using the formula R=(F(x).F*(Y)) divided by Mod(F(x).F*(y))
find the IFFT of R and the peak value of R corresponds to the rotation deviation in the Y Axis and Scaling deviation in the X Axis from the original Image
references:
http://etd.lsu.edu/docs/available/etd-07072005-113808/unrestricted/Thunuguntla_thesis.pdf
and[http://www.nashruddin.com/phase-correlation-function-in-opencv.html]