Bilinear Interpolation: Enhancing Image Resolution and Clarity through Bilinear Interpolation
By Fouad Sabry
()
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.
Related to Bilinear Interpolation
Titles in the series (100)
Histogram Equalization: Enhancing Image Contrast for Enhanced Visual Perception Rating: 0 out of 5 stars0 ratingsNoise Reduction: Enhancing Clarity, Advanced Techniques for Noise Reduction in Computer Vision Rating: 0 out of 5 stars0 ratingsAffine Transformation: Unlocking Visual Perspectives: Exploring Affine Transformation in Computer Vision Rating: 0 out of 5 stars0 ratingsActive Contour: Advancing Computer Vision with Active Contour Techniques Rating: 0 out of 5 stars0 ratingsAdaptive Filter: Enhancing Computer Vision Through Adaptive Filtering Rating: 0 out of 5 stars0 ratingsHarris Corner Detector: Unveiling the Magic of Image Feature Detection Rating: 0 out of 5 stars0 ratingsHough Transform: Unveiling the Magic of Hough Transform in Computer Vision Rating: 0 out of 5 stars0 ratingsUnderwater Computer Vision: Exploring the Depths of Computer Vision Beneath the Waves Rating: 0 out of 5 stars0 ratingsComputer Stereo Vision: Exploring Depth Perception in Computer Vision Rating: 0 out of 5 stars0 ratingsAnisotropic Diffusion: Enhancing Image Analysis Through Anisotropic Diffusion Rating: 0 out of 5 stars0 ratingsComputer Vision: Exploring the Depths of Computer Vision Rating: 0 out of 5 stars0 ratingsRandom Sample Consensus: Robust Estimation in Computer Vision Rating: 0 out of 5 stars0 ratingsFilter Bank: Insights into Computer Vision's Filter Bank Techniques Rating: 0 out of 5 stars0 ratingsInpainting: Bridging Gaps in Computer Vision Rating: 0 out of 5 stars0 ratingsJoint Photographic Experts Group: Unlocking the Power of Visual Data with the JPEG Standard Rating: 0 out of 5 stars0 ratingsHomography: Homography: Transformations in Computer Vision Rating: 0 out of 5 stars0 ratingsImage Histogram: Unveiling Visual Insights, Exploring the Depths of Image Histograms in Computer Vision Rating: 0 out of 5 stars0 ratingsColor Space: Exploring the Spectrum of Computer Vision Rating: 0 out of 5 stars0 ratingsHadamard Transform: Unveiling the Power of Hadamard Transform in Computer Vision Rating: 0 out of 5 stars0 ratingsRadon Transform: Unveiling Hidden Patterns in Visual Data Rating: 0 out of 5 stars0 ratingsImage Compression: Efficient Techniques for Visual Data Optimization Rating: 0 out of 5 stars0 ratingsTone Mapping: Tone Mapping: Illuminating Perspectives in Computer Vision Rating: 0 out of 5 stars0 ratingsRetinex: Unveiling the Secrets of Computational Vision with Retinex Rating: 0 out of 5 stars0 ratingsGamma Correction: Enhancing Visual Clarity in Computer Vision: The Gamma Correction Technique Rating: 0 out of 5 stars0 ratingsColor Mapping: Exploring Visual Perception and Analysis in Computer Vision Rating: 0 out of 5 stars0 ratingsHuman Visual System Model: Understanding Perception and Processing Rating: 0 out of 5 stars0 ratingsEpipolar Geometry: Unlocking Depth Perception in Computer Vision Rating: 0 out of 5 stars0 ratingsColor Management System: Optimizing Visual Perception in Digital Environments Rating: 5 out of 5 stars5/5Visual Perception: Insights into Computational Visual Processing Rating: 0 out of 5 stars0 ratingsCanny Edge Detector: Unveiling the Art of Visual Perception Rating: 0 out of 5 stars0 ratings
Related ebooks
Introduction to Numerical Analysis Rating: 0 out of 5 stars0 ratingsExercises of Numerical Analysis Rating: 0 out of 5 stars0 ratingsInterpolation and Extrapolation Optimal Designs 2: Finite Dimensional General Models Rating: 0 out of 5 stars0 ratingsIntroductory Numerical Analysis Rating: 2 out of 5 stars2/5Learning NumPy Array Rating: 0 out of 5 stars0 ratingsLine Drawing Algorithm: Mastering Techniques for Precision Image Rendering Rating: 0 out of 5 stars0 ratingsAnalysis of Numerical Methods Rating: 3 out of 5 stars3/5Chebyshev and Fourier Spectral Methods: Second Revised Edition Rating: 4 out of 5 stars4/5Introduction to Numerical Analysis: Second Edition Rating: 4 out of 5 stars4/5Radial Basis Networks: Fundamentals and Applications for The Activation Functions of Artificial Neural Networks Rating: 0 out of 5 stars0 ratingsOptimization in Function Spaces Rating: 0 out of 5 stars0 ratingsIntroduction to the Mathematics of Inversion in Remote Sensing and Indirect Measurements Rating: 0 out of 5 stars0 ratingsNumerical Methods for Science and Engineering Rating: 0 out of 5 stars0 ratingsDirect Linear Transformation: Practical Applications and Techniques in Computer Vision Rating: 0 out of 5 stars0 ratingsSplines and Variational Methods Rating: 5 out of 5 stars5/5Schaum's Outline of Mathematics for Liberal Arts Majors Rating: 0 out of 5 stars0 ratingsDigital Signal and Image Processing using MATLAB, Volume 3: Advances and Applications, The Stochastic Case Rating: 3 out of 5 stars3/5Algorithms for Minimization Without Derivatives Rating: 0 out of 5 stars0 ratingsStability Theory of Differential Equations Rating: 4 out of 5 stars4/5Elementary Theory and Application of Numerical Analysis: Revised Edition Rating: 0 out of 5 stars0 ratingsSchaum's Outline of Mathematical Methods for Business, Economics and Finance, Second Edition Rating: 0 out of 5 stars0 ratingsTheory of Linear Physical Systems: Theory of physical systems from the viewpoint of classical dynamics, including Fourier methods Rating: 0 out of 5 stars0 ratingsegghead's Guide to Calculus Rating: 0 out of 5 stars0 ratingsLinear Programming and Network Flows Rating: 0 out of 5 stars0 ratingsDigital Image Processing: Fundamentals and Applications Rating: 0 out of 5 stars0 ratingsBusiness Calculus Demystified Rating: 0 out of 5 stars0 ratingsLearning Probabilistic Graphical Models in R Rating: 0 out of 5 stars0 ratingsA Workout in Computational Finance Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/5Writing AI Prompts For Dummies Rating: 0 out of 5 stars0 ratingsCreating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5The ChatGPT Revolution: How to Simplify Your Work and Life Admin with AI Rating: 0 out of 5 stars0 ratings100M Offers Made Easy: Create Your Own Irresistible Offers by Turning ChatGPT into Alex Hormozi Rating: 5 out of 5 stars5/5The Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5ChatGPT Millionaire: Work From Home and Make Money Online, Tons of Business Models to Choose from Rating: 5 out of 5 stars5/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 4 out of 5 stars4/580 Ways to Use ChatGPT in the Classroom Rating: 5 out of 5 stars5/5THE CHATGPT MILLIONAIRE'S HANDBOOK: UNLOCKING WEALTH THROUGH AI AUTOMATION Rating: 5 out of 5 stars5/5AI Money Machine: Unlock the Secrets to Making Money Online with AI Rating: 5 out of 5 stars5/53550+ Most Effective ChatGPT Prompts Rating: 0 out of 5 stars0 ratingsMidjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5The Roadmap to AI Mastery: A Guide to Building and Scaling Projects Rating: 3 out of 5 stars3/5A Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5AI for Educators: AI for Educators Rating: 3 out of 5 stars3/5Coding with AI For Dummies Rating: 1 out of 5 stars1/5Mastering ChatGPT Rating: 0 out of 5 stars0 ratingsGenerative AI For Dummies Rating: 2 out of 5 stars2/5The AI-Driven Leader: Harnessing AI to Make Faster, Smarter Decisions Rating: 4 out of 5 stars4/5AI Investing For Dummies Rating: 0 out of 5 stars0 ratings
Reviews for Bilinear Interpolation
0 ratings0 reviews
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