| Customize Help
| Save Settings

McalFixture



Function Map
Synopsis
Move the relative coordinate system or learn the fixturing offset.
Syntax
void McalFixture(
MIL_ID DstCalibratedMilObjectId, //in
MIL_ID FixturingOffsetCalId, //in
MIL_INT64 Operation, //in
MIL_INT64 LocationType, //in
MIL_ID CalOrLocSourceId, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2, //in
MIL_DOUBLE Param3, //in
MIL_DOUBLE Param4 //in
)
Description

This function allows you to move the relative coordinate system to a location (position and angle) that is at a fixed offset from an object that you want to analyze. Alternatively, this function can write the values required for the move to the specified 3D transformation matrix object. To specify the location, you must pass the calculated reference location for the object and, optionally, a preestablished offset to apply to this reference location. To pass the preestablished offset, you must pass a fixturing offset object that contains the information. Use a separate call to this function to set up the fixturing offset object.

When moving the relative coordinate system (M_MOVE_RELATIVE), you can specify the reference location of the object in one of two ways, based upon some previous analysis. You can have McalFixture() use, for example, the position and angle of a model occurrence from a specified MIL Pattern Matching or Model Finder result buffer. Alternatively, you can explicitly specify a location with respect to the relative coordinate system of the MIL object passed to CalOrLocSourceId; internally, McalFixture() converts this location so that it is with respect to the absolute coordinate system, and then uses the calculated location to place the new relative coordinate system.

Note that if you know the new position and angle for the relative coordinate system in the absolute coordinate system, use McalSetCoordinateSystem() or McalRelativeOrigin() to move it explicitly. Alternatively, you can specify the default uniform camera calibration context (M_DEFAULT_UNIFORM_CALIBRATION) as the coordinate system in which the location is expressed (CalOrLocSourceId). This camera calibration context's relative coordinate system is always aligned with its absolute coordinate system (no angle, no offset, no scale). Therefore, the specified location is consequently interpreted as being relative to the absolute coordinate system.

When setting up the fixturing offset object (M_LEARN_OFFSET), McalFixture() learns the offset between a specified location and the relative coordinate system. You can specify the location using the same techniques as those available when moving the relative coordinate system. In addition, you can set it to the reference location of a specified model in its original model source image. The function then saves the offset between the location and its relative coordinate system, in the specified fixturing offset object. Typically, you have obtained the location from a training image, whereby the location is a typical reference location and the relative coordinate system is at a required offset from this location.

McalFixture() assumes that the reference location and preestablished offset use the same absolute coordinate system as the image/calibrated context in which to save the new relative coordinate system, even if their mapping to the pixel coordinate system is different.

For more information on fixturing, see Chapter 27: Fixturing in MIL.

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 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
DstCalibratedMilObjectId

Specifies the identifier of the destination camera calibration context, 3D transformation matrix object, the 3D reconstruction result buffer, or the image for which to displace the relative coordinate system. If the Operation parameter is set to M_LEARN_OFFSET, this parameter should be set to M_NULL.

Note that if an image is passed but is not associated with a camera calibration context, it is automatically considered to be associated with a uniform camera calibration context where there is no scaling, rotation, or offset present. Therefore, each pixel in the image is considered to represent the same area in real-world units and the image is assumed to have no non-linear distortions.

FixturingOffsetCalId

Specifies the identifier of the fixturing offset object to set up (M_LEARN_OFFSET) or to apply to the reference location when moving the relative coordinate system (M_MOVE_RELATIVE). The fixturing offset object must have been previously allocated using McalAlloc(). If you don't need to apply a fixturing offset when moving the relative coordinate system, set this parameter to M_NULL.

Operation

Specifies the operation to perform.

See the Parameter associations section for possible values that can be specified.

LocationType

Specifies how the location used for the operation is specified.

See the Parameter associations section for possible values that can be specified.

CalOrLocSourceId

Specifies the identifier of the MIL object containing the location for the operation, or containing the coordinate system in which the location is expressed.

When this parameter is not used, it should be set to M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

Param1

Specifies information about the location used for the operation. Its definition is dependent on the specified operation and the location type.

When this parameter is not used, it should be set to M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

Param2

Specifies information about the location used for the operation. Its definition is dependent on the specified operation and the location type.

When this parameter is not used, it should be set to M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

Param3

Specifies information about the location used for the operation. Its definition is dependent on the specified operation and the location type.

When this parameter is not used, it should be set to M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

Param4

Specifies information about the location used for the operation. Its definition is dependent on the specified operation and the location type.

When this parameter is not used, it should be set to M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

The table below lists possible values for the Operation, LocationType, CalOrLocSourceId, Param1, Param2, Param3, and Param4 parameters.

Any parameter that is not used should be set to M_DEFAULT.

function map For specifying the location used for the operation
Click to summarize
Operation
Description
LocationType
CalOrLocSourceId
Param1
Param2
Param3
Param4
Click to summarize M_LEARN_OFFSET

Learns the offset between the specified location and the coordinate system in which it is expressed, and saves this offset in the specified fixturing offset object. INQ

(summarize)
Click to summarize M_MODEL_MOD

Specifies to use the location of a Model Finder model's reference axis (that is, the model's reference location) in the model source image. Note that this location is with respect to the model source image's top-left corner (the top-left corner of the original image from which the model was defined), and not the model image itself.

To set the reference location of the model, use MmodControl() with M_REFERENCE_X, M_REFERENCE_Y, and M_REFERENCE_ANGLE.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the Model Finder context identifier.

(summarize)
Click to summarize Param1

Specifies the index of the model within the context.

(summarize)
Click to summarize M_MODEL_PAT

Specifies to use the reference location of a Pattern Matching model in its source image.

To set the reference location of the model, use MpatControl() with M_REFERENCE....

(summarize)
Click to summarize CalOrLocSourceId

Specifies the Pattern Matching context identifier.

(summarize)
Click to summarize Param1

Specifies a camera calibration context or calibrated image that defines the pixel-to-world mapping of the Pattern Matching model's source image.

This is needed because this association is not stored with the model.

If the Pattern Matching model was defined from an uncalibrated image, set this parameter to M_NULL.

(summarize)
Click to summarize Param2

Specifies the index of the model within the context.

(summarize)
Click to summarize M_POINT_AND_ANGLE

Specifies to use the specified point and angle as the location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the relative coordinate system in which the point and angle are expressed.

(summarize)
Click to summarize M_DEFAULT_UNIFORM_CALIBRATION

Specifies to use the relative coordinate system of a uniform camera calibration where the absolute and relative coordinate systems are equal to the pixel coordinate system.

Click to summarize Calibrated image ID

Specifies the identifier of the calibrated image.

If an image is passed but is not associated with a camera calibration context, it will be treated as if associated with a uniform camera calibration context where there is no scaling, rotation, or offset present. Therefore, each pixel in the image will be considered to represent the same area in real-world units and it will be assumed that no non-linear distortions are present within the image.

(summarize)
Click to summarize Calibration context ID

Specifies the identifier of the camera calibration context which defines the relative coordinate system in which the point and angle are expressed.

Click to summarize Param1

Specifies the X-coordinate of the point, expressed in the specified relative coordinate system.

Click to summarize Param2

Specifies the Y-coordinate of the point, expressed in the specified relative coordinate system.

Click to summarize Param3

Specifies the angle, in degrees. The angle is measured from the positive X-axis towards the negative Y-axis of the specified relative coordinate system, as described in the Angle convention in MIL subsection of the Working with real-world units section of Chapter 26: Calibrating your camera setup.

(summarize)
Click to summarize M_POINT_AND_DIRECTION_POINT

Specifies to use two points to define the reference location. The first point defines the position, and the angle of the vector going from the first point to the second point defines the angle.

If there is no fixturing offset object, the origin of the new relative coordinate system is placed at the first point and the angle of the X-axis of the new relative coordinate system is set to the angle of the vector going from the first point to the second point. The Y-axis is 90° from the X-axis.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the relative coordinate system in which the two points are expressed.

(summarize)
Click to summarize M_DEFAULT_UNIFORM_CALIBRATION

Specifies to use the relative coordinate system of a uniform camera calibration where the absolute and relative coordinate systems are equal to the pixel coordinate system.

Click to summarize Calibrated image ID

Specifies the identifier of the calibrated image.

If an image is passed but is not associated with a camera calibration context, it will be treated as if associated with a uniform camera calibration context where there is no scaling, rotation, or offset present. Therefore, each pixel in the image will be considered to represent the same area in real-world units and it will be assumed that no non-linear distortions are present within the image.

(summarize)
Click to summarize Calibration context ID

Specifies the identifier of the camera calibration context which defines the relative coordinate system in which the point and angle are expressed.

Click to summarize Param1

Specifies the X-coordinate of the first point, expressed in the specified relative coordinate system.

Click to summarize Param2

Specifies the Y-coordinate of the first point, expressed in the specified relative coordinate system.

Click to summarize Param3

Specifies the X-coordinate of the second point, expressed in the specified relative coordinate system.

Click to summarize Param4

Specifies the Y-coordinate of the second point, expressed in the specified relative coordinate system.

Click to summarize M_RESULT_MET

Specifies to use the resulting position and angle of a metrology reference frame.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of a Metrology result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the reference frame feature to use. An index value of 0 represents the global frame. Note that the only metrology features supported are local or global frame results.

(summarize)
Click to summarize M_RESULT_MOD

Specifies to use the position and angle of a Model Finder model occurrence.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the Model Finder result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the result occurrence.

(summarize)
Click to summarize M_RESULT_PAT

Specifies to use the position and angle of a Pattern Matching model occurrence.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the Pattern Matching result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the result occurrence.

(summarize)
Click to summarize M_MOVE_RELATIVE

Moves the relative coordinate system to a location that is at a specified offset from the specified reference location. If no fixturing offset object is specified, the relative coordinate system is placed at the specified reference location.

(summarize)
Click to summarize M_LASER_3DMAP

Specifies to use the laser line coordinate system, defined by the 3D reconstruction context, to define the location. Note that the context must have been allocated using M_CALIBRATED_CAMERA_LINEAR_MOTION and have been calibrated using M3dmapCalibrate() or M3dmapCalibrateMultiple().

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the 3D reconstruction context which defines the laser line coordinate system.

(summarize)
Click to summarize M_POINT_AND_ANGLE

Specifies to use the specified point and angle as the reference location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the relative coordinate system in which the point and angle are expressed.

(summarize)
Click to summarize M_DEFAULT

Specifies to use the current relative coordinate system of the target calibrated image or target camera calibration context (DstCalibratedMilObjectId).

Click to summarize M_DEFAULT_UNIFORM_CALIBRATION

Specifies to use the relative coordinate system of a uniform camera calibration where the absolute and relative coordinate systems are equal to the pixel coordinate system.

Click to summarize Calibrated image ID

Specifies the identifier of the calibrated image.

If an image is passed but is not associated with a camera calibration context, it will be treated as if associated with a uniform camera calibration context where there is no scaling, rotation, or offset present. Therefore, each pixel in the image will be considered to represent the same area in real-world units and it will be assumed that no non-linear distortions are present within the image.

(summarize)
Click to summarize Calibration context ID

Specifies the identifier of the camera calibration context which defines the relative coordinate system in which the point and angle are expressed.

Click to summarize Param1

Specifies the X-coordinate of the point, expressed in the specified relative coordinate system.

Click to summarize Param2

Specifies the Y-coordinate of the point, expressed in the specified relative coordinate system.

Click to summarize Param3

Specifies the angle, in degrees. The angle is measured from the positive X-axis towards the negative Y-axis of the specified relative coordinate system, as described in the Angle convention in MIL subsection of the Working with real-world units section of Chapter 26: Calibrating your camera setup.

(summarize)
Click to summarize M_POINT_AND_DIRECTION_POINT

Specifies to use two points to define the reference location. The first point defines the position, and the angle of the vector going from the first point to the second point defines the angle.

If there is no fixturing offset object, the origin of the new relative coordinate system is placed at the first point and the angle of the X-axis of the new relative coordinate system is set to the angle of the vector going from the first point to the second point. The Y-axis is 90° from the X-axis.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the relative coordinate system in which the two points are expressed.

(summarize)
Click to summarize M_DEFAULT

Specifies to use the current relative coordinate system of the target calibrated image or target camera calibration context (DstCalibratedMilObjectId).

Click to summarize M_DEFAULT_UNIFORM_CALIBRATION

Specifies to use the relative coordinate system of a uniform camera calibration where the absolute and relative coordinate systems are equal to the pixel coordinate system.

Click to summarize Calibrated image ID

Specifies the identifier of the calibrated image.

If an image is passed but is not associated with a camera calibration context, it will be treated as if associated with a uniform camera calibration context where there is no scaling, rotation, or offset present. Therefore, each pixel in the image will be considered to represent the same area in real-world units and it will be assumed that no non-linear distortions are present within the image.

(summarize)
Click to summarize Calibration context ID

Specifies the identifier of the camera calibration context which defines the relative coordinate system in which the point and angle are expressed.

Click to summarize Param1

Specifies the X-coordinate of the first point, expressed in the specified relative coordinate system.

Click to summarize Param2

Specifies the Y-coordinate of the first point, expressed in the specified relative coordinate system.

Click to summarize Param3

Specifies the X-coordinate of the second point, expressed in the specified relative coordinate system.

Click to summarize Param4

Specifies the Y-coordinate of the second point, expressed in the specified relative coordinate system.

Click to summarize M_RESULT_MET

Specifies to use the resulting position and angle of a metrology reference frame as the reference location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of a Metrology result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the frame feature to use. An index value of 0 represents the global frame. Note that the only metrology features supported are local or global frame results.

(summarize)
Click to summarize M_RESULT_MOD

Specifies to use the position and angle of a Model Finder model occurrence as the reference location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the Model Finder result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the result occurrence.

(summarize)
Click to summarize M_RESULT_PAT

Specifies to use the position and angle of a Pattern Matching model occurrence as the reference location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the Pattern Matching result buffer.

(summarize)
Click to summarize Param1

Specifies the index of the result occurrence.

(summarize)
Click to summarize M_RESULT_POINT_CLOUD_3DMAP

Specifies to use the relative coordinate system of the 3D reconstruction result buffer to define the location.

(summarize)
Click to summarize CalOrLocSourceId

Specifies the identifier of the 3D reconstruction result buffer, which defines the relative coordinate system of the result buffer.

(summarize)
Click to summarize M_SAME_AS_SOURCE

Specifies that the relative coordinate system of CalOrLocSourceId is copied into DstCalibratedMilObjectId and takes the fixturing offset into account (if any).

(summarize)
Click to summarize CalOrLocSourceId

Specifies the camera calibration context to be copied. This can be any calibrated object.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milcal.lib.
DLL Requires mil.dll; milcal.dll.
PROC LEARN OFFSET MODEL MOD MODEL PAT NULL NULL PROC POINT AND ANGLE DEFAULT UNIFORM CALIBRATION PROC POINT AND DIRECTION POINT DEFAULT UNIFORM CALIBRATION PROC RESULT MET RESULT MOD RESULT PAT MOVE RELATIVE LASER 3DMAP POINT AND ANGLE DEFAULT DEFAULT UNIFORM CALIBRATION PROC POINT AND DIRECTION POINT DEFAULT DEFAULT UNIFORM CALIBRATION PROC RESULT MET RESULT MOD RESULT PAT RESULT POINT CLOUD 3DMAP SAME AS SOURCE NULL