

These conditions uniquely define the coefficients of a second degree function so there is nothing we can do to force the first derivative to be continuous. It can be seen that qterp2(0)=a 0, qterp2(1)=a 1 and qterp2(2)=a 2. Instead of using a linear function, this method uses a second degree function: I have encountered this method in the NGS GEOCON program and the oldest version I could find is in GEOID90 interpolation program. If a first degree (linear) function got us a continuous interpolation function but with a discontinuous derivative, maybe a second degree (called quadratic or parabolic) function will give us a better interpolation function. Method 3 - The Wrong Way - Biquadratic Interpolation

There are however sudden changes in slope (in calculus parlance - the first derivative is not continuous) and those produce the diamond shaped artifacts in the color map. Now, looking at the cross section, you can see that there are no sudden jumps (the interpolation function is continuous).

Where frac(x) is the fractional part of x. The interpolation function is linear in X and in Y (hence the name – bilinear): Method 2 - The Popular Way - Bilinear Interpolation Looking at the cross section, notice the sudden jumps that translate into the sudden changes of color.Īlthough the method seems almost too simple, if the original data set is dense enough and the data points aren't too noisy, this method can give acceptable results. It shows the initial data points and interpolated values: This is a color map of the resulting matrix:Īnd below is a cross section going through second row of the original data set. The output matrix is simply generated by M=nni(i/N, j/N). It could also be called "zero degree interpolation" and is described by the function: nni(x,y)=V round(x),round(y). The simplest interpolation strategy is just to take the value from the nearest data point. Method 1 - The Simple Way - Nearest Neighbor Interpolation We will divide each interval in the original data set in N=100 points, creating a 300x400 pixel image. For our examples we will take a 4 by 5 matrix and assign each value an arbitrary color. The purpose of the interpolation is to "densify" a sparse data set by creating intermediate points. Here we will compare different interpolation strategies. Two-dimensional interpolation finds its way in many applications like image processing and digital terrain modeling.
