Table: | For selecting the operation mode |
+ combination: | For the output LUT buffers |
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 for a M_WARP_4_CORNER or a M_WARP_4_CORNER_REVERSE perspective polynomial warping, the coefficients that were internally generated and used cannot be retrieved. 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, this function can generate coefficients or LUTs 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. If required, after the appropriate coefficients are generated, you can pass the coefficient buffer to MgenWarpParameter() with M_WARP_LUT to generate the corresponding LUTs.
Coefficients are calculated such that each pixel position of the destination buffer, (x d,y d) is associated 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. If an input buffer is not required to perform the coefficient generation, set this parameter to M_NULL.
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 this 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. 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 which contains the X and Y positions of the four corners of the quadrilateral and the top-left and bottom-right corners of the rectangle. The buffer must be a one-dimensional floating-point buffer allocated with the M_ARRAY attribute, containing 12 entries. The buffer must contain 12 entries; each entry corresponds to one of the following points.
Specifies the input buffer which contains the X and Y positions of the four corners of the quadrilateral and the top-left and bottom-right corners of the rectangle. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (summarize)Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL array buffer identifier |
Specifies the MIL array buffer identifier. The buffer must be a 3x3 floating-point buffer allocated with an M_ARRAY attribute. (summarize)Specifies the MIL array buffer identifier. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL LUT buffer identifier |
Specifies the MIL LUT buffer identifier. The buffer must be a signed 16- or 32-bit integer buffer with an M_LUT attribute and the same X-size as the destination image buffer that will be passed to MimWarp(). (summarize)Specifies the MIL LUT buffer identifier. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies the buffer in which to place the Y-component LUT entries. Note that if you want to generate coefficients and not LUTs, this parameter must be set to M_NULL. (summarize)Specifies the buffer in which to place the Y-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the coefficients will be generated. |
||||||||||||||||||||||||||||||||||||||
MIL LUT buffer identifier |
Specifies the MIL LUT buffer identifier. The buffer must be 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(). (summarize)Specifies the MIL LUT buffer identifier. (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. 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 which contains the X and Y positions of the four corners of the quadrilateral and the top-left and bottom-right corners of the rectangle. The buffer must be a one dimensional floating-point buffer allocated with the M_ARRAY attribute, containing 12 entries. The buffer must contain 12 entries; each entry corresponds to one of the following points.
Specifies the input buffer which contains the X and Y positions of the four corners of the quadrilateral and the top-left and bottom-right corners of the rectangle. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (summarize)Specifies the buffer in which to place the generated coefficients or X-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL array buffer identifier |
Specifies the MIL array buffer identifier. The buffer must be a 3x3 floating-point buffer allocated with an M_ARRAY attribute. (summarize)Specifies the MIL array buffer identifier. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL LUT buffer identifier |
Specifies the MIL LUT buffer identifier. The buffer must be a signed 16- or 32-bit integer buffer with an M_LUT attribute and the same X-size as the destination image buffer that will be passed to MimWarp(). (summarize)Specifies the MIL LUT buffer identifier. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies the buffer in which to place the Y-component LUT entries. Note that If you wish to generate coefficients and not LUTs, this parameter must be set to M_NULL. (summarize)Specifies the buffer in which to place the Y-component LUT entries. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the coefficients will be generated. |
||||||||||||||||||||||||||||||||||||||
MIL LUT buffer identifier |
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(). |
||||||||||||||||||||||||||||||||||||||
M_WARP_LUT + |
Generates LUTs that can be passed to MimWarp() to perform a warping that is equivalent to the warping that would be performed if the coefficients specified in the SrcArrayBufId parameter were used instead. (summarize)Generates LUTs that can be passed to MimWarp() to perform a warping that is equivalent to the warping that would be performed if the coefficients specified in the SrcArrayBufId parameter were used instead. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the input buffer which contains the coefficients of the polynomial equations used to perform the warping. The buffer must be a 3x3 floating-point buffer with 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. (summarize)Specifies the input buffer which contains the coefficients of the polynomial equations used to perform the warping. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId | |||||||||||||||||||||||||||||||||||||||
DstYLutBufId | |||||||||||||||||||||||||||||||||||||||
M_WARP_POLYNOMIAL |
Generates coefficients that can be passed to MimWarp() to perform a first-order polynomial warping. (summarize)Generates coefficients that can be passed to MimWarp() to perform a first-order polynomial warping. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcArrayBufId |
Specifies the input buffer containing the coefficients generated by a previous call to MgenWarpParameter(). The values generated by any subsequent call to this function can be combined with the values contained in this buffer. The resulting coefficients can be passed to MimWarp() to perform a composite warp (for example, a rotation and translation). Note that if this is your first call to MgenWarpParameter() this parameter must be set to M_NULL. (summarize)Specifies the input buffer containing the coefficients generated by a previous call to MgenWarpParameter(). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that this is the first call to MgenWarpParameter(). |
||||||||||||||||||||||||||||||||||||||
MIL array buffer identifier |
Specifies a MIL array buffer identifier. The buffer must be a 3x3 floating-point buffer with an M_ARRAY attribute. (summarize)Specifies a MIL array buffer identifier. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstXLutOrArrayBufId |
Specifies the identifier of a 3x3 floating-point buffer with an M_ARRAY attribute in which to place the generated coefficients. The resulting coefficients can be passed to MimWarp() to perform a composite warp (for example, a rotation and translation). (summarize)Specifies the identifier of a 3x3 floating-point buffer with an M_ARRAY attribute in which to place the generated coefficients. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstYLutBufId |
Specifies to ignore this parameter. This parameter must be set to M_NULL when performing an M_WARP_POLYNOMIAL operation. (summarize)Specifies to ignore this parameter. (more details...) |
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). The default value is 0. Note that when using this combination constant with M_WARP_4_CORNER or M_WARP_4_CORNER_REVERSE, the destination buffers (DstXLutOrArrayBufId and DstYLutBufId) must be LUT buffers (similar to when using M_WARP_LUT). (summarize)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. |