Bilinear Interpolation - Application in Image Processing

Application in Image Processing

In computer vision and image processing, bilinear interpolation is one of the basic resampling techniques.

In texture mapping, it is also known as bilinear filtering or bilinear texture mapping, and it can be used to produce a reasonably realistic image. An algorithm is used to map a screen pixel location to a corresponding point on the texture map. A weighted average of the attributes (color, alpha, etc.) of the four surrounding texels is computed and applied to the screen pixel. This process is repeated for each pixel forming the object being textured.

When an image needs to be scaled up, each pixel of the original image needs to be moved in a certain direction based on the scale constant. However, when scaling up an image by a non-integral scale factor, there are pixels (i.e., holes) that are not assigned appropriate pixel values. In this case, those holes should be assigned appropriate RGB or grayscale values so that the output image does not have non-valued pixels.

Bilinear interpolation can be used where perfect image transformation with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels. Unlike other interpolation techniques such as nearest neighbor interpolation and bicubic interpolation, bilinear interpolation uses only the 4 nearest pixel values which are located in diagonal directions from a given pixel in order to find the appropriate color intensity values of that pixel.

Bilinear interpolation considers the closest 2x2 neighborhood of known pixel values surrounding the unknown pixel's computed location. It then takes a weighted average of these 4 pixels to arrive at its final, interpolated value. The weight on each of the 4 pixel values is based on the computed pixel's distance (in 2D space) from each of the known points.

As seen in the example on the right, the intensity value at the pixel computed to be at row 20.2, column 14.5 can be calculated by first linearly interpolating between the values at column 14 and 15 on each rows 20 and 21, giving

\begin{array}{llll}
I_{20, 14.5} & = \tfrac{15 - 14.5}{15 - 14} \cdot 91 \, & + \; \tfrac{14.5 - 14}{15 - 14} \cdot 210 \, & = 150.5 \\
I_{21, 14.5} & = \tfrac{15 - 14.5}{15 - 14} \cdot 162 \, & + \; \tfrac{14.5 - 14}{15 - 14} \cdot 95 \, & = 128.5
\end{array}
and then interpolating linearly between these values, giving

This algorithm reduces some of the visual distortion caused by resizing an image to a non-integral zoom factor, as opposed to nearest neighbor interpolation, which will make some pixels appear larger than others in the resized image. Bilinear interpolation tends, however, to produce a greater number of interpolation artifacts (such as aliasing, blurring, and edge halos) than more computationally demanding techniques such as bicubic interpolation.

Read more about this topic:  Bilinear Interpolation

Famous quotes containing the words application and/or image:

    “I think that a young state, like a young virgin, should modestly stay at home, and wait the application of suitors for an alliance with her; and not run about offering her amity to all the world; and hazarding their refusal.... Our virgin is a jolly one; and tho at present not very rich, will in time be a great fortune, and where she has a favorable predisposition, it seems to me well worth cultivating.”
    —Benjamin Franklin (1706–1790)

    “Let us imagine a number of men in chains and all condemned to death, where some are killed each day in the sight of the others, and those who remain see their own fate in that of their fellows and wait their turn, looking at each other sorrowfully and without hope. It is an image of the condition of man.”
    —Blaise Pascal (1623–1662)