Interpolation#

Image interpolation is a basic tool used extensively in tasks such as rescaling, translating, shrinking or rotating an image. These tasks are geometric transformations that map an image into a predefined geometry, for example in remote sensing to return a cartographic reference, or in medical imaging to align images on anatomical references. The consequence of a geometric transformation is that the transformed grid points of the input image no longer coincide with the grid points of the output image and vice-versa.

The basic idea of interpolation is quite simple: first, reconstruct a “continuous” image from the discrete input image, then sample this “continuous” image onto the grid of the output image. Interpolation methods differ from the way the “continuous” image is reconstructed.

../_images/interpolation.png

Fig. 41 Principle of interpolation. The green image is the continuous image. The blue and red grid schematize the input and ouput grids, respectively. The question is: how to compute the intensity of the pixels of the red grid from the one of the blue grid?#

It is more simple to understand image (2D) interpolation by considering 1D interpolation. Thus the sequel of this section illustrates some interpolation methods in the 1D domain.

Nearest neighbour interpolation#

Nearest neighbour interpolation (French: interpolation au plus proche voisin) is the simplest method. The intensity of a pixel in the output image is assigned to the intensity of the closest pixel in the input image.

Fig. 42 illustrates the principle of nearest neighbour interpolation in a 1-dimensional context.

../_images/interp-nearest-1d.svg

Fig. 42 Nearest neighbour interpolation on a 1D example. The blue dots represent the input image pixels, the red dots represent the output image pixels. The gray line is the continuous image reconstructed from the input image.#

../_images/interp-nearest-2d.svg

Fig. 43 Nearest neighbour interpolation on an image with one row (the pixel intensities have the same intensities as the data in Fig. 42).#

(Bi)linear interpolation#

With linear interpolation (French: interpolation linéaire), the interpolated points lie on pieces of straight lines connecting neighbouring grid points. Because images are in 2D, this method is called bilinear interpolation. This generally gives better results that nearest neighbour interpolation, but structures with high frequencies are not correctly interpolated.

../_images/interp-linear-1d.svg

Fig. 44 Linear interpolation on a 1D example.#

../_images/interp-linear-2d.svg

Fig. 45 Linear interpolation on an image.#

Polynomial Interpolation#

The basic principle of linear interpolation was that a straight line was drawn to pass through two neighbouring points. Besides its porr behavior to interpolate high frequencies, polynomial interpolation has another significant disadvantage: the interpolated curve is not continuous at the grid points already in its first derivative.

Therefore, an alternative is to use a polynomial of degree \(P\) that must pass through \(P+1\) grid points.

../_images/interp-cubic-1d.svg

Fig. 46 Polynomial interpolation on a 1D example.#

../_images/interp-cubic-2d.svg

Fig. 47 Polynomial interpolation on an image.#