MIL_ID SrcImageOrContextCalId, | //in |
MIL_ID DstImageOrContextCalId, | //in |
MIL_ID WarpParam1Id, | //in |
MIL_ID WarpParam2Id, | //in |
MIL_DOUBLE OffsetX, | //in |
MIL_DOUBLE OffsetY, | //in |
MIL_DOUBLE SizeX, | //in |
MIL_DOUBLE SizeY, | //in |
MIL_INT RowNumber, | //in |
MIL_INT ColumnNumber, | //in |
MIL_INT64 TransformationType, | //in |
MIL_INT64 ControlFlag | //in |
This function defines the mapping of a calibration context according to a previously configured calibration context. Note that the calibration mode of the destination calibration context need not necessarily be the same as the calibration mode of the source context. The resulting mapping will be an accurate approximation of the source mapping for the specified image or context. This can be used, for example, to approximate a complex calibration using a constant pixel size calibration, simplifying further calculations.
This function can also be used to generate a new context by warping a previously calibrated context. The resulting context can then be associated with the uncalibrated warped image. This can be used, for example, to calibrate an image that has been warped using MimWarp(). MimWarp() returns an uncalibrated image which can then be associated (using McalAssociate()) with the newly warped calibration context.
To define new mapping that will only apply to a specific region of an image, use the OffsetX, OffsetY, SizeX and SizeY parameters. The mapping of the new calibration context will apply only to this defined area. See the description of these paramters in the Paramters section located below for more information.
Specifies the identifier of the calibration context, calibrated image, or corrected image From which the source mapping is taken.
Note that the underlying source calibration context must have been previously configured using a successful call to McalGrid(), McalList(), McalUniform(), or McalWarp().
Specifies the identifier of the destination calibration context or image buffer.
When the identifier of a destination calibration context is specified, the calibration context must have been allocated using McalAlloc() with M_UNIFORM_TRANSFORMATION, M_LINEAR_INTERPOLATION, or M_PERSPECTIVE_TRANSFORMATION, that is, the calibration mode of the context must be 2D.
When an identifier of an image buffer is specified, the default uniform calibration context (M_DEFAULT_UNIFORM_CALIBRATION) will be associated to the image, and the M_UNIFORM_TRANSFORMATION calibration mode will be assumed. Any current calibration context associated to the image is ignored.
If the operation fails, the image will be uncalibrated. In-place processing is supported, that is, DstImageOrContextCalId can be the same identifier as SrcImageOrContextCalId.
Specifies the buffer containing the matrix of coefficients or the LUT buffer from which source X-coordinates are determined.
If specifying a matrix of coefficients, the buffer must be a single-band, 32-bit floating-point buffer that has an M_ARRAY attribute and that has dimensions 3x2 or 3x3.
If specifying a LUT buffer, then the buffer must be a signed 16- or 32-bit integer buffer and have an M_LUT attribute.
If no warping of the source calibration context is required, set WarpParam1Id to M_NULL.
Please refer to MimWarp() for more information on this parameter.
Specifies the LUT buffer from which source Y-coordinates are determined.
This buffer must be a single-band, signed 16- or 32-bit integer buffer and have an M_LUT attribute. The buffer must also have the same type and dimensions as WarpParam1Id.
If no warping is applied to the source calibration context, or if you are not using LUTs to perform the warping, set WarpParam2Id to M_NULL.
Please refer to MimWarp() for more information on this parameter.
Specifies the X pixel coordinate of the top-left calibration point.
If the calibration context has been warped, then it refers to the coordinate in the newly warped object.
Specifies the Y pixel coordinate of the top-left calibration point.
If the calibration context has been warped, then it refers to the coordinate in the newly warped object.
Specifies the width of the grid of calibration points, in pixels.
SizeX must be set to a value > 1.0.
However, if TransformationType is set to M_WARP_LUT, SizeX can be set to M_NULL to indicate that the width specified by the LUTs should be used. In this case, OffsetX, OffsetY, SizeX and SizeY must all be set to M_NULL.
Specifies the height of the grid of calibration points, in pixels.
SizeY must be set to a value > 1.0.
However, if TransformationType is set to M_WARP_LUT, SizeY can be set to M_NULL to indicate that the width specified be the LUTs should be used. In this case, OffsetX, OffsetY, SizeX and SizeY must all be set to M_NULL.
Specifies the number of rows of calibration points to be used for calibration.
Depending on the calibration mode of the destination calibration context or image, the operation requires that enough calibration points be present. For calibration contexts allocated using McalAlloc with M_UNIFORM_TRANSFORMATION and M_LINEAR_INTERPOLATION calibration modes, the minimum number of calibration points required is 3. For the M_PERSPECTIVE_TRANSFORMATION calibration mode, the minimum number of calibration points required is 4. Accuracy increases with the number of points.
For specifying the number of
rows:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 15. |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the number of rows of calibration points to be used for calibration. |
Specifies the number of columns of calibration points to be used for calibration.
Depending on the calibration mode of the destination calibration context or image, the operation requires that enough calibration points be present. For calibration contexts allocated using McalAlloc with M_UNIFORM_TRANSFORMATION and M_LINEAR_INTERPOLATION calibration modes, the minimum number of calibration points required is 3. For the M_PERSPECTIVE_TRANSFORMATION calibration mode, the minimum number of calibration points required is 4. Accuracy increases with the number of points.
For specifying the number of
columns:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 15. |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the number of columns of calibration points to be used for calibration. |
Specifies the type of transformation. This parameter must be set to one of the following values.
For specifying the type of
transformation:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_IDENTITY |
No transformation is performed. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_LUT + |
Performs the warping through LUTs. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_POLYNOMIAL |
Performs the warping using a 3x3 coefficient matrix. (more details...) |
You can add the following value to the above-mentioned value to specify the number of fractional bits in the coordinates of the source point.
For specifying fractional
bits
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_FIXED_POINT + n |
Specifies the number of fractional bits for source coordinates. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milcal.lib. |
DLL | Requires mil.dll; milcal.dll. |