Interpolation#

Image interpolation is a tool used extensively when an image is mapped into a predefined geometry, by using transformations such as rescaling, translating, shrinking or rotating. Applications arise in many domains: creating panoramas in photography, return a cartographic reference in remote sensing, or align images on anatomical references in medical imaging.

The consequence of a geometric transformation on an image is that the coordinates of the pixels in the input and and the output image no longer coincide. Thus the pixel intensities in the output image have to be calculated.

../_images/interp-grid-image.svg

Fig. 47 Principle of interpolation. The blue and red grids schematize the pixels of the input and ouput images, respectively. The question is: how to compute the intensity of the highlighted pixel of the red grid from the ones of the blue grid?#

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. Below are listed the three main interpolation methods: nearest neighbour interpolation (order 0), bilinear interpolation (order 1), and bicubic Interpolation (order 3). In these methods, the “continuous” image is built from a polynomial model. The order of the polynomial differs from the interpolation methods.

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.

An example of nearest neighbour interpolation in 1D is given in Fig. 48.

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

Fig. 48 Illustration of the 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.#

In 2D, an 1D interpolation if made on each row of the image, the, a last 1D interpolation is made on the colum, as illustrated in Fig. 49.

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

Fig. 49 Illustration of the nearest neighbour interpolation on a 2D example: the interpolation is separated in the two dimensions.#

The result of nearest-neighbour interpolation on an image is given in Fig. 50.

../_images/interp-0-image.svg

Fig. 50 Example of nearest-neighbour interpolation, with the same grid as in Fig. 47. The original image is of size 32\(\times\)32. (For clarity, the grid depicted in Fig. 47 shows squares of size \(2\times2\) pixels).#

Bilinear interpolation (order 1)#

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.

An example of linear interpolation is given in Fig. 51, and the principle of bilinear interpolation is shown in Fig. 52.

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

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

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

Fig. 52 Illustration of the bilinear interpolation on a 2D example: the interpolation is separated in the two dimensions.#

The result of bilinear interpolation on an image is given in Fig. 53.

../_images/interp-1-image.svg

Fig. 53 Example of bilinear interpolation. See how much more natural the result is compared to nearest-neighbor interpolation.#

Bicubic Interpolation (order 3)#

Artifacts/Aliasing#