Checking Camera Calibration

Changes in temperature and forces from mounting the camera can change its internal geometry and lead to an incorrect calibration. You can check whether the calibration of your camera still fits with a calibration pattern.

  • Capture an image where the camera sees a calibration pattern.

    • Execute CollectPatterns and EstimatePatternPose. The result contains the PoseError, which is the difference between the pattern pose estimates from the left and the right camera image. This error should be low for a good calibration. If the geometry of your camera changed and the calibration does not fit anymore, it will become larger.

      Note

      The exact values depend on the measurement volume of your camera. You should perform this test with a known good calibration to get reference values.

Note

We recommend to foresee regular calibration checks in the final application.

Dynamic Recalibration

The calibration can automatically be adjusted to small changes of the camera geometry with the dynamic calibration. It automatically gets updated when you capture images while UseRecalibrator is enabled. You can explicitly perform such a recalibration with the Recalibrate command. There is also an option for performing a recalibration in NxView.

Note

The dynamic recalibration has a limit on how far the angles can be adjusted. If the camera geometry changed too much, the DynamicCalibrationLimitReached flag will be set. You should check this flag to get notified about potential problems with the camera calibration.

Code Example

We assume that the camera with serial “1234” is already open and has at least one stereo pattern observation in the pattern buffer. See here for more information on how to capture patterns.

// Perform the recalibration with the patterns from the pattern buffer.
NxLibCommand recalibrate(cmdRecalibrate);
recalibrate.parameters()[itmCameras] = "1234";
recalibrate.execute();

// Store the new calibration angle offsets to the camera's EEPROM.
NxLibCommand storeCalibration(cmdStoreCalibration);
storeCalibration.parameters()[itmCameras] = "1234";
storeCalibration.parameters()[itmDynamicOffsets] = true;
storeCalibration.execute();
* Perform the recalibration with the patterns from the pattern buffer.
set_framegrabber_param(RootHandle, 'exec:Parameters/Cameras', '1234' )
set_framegrabber_param(RootHandle, 'do_execute', 'Recalibrate' )

* Write the new offset angles into the EEPROM of the camera.
set_framegrabber_param(RootHandle, 'exec:Parameters/Cameras', '1234' )
set_framegrabber_param(RootHandle, 'exec:Parameters/DynamicOffsets', 'true' )
set_framegrabber_param(RootHandle, 'do_execute', 'StoreCalibration' )