MIL_ID SrcArrayBufId, | //in |
MIL_ID DstXLutOrArrayBufId, | //in |
MIL_ID DstYLutBufId, | //in |
MIL_INT OperationMode, | //in |
MIL_INT Transform, | //in |
MIL_DOUBLE Val1, | //in |
MIL_DOUBLE Val2 | //in |
This function generates coefficients or LUTs to be used by MimWarp() to perform first-order polynomial warpings or perspective polynomial warpings. Specifically, this function can generate:
Coefficients for a first-order polynomial warping (M_WARP_POLYNOMIAL).
Coefficients or LUTs for a perspective polynomial warping that maps an arbitrary quadrilateral onto a rectangle (M_WARP_4_CORNER) or that maps a rectangle onto an arbitrary quadrilateral (M_WARP_4_CORNER_REVERSE).
LUTs, based on the input of a matrix of coefficients, for a first-order polynomial warping or for a perspective polynomial warping (M_WARP_LUT).
Note that when generating LUTs by passing a matrix of coefficients to MgenWarpParameter() with OperationMode set to M_WARP_4_CORNER, or M_WARP_4_CORNER_REVERSE, the coefficients that were passed to the function will not be saved. In order to generate LUTs while saving the coefficients, you must call MgenWarpParameter() twice. Once to generate the coefficients needed to produce the LUTs, and the second time to actually generate the LUTs with M_WARP_LUT.
For a first-order polynomial warping, coefficients or LUTs can be generated for a rotation, a scaling, a shearing, or a translation. To combine coefficients (for example, to generate coefficients that will perform both a rotation and a translation), you need to make separate calls to this function, using the previous output buffer of type M_ARRAY as your current input buffer. After all the coefficients are generated, pass the coefficient buffer to MimWarp().
For a perspective polynomial warping, coefficients or LUTs can be generated to map an arbitrary quadrilateral onto a rectangle or vice versa. After all the coefficients or LUT values are generated, pass the coefficient or LUT buffers to MimWarp().
First-order polynomial warpings and perspective polynomial warpings are performed by associating each pixel position of the destination buffer, (x d,y d), with a specific point in the source buffer, (x s,y s), according to the following equation:
Where xs and ys are defined as follows:
Note that in the case of a first-order polynomial warping, the c0, c1, c2 coefficients are 0, 0, and 1, respectively. The equation then reduces to:
Specifies the input buffer from which to generate coefficients or LUT entries.
When generating coefficients or LUTs for a first-order polynomial warping, set SrcArrayBufId to M_NULL if this is your first call to MgenWarpParameter(). If you are combining coefficients and this is a second (or later) call, set SrcArrayBufId to the identifier of the previous output buffer.
When generating LUTs to be used by MimWarp() using M_WARP_LUT, SrcArrayBufId must be set to the identifier of a 3x3 floating-point buffer that has an M_ARRAY attribute. 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.
See the Parameter associations section for possible values that can be specified.
Specifies the buffer in which to place generated coefficients or X-LUT entries.
See the Parameter associations section for possible values that can be specified.
Specifies the buffer in which to place Y-LUT entries.
If you are not generating LUTs, set the DstYLutBufId parameter to M_NULL.
See the Parameter associations section for possible values that can be specified.
Specifies the mode of operation.
See the Parameter associations section for possible values that can be specified.
Specifies the type of first-order polynomial warping for which to generate coefficients. If you are not generating coefficients for a first-order polynomial warping (M_WARP_POLYNOMIAL), set the this parameter to M_DEFAULT.
For specifying the type of first-order
polynomial warping
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ROTATE |
Generates coefficients for a counter-clockwise rotation around (0,0) by Val1 °. |
||||||||||||||||||||||||||||||||||||||
M_SCALE |
Generates coefficients for an image scaling, by a factor of Val1 in the X-direction and by a factor of Val2 in the Y-direction. |
||||||||||||||||||||||||||||||||||||||
M_SHEAR_X |
Generates coefficients or for a shearing in the X-direction, by a factor of Val1. |
||||||||||||||||||||||||||||||||||||||
M_SHEAR_Y |
Generates coefficients for a shearing in the Y-direction, by a factor of Val1. |
||||||||||||||||||||||||||||||||||||||
M_TRANSLATE |
Generates coefficients for a translation by Val1 pixels in the X-direction and by Val2 pixels in the Y-direction. |
The table below lists possible values for the SrcArrayBufId, DstXLutOrArrayBufId, DstYLutBufId, and OperationMode parameters.
For selecting the Operation
Mode
|
|||||||||||||||||||||||||||||||||||||||
OperationMode |
Description
|
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId | |||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId | |||||||||||||||||||||||||||||||||||||||
DstYLutBufId | |||||||||||||||||||||||||||||||||||||||
M_WARP_4_CORNER + |
Generates coefficients or LUT values for a perspective polynomial warping which, when passed to MimWarp(), maps an arbitrary quadrilateral onto a rectangle. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the input buffer from which to generate coefficients or LUT values. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies a signed 16- or 32-bit integer buffer, which has an M_LUT attribute and the same Y-size as the destination image buffer that will be passed to MimWarp(). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_4_CORNER_REVERSE + |
Generates coefficients or LUT values for a perspective polynomial warping which, when passed to MimWarp(),maps a rectangle onto an arbitrary quadrilateral. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the input buffer from which to generate coefficients or LUT values. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies a signed 16- or 32-bit integer buffer, which has an M_LUT attribute and the same Y-size as the destination image buffer that will be passed to MimWarp(). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_LUT + |
Generates LUTs to be passed to MimWarp() to perform a first-order polynomial warping or a perspective polynomial warping. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the identifier of a 3x3 floating-point buffer with an M_ARRAY attribute. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies a signed 16- or 32-bit integer buffer, which has an M_LUT attribute and the same X-size as the destination image buffer that will be passed to MimWarp(). (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies a signed 16- or 32-bit integer buffer, which has an M_LUT attribute and the same Y-size as the destination image buffer that will be passed to MimWarp(). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_POLYNOMIAL |
Generates coefficients that can be passed to MimWarp() to perform a first-order polynomial warping. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the input buffer needed to combine coefficients. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the identifier of a 3x3 floating-point buffer with an M_ARRAY attribute in which to place the generated coefficients. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
This Parameter must be set to M_NULL when in M_WARP_POLYNOMIAL mode. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that this parameter will not be used. |
You can add the following value to the above-mentioned values to specify the number of fractional bits for the source address.
For the output LUT buffers
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_FIXED_POINT + n |
Specifies the number of fractional bits for the source address (x s , y s). (more details...) |
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |