The following steps provide a basic methodology for a typical camera calibration:
Physically place the camera so that the working area is in the camera's field of view.
Allocate a camera calibration context, using McalAlloc(). The camera calibration context will store the non-linear mapping between the pixel coordinate system and the world coordinate system, as well as information about the calibration setup, and the positions of all the coordinate systems. When allocating the context, specify the camera calibration mode.
Calibrate your camera setup, using either McalGrid() or McalList() with M_FULL_CALIBRATION to map image pixels to world points in the camera calibration context.
Associate the camera calibration context with an image or digitizer, using McalAssociate(), to enable working in real-world units. Once an image or digitizer is associated with a camera calibration context, it becomes known as a calibrated image or calibrated digitizer, respectively.
Physically correct an image using McalTransformImage().
Save your camera calibration context using McalSave() or McalStream().
Free the camera calibration context using McalFree().
You can skip all of the above steps if no non-linear distortion is present and uniform camera calibration mode is sufficient; simply call McalUniform() to associate the default uniform camera calibration context with an image. Whereas, additional steps are required in M_3D_ROBOTICS mode. For more information, see the Uniform camera calibration and other camera calibration modes section later in this chapter.
If the movement is known, specify the transformation, using McalSetCoordinateSystem() with the camera coordinate system as the target coordinate system.
If the movement is not known, you can have the new position calculated automatically using McalGrid() or McalList() with M_DISPLACE_CAMERA_COORD.