Skip to main content

McalWarp

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Define the mapping characteristics of a camera calibration context according to an existing camera calibration context.

Syntax

void McalWarp(
AIL_ID SrcImageOrContextCalId, //in
AIL_ID DstImageOrContextCalId, //out
AIL_ID WarpParam1Id, //in
AIL_ID WarpParam2Id, //in
AIL_DOUBLE OffsetX, //in
AIL_DOUBLE OffsetY, //in
AIL_DOUBLE SizeX, //in
AIL_DOUBLE SizeY, //in
AIL_INT RowNumber, //in
AIL_INT ColumnNumber, //in
AIL_INT64 TransformationType, //in
AIL_INT64 ControlFlag //in
)

Description

This function defines the mapping of a camera calibration context according to a previously configured camera calibration context. Note that the camera calibration mode of the destination camera calibration context need not necessarily be the same as the camera calibration mode of the source context. The resulting mapping will be an accurate approximation of the source mapping for the specified image or context. This can be used, for example, to approximate a complex camera calibration using a constant pixel size camera calibration, simplifying further calculations.

This function can also be used to generate a new context by warping a previously calibrated context. The resulting context can then be associated with the uncalibrated warped image. This can be used, for example, to calibrate an image that has been warped using MimWarp. MimWarpreturns an uncalibrated image which can then be associated (using McalAssociate) with the newly warped camera calibration context.

To define new mapping that will only apply to a specific region of an image, use the OffsetX, OffsetY, SizeX and SizeY parameters. The mapping of the new camera calibration context will apply only to this defined area. See the description of these parameters in the Parameters section located below for more information.

Parameters

SrcImageOrContextCalId (in, AIL_ID)

Specifies the identifier of the camera calibration context, calibrated image, or corrected image From which the source mapping is taken.

DstImageOrContextCalId (out, AIL_ID)

Specifies the identifier of the destination camera calibration context or image buffer.

WarpParam1Id (in, AIL_ID)

Specifies the buffer containing the matrix of coefficients or the LUT buffer from which source X-coordinates are determined.

WarpParam2Id (in, AIL_ID)

Specifies the LUT buffer from which source Y-coordinates are determined.

OffsetX (in, AIL_DOUBLE)

Specifies the X pixel coordinate of the top-left calibration point.

OffsetY (in, AIL_DOUBLE)

Specifies the Y pixel coordinate of the top-left calibration point.

SizeX (in, AIL_DOUBLE)

Specifies the width of the grid of calibration points, in pixels.

SizeY (in, AIL_DOUBLE)

Specifies the height of the grid of calibration points, in pixels.

RowNumber (in, AIL_INT)

Specifies the number of rows of calibration points to be used for camera calibration.

For specifying the number of rows:

ValueDescription
M_DEFAULT
Value >= 2 (default)Specifies the number of rows of calibration points to be used for camera calibration.

ColumnNumber (in, AIL_INT)

Specifies the number of columns of calibration points to be used for camera calibration.

For specifying the number of columns:

ValueDescription
M_DEFAULT
Value >= 2 (default)Specifies the number of columns of calibration points to be used for camera calibration.

TransformationType (in, AIL_INT64)

Specifies the type of transformation. This parameter must be set to one of the following values.

For specifying the type of transformation:

ValueDescription
M_IDENTITYNo transformation is performed. This is used when McalWarp approximates a new camera calibration context based on a source camera calibration context. In such cases, WarpParam1Id and WarpParam2Id must be set to M_NULL.
M_WARP_LUTPerforms the warping through LUTs. In such cases, WarpParam1Id and WarpParam2Id must be buffers allocated with the M_LUT attribute.
M_WARP_POLYNOMIALPerforms the warping using a 3x3 coefficient matrix. This includes first-order polynomial warping or perspective polynomial warping. In such cases, WarpParam1Id must indicate a buffer having the M_ARRAY attribute and WarpParam2Id must be set toM_NULL.

For specifying fractional bits

ValueDescription
M_FIXED_POINT + nSpecifies the number of fractional bits for source coordinates. To do so, add the define M_FIXED_POINT + n to M_WARP_LUT where n >= 0. If nothing is added to M_WARP_LUT, it is assumed that there are no fractional bits in the coordinates of the source point.

ControlFlag (in, AIL_INT64)

Reserved for future expansion and must be set toM_DEFAULT.

Copyright © 2026 Zebra Technologies.