| Customize Help
| Save Settings

McalAlloc



Function Map
Synopsis
Allocate a camera calibration context, a fixturing offset object, or a 3D draw calibration context.
Syntax
MIL_ID McalAlloc(
MIL_ID SysId, //in
MIL_INT64 Mode, //in
MIL_INT64 ModeFlag, //in
MIL_ID *CalibrationIdPtr //out
)
Description

This function allocates a camera calibration context, a fixturing offset object, or a 3D draw calibration context.

When allocating a camera calibration context, use McalGrid() or McalList() to define the pixel-to-world mapping for the camera calibration context. For a uniform pixel-to-world mapping, instead of using McalGrid() or McalList(), use McalUniform().

When the camera calibration context, fixturing offset object, or 3D draw calibration context is no longer required, you should free it with McalFree().

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
SysId INQ

Specifies the system on which to allocate the camera calibration context, fixturing offset object, or 3D draw calibration context. This parameter should be set to one of the following values:

function map For specifying the system
Click to summarizeValue Description
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Click to summarize MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

Mode

Specifies the camera calibration mode, if allocating a camera calibration context. Otherwise, specifies to allocate a fixturing offset or a 3D draw calibration context.

When allocating a camera calibration context, this parameter must be set to one of the following values:

function map For specifying the camera calibration mode INQ
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_LINEAR_INTERPOLATION.

Click to summarize M_3D_ROBOTICS

Specifies a 3D camera calibration mode for a camera setup with the camera mounted on a robot arm at an unknown position.

Since this mode requires that the image has perspective distortion, you should not use this mode when using a camera with a telecentric lens; telecentric lenses negate perspective effects.

(summarize)
Click to summarize M_LINEAR_INTERPOLATION

Specifies piecewise linear interpolation mode.

Click to summarize M_PERSPECTIVE_TRANSFORMATION

Specifies perspective transformation mode.

Click to summarize M_TSAI_BASED

Specifies a 3D camera calibration mode based on the technique developed by Roger Y Tsai.

Since this mode requires that the image has perspective distortion, you should not use this mode when using a camera with a telecentric lens; telecentric lenses negate perspective effects.

(summarize)
Click to summarize M_UNIFORM_TRANSFORMATION

Specifies uniform transformation mode.

When allocating a fixturing offset object, set this parameter to the following value:

function map For setting a fixturing offset
Click to summarizeValue Description
Click to summarize M_FIXTURING_OFFSET

Specifies to allocate a fixturing offset object, used to store a preestablished positional and angular offset of the relative coordinate system from the object to be processed or analyzed when fixturing.

To set up the fixturing offset object, use McalFixture() with M_LEARN_OFFSET. To use the fixturing offset object, call McalFixture() with M_MOVE_RELATIVE, the reference location, and the fixturing offset object.

Note that you cannot use a fixturing offset object to calibrate an image.

(summarize)

When allocating a 3D draw calibration context, set this parameter to the following value:

function map For allocating a 3D draw calibration context
Click to summarizeValue Description
Click to summarize M_DRAW_3D_CONTEXT

Specifies to allocate a 3D draw calibration context, for drawing 3D annotations using McalDraw3d().

ModeFlag

Specifies the function's operation flag. Reserved for future expansion. This parameter must be set to M_DEFAULT.

CalibrationIdPtr

Specifies the address in which to return the identifier of the camera calibration context, fixturing offset object, or 3D draw calibration context. Since McalAlloc() also returns the identifier, you can set this parameter to M_NULL.

Return value
The returned value is the context's or fixturing offset object's identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milcal.lib.
DLL Requires mil.dll; milcal.dll.
DEFAULT HOST DEFAULT 3D ROBOTICS LINEAR INTERPOLATION PERSPECTIVE TRANSFORMATION TSAI BASED UNIFORM TRANSFORMATION FIXTURING OFFSET DRAW 3D CONTEXT