| Customize Help
| Save Settings

McalWarp



Function Map
Synopsis
Define the mapping characteristics of a camera calibration context according to an existing camera calibration context.
Syntax
void McalWarp(
MIL_ID SrcImageOrContextCalId, //in
MIL_ID DstImageOrContextCalId, //in
MIL_ID WarpParam1Id, //in
MIL_ID WarpParam2Id, //in
MIL_DOUBLE OffsetX, //in
MIL_DOUBLE OffsetY, //in
MIL_DOUBLE SizeX, //in
MIL_DOUBLE SizeY, //in
MIL_INT RowNumber, //in
MIL_INT ColumnNumber, //in
MIL_INT64 TransformationType, //in
MIL_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(). MimWarp() returns 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 paramters in the Paramters section located below 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
SrcImageOrContextCalId

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

Note that the underlying source camera calibration context must have been previously configured using a successful call to McalGrid(), McalList(), McalUniform(), or McalWarp().

DstImageOrContextCalId

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

When the identifier of a destination camera calibration context is specified, the camera calibration context must have been allocated using McalAlloc() with M_UNIFORM_TRANSFORMATION, M_LINEAR_INTERPOLATION, or M_PERSPECTIVE_TRANSFORMATION, that is, the camera calibration mode of the context must be 2D.

When an identifier of an image buffer is specified, the default uniform camera calibration context (M_DEFAULT_UNIFORM_CALIBRATION) will be associated to the image, and the M_UNIFORM_TRANSFORMATION camera calibration mode will be assumed. Any current camera calibration context associated to the image is ignored.

If the operation fails, the image will be uncalibrated. In-place processing is supported, that is, DstImageOrContextCalId can be the same identifier as SrcImageOrContextCalId.

WarpParam1Id

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

If specifying a matrix of coefficients, the buffer must be a single-band, 32-bit floating-point buffer that has an M_ARRAY attribute and that has dimensions 3x2 or 3x3.

If specifying a LUT buffer, then the buffer must be a signed 16- or 32-bit integer buffer and have an M_LUT attribute.

If no warping of the source camera calibration context is required, set WarpParam1Id to M_NULL.

Please refer to MimWarp() for more information on this parameter.

WarpParam2Id

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

This buffer must be a single-band, signed 16- or 32-bit integer buffer and have an M_LUT attribute. The buffer must also have the same type and dimensions as WarpParam1Id.

If no warping is applied to the source camera calibration context, or if you are not using LUTs to perform the warping, set WarpParam2Id to M_NULL.

Please refer to MimWarp() for more information on this parameter.

OffsetX

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

If the camera calibration context has been warped, then it refers to the coordinate in the newly warped object.

OffsetY

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

If the camera calibration context has been warped, then it refers to the coordinate in the newly warped object.

SizeX

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

SizeX must be set to a value > 1.0.

However, if TransformationType is set to M_WARP_LUT, SizeX can be set to M_NULL to indicate that the width specified by the LUTs should be used. In this case, OffsetX, OffsetY, SizeX and SizeY must all be set to M_NULL.

SizeY

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

SizeY must be set to a value > 1.0.

However, if TransformationType is set to M_WARP_LUT, SizeY can be set to M_NULL to indicate that the width specified be the LUTs should be used. In this case, OffsetX, OffsetY, SizeX and SizeY must all be set to M_NULL.

RowNumber

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

Depending on the camera calibration mode of the destination camera calibration context or image, the operation requires that enough calibration points be present. For camera calibration contexts allocated using McalAlloc with M_UNIFORM_TRANSFORMATION and M_LINEAR_INTERPOLATION camera calibration modes, the minimum number of calibration points required is 3. For the M_PERSPECTIVE_TRANSFORMATION camera calibration mode, the minimum number of calibration points required is 4. Accuracy increases with the number of points.

function map For specifying the number of rows:
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default value; the default value is 15.

Click to summarize Value >= 2

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

ColumnNumber

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

Depending on the camera calibration mode of the destination camera calibration context or image, the operation requires that enough calibration points be present. For camera calibration contexts allocated using McalAlloc with M_UNIFORM_TRANSFORMATION and M_LINEAR_INTERPOLATION camera calibration modes, the minimum number of calibration points required is 3. For the M_PERSPECTIVE_TRANSFORMATION camera calibration mode, the minimum number of calibration points required is 4. Accuracy increases with the number of points.

function map For specifying the number of columns:
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default value; the default value is 15.

Click to summarize Value >= 2

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

TransformationType

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

function map For specifying the type of transformation:
Click to summarizeValue Description
Click to summarize M_IDENTITY

No 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.

(summarize)
Click to summarize M_WARP_LUT +

Performs the warping through LUTs. In such cases, WarpParam1Id and WarpParam2Id must be buffers allocated with the M_LUT attribute.

(summarize)
Click to summarize M_WARP_POLYNOMIAL

Performs 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 to M_NULL.

(summarize)
Combination value for M_WARP_LUT.

You can add the following value to the above-mentioned value to specify the number of fractional bits in the coordinates of the source point.

function map For specifying fractional bits
Click to summarizeCombination value Description
Click to summarize M_FIXED_POINT + n

Specifies 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.

(summarize)
ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcal.lib.
DLL Requires mil.dll; milcal.dll.
TRUE PROC NULL PROC LINEAR INTERPOLATION PERSPECTIVE TRANSFORMATION UNIFORM TRANSFORMATION PROC FLOAT SIGNED SIGNED DEFAULT DEFAULT IDENTITY WARP LUT WARP POLYNOMIAL FIXED POINT n M_FIXED_POINT + n