| MIL 10 Reference
| Customize Help
| Save Settings

McalRelativeOrigin



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
Synopsis
Change the origin and/or orientation of the relative coordinate system.
Syntax
void McalRelativeOrigin(
MIL_ID CalibrationOrImageId, //in
MIL_DOUBLE XOffset, //in
MIL_DOUBLE YOffset, //in
MIL_DOUBLE ZOffset, //in
MIL_DOUBLE AngularOffset, //in
MIL_INT64 ControlFlag //in
)
Description

This function changes the origin and/or orientation of the relative coordinate system of a calibration context or a calibrated image. If you specify a calibration context, the new location of the relative coordinate system will be taken into account in images associated with the calibration context after the function call, but images previously associated with the calibration context will not be affected. After the function call, you can reference all images with the new relative coordinate system in world units with respect to the new origin.

Moving the relative coordinate system of an image is useful for analyzing an object with respect to a temporary local coordinate system. The relative coordinate system is moved with respect to the specified reference coordinate system. The reference coordinate system can be the absolute coordinate system (M_ASSIGN) or the current location of relative coordinate system (M_COMPOSE_WITH_CURRENT); when it is the absolute coordinate system, the relative coordinate system is re-initialized to the location and orientation of the absolute coordinate system before applying the specified transformation. You can also use McalFixture() to move the relative coordinate system to the location of a specified occurrence of a MIL Pattern Matching or Model Finder model.

If you specify both a rotation and a translation of the relative coordinate system, the rotation is done first.

Note that when the reference coordinate system is the absolute coordinate system, setting the XOffset, YOffset, ZOffset, and AngularOffset parameters to 0 has the effect of resetting the relative coordinate system to that of the absolute coordinate system.

To manipulate the relative coordinate system of a 3D-based calibration context (M_TSAI_BASED or M_3D_ROBOTICS), it is recommended to use McalSetCoordinateSystem() instead of McalRelativeOrigin() since the former supports more transformation types.

If you adjust the relative coordinate system of a calibrated image associated with an M_VECTOR_AND_RASTER ROI, the raster information will be discarded, causing the ROI to become an M_VECTOR ROI. See MbufSetRegion() for more information.

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 calibrated image.

XOffset INQ

Specifies the X-offset of the relative coordinate system origin from the reference coordinate system, in world-units.

YOffset INQ

Specifies the Y-offset of the relative coordinate system origin from the reference coordinate system, in world-units.

ZOffset INQ

Specifies the Z-offset of the relative coordinate system origin from the reference coordinate system, in world-units.

For 2D-based calibration contexts, this parameter must be set to M_NULL.

AngularOffset INQ

Specifies the angle, in degrees, at which to rotate the relative coordinate system around the Z-axis of the reference coordinate system. A positive angle will rotate the relative coordinate system in the direction from the positive X-axis to the negative Y-axis of the reference coordinate system.

ControlFlag

Specifies how to apply the transformation. This establishes the reference coordinate system. This parameter can be set to one of the following values:

function map For specifying the reference coordinate system
CollapseValue Description
Collapse M_DEFAULT

Same as M_ASSIGN.

Collapse M_ASSIGN

Specifies to assign the specified transformation to the relative coordinate system from the origin and orientation of the absolute coordinate system.

Collapse M_COMPOSE_WITH_CURRENT

Specifies to compose the specified transformation with the current position and orientation of the relative coordinate system. This effectively applies the transformation to the current position and orientation of the relative coordinate system.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milcal.lib.
DLL Requires mil.dll; milcal.dll.
NULL PROC DEFAULT ASSIGN COMPOSE WITH CURRENT