Académique Documents
Professionnel Documents
Culture Documents
1 Algorithm
y2
Q12
R2
Q22
y1
Q11
x1
R1
x
x2 x
f (Q11 ) +
x2 x1
x2 x
f (x, y2 )
f (Q12 ) +
x2 x1
f (x, y1 )
Q21
x2
x x1
f (Q21 )
x2 x1
x x1
f (Q22 )
x2 x1
y2 y
y y1
f (x, y1 ) +
f (x, y2 )
y2 y1
y2 y1
(
)
(
y2 y
x2 x
x x1
y y1
f (Q11 ) +
f (Q21 ) +
y2 y1 x2 x1
x2 x1
y2 y1 x
1
=
(f (Q11 )(x2 x)(y2 y) + f (Q21 )(x
(x2 x1 )(y2 y1 )
[
][
[
] f (Q11 ) f (Q12 ) y2
1
x2 x x x1
=
f (Q21 ) f (Q22 ) y
(x2 x1 )(y2 y1 )
f (x, y)
Note that we will arrive at the same result if the interpolation is done rst along the y-direction and then along the
x-direction.
Example of bilinear interpolation on the unit square with the zvalues 0, 1, 1 and 0.5 as indicated. Interpolated values in between represented by color.
f (x, y) a0 + a1 x + a2 y + a3 xy
In mathematics, bilinear interpolation is an extension Where the coecients are found by solving the linear sysof linear interpolation for interpolating functions of two tem
variables (e.g., x and y) on a rectilinear 2D grid.
The key idea is to perform linear interpolation rst in one
direction, and then again in the other direction. Although
each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather
quadratic in the sample location.
1
1
1
1
1
x1
x1
x2
x2
y1
y2
y1
y2
x1 y1 a0
f (Q11 )
x1 y2
a1 = f (Q12 )
x2 y1 a2 f (Q21 )
x2 y2 a3
f (Q22 )
(x1,y2)
(x2,y2)
1.2
x1
x1
x2
x2
y1
y2
y1
y2
1 T
x1 y1
x1 y2
x2 y1
x2 y2
(x,y)
1
x
y
xy
(x1,y1)
Unit Square
(x2,y1)
+
1.3
f (0, 1)
f (1, 1)
][
]
1y
.
y
Nonlinear
In computer vision and image processing, bilinear interpolation is one of the basic resampling techniques.
In texture mapping, it is also known as bilinear ltering 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.[1]
3
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 nd the appropriate color intensity values of
that pixel.
Bilinear interpolation considers the closest 2x2 neighborhood of known pixel values surrounding the unknown
pixels computed location. It then takes a weighted average of these 4 pixels to arrive at its nal, interpolated
value. The weight on each of the 4 pixel values is based
on the computed pixels distance (in 2D space) from each
of the known points.[2]
3 See also
Bicubic interpolation
Trilinear interpolation
Spline interpolation
Lanczos resampling
Stairstep interpolation
Barycentric coordinates - for interpolating within a
triangle or tetrahedron
4 References
[1] Bilinear interpolation denition at www.pcmag.com
[2] Digital Image Interpolation
1514.5
1514
1514.5
1514
91 +
14.514
1514
+ 14.514
1514
210 = 150.5
162
95 = 128.5
I20.2,14.5 =
2120.2
2120
150.5 +
20.220
2120
128.5 = 146.1
5.1
Text
5.2
Images
5.3
Content license