Table: | For specifying the type of transformation: |
+ combination: | For specifying fractional bits |
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 |
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.
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().
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.
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.
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.
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.
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.
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.
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.
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.
For specifying the number of rows:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 15. |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the number of rows of calibration points to be used for camera calibration. |
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.
For specifying the number of columns:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 15. |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the number of columns of calibration points to be used for camera calibration. |
Specifies the type of transformation. This parameter must be set to one of the following values.
For specifying the type of
transformation:
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
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)No transformation is performed. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WARP_LUT + |
Performs the warping through LUTs. In such cases, WarpParam1Id and WarpParam2Id must be buffers allocated with the M_LUT attribute. (summarize)Performs the warping through LUTs. (more details...) |
||||||||||||||||||||||||||||||||||||||
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)Performs the warping using a 3x3 coefficient matrix. (more details...) |
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.
For specifying fractional bits
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description | ||||||||||||||||||||||||||||||||||||||
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)Specifies the number of fractional bits for source coordinates. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milcal.lib. |
DLL | Requires mil.dll; milcal.dll. |