# Log Polar Transform

backlinks: /SRSoftwareOverview

### Overview

The log-polar transform warps an image onto new axes, angle () and log of distance (). The angle and distance are measured in relation
to the centre of the image, .

### Forward coordinate transformation

Using the centre of the image as the axis reference, pixel coordinates
are given by

the angle is

and, with a base of , the log of the distance is

The base, chosen so the diameter of the transformed image is the same
as that of the input image, is

where is the minimum dimension (probably
height) of the input image.

### Reverse coordinate transformation

When warping images, it is often impractical to use the forward
transform. Since we use discrete coordinates (i.e. integer x and y
values), more than one input coordinate may map to the same output
coordinate. Even worse, not every output coordinate will be covered.

One solution is to calculate the irregular grid of coordinates
obtained by transforming each input coordinate (without discretising).
Then, the grid is resampled (using interpolation) at the required
output positions.

An easier (and sometimes less computationally intensive) method is to
reverse the process. For each output coordinate, the transformation
is applied in reverse, to obtain a coordinate in (or outside) the
input image. Using interpolation, a value is determined.

This can be done if, neglecting the effect of discretisation, the
transformation function is bijective (one-to-one correspondence, and
all input and output coordinates are mapped).

Given and , we
would now like to find and . First, we calculate the distance from the centre:

whereafter we can determine and as

sahara trip
rainbow