Image Processing Toolbox User's Guide Previous page   Next Page

Interpolation

Interpolation is the process used to estimate an image value at a location in between image pixels. For example, if you resize an image so it contains more pixels than it did originally, the toolbox uses interpolation to determine the values for the additional pixels. The imresize and imrotate geometric functions use two-dimensional interpolation as part of the operations they perform. The improfile image analysis function also uses interpolation. See Getting the Intensity Profile of an Image for information about this function.

Interpolation Methods

The Image Processing Toolbox provides three interpolation methods:

The interpolation methods all work in a fundamentally similar way. In each case, to determine the value for an interpolated pixel, they find the point in the input image that the output pixel corresponds to. They then assign a value to the output pixel by computing a weighted average of some set of pixels in the vicinity of the point. The weightings are based on the distance each pixel is from the point.

The methods differ in the set of pixels that are considered:

The number of pixels considered affects the complexity of the computation. Therefore the bilinear method takes longer than nearest-neighbor interpolation, and the bicubic method takes longer than bilinear. However, the greater the number of pixels considered, the more accurate the effect is, so there is a tradeoff between processing time and quality.

Interpolation and Image Types

You can use all three types of interpolation with grayscale, truecolor, or binary images; however, bilinear or bicubic are recommended. Nearest-neighbor is the only type of interpolation that can be used with indexed images.


Previous page  Spatial Transformations Resizing an Image Next page

© 1994-2005 The MathWorks, Inc.