MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageOrLutId, | //in |
MIL_ID CalibrationId, | //in |
MIL_INT64 InterpolationMode, | //in |
MIL_INT64 OperationType, | //in |
MIL_INT64 ControlFlag | //in |
This function removes distortions in an image by physically transforming the image according to a specified calibration context. This function can also just extract the warping lookup tables (LUTs) that would be used to transform the image; you can then use these LUTs to transform images with the same distortions, using MimWarp().
Typically, the image is transformed such that:
Its pixel coordinate system is aligned with its relative coordinate system.
All the pixels in the destination image are square and represent the same size in world units.
It is scaled and positioned in the destination image according to the specified fill mode.
After transformation, the image will be considered physically corrected if an M_FULL_CORRECTION operation was performed, and the fill mode scaled the image such that all its pixels are square and represent the same size in world units.
Specifies the identifier of the source image buffer.
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 identifier of the destination image buffer or LUT buffer.
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.
When transforming the image (M_WARP_IMAGE), set this parameter to the image buffer that has an appropriate size for the selected fill mode.
When extracting the X or Y warping LUT required for the image transformation (M_EXTRACT_LUT_X or M_EXTRACT_LUT_Y), set this parameter to a 32-bit signed, M_LUT buffer that has the same size as the destination image being passed to MimWarp().
While the transformed image retains the MIL identifier of the calibration context associated with the source image, the transformed image itself has a uniform world-to-pixel mapping. Propagating the calibration information of the transformed image will pass both the identifier of the calibration context associated with the source image along with the uniform world-to-pixel mapping of the transformed image established during McalTransformImage().
Specifies the calibration context with which to transform the image.
For specifying the calibration
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the calibration context associated with the source image will be used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL calibration context identifier |
Specifies the identifier of a valid calibration context, which you have calibrated using McalGrid(), McalList(), McalUniform(), or McalWarp(). (more details...) |
Specifies the interpolation mode to use when associating destination pixels with source points. This parameter must be set to one of the following values:
For specifying the type of interpolation
to perform
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_NEAREST_NEIGHBOR + M_OVERSCAN_ENABLE. |
||||||||||||||||||||||||||||||||||||||
M_BICUBIC + |
Specifies bicubic interpolation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_BILINEAR + |
Specifies bilinear interpolation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NEAREST_NEIGHBOR + |
Specifies nearest-neighbor interpolation. (more details...) |
You can add one of the following values to the above-mentioned values to specify how to determine the value of a destination pixel when its associated point falls outside the source buffer.
For specifying overscan
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_CLEAR |
Sets the destination pixel to 0, if the associated point falls outside the source buffer. |
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_DISABLE |
Leaves the destination pixel as is, if the associated point falls outside the source buffer. |
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_ENABLE |
Uses pixels from the source buffer's ancestor buffer, if the associated point falls outside the source buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_FAST |
Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. (more details...) |
Specifies the function's operation type. This parameter must be set to the following value:
For specifying the function's operation
type
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_FULL_CORRECTION. |
||||||||||||||||||||||||||||||||||||||
M_CORRECT_LENS_DISTORTION_ONLY |
Specifies a partial correction of the source image by only removing lens distortion, without modifying the perspective effect. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FULL_CORRECTION |
Specifies a full correction of the source image. (more details...) |
Specifies the function's control flag. This parameter must be set to the following value:
For specifying the type of result to
output
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_WARP_IMAGE. |
||||||||||||||||||||||||||||||||||||||
M_EXTRACT_LUT_X + |
Extracts the X warping LUT for the image transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXTRACT_LUT_Y + |
Extracts the Y warping LUT for the image transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_IMAGE + |
Transforms the source image and fits it into the destination image according to the specified fill mode. |
You can add one of the following values to the above-mentioned values to specify the fill mode.
Essentially, these values allow you to specify how to position and scale the source image in the destination image.
For specifying how to position and scale
the source image in the destination image
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CLIP |
Specifies that the source image is positioned and scaled such that every destination pixel maps to a valid source pixel. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FIT |
Specifies that the source image is positioned and scaled such that every source pixel maps to a valid destination pixel. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_USE_DESTINATION_CALIBRATION |
Specifies that the source image is positioned and scaled using the calibration information of the destination image. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milcal.lib. |
DLL | Requires mil.dll; milcal.dll. |