MIL_ID CalibrationOrImageId, | //in |
MIL_INT64 TransformType, | //in |
MIL_INT64 ResultType, | //in |
MIL_DOUBLE PositionX, | //in |
MIL_DOUBLE PositionY, | //in |
MIL_DOUBLE Result, | //in |
MIL_DOUBLE *ConvertedResultPtr | //out |
This function converts an angle from its pixel value to its world value or vice-versa. This conversion is done locally at the specified position, and can be performed according to a calibration context, calibrated image, or corrected image. This function is useful when in the presence of distortion and the result is meaningless when converted from real-world to pixel units unless considered at a specific position in the image . For example, if a Model Finder model appears warped in a target image, but the calibration context of the image compensates for this during the model search, the resulting angle is meaningful in the real-world coordinate system, and meaningless in the pixel coordinate system unless converted at a specific position in the target image.
The position should be given in the units of the source coordinate system. For example, if converting from pixel units to world units, specify the position in pixel units.
When an image is specified, the transformation uses the calibration information associated with this image.
If the position is from a corrected image (McalTransformImage()), you must specify the identifier of the image, rather than its calibration context, to get the result in the corrected image .
Note that, if the relative plane used to return results is set behind the camera, the return is undefined unless M_NO_POINTS_BEHIND_CAMERA is used.
Specifies the identifier of the calibration context or image.
When specifying a calibrated image or corrected image, the image cannot be associated with a region of interest (ROI), otherwise an error will occur.
Specifies whether to perform a pixel-to-world or world-to-pixel conversion. This parameter must be set to one of the following values:
For specifying pixel-to-world or
world-to-pixel
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_PIXEL_TO_WORLD + |
Converts from pixel to world units. |
||||||||||||||||||||||||||||||||||||||
M_WORLD_TO_PIXEL + |
Converts from world to pixel units. |
You can add one of the following values to the above-mentioned values to set the return values of invalid points.
For specifying to return invalid
points
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NO_EXTRAPOLATED_POINTS |
This flag only applies to piecewise linear calibrations; otherwise, it is ignored. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_POINTS_BEHIND_CAMERA |
Returns M_INVALID_POINT instead of an undefined value. |
Specifies the type of result to convert. This parameter must be set to the following value:
For specifying the type of
result
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ANGLE |
Specified that result to convert is an angle. (more details...) |
Specifies the X-coordinate of the position at which to convert the result, in the units of the source coordinate system.
Specifies the Y-coordinate of the position at which to convert the result, in the units of the source coordinate system.
Specifies the result to convert at the specified position. This result must be of the type specified using ResultType.
Header | Include mil.h. |
Library | Use mil.lib; milcal.lib. |
DLL | Requires mil.dll; milcal.dll. |