Bicubic interpolation

This is an old revision of this page, as edited by 138.194.12.32 (talk) at 09:18, 30 August 2010 (→‎See also: alphabetic, * Natural neighbor interpolation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Fixbunching

Bicubic interpolation on the square consisting of 9 unit squares patched together. Bicubic interpolation as per MATLAB's implementation. Colour indicates function value. The black dots are the locations of the prescribed data being interpolated. Note how the color samples are not radially symmetric. They are more square-based (It may be easier to compare by zooming on the image)

Template:Fixbunching

Bilinear interpolation on the same dataset as above. Derivatives of the surface are not continuous over the square boundaries.

Template:Fixbunching

Nearest-neighbor interpolation on the same dataset as above. Note that the information content in all these three examples is equivalent.

Template:Fixbunching

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 interpolation

Suppose the function values   and the derivatives  ,   and   are known at the four corners  ,  ,  , and   of the unit square. The interpolated surface can then be written

 

The interpolation problem consists of determining the 16 coefficients  . Matching   with the function values yields four equations,

  1.  
  2.  
  3.  
  4.  

Likewise, eight equations for the derivatives in the  -direction and the  -direction

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  

And four equations for the cross derivative  .

  1.  
  2.  
  3.  
  4.  

where the expressions above have used the following identities,

 
 
 .

This procedure yields a surface   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, i.e. using finite differences.

Grouping the unknown parameters   in a vector,

 

and letting

 ,

the problem can be reformulated into a linear equation   where its inverse is: [1]:

 .

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   is usually set to -0.5 or -0.75. Note that   and   for all nonzero integers  .

This approach was proposed by Keys who showed that   (which corresponds to cubic Hermite spline) produces the best approximation of the original function[2].

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

 

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

 
 
 
 
 

Use in computer graphics

 
Bicubic interpolation causes overshoot, which increases acutance.

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.

See also

References

  1. ^ Numerical Recipes. The Art of Scientific Computing, 3rd Edition, 2007, ISBN 0-521-88068-8. (C++ code), section 3.3.6 [1]
  2. ^ R. Keys, (1981). "Cubic convolution interpolation for digital image processing". IEEE Transactions on Signal Processing, Acoustics, Speech, and Signal Processing. 29: 1153. doi:10.1109/TASSP.1981.1163711.{{cite journal}}: CS1 maint: extra punctuation (link)