Table:  For specifying the mode of operation 
+ combination:  For M_WARP_LUT 
Table:  For specifying the interpolation mode 
+ combination:  For overscan 
MIL_ID SrcImageBufId,  //in 
MIL_ID DstImageBufId,  //in 
MIL_ID WarpParam1BufId,  //in 
MIL_ID WarpParam2BufId,  //in 
MIL_INT64 OperationMode,  //in 
MIL_INT64 InterpolationMode  //in 
This function warps an image through either a 3x3 matrixdefined warping or LUTs. You can perform firstorder polynomial warpings or perspective polynomial warpings using either a 3x3 coefficients matrix or lookup tables (LUTs). You can perform custom warpings using LUTs.
A warping associates each pixel position of the destination buffer, (x_{d}, y_{d} ), with a specific point in the source buffer, (x_{s}, y_{s} ), and then determines the pixel value of (x_{d}, y_{d} ) from its associated point and from a specified interpolation mode.
When performing a firstorder polynomial warping, (x_{d}, y_{d} ) gets associated with (x_{s}, y_{s} ) through the following equations:
x _{s} = a_{0} x _{d} + a_{1} y _{d} + a_{2} .
y _{s} = b_{0} x _{d} + b_{1} y _{d} + b_{2} .
When performing a perspective polynomial warping, (x_{d}, y_{d} ) gets associated with (x_{s}, y_{s} ) through the following equations:
x _{s} = (a_{0} x _{d} + a_{1} y _{d} + a_{2})/(c_{0} x _{d} + c_{1} y _{d} + c_{2}).
y _{s} = (b_{0} x _{d} + b_{1} y _{d} + b_{2})/(c_{0} x _{d} + c_{1} y _{d} + c_{2}).
When performing a 3x3 matrixdefined warping, WarpParam1BufId specifies the required coefficients (a_{0}...a_{2}, b_{0}...b_{2} ) or (a_{0}...a_{2}, b_{0}...b_{2}, c_{0}...c_{2} ) and WarpParam2BufId must be set to M_NULL. The coefficients can be automatically generated using MgenWarpParameter() or can be usersupplied.
When performing a warping using LUTs, x_{s} is determined from (x_{d}, y_{d} ) through one LUT and y_{s} is determined from (x_{d}, y_{d} ) through another LUT. In this case, WarpParam1BufId specifies the LUT for x_{s} and WarpParam2BufId specifies the LUT for y_{s} . The LUTs can be usersupplied or can be automatically generated from a 3x3 coefficient matrix (for a firstorder or polynomial warping) using MgenWarpParameter().
Specifies the buffer on which to perform the warping. This buffer can be of any type.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Specifies the buffer in which to place the results of the warping. This buffer can be of any type.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Note that after performing the operation, the destination image will not be calibrated, even if the source image was calibrated.
Specifies the buffer containing the matrix coefficients or the LUT buffer from which x _{s} is determined.
When WarpParam1BufId specifies the (a_{0}...a_{2}, b_{0}...b_{2} ) or (a_{0}...a_{2}, b_{0}...b_{2}, c_{0}...c_{2} ) coefficients, the coefficients must be in a singleband, 32bit floatingpoint buffer that has an M_ARRAY attribute and that has dimensions 3x2 or 3x3. The first row specifies the a _{n} coefficients, the second row specifies the b _{n} coefficients, and the third row specifies the c _{n} coefficients. If the buffer is 3x2, the third row is assumed to be (0, 0, 1).
When WarpParam1BufId specifies the LUT buffer from which x _{s} is determined, the buffer must be a signed 16 or 32bit integer buffer, have the same X and Y size as the destination image buffer, and have an M_LUT attribute.
Specifies the LUT buffer from which y _{s} is determined. This buffer must be a signed 16 or 32bit integer buffer, have the same X and Y size as the destination image buffer, and have an M_LUT attribute.
If you are not using LUTs to perform the warping, set WarpParam2BufId to M_NULL.
Specifies the mode of operation. This parameter must be set to one of the values below.
For specifying the mode of operation


Value  Description  
M_WARP_LUT + 
Performs the warping through LUTs. 

M_WARP_POLYNOMIAL 
Performs the warping through a 3x3 coefficient matrix. 
You can add the following value to the abovementioned value to specify the number of fractional bits in the coordinates of the source point.
For M_WARP_LUT


Combination value  Description  
M_FIXED_POINT + n 
Specifies the number of fractional bits for the source point ( x _{s} , y _{s} ). 
Specifies the interpolation mode. This parameter must be set to one of the values below.
For specifying the interpolation mode


Value  Description 
MIL systemspecific tooltip (‡) 

M_DEFAULT 
Same as M_NEAREST_NEIGHBOR + M_OVERSCAN_ENABLE. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
M_BICUBIC + 
Specifies bicubic interpolation. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
M_BILINEAR + 
Specifies bilinear interpolation. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
M_NEAREST_NEIGHBOR + 
Specifies nearest neighbor interpolation. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa 
You can add one of the following values to the abovementioned values to specify how to determine the value of a destination pixel when its associated point falls outside the source buffer.
For overscan


Combination value  Description 
MIL systemspecific tooltip (‡) 

M_OVERSCAN_CLEAR 
Sets the destination pixel to 0, if the associated point falls outside the source buffer. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
M_OVERSCAN_DISABLE 
Leaves the destination pixel as is. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
M_OVERSCAN_ENABLE 
Uses pixels from the source buffer's ancestor buffer. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa  
MIL system specific  
Points falling outside the source image are undefined. 
‡  j  k M10 
l  m  p  r U27 
y U75 
aa  
M_OVERSCAN_FAST 
Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. 
‡  a  c M10 
g  h  i  j  k M10 
l  m  o  p  r U27 
t U28 
u U36 
v  y U75 
aa 
Header  Include mil.h. 
Library  Use mil.lib; milim.lib. 
DLL  Requires mil.dll; milim.dll. 