Home Login  |   Contact  |   About Us       Tuesday, November 29, 2022   

j0110924 - Back to Home
   Skip Navigation LinksHOME ›  AREAS OF EXPERTISE ›   Interpolation Apps ›  ~ Bilinear Method



Skip Navigation Links.



"Interpolation Solutions"
Bilinear Interpolation Method
X =
Y =

Results Z =

Grid Values = { , , , }



[ Initial GridValues X: {0,10} ]
[ Initial GridValues Y: {10,5} ]

IMPLEMENTATION
Bilinear Interpolation

The bilinear interpolation is an extension of the linear interpolation for interpolating functions of two variables, z = f(x,y), on a regular grid. This type of interpolation plays an important role in computer vision and image processing. It is a texture mapping method that produces a reasonably realistic image, and is also known as bilinear texture mapping.

Algorithm Creation

The bilinear interpolation uses four vertex values sorrounding each rectangular unit cell to obtain any value inside the unit cell. To get the value at (x,y), and the vertices of the unit cell are located at (x0,y0),(x0,y1),(x1,y0), and (x1,y1), where they have the given function values z00,z01, z10, and z11, respectively.

The linear interpolation on the top row of neighbors, between (x0,y0) and (x1,y0), estimates the value f(x1,y0) at (x1, y0) as:

f(x,y0) = x1 - x / x1 - x0 z00 + x - x0 / x1 - x0 * z10

Likewise, the linear interpolation on the bottom row of neighbors follow the same concept.



Testing the Bilinear Interpolation Method

In order to test the Bilinear Interpolation method as defined above, a new TestBilinear() static method has been added and executed. Supporting code and methods are not shown.

In order to test the bilinear interpolation, a two-dimensional data mapping grid with four points was defined: (0,0), (0,1), (1,0), and (1,1), which have the values 0, 10, 10, and 5, respectively. The user can manipulate grid values to test the bilinear method.

           static void TestBilinear();
              {
                 ListBox1.Items.Clear();
                 ListBox2.Items.Clear();
                 ListBox3.Items.Clear();
                 double[] xarray = new double[] { 0,1 };
                 double[] yarray = new double[] { 0,1 };
                 double[] x = new double[9];
                 double[] y = new double[9];
                 MatrixR z = new MatrixR(9, 9);;
                 VectorR vx = new VectorR(x);
                 VectorR vy = new VectorR(y);
                  for (int i = 0; i < 9; i++)
                  {
                  for (int j = 0; j < 9; j++)
                  {
                  z[i, j] = Interpolation.Bilinear(xarray, yarray, zarray, x[i], y[j]);
                  }
                 ListBox1.Items.Add(" " + vx.ToString());
                 ListBox2.Items.Add(" " + vy.ToString());
                 ListBox3.Items.Add(" " + z.ToString());
              }



Other Implementations...


Object-Oriented Implementation
Graphics and Animation
Sample Applications
Ore Extraction Optimization
Vectors and Matrices
Complex Numbers and Functions
Ordinary Differential Equations - Euler Method
Ordinary Differential Equations 2nd-Order Runge-Kutta
Ordinary Differential Equations 4th-Order Runge-Kutta
Higher Order Differential Equations
Nonlinear Systems
Numerical Integration
Numerical Differentiation
Function Evaluation


Consulting Services - Back to Home
Home

Home Math, Analysis,
  expertise..."

EIGENVALUE
SOLUTIONS...


> Rayleigh-Quotient Method

> Cubic Spline Method

 

Applied Mathematical Algorithms

Home

ComplexFunctions

Home

NonLinear
Home

Differentiation
Home

Integration
About Us


KMP Software Engineering is an independent multidisciplinary engineering consulting company specializing in mathematical algorithms.
Areas of
Expertise


SpecialFunctions
VectorsMatrices
OptimizationMethods
ComplexNumbers
Interpolation
CurveFitting
NonLinearSystems
LinearEquations
DistributionFunctions
NumericalDifferentiation
NumericalIntegration
DifferentialEquations
Smalltalk
FiniteBoundary
Eigenvalue
Graphics
Understanding
Mining


MiningMastery
MineralNews
MineralCommodities
MineralForum
Crystallography
Services


NumericalModeling
WebServices
MainframeServices
OutsourceServices

LINKED IN
KMP ARTICLES
Brand





Home

Login

Contact
Since 2006 All Rights Reserved  © KMP Software Engineering LINKS | PRIVACY POLICY | LEGAL NOTICE