Register one image with another that has been both translated and rotated



Hello,

I am having some difficulties with image registration, and was hoping
to get some help. My application involves a camera that takes images
every so often, the objects within them move uniformly (you can think
of this as the camera is moving over stationary objects). The
difference between the images will be BOTH a translation and rotation
of the entire image, with potentially large portions of one image
being outside that of the other (a significant overlap, but still
should be plenty to properly register the images). I need a method
that can extract the translation (in pixels) and rotation angle
required to register the images quickly.

I have found methods that use the FFT, and want to use them. For
example, the below code can successfully find the pixel translation
required to register two grayscale images that only contain objects
that are translated (no rotation from one image to the next):

% Take FFT of each image
F1 = fft2(im1);
F2 = fft2(im2);
% Create phase difference matrix using phase angles from the two FFTs
(i.e., phase correlation)
pdm = exp(i*(angle(F1)-angle(F2)));
% Solve for phase correlation function. The peak of this function
% corresponds to the registration point for translation.
pcf = real(ifft2(pdm));
figure; mesh(pcf);
% Find the linear index of where the maximum occurs, then convert that
into
% the 2D image subscripts
linear_index = find((pcf == (max(max(pcf)))));
[X, Y] = ind2sub(size(pcf),linear_index);
% Adjust subcripts to be correct offsets from (0,0) in pixels (should
return 0,0 if images are the same)
X = min(size(pcf,1)-X, X) - 1;
Y = -1*(min(size(pcf,2)-Y, Y) - 1);

I know that to find both the translation and the rotation, that I
first need to find the rotation. After finding the rotation, I rotate
the first image by that rotation and then use the above code to find
the translation between the images. I would also like to use an FFT-
based approach here too. I have found papers stating that the polar
transform (or log-polar transform) of each image's magnitude spectrum
can lead to finding out the rotation. I have a desire to use the FFT-
based approaches because they are faster than other regression or
least-squares approaches I have found.

Could someone please help me with the Matlab code for finding the
rotation angle between a pair of images, where the second image has
been translated and rotated (likely with large portions lying outside
of the image boundary after registration)? Any help is appreciated.
Thanks in advance.
.



Relevant Pages

  • image registration problem
    ... for the translation case only. ... "An fft based technique for translatiopn rotation and scale invariant ... then do the phase correlation for estimating the rotation. ...
    (sci.image.processing)
  • local coordinate systems to one global
    ... I have three camera systems. ... that consists of a global rotation and translation of the marker. ...
    (comp.graphics.algorithms)
  • Re: Graphic transforms
    ... rotation is not about the desired rotation point. ... before rotating since scaling is on two different axis, ... one must apply scale, then rotate, then translation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Properly combining a Rotation and Translation matrix? (linear algebra)
    ... Vector3 containing a translation I wish to perform, ... defining a rotation I wish to perform. ... rotates the object by the given rotation matrix, ... a single matrix multiplication unless you cheat on the notation by ...
    (sci.math)
  • Re: Cross Power Spectrum and Image Registration
    ... a separate test, for a rotated image, using phase correlation. ... When I apply both a rotation and a translation to the ... Can you please send me your code of transform and inverse transform of log polar code? ...
    (comp.soft-sys.matlab)