Register one image with another that has been both translated and rotated
- From: ChrisGifford <chris.m.gifford@xxxxxxxxx>
- Date: Tue, 23 Sep 2008 06:48:34 -0700 (PDT)
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.
.
- Follow-Ups:
- Register one image with another that has been both translated and
- From: Matt
- Register one image with another that has been both translated and
- From: Matt
- Register one image with another that has been both translated and
- From: Matt
- Register one image with another that has been both translated and
- From: Matt
- Register one image with another that has been both translated and
- Prev by Date: protofile for loadlibrary (on 64-bit platforms)
- Next by Date: Re: not writing data to file
- Previous by thread: protofile for loadlibrary (on 64-bit platforms)
- Next by thread: Register one image with another that has been both translated and
- Index(es):
Relevant Pages
|