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, a 1D interpolation is made on each row of the image, then a last 1D interpolation is made on the column, 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 into 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 than 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 bilinear interpolation on a 2D example: the interpolation is separated into 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)#

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

Thus, cubic interpolation uses third-order polynomials to get the “continuous” image. An example of cubic interpolation is given in Fig. 54. Consider the part of the interpolation between 1 and 2: this third-order polynomial is computed by using the four points identified with the arrows. Therefore, the whole interpolated function is a piecewise cubic function.

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

Fig. 54 Cubic interpolation on a 1D example.#

As with previous interpolation methods, the 2D interpolation is made with 1D interpolation on the rows of the image, then on the columns, as shown in Fig. 55.

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

Fig. 55 Illustration of the bicubic interpolation on a 2D example: the interpolation is separated into the two dimensions.#

Finally, the result of bicubic interpolation on an image is given in Fig. 53.

../_images/interp-3-image.svg

Fig. 56 Example of bicubic interpolation.#