MIL_ID WarpParamBufId, | //in |
MIL_INT64 TransformType, | //in |
MIL_INT NumPoints, | //in |
const MIL_DOUBLE *SrcCoordXArrayPtr, | //in |
const MIL_DOUBLE *SrcCoordYArrayPtr, | //in |
MIL_DOUBLE *DstCoordXArrayPtr, | //out |
MIL_DOUBLE *DstCoordYArrayPtr, | //out |
MIL_INT64 ControlFlag | //in |
This function transforms a list of coordinates (points) using the specified warping matrix and stores the resulting coordinates in the destination arrays (M_REVERSE). Alternatively, this function can transform the coordinates using the inverse of the specified matrix (M_FORWARD).
When this function transforms the coordinates using the warping matrix as is (M_REVERSE), it is referred to as a reverse warping transformation because this is how MimWarp() associates each pixel position of its destination buffer, (x_{d}, y_{d} ), with a specific point in its source buffer, (x_{s}, y_{s} ). Therefore, you can use MimWarpList() to establish which points in a source image MimWarp() associates with destination pixels when using the same matrix. When this function transforms the coordinates using the inverse of the specified warping matrix (M_FORWARD), it is referred to as a forward warping transformation; you can use a forward warping transformation, for example, to see if a specific pixel in the source image of MimWarp() is actually mapped to a destination buffer pixel.
You can only specify the coefficients for a 3x3 or 3x2 matrix; this allows you to perform a first-order polynomial warping or a perspective polynomial warping.
Perform a first-order polynomial warping by passing a 3x3 matrix, where the third row has the coefficients [0,0,1], or by passing a 3x2 matrix, the last row is assumed to be [0,0,1]. Perform a perspective polynomial warping by passing a 3x3 matrix, where the third row does not have the coefficients [0,0,1]. The matrix is applied as follows:
x _{d} = (a_{0} x _{s} + a_{1} y _{s} + a_{2})/(c_{0} x _{s} + c_{1} y _{s} + c_{2}).
y _{d} = (b_{0} x _{s} + b_{1} y _{s} + b_{2})/(c_{0} x _{s} + c_{1} y _{s} + c_{2}).
If a 3x2 matrix, or a 3x3 matrix whose third row has the coefficients of [0,0,1] is specified (for a first-order polynomial warping operation), the denominator resolves to 1, effectively leaving only the numerator. The coefficients can be automatically generated using MgenWarpParameter(), MimResize(), MimRotate(), or MimTranslate(), or can be user-established.
Note that MimWarpList() will internally invert the coefficients matrix (a_{0}...a_{2}, b_{0}...b_{2}, c_{0}...c_{2} ) for a forward transfomation (M_FORWARD).
Specifies the buffer containing the warp matrix coefficients.
The coefficients must be in a single-band, 32-bit floating-point 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).
Specifies the number of points in the arrays.
When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the SrcCoordXArrayPtr or SrcCoordYArrayPtr parameter.
Specifies the address of the array that contains the source X-coordinates.
Specifies the address of the array that contains the source Y-coordinates.
Specifies the address of the array in which to store the destination X-coordinates.
Specifies the address of the array in which to store the destination Y-coordinates.
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |