Image Registration: Difference between revisions

From David's Wiki
Line 30: Line 30:


==Log-Polar Transformation==
==Log-Polar Transformation==
See Wolberg and Zokai<ref name="wolberg2000robust">George Wolberg, and Siavash Zokai. ''Robust Image Registration Using Log-Polar Transform'' URL:[https://home.cis.rit.edu/~cnspci/references/wolberg2000.pdf https://home.cis.rit.edu/~cnspci/references/wolberg2000.pdf].
This is copied from Wolberg and Zokai<ref name="wolberg2000robust">George Wolberg, and Siavash Zokai. ''Robust Image Registration Using Log-Polar Transform'' URL:[https://home.cis.rit.edu/~cnspci/references/wolberg2000.pdf https://home.cis.rit.edu/~cnspci/references/wolberg2000.pdf]</ref>.


The log-polar transformation is defined as follows:<br>
The log-polar transformation is defined as follows:<br>
\(
\(
\begin{align}
\begin{align}
r &= \sqrt{(x-x_c)^2 + (y-y_c)^2}\\
b &= \log(r) = \log\left(\sqrt{(x-x_c)^2 + (y-y_c)^2}\right)\\
a &= \operatorname{arctan2}(y-y_c, x-x_c)
a &= \operatorname{arctan2}(y-y_c, x-x_c)
\end{align}
\end{align}
\)<br>
\)<br>
where <math>(x_c, y_c)</math> is the center of the image.
where <math>(x_c, y_c)</math> is the center of the image and <math>r</math> is the distance from the center of the image.
 
Here a rotation in Cartesian coordinates <math>(x, y)</math> around the center \((x_c, y_c)\) corresponds to a shift in \(a\) in log-polar coordinates.
 
A scale change (i.e. enlarge or stretch) is a shift in log-space:<br>
\( \lambda r \mapsto \log(\lambda r) = \log(\lambda) + \log(r) \)<br>


Here a rotation in Cartesian coordinates <math>(x, y)</math> around the center \((x_c, y_c)\) corresponds to a shift in \(a\) in log-polar coordinates.<br>
These translations can be found using [[Wikipedia: Cross-correlation]].
These translations can be found using [[Wikipedia: Cross-correlation]].


A scale change (i.e. enlarge or stretch) is a shift in log-space:<br>
;Algorithm
\( \lambda x \mapsto \log(\lambda x) = \log(\lambda) + \log(x) \)
For each resolution from coarse to fine, do the following:
# Crop central region <math>I_1'</math> from <math>I_1</math>
# Compute the low-polar transformation <math>I_{1p}'</math>
# For all positions \((x,y)\)
## Crop region \(I_{2p}'\)
## Compute \(I_{2p}'\)
## Cross-correlate \(I_{1p}'\) and \(I_{2p}'\) to get \((dx, dy)\)
## If max correlation, save \((x, y)\) and \((dx, dy)\)
# Scale = \(dx\)


==References==
==References==

Revision as of 14:14, 15 May 2020

Image registration is recovering an affine transformation (rotation + translation) between two images.

Problem Statement

We are given two images \(\displaystyle I_1\) and \(\displaystyle I_2\).
Let \(\displaystyle (x,y)\) be uv coordinates within the image.
We want to find a rotation and translation from \(\displaystyle (x,y)\) to \(\displaystyle (x',y')\) such that \(\displaystyle I_1(x,y) = I_2(x', y')\).
This is represented as:
\( \begin{align} x' &= a_1 x + a_2 y + a_3\\ y' &= a_4 x + a_5 y + a_6 \end{align} \)
This can also be written as:
\(\displaystyle \begin{pmatrix} x' \\ y' \\ 1 \end{pmatrix} = \begin{pmatrix} a_1 & a_2 & a_3\\ a_4 & a_5 & a_6\\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} \)

Log-Polar Transformation

This is copied from Wolberg and Zokai[1].

The log-polar transformation is defined as follows:
\( \begin{align} b &= \log(r) = \log\left(\sqrt{(x-x_c)^2 + (y-y_c)^2}\right)\\ a &= \operatorname{arctan2}(y-y_c, x-x_c) \end{align} \)
where \(\displaystyle (x_c, y_c)\) is the center of the image and \(\displaystyle r\) is the distance from the center of the image.

Here a rotation in Cartesian coordinates \(\displaystyle (x, y)\) around the center \((x_c, y_c)\) corresponds to a shift in \(a\) in log-polar coordinates.

A scale change (i.e. enlarge or stretch) is a shift in log-space:
\( \lambda r \mapsto \log(\lambda r) = \log(\lambda) + \log(r) \)

These translations can be found using Wikipedia: Cross-correlation.

Algorithm

For each resolution from coarse to fine, do the following:

  1. Crop central region \(\displaystyle I_1'\) from \(\displaystyle I_1\)
  2. Compute the low-polar transformation \(\displaystyle I_{1p}'\)
  3. For all positions \((x,y)\)
    1. Crop region \(I_{2p}'\)
    2. Compute \(I_{2p}'\)
    3. Cross-correlate \(I_{1p}'\) and \(I_{2p}'\) to get \((dx, dy)\)
    4. If max correlation, save \((x, y)\) and \((dx, dy)\)
  4. Scale = \(dx\)

References

  1. George Wolberg, and Siavash Zokai. Robust Image Registration Using Log-Polar Transform URL:https://home.cis.rit.edu/~cnspci/references/wolberg2000.pdf