# Bicubic interpolation

### From Wikipedia, the free encyclopedia

In mathematics, **bicubic interpolation** is an extension of cubic interpolation for interpolating data points on a two dimensional regular grid. The interpolated surface is smoother than corresponding surfaces obtained by bilinear interpolation or nearest-neighbor interpolation. Bicubic interpolation can be accomplished using either Lagrange polynomials, cubic splines or cubic convolution algorithm.

In image processing, bicubic interpolation is often chosen over bilinear interpolation or nearest neighbor in image resampling, when speed is not an issue. Images resampled with bicubic interpolation are smoother and have fewer interpolation artifacts.

## Contents |

## [edit] Bicubic spline interpolation

Suppose the function values *f* and the derivatives *f*_{x}, *f*_{y} and *f*_{xy} are known at the four corners (0,0), (1,0), (0,1), and (1,1) of the unit square. The interpolated surface can then be written

The interpolation problem consists of determining the 16 coefficients *a*_{ij}. Matching *p*(*x*,*y*) with the function values yields four equations,

*f*(0,0) =*p*(0,0) =*a*_{00}*f*(1,0) =*p*(1,0) =*a*_{00}+*a*_{10}+*a*_{20}+*a*_{30}*f*(0,1) =*p*(0,1) =*a*_{00}+*a*_{01}+*a*_{02}+*a*_{03}

Likewise, eight equations for the derivatives in the *x*-direction and the *y*-direction

*f*_{x}(0,0) =*p*_{x}(0,0) =*a*_{10}*f*_{x}(1,0) =*p*_{x}(1,0) =*a*_{10}+ 2*a*_{20}+ 3*a*_{30}*f*_{x}(0,1) =*p*_{x}(0,1) =*a*_{10}+*a*_{11}+*a*_{12}+*a*_{13}*f*_{y}(0,0) =*p*_{y}(0,0) =*a*_{01}*f*_{y}(1,0) =*p*_{y}(1,0) =*a*_{01}+*a*_{11}+*a*_{21}+*a*_{31}*f*_{y}(0,1) =*p*_{y}(0,1) =*a*_{01}+ 2*a*_{02}+ 3*a*_{03}

And four equations for the cross derivative *x**y*.

*f*_{xy}(0,0) =*p*_{xy}(0,0) =*a*_{11}*f*_{xy}(1,0) =*p*_{xy}(1,0) =*a*_{11}+ 2*a*_{21}+ 3*a*_{31}*f*_{xy}(0,1) =*p*_{xy}(0,1) =*a*_{11}+ 2*a*_{12}+ 3*a*_{13}

where the expressions above have used the following identities,

- .

This procedure yields a surface *p*(*x*,*y*) on the unit square which is continuous and with continuous derivatives. Bicubic interpolation on an arbitrarily sized regular grid can then be accomplished by patching together such bicubic surfaces, ensuring that the derivatives match on the boundaries.

If the derivatives are unknown, they are typically approximated from the function values at points neighbouring the corners of the unit square, ie. using finite differences.

## [edit] Bicubic convolution algorithm

Bicubic spline interpolation requires the solution of the linear system described above for each grid cell. An interpolator with similar properties can be obtained by applying convolution with the following kernel in both dimensions:

where *a* is usually set to -0.5 or -0.75. Note that *W*(0) = 1 and *W*(*n*) = 0 for all nonzero integers *n*.

This approach was proposed by Keys who showed that *a* = − 0.5 (which corresponds to cubic Hermite spline) produces the best approximation of the original function^{[1]}.

If we use the matrix notation for the common case *a* = − 0.5, we can express the equation in a more friendly manner:

for *t* between 0 and 1 for one dimension. for two dimensions first applied once in *x* and again in *y*:

## [edit] Use in computer graphics

The bicubic algorithm is frequently used for scaling images and video for display (see bitmap resampling). It preserves fine detail better than the common bilinear algorithm.

However, due to the negative lobes on the kernel, it causes overshoot (haloing). This can cause clipping, and is an artifact (see also ringing artifacts), but it increases acutance (apparent sharpness), and can be desirable.

## [edit] References

## [edit] See also

- Anti-aliasing
- Bézier surface
- Bilinear interpolation
- Tricubic interpolation
- Cubic Hermite spline, the one-dimensional analogue of bicubic spline
- Lanczos resampling
- Sinc filter
- Spline interpolation