Developer Reference for Intel® Integrated Performance Primitives

Overview of Interpolation Modes

In geometric transformations, the grid of input image pixels is not necessarily mapped onto the grid of pixels in the output image. Therefore, to compute the pixel intensities in the output image, the geometric transform functions need to interpolate the intensity values of several input pixels that are mapped to a certain neighborhood of the output pixel.

Geometric transformations can use various interpolation algorithms. The library supports the following interpolation modes depending on how the type of interpolation algorithm is specified:

For certain functions of type 1, the specified interpolation modes can be combined with additional smoothing of edges to which the borders of the original image are transformed. To use this option, for the interpolation parameter, specify the edge smoothing flag and the desired interpolation mode using the bitwise OR operation. For example, in order to rotate an image with cubic interpolation and smooth the rotated image edges, pass the following value to ippiRotate():

interpolation = IPPI_INTER_CUBIC | IPPI_SMOOTH_EDGE.

To enable edge smoothing for functions of type 2, pass the special flag to the Init function (if it exists), for example, you can pass this flag to Init functions for WarpAffine and WarpPerspective function groups.

Interpolation with edge smoothing option can be used only in those geometric transform functions where this option is explicitly listed in the parameters definition section.

Table Interpolation Modes Supported by Image Geometric Transform Functions lists the supported interpolation modes for the main geometric transform functions that use interpolation.

Interpolation Modes Supported by Image Geometric Transform Functions
Function Base Name NN Lin Cub2P Cub CR La2 La3 SS AA ES
ResizeCubic     x   x *)          
ResizeLanczos           x x      
ResizeLinear   x                
ResizeNearest x                  
ResizeSuper               x    
WarpAffineCubic     x   x *)          
WarpAffineLinear   x                
WarpAffineNearest x                  
WarpPerspectiveCubic     x   x *)          
WarpPerspectiveLinear   x                
WarpPerspectiveNearest x                  
Remap x x   x x   x n/a n/a x
WarpBilinear x x   x       n/a n/a x
WarpBilinearBack x x   x       n/a n/a  
WarpBilinearQuad x x   x       n/a n/a x

*) The function ippiResizeCubic supports the interpolation with two-parameter cubic filters, where parameters B and C can be specified explicitly.

Here NN - nearest neighbor interpolation, Lin - linear interpolation, Cub2P - interpolation with two-parameter cubic filters, Cub - cubic interpolation, CR - Catmull-Rom spline, La2, La3 - interpolation with the Lanczos window, SS - super sampling interpolation, AA - antialiasing, ES - edge smoothing.

The sections that follow provide more details on each interpolation mode.