Removal of Geometric Distortion
Fig. 1: Undistorted image, barrel distortion, and pincushion distortion.
Barrel and pincushion distortions are examples of radial distortion. One of the simplest ways to model these distortions is by transforming image coordinates.
Let represent the undistorted coordinates and the observed coordinates, i.e. the coordinates in the distorted image. Any radially symmetric distortion can be approximated using a Taylor series of the following form:
where , and , , are the radial distortion coefficients.
To make the coordinates independent of the image dimensions, and are dimensionless. In addition, to preserve radial symmetry, the origin of the coordinate system must be moved to the centre of the image. Coordinates with the required properties can be obtained as follows:
where
and the coordinates of the image centre are
where is the image width and is the image height.
The transformation from the coordinates in the reconstructed image to the corresponding coordinates in the original distorted image can then be written as
Process the output image pixel by pixel. For each output pixel , compute the corresponding coordinates in the input image.
In general, the resulting coordinates are real-valued, so an interpolation method must be used to obtain the pixel value. The simplest option is nearest-neighbour interpolation. For better results, use bilinear interpolation.
An example of the result obtained using this method is shown in Fig. 2.
Fig. 2: Original distorted image (left); image after removal of radial distortion (right).