[Background]
I am learning about two dimensional cross correlations (2DCC) to find how it can be applied to my current project. My current project is to make an efficient method to find displacement and rotation of an object on 2D surface.
To do this, I did the following experiment on my Software environment.
[Experiment]
I have one 1024x1024 image with a duck located at its center.
1024x1024 image with a duck located at center
I have another 1024x1024 image with a duck located not at its center and rotated. 1024x1024 image with a duck at 752, 336 rotated 123
Then, apply the two images to two dimensional cross correlation.
I got the following amplitude and its peak index of cross correlation result almost matches to the duck displacement of my 2nd image.
amplitude result of 2D Cross Correlation
On the other hand, phase value at the index of corresponding amplitude peak does not match the duck rotation of my 2nd image. The expected phase value is 123[degree] as seen in 2nd image, but the actual value is very small.
phase result of 2D Cross Correlation
[Question]
Is two dimensional cross correlation a right approach to recover the rotational degree of duck in this situation?
The cross-correlation only yields a shift. What it does is compare the two images at all possible translations.
You computed the cross-correlation through the Fourier domain, and obtained a result that has very small imaginary values. These are the result of numerical inaccuracies, and should be ignored. The cross-correlation of two real-valued signals (or images) is a real-valued signal (or image).
To find the rotation, you should probably look into the Fourier-Mellin transform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With