Skip to content

Camera Calibration

Emanuele Giacomini edited this page Apr 17, 2024 · 2 revisions

Screenshot from 2024-04-17 12-26-18

The procedure to calibrate the camera intrinsics is the same as every other method based on Zhang's. To allow for a finer control over the calibration, we split the acquisition of the calibration images from the calibration.

Acquisition

When you get the acquisition, please plan where to place the calibration target on the image. A good calibration procedure requires the following:

  • Full coverage of the image plane especially the borders (where most of the typical radial distortion occurs)
  • Few sharp images. Try staying under 10-15 images per camera.
  • Various distances between the camera and the calibration target.

Assuming you have a ROS-enabled, running camera and a calibration target configuration file (see here), you can acquire calibration images by typing:

rosrun ca2lib mono_recorder \
    --topic-camera <camera_topic> \
    --target <target.yaml> \
    --output-dir <output_directory>

Use the space key to attempt target detection and image acquisition and esc to close the process.

We also provide a node for synchronous stereo acquisition, but we do not provide additional details.

Calibration

Based on the type of camera and lens you have, you might want to choose a different camera and distortion model. Please look at Camera Models to see what the suite offers.

After obtaining your images, you can run the calibration procedure (based on OpenCV) by typing:

rosrun ca2lib calibrate_camera \
    --input-dir <images_directory> \
    --target <target.yaml> \
    --output <camera_intrinsics.yaml> \
    --distortion <distortion_type> \
    --model <camera_model_type>
Clone this wiki locally