8
$\begingroup$

I'm trying to do image registration using phase correlation as described in the Reddy Chatterji paper. In my case, the images may be scaled and translated relative to each other.

The algorithm for finding the relative scale, as I understand it, is (see: the flowchart from the paper):

F1 = DFT(I1)
F2 = DFT(I2)
H1 = Highpass(F1)
H2 = Highpass(F2)
L1 = LogPolar(Magnitude(H1))
L2 = LogPolar(Magnitude(H2))
PC = PhaseCorrelate(L1,L2)
PM = norm(PC)
R = IDFT(PhaseCorr/PM)
P = Peak(R)
Scale = LogBase^P[1]

Scale gives me seemingly nonsensical values (wildly different from image to image and never correct).

But ignoring scale, the same phase correlation approach works fine for translation; and so I suspect I have a problem with my log-polar transform. Here's an example, where I've solved for translation--the left image is the original and the right has been cropped and translated--the solution is shown on top of the orignal:

Translation alone works

For the log-polar transform, I first transform into polar space: $$ \hat{I}(\rho,\theta) = I\left(r+\rho\cos\left(\frac{2\pi\theta}{N_{\theta}}\right),r-\rho\sin\left(\frac{2\pi\theta}{N_{\theta}}\right) \right) $$ where $I$ is the original image, $r$ is the image radius (half-width) and $N_{\theta}$ is the number of samples in the $\theta$ direction. I then sample from this to transform into log polar space: $$ \hat{I}_{log}(\rho,\theta) = \hat{I}\left(\log_{b}(\rho),\theta\right) $$ where $b = (2r)^{-N_{\rho}}$ as described in 1 so that it spans the whole polar space.

Here're the example images in log-polar space with $\rho=\theta=256$ (in case there's something glaringly wrong):

Log Polar

Lastly, this shows the actual transformation the images go through before the phase correlation step (top is DFT magnitude post highpass filter, bottom is that in log polar space):

Log Polar of DFT

I'm using OpenCV, which has LogPolar and PhaseCorrelate methods. While the PhaseCorrelate, like my manual implementation, gives me the correct answer for translation, it's incorrect on scale. Since using the OpenCV LogPolar or my own doesn't affect the correctness, I must be missing something.

Any help would be appreciated.

$\endgroup$
  • 1
    $\begingroup$ Did you figure out what was wrong? $\endgroup$ – Mr.WorshipMe Jan 9 '16 at 21:52
  • 1
    $\begingroup$ @Mr.WorshipMe Unfortunately not. $\endgroup$ – Drew Cummins Jan 15 '16 at 19:29
  • $\begingroup$ @Drew Cummins, I guess it was due to the test image you used, because there was sharp transition from the background. How about other test images? Also, from the last figure, there were apparent differences between the two magnitudes, thus it is better to preform proper windowing pre-processing before the DFT. $\endgroup$ – lxg Mar 27 '17 at 3:19
  • $\begingroup$ A couple of days before I found that paper and I've been trying to implement the algorithm without success. I was wondering if you could share your implementation to a beginner :) $\endgroup$ – Alexis España Jul 31 '18 at 17:14
1
$\begingroup$

If you want something really robust, but that might be more computationally expensive, you might want to check out the algorithm I implemented here. It implements the paper, "Robust Image Registration Using Log-Polar Transform" (pdf). It also has the advantage of being rotation-invariant, in addition to translation and scale invariant. In my application (art), it was able to register even even similar-looking images, not just transformed versions of the same image.

$\endgroup$
0
$\begingroup$

I guess it is due to specific implementation issues. For example, (1) it is better to perform the windowing pre-processing before the DFT; (2) you can check the Highpass() function, and you can refer to the one in Reddy Chatterji's paper Eq.(23)-(24). Also, there is limit for the scale value, and you can try other scale values.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.