| MIL 10 Reference
| Customize Help
| Save Settings

McalTransformResultAtPosition



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
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 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.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
CalibrationOrImageId

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.

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
CollapseValue Description
Collapse M_PIXEL_TO_WORLD +

Converts from pixel to world units.

Collapse M_WORLD_TO_PIXEL +

Converts from world to pixel units.

Combination constants 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
CollapseCombination value Description
Collapse M_NO_EXTRAPOLATED_POINTS

This flag only applies to piecewise linear calibrations; otherwise, it is ignored. If the pixel involved in the conversion is not inside the calibrated region, M_INVALID_POINT will be returned instead of a coordinate resulting from extrapolation. The calibrated region is defined as the image region covered by the calibration grid, as displayed by McalDraw() with Operation set to M_DRAW_VALID_REGION.

(summarize)
Collapse 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
CollapseValue Description
Collapse 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 TRUE PROC NONE PIXEL TO WORLD WORLD TO PIXEL NO EXTRAPOLATED POINTS NO POINTS BEHIND CAMERA ANGLE