Explore 1.5M+ audiobooks & ebooks free for days

Only $12.99 CAD/month after trial. Cancel anytime.

Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation
Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation
Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation
Ebook113 pages51 minutesComputer Vision

Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation

Rating: 0 out of 5 stars

()

Read preview

About this ebook

What is Bilinear Interpolation


In mathematics, bilinear interpolation is a method for interpolating functions of two variables using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be generalized to functions defined on the vertices of arbitrary convex quadrilaterals.


How you will benefit


(I) Insights, and validations about the following topics:


Chapter 1: Bilinear interpolation


Chapter 2: Interpolation


Chapter 3: Linear interpolation


Chapter 4: Polynomial interpolation


Chapter 5: Newton polynomial


Chapter 6: Lagrange polynomial


Chapter 7: Spline interpolation


Chapter 8: Cubic Hermite spline


Chapter 9: Trilinear interpolation


Chapter 10: Bicubic interpolation


(II) Answering the public top questions about bilinear interpolation.


(III) Real world examples for the usage of bilinear interpolation in many fields.


Who this book is for


Professionals, undergraduate and graduate students, enthusiasts, hobbyists, and those who want to go beyond basic knowledge or information for any kind of Bilinear Interpolation.

LanguageEnglish
PublisherOne Billion Knowledgeable
Release dateMay 4, 2024
Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation

Related to Bilinear Interpolation

Titles in the series (100)

View More

Related ebooks

Intelligence (AI) & Semantics For You

View More

Reviews for Bilinear Interpolation

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Bilinear Interpolation - Fouad Sabry

    Chapter 1: Bilinear interpolation

    Bilinear interpolation is a technique for interpolating two-variable functions (e.g., x and y) using repeated linear interpolation. It is often applied to functions sampled on a 2D rectilinear grid, but can be extended to functions specified on the vertices of arbitrary convex quadrilaterals.

    Bilinear interpolation is accomplished by employing linear interpolation in one direction and then the other. Although each step is linear in terms of sampled values and position, the interpolation as a whole is quadratic in terms of the sample location.

    Bilinear interpolation is one of the fundamental resampling methods in computer vision and image processing, where it is also known as bilinear filtering and bilinear texture mapping.

    Suppose we wish to determine the value of an unknown function f at the position (x, y), y).

    It is assumed that we know the value of f at the four points Q11 = (x1, y1), Q12 = (x1, y2), Q21 = (x2, y1), and Q22 = (x2, y2).

    First, we perform linear interpolation along the x-axis. This leads to

    {\displaystyle {\begin{aligned}f(x,y_{1})={\frac {x_{2}-x}{x_{2}-x_{1}}}f(Q_{11})+{\frac {x-x_{1}}{x_{2}-x_{1}}}f(Q_{21}),\\f(x,y_{2})={\frac {x_{2}-x}{x_{2}-x_{1}}}f(Q_{12})+{\frac {x-x_{1}}{x_{2}-x_{1}}}f(Q_{22}).\end{aligned}}}

    We then interpolate along the y-axis to acquire the appropriate estimate:

    {\displaystyle {\begin{aligned}f(x,y)&={\frac {y_{2}-y}{y_{2}-y_{1}}}f(x,y_{1})+{\frac {y-y_{1}}{y_{2}-y_{1}}}f(x,y_{2})\\&={\frac {y_{2}-y}{y_{2}-y_{1}}}\left({\frac {x_{2}-x}{x_{2}-x_{1}}}f(Q_{11})+{\frac {x-x_{1}}{x_{2}-x_{1}}}f(Q_{21})\right)+{\frac {y-y_{1}}{y_{2}-y_{1}}}\left({\frac {x_{2}-x}{x_{2}-x_{1}}}f(Q_{12})+{\frac {x-x_{1}}{x_{2}-x_{1}}}f(Q_{22})\right)\\&={\frac {1}{(x_{2}-x_{1})(y_{2}-y_{1})}}\left(f(Q_{11})(x_{2}-x)(y_{2}-y)+f(Q_{21})(x-x_{1})(y_{2}-y)+f(Q_{12})(x_{2}-x)(y-y_{1})+f(Q_{22})(x-x_{1})(y-y_{1})\right)\\&={\frac {1}{(x_{2}-x_{1})(y_{2}-y_{1})}}{\begin{bmatrix}x_{2}-x&x-x_{1}\end{bmatrix}}{\begin{bmatrix}f(Q_{11})&f(Q_{12})\\f(Q_{21})&f(Q_{22})\end{bmatrix}}{\begin{bmatrix}y_{2}-y\\y-y_{1}\end{bmatrix}}.\end{aligned}}}

    Note that the outcome is identical if the interpolation is performed first along the y direction and then along the x direction.

    Alternatively, the solution to the interpolation problem can be expressed as a multilinear polynomial.

    {\displaystyle f(x,y)\approx a_{00}+a_{10}x+a_{01}y+a_{11}xy,}

    where coefficients are determined via linear system solution

    {\displaystyle {\begin{aligned}{\begin{bmatrix}1&x_{1}&y_{1}&x_{1}y_{1}\\1&x_{1}&y_{2}&x_{1}y_{2}\\1&x_{2}&y_{1}&x_{2}y_{1}\\1&x_{2}&y_{2}&x_{2}y_{2}\end{bmatrix}}{\begin{bmatrix}a_{00}\\a_{10}\\a_{01}\\a_{11}\end{bmatrix}}={\begin{bmatrix}f(Q_{11})\\f(Q_{12})\\f(Q_{21})\\f(Q_{22})\end{bmatrix}},\end{aligned}}}

    yielding the result

    {\displaystyle {\begin{aligned}{\begin{bmatrix}a_{00}\\a_{10}\\a_{01}\\a_{11}\end{bmatrix}}={\frac {1}{(x_{2}-x_{1})(y_{2}-y_{1})}}{\begin{bmatrix}x_{2}y_{2}&-x_{2}y_{1}&-x_{1}y_{2}&x_{1}y_{1}\\-y_{2}&y_{1}&y_{2}&-y_{1}\\-x_{2}&x_{2}&x_{1}&-x_{1}\\1&-1&-1&1\end{bmatrix}}{\begin{bmatrix}f(Q_{11})\\f(Q_{12})\\f(Q_{21})\\f(Q_{22})\end{bmatrix}}.\end{aligned}}}

    The answer can also be expressed as a weighted mean of the f values (Q):

    {\displaystyle f(x,y)\approx w_{11}f(Q_{11})+w_{12}f(Q_{12})+w_{21}f(Q_{21})+w_{22}f(Q_{22}),}

    If the sum of the weights is 1 and the transposed linear system is satisfied

    {\displaystyle {\begin{bmatrix}1&1&1&1\\x_{1}&x_{1}&x_{2}&x_{2}\\y_{1}&y_{2}&y_{1}&y_{2}\\x_{1}y_{1}&x_{1}y_{2}&x_{2}y_{1}&x_{2}y_{2}\end{bmatrix}}{\begin{bmatrix}w_{11}\\w_{12}\\w_{21}\\w_{22}\end{bmatrix}}={\begin{bmatrix}1\\x\\y\\xy\end{bmatrix}},}

    yielding the result

    {\displaystyle {\begin{aligned}{\begin{bmatrix}w_{11}\\w_{21}\\w_{12}\\w_{22}\end{bmatrix}}={\frac {1}{(x_{2}-x_{1})(y_{2}-y_{1})}}{\begin{bmatrix}x_{2}y_{2}&-y_{2}&-x_{2}&1\\-x_{2}y_{1}&y_{1}&x_{2}&-1\\-x_{1}y_{2}&y_{2}&x_{1}&-1\\x_{1}y_{1}&-y_{1}&-x_{1}&1\end{bmatrix}}{\begin{bmatrix}1\\x\\y\\xy\end{bmatrix}},\end{aligned}}}

    which simplifies to

    {\displaystyle {\begin{aligned}w_{11}&=(x_{2}-x)(y_{2}-y)/((x_{2}-x_{1})(y_{2}-y_{1})),\\w_{12}&=(x_{2}-x)(y-y_{1})/((x_{2}-x_{1})(y_{2}-y_{1})),\\w_{21}&=(x-x_{1})(y_{2}-y)/((x_{2}-x_{1})(y_{2}-y_{1})),\\w_{22}&=(x-x_{1})(y-y_{1})/((x_{2}-x_{1})(y_{2}-y_{1})),\end{aligned}}}

    consistent with the outcome of successive linear interpolation. The collection of weights can also be interpreted as a set of barycentric coordinates for a rectangle that have been generalized.

    Considering the above, we have

    {\displaystyle {\begin{aligned}f(x,y)\approx {\frac {1}{(x_{2}-x_{1})(y_{2}-y_{1})}}{\begin{bmatrix}f(Q_{11})&f(Q_{12})&f(Q_{21})&f(Q_{22})\end{bmatrix}}{\begin{bmatrix}x_{2}y_{2}&-y_{2}&-x_{2}&1\\-x_{2}y_{1}&y_{1}&x_{2}&-1\\-x_{1}y_{2}&y_{2}&x_{1}&-1\\x_{1}y_{1}&-y_{1}&-x_{1}&1\end{bmatrix}}{\begin{bmatrix}1\\x\\y\\xy\end{bmatrix}}.\end{aligned}}}

    If the four positions where f is known are (0, 0), (1, 0), (0, 1), and (1, 1), then the interpolation formula reduces to

    {\displaystyle f(x,y)\approx f(0,0)(1-x)(1-y)+f(1,0)x(1-y)+f(0,1)(1-x)y+f(1,1)xy,}

    correspondingly, in matrix operations:

    {\displaystyle f(x,y)\approx {\begin{bmatrix}1-x&x\end{bmatrix}}{\begin{bmatrix}f(0,0)&f(0,1)\\f(1,0)&f(1,1)\end{bmatrix}}{\begin{bmatrix}1-y\\y\end{bmatrix}}.}

    Additionally, we acknowledge the weights:

    {\displaystyle {\begin{aligned}w_{11}&=(1-x)(1-y),\\w_{12}&=(1-x)y,\\w_{21}&=x(1-y),\\w_{22}&=xy.\end{aligned}}}

    Alternately, the unit square interpolant can be expressed as

    {\displaystyle f(x,y)=a_{00}+a_{10}x+a_{01}y+a_{11}xy,}

    where

    {\displaystyle {\begin{aligned}a_{00}&=f(0,0),\\a_{10}&=f(1,0)-f(0,0),\\a_{01}&=f(0,1)-f(0,0),\\a_{11}&=f(1,1)-f(1,0)-f(0,1)+f(0,0).\end{aligned}}}

    Four constants correspond to the number of data points where f is given in both instances.

    As its name implies, the bilinear interpolant is not linear; nonetheless, it is linear (i.e. affine) along lines parallel to either the x or y axis, if either x or y is held constant. The interpolant along any other straight line is quadratic. Even though the interpolation is not linear in the location (x and y), the interpolation values are linear at a fixed point, as shown in the preceding (matrix) calculations.

    Bilinear interpolation yields the same result regardless of which axis is interpolated first and which is interpolated second. If we had performed linear interpolation in the y direction before the x direction, the resultant approximation would have been same.

    Interpolation is performed using a bilinear polynomial, It also satisfies Laplace's equation for a harmonic function.

    Its graph is a bilinear Bézier surface patch.

    Interpolation is not invertible because the interpolant assumes any value (within the convex hull of the vertex values) at an infinite number of points (creating branches of hyperbolas).

    When bilinear interpolation is used concurrently to two functions, such as when interpolating a vector field, the interpolation is invertible (under certain conditions). Specifically, this inverse can be used to determine the unit square coordinates of a point located within any convex quadrilateral (by considering the coordinates of the quadrilateral as a vector field which is bilinearly interpolated on the unit square). Using this method, bilinear interpolation can be applied to any convex quadrilateral, however the computation is substantially more difficult if the quadrilateral is not a parallelogram. Bilinear transformation, bilinear warp, or bilinear distortion describes the resulting map between quadrilaterals.

    An alternative is to employ a projective

    Enjoying the preview?
    Page 1 of 1