The POLY_2D function performs polynomial warping of images. This function performs a geometrical transformation in which the resulting array is defined by:
g [x, y] = f [x', y'] = f [a [x, y], b [x, y]]
where g [ x , y ] represents the pixel in the output image at coordinate ( x , y ), and f [ x ', y '] is the pixel at ( x ', y ') in the input image that is used to derive g [ x , y ]. The functions a ( x , y ) and b ( x , y ) are polynomials in x and y of degree N , whose coefficients are given by P and Q , and specify the spatial transformation:
Either the nearest neighbor or bilinear interpolation methods can be selected.
P and Q are arrays containing the polynomial coefficients. Each array must contain ( N +1) 2 elements (where N is the degree of the polynomial). For example, for a linear transformation, P and Q contain four elements and can be a 2 x 2 array or a 4-element vector. P i,j contains the coefficient used to determine x' , and is the weight of the term x j y i . The POLYWARP procedure can be used to fit (x', y') as a function of (x, y) and determines the coefficient arrays P and Q .
Set this argument to a 1to perform bilinear interpolation. Set this argument to 2 to perform cubic convolution interpolation (as described under the CUBIC keyword, below). Otherwise, the nearest neighbor method is used. For the linear case, ( N =1), bilinear interpolation requires approximately twice as much time as does the nearest neighbor method.
Set this keyword to a value between -1 and 0 to use the cubic convolution interpolation method with the specified value as the interpolation parameter. Setting this keyword equal to a value greater than zero specifies a value of -1 for the interpolation parameter. Park and Schowengerdt (see reference below) suggest that a value of -0.5 significantly improves the reconstruction properties of this algorithm. Note that cubic convolution interpolation works only with one- and two-dimensional arrays.
Cubic convolution is an interpolation method that closely approximates the theoretically optimum sinc interpolation function using cubic polynomials. According to sampling theory, details of which are beyond the scope of this document, if the original signal, f , is a band-limited signal, with no frequency component larger than w 0 , and f is sampled with spacing less than or equal to 1/2 w 0 , then f can be reconstructed by convolving with a sinc function: sinc ( x ) = sin ( p x ) / ( p x ).
In the one-dimensional case, four neighboring points are used, while in the two-dimensional case 16 points are used. Note that cubic convolution interpolation is significantly slower than bilinear interpolation.