MIL_ID CalibrationOrImageId, | //in |
MIL_DOUBLE WorldPosX, | //in |
MIL_DOUBLE WorldPosY, | //in |
MIL_DOUBLE PixelSizeX, | //in |
MIL_DOUBLE PixelSizeY, | //in |
MIL_DOUBLE PixelRotation, | //in |
MIL_INT64 ControlFlag | //in |
This function allows you to calibrate an image or a calibration context with a uniform calibration, by specifying the translation, rotation, and scale of the transformation between pixel and world units. You do not need to allocate a calibration context or supply an image of a grid or a list as with the other calibration modes. If you choose to apply McalUniform() to a calibration context, however, you must allocate the calibration context using McalAlloc() with M_UNIFORM_TRANSFORMATION. If you apply McalUniform() to an image, the associated calibration context will be M_DEFAULT_UNIFORM_CALIBRATION.
The origin of the relative coordinate system and of the tool coordinate system will be set at (0,0) in the absolute coordinate system. For more information on coordinate systems, see the Coordinate systems section of Chapter 25: Calibrating your camera setup.
The following linear transformations are used to relate the pixel coordinate system, in pixels, to the absolute coordinate system, in world units:
where:
R = PixelRotation.
Sx = PixelSizeX.
Sy = PixelSizeY.
Tx = WorldPosX.
Ty = WorldPosY.
If the PixelRotation parameter is set to 0 and the same pixel size is specified in X and Y, the image will be considered corrected.
For more information on uniform calibration, see the Uniform calibration and other calibration modes section of Chapter 25: Calibrating your camera setup.
If you adjust the 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.
Specifies the identifier of the calibration context or of the image to calibrate.
Specifies the X-position in the absolute coordinate system of the center of the top-left pixel of the image.
Specifies the Y-position in the absolute coordinate system of the center of the top-left pixel of the image.
Specifies the scale between the world and pixel units in the X-direction. Specify the scale in world units per pixel. The scale must be a positive value.
Specifies the scale between the world and pixel units in the Y-direction. Specify the scale in world units per pixel. The scale must be a positive value.
Header | Include mil.h. |
Library | Use mil.lib; milcal.lib. |
DLL | Requires mil.dll; milcal.dll. |