﻿

# Bicubic interpolation

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.

Bicubic spline interpolation

Suppose the function values $f$ and the derivatives $f_x$, $f_y$ and $f_\left\{xy\right\}$ are known at the four corners $\left(0,0\right)$, $\left(1,0\right)$, $\left(0,1\right)$, and $\left(1,1\right)$ of the unit square. The interpolated surface can then be written:$p\left(x,y\right) = sum_\left\{i=0\right\}^3 sum_\left\{j=0\right\}^3 a_\left\{ij\right\} x^i y^j.$

The interpolation problem consists of determining the 16 coefficients $a_\left\{ij\right\}$.Matching $p\left(x,y\right)$ with the function values yields four equations,
# $f\left(0,0\right) = p\left(0,0\right) = a_\left\{00\right\}$
# $f\left(1,0\right) = p\left(1,0\right) = a_\left\{00\right\} + a_\left\{10\right\} + a_\left\{20\right\} + a_\left\{30\right\}$
# $f\left(0,1\right) = p\left(0,1\right) = a_\left\{00\right\} + a_\left\{01\right\} + a_\left\{02\right\} + a_\left\{03\right\}$
# $f\left(1,1\right) = p\left(1,1\right) = extstyle sum_\left\{i=0\right\}^3 sum_\left\{j=0\right\}^3 a_\left\{ij\right\}$

Likewise, eight equations for the derivatives in the $x$-direction and the $y$-direction
# $f_x\left(0,0\right) = p_x\left(0,0\right) = a_\left\{10\right\}$
# $f_x\left(1,0\right) = p_x\left(1,0\right) = a_\left\{10\right\} + 2a_\left\{20\right\} + 3a_\left\{30\right\}$
# $f_x\left(0,1\right) = p_x\left(0,1\right) = a_\left\{10\right\} + a_\left\{11\right\} + a_\left\{12\right\} + a_\left\{13\right\}$
# $f_x\left(1,1\right) = p_x\left(1,1\right) = extstyle sum_\left\{i=1\right\}^3 sum_\left\{j=0\right\}^3 a_\left\{ij\right\} i$
# $f_y\left(0,0\right) = p_y\left(0,0\right) = a_\left\{01\right\}$
# $f_y\left(1,0\right) = p_y\left(1,0\right) = a_\left\{01\right\} + a_\left\{11\right\} + a_\left\{21\right\} + a_\left\{31\right\}$
# $f_y\left(0,1\right) = p_y\left(0,1\right) = a_\left\{01\right\} + 2a_\left\{02\right\} + 3a_\left\{03\right\}$
# $f_y\left(1,1\right) = p_y\left(1,1\right) = extstyle sum_\left\{i=0\right\}^3 sum_\left\{j=1\right\}^3 a_\left\{ij\right\} j$

And four equations for the cross derivative $xy$.
# $f_\left\{xy\right\}\left(0,0\right) = p_\left\{xy\right\}\left(0,0\right) = a_\left\{11\right\}$
# $f_\left\{xy\right\}\left(1,0\right) = p_\left\{xy\right\}\left(1,0\right) = a_\left\{11\right\} + 2a_\left\{21\right\} + 3a_\left\{31\right\}$
# $f_\left\{xy\right\}\left(0,1\right) = p_\left\{xy\right\}\left(0,1\right) = a_\left\{11\right\} + 2a_\left\{12\right\} + 3a_\left\{13\right\}$
# $f_\left\{xy\right\}\left(1,1\right) = p_\left\{xy\right\}\left(1,1\right) = extstyle sum_\left\{i=1\right\}^3 sum_\left\{j=1\right\}^3 a_\left\{ij\right\} i j$

where the expressions above have used the following identities,:$p_x\left(x,y\right) = extstyle sum_\left\{i=1\right\}^3 sum_\left\{j=0\right\}^3 a_\left\{ij\right\} i x^\left\{i-1\right\} y^j$
:$p_y\left(x,y\right) = extstyle sum_\left\{i=0\right\}^3 sum_\left\{j=1\right\}^3 a_\left\{ij\right\} x^i j y^\left\{j-1\right\}$
:$p_\left\{xy\right\}\left(x,y\right) = extstyle sum_\left\{i=1\right\}^3 sum_\left\{j=1\right\}^3 a_\left\{ij\right\} i x^\left\{i-1\right\} j y^\left\{j-1\right\}$.

This procedure yields a surface $p\left(x,y\right)$ on the unit square $\left[0,1\right] imes \left[0,1\right]$ 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.

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\left(0\right)=1$ and $W\left(n\right)=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 functioncite journal
author = R. Keys,
year = 1981
title = Cubic convolution interpolation for digital image processing
journal = IEEE Transactions on Signal Processing, Acoustics, Speech, and Signal Processing
doi = 10.1109/TASSP.1981.1163711
volume = 29
pages = 1153
] .

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

1 & t & t^2 & t^3 \

end{bmatrix}egin{bmatrix}

0 & 2 & 0 & 0 \-1 & 0 & 1 & 0 \2 & -5 & 4 & -1 \-1 & 3 & -3 & 1 \

end{bmatrix}egin{bmatrix}

a_{-1} \a_0 \a_1 \a_2 \

end{bmatrix}for $t$ between 0 and 1 for one dimension (must be applied once in $x$ and again in $y$)

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.

References

ee also

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

* [http://www.geovista.psu.edu/sites/geocomp99/Gc99/082/gc_082.htm Application of interpolation to elevation samples]
* [http://www.all-in-one.ee/~dersch/interpolator/interpolator.html Comparison of interpolation functions]
* [http://sepwww.stanford.edu/public/docs/sep107/paper_html/node20.html Interpolation theory]
* [http://www.npac.syr.edu/projects/nasa/MILOJE/final/node36.html Lagrange interpolation]

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Interpolation — In the mathematical subfield of numerical analysis, interpolation is a method of constructing new data points within the range of a discrete set of known data points. In engineering and science one often has a number of data points, as obtained… …   Wikipedia

• bicubic — adjective Of or pertaining to interpolation in two dimensions using cubic splines or other polynomials (technique for sharpening enlargements of digital images) …   Wiktionary

• Stairstep interpolation — In image processing, stairstep interpolation is a general method for interpolating the pixels after enlarging an image. The key idea is to interpolate multiple times in small increments using any interpolation algorithm that is better than… …   Wikipedia

• Bilinear interpolation — In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular grid. The key idea is to perform linear interpolation first in one direction, and then again in the other… …   Wikipedia

• Multivariate interpolation — In numerical analysis, multivariate interpolation or spatial interpolation is interpolation on functions of more than one variable. The function to be interpolated is known at given points and the interpolation problem consist of yielding values… …   Wikipedia

• Tricubic interpolation — In the mathematical subfield numerical analysis, tricubic interpolation is a method for obtaining values at arbitrary points in 3D space of a function defined on a regular grid. The approach involves approximating the function locally by an… …   Wikipedia

• Demosaicing — A demosaicing algorithm is a digital image process used to reconstruct a full color image from the incomplete color samples output from an image sensor overlaid with a color filter array (CFA). Also known as CFA interpolation or color… …   Wikipedia

• Image scaling — In computer graphics, image scaling is the process of resizing a digital image. Scaling is a non trivial process that involves a trade off between efficiency, smoothness and sharpness. As the size of an image is increased, so the pixels which… …   Wikipedia

• Bézier surface — Bézier surfaces are a species of mathematical spline used in computer graphics, computer aided design, and finite element modelling. As with the Bézier curve, a Bézier surface is defined by a set of control points. Similar to interpolation in… …   Wikipedia

• List of numerical analysis topics — This is a list of numerical analysis topics, by Wikipedia page. Contents 1 General 2 Error 3 Elementary and special functions 4 Numerical linear algebra …   Wikipedia