Skip to content

Calibration

Enric Cervera edited this page May 23, 2019 · 9 revisions

For the calibration of the fish-eye cameras several models are available:

There are two software packages available for fish-eye camera calibration:

The steps of the calibration process are presented below for each package, but first we explain the process of obtaining the calibration data.

Recording Data

First, set the parameters of capture.launch to:

width=1280, height=720, frequency=1Hz, split=True, display=True

Next, launch the capture process and record the data with rosbag, e.g. 100 images:

roslaunch ricoh_camera capture.launch
rosbag record --bz2 --limit=100 --output-name=front_camera.bag /cam_1/image_front_raw
rosbag record --bz2 --limit=100 --output-name=back_camera.bag /cam_1/image_back_raw

The bags can be directly used in Kalibr; if using CamOdocal you should extract the images from the bags with:

rosrun image_view image_saver image:=/cam_1/image_back_raw \
  _filename_format:="back%04d.png"
rosbag play back_camera.bag
rosrun image_view image_saver image:=/cam_1/image_front_raw \
  _filename_format:="front%04d.png"
rosbag play front_camera.bag

CamOdoCal

Installation

We use a Docker container, with requisites:

After cloning the repository, you only need to run the command (UNIX systems):

./docker_helper.sh build

Calibration process

Move the recorded images from the back and front cameras to the folders:

  • calibration/camodocal/back_images
  • calibration/camodocal/front_images

cd to calibration/camodocal and run the calibration script for each camera:

./camodocal_back.sh run "intrinsic_calib -w 8 -h 5 -s 0.03 \
  --camera-model mei -i /root/input_data -p back -e .png --camera-name back"
./camodocal_front.sh run "intrinsic_calib -w 8 -h 5 -s 0.03 \
  --camera-model mei -i /root/input_data -p front -e .png --camera-name front"

The results are stored in the output_data folder as:

  • back_camera_calib.yaml
  • front_camera_calib.yaml

Kalibr

Use with Docker (recommended)

Build Docker image with:

git clone https://github.com/davvdg/ros-kalibr.git
cd ros-kalibr
docker build -t ros-kalibr .

Alternatively, you can download an already-build image with:

docker pull davvdg/ros-kalibr

Calibration process

Move the recorded bags to calibration/kalibr, and run:

xhost +
roscd ricoh_camera/calibration/kalibr/
./run_kalibr_calibrate_cameras_in_docker.bash omni-radtan cam_1 back
./run_kalibr_calibrate_cameras_in_docker.bash omni-radtan cam_1 front
./run_kalibr_calibrate_cameras_in_docker.bash eucm-none cam_1 back
./run_kalibr_calibrate_cameras_in_docker.bash eucm-none cam_1 front
./run_kalibr_calibrate_cameras_in_docker.bash ds-none cam_1 back
./run_kalibr_calibrate_cameras_in_docker.bash ds-none cam_1 front

The results are stored in the folders omni-radtan (Unified Camera Model), eucm-none (Extended Unified Camera Model), and ds-none (Double Sphere Camera Model).

Local Installation

Clone the repository and follow the installation instructions. Requisites:

  • matplotlib 1.5.1: if a newer version is installed in your system, downgrade with
pip install 'matplotlib==1.5.1' --user --force-reinstall

Calibration process

Move the recorded bags to calibration/kalibr, cd there and run:

kalibr_calibrate_cameras --target checker_8x5.yaml --bag back_camera.bag \
  --models omni-radtan --topics /cam_1/image_back_raw --show-extraction
kalibr_calibrate_cameras --target checker_8x5.yaml --bag front_camera.bag \
  --models omni-radtan --topics /cam_1/image_front_raw --show-extraction

The results are stored in the same folder as:

  • camchain-back_camera.yaml
  • camchain-front_camera.yaml

Detailed results are written into the files:

  • results-cam-back_camera.txt
  • results-cam-front_camera.txt

Clone this wiki locally