Table: | For specifying pixel-to-world or world-to-pixel |
+ combination: | For specifying to return invalid points |
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 camera 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 camera 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.
If the position is from a corrected image (McalTransformImage()), you must specify the identifier of the image, rather than its camera 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 camera calibration context, calibrated image, or corrected image. When an image is specified, the transformation uses the camera calibration information associated with this image.
If you are transforming results obtained from an image, pass the identifier of that image. For example, for results originating from a child buffer, pass the child buffer's identifier.
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 |
Specifies that if a pixel involved in the transformation is not inside the calibrated region, M_INVALID_POINT will be returned, instead of a coordinate resulting from the extrapolation. The calibrated region is defined as the image region covered by the camera calibration grid. To display this region, call McalDraw() with M_DRAW_VALID_REGION. This value only applies to piecewise linear camera calibrations (M_LINEAR_INTERPOLATION); if it is set and the image has any other type of camera calibration, it is ignored. (summarize)Specifies that if a pixel involved in the transformation is not inside the calibrated region, M_INVALID_POINT will be returned, instead of a coordinate resulting from the extrapolation. (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. Note that angles are always returned in the range of 0 to 360 degrees. (summarize)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. |