| Customize Help
| Save Settings

McalTransformResultAtPosition



Function Map
Synopsis
Convert a result, taken at a specific position , between its world and pixel value.
Syntax
void McalTransformResultAtPosition(
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
)
Description

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.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
CalibrationOrImageId

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.

TransformType

Specifies whether to perform a pixel-to-world or world-to-pixel conversion. This parameter must be set to one of the following values:

function map For specifying pixel-to-world or world-to-pixel
Click to summarizeValue Description
Click to summarize M_PIXEL_TO_WORLD +

Converts from pixel to world units.

Click to summarize M_WORLD_TO_PIXEL +

Converts from world to pixel units.

Combination values for any of the possible values of the TransformType parameter.

You can add one of the following values to the above-mentioned values to set the return values of invalid points.

function map For specifying to return invalid points
Click to summarizeCombination value Description
Click to summarize 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)
Click to summarize M_NO_POINTS_BEHIND_CAMERA

Returns M_INVALID_POINT instead of an undefined value.

ResultType

Specifies the type of result to convert. This parameter must be set to the following value:

function map For specifying the type of result
Click to summarizeValue Description
Click to summarize 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)
PositionX

Specifies the X-coordinate of the position at which to convert the result, in the units of the source coordinate system.

PositionY

Specifies the Y-coordinate of the position at which to convert the result, in the units of the source coordinate system.

Result

Specifies the result to convert at the specified position. This result must be of the type specified using ResultType.

ConvertedResultPtr

Specifies the address in which to place the converted result.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcal.lib.
DLL Requires mil.dll; milcal.dll.
NULL PROC NONE CALIBRATED TRUE PROC NONE PIXEL TO WORLD WORLD TO PIXEL NO EXTRAPOLATED POINTS NO POINTS BEHIND CAMERA ANGLE