ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.21k stars 1.38k forks source link

calibration of non synchronized cameras #633

Closed lsorgi closed 1 year ago

lsorgi commented 1 year ago

Hello!

I am having issues calibrating a system with 2 non-synchronized cameras with divergent optical axis, i.e. with only ~30% of the field of view overlap.

If I run the intrinsic calibration of both cameras independently it works correctly, undistorsion look good, metrics good, all good. Commands for intrinsic calibration is

rosrun kalibr kalibr_calibrate_cameras  --bag <KALIBR_BAGFILE>  --topics /cam0/image_raw  --models pinhole-equi  --target <TARGET_YAML>
rosrun kalibr kalibr_calibrate_cameras  --bag <KALIBR_BAGFILE>  --topics /cam1/image_raw  --models pinhole-equi  --target <TARGET_YAML>

If I run the calibration of both cameras simultaneously it fails, not being able to correctly initialize the stereo pairs.
The command for stereo calibration is

rosrun kalibr kalibr_calibrate_cameras  --bag <KALIBR_BAGFILE>  --topics /cam0/image_raw  /cam1/image_raw  --models pinhole-equi pinhole-equi  --target <TARGET_YAML>

I naively assumed that the temporal offset between the cameras was handled by the tool... is it not the case? do the 2 camera stream need to be strictly synchronized?

kololhe commented 1 year ago

I faced a similar issue. What you can do instead is provide a measure of the asynchronization. AFAIK, Kalibr does do approximate synchronization if the topics are not synchronized.

You can pass the tolerance for approximate synchronization: --approx-sync MAX_DELTA_APPROXSYNC Time tolerance for approximate image synchronization [s] (default: 0.02)

To identify the time difference, you can use rostopic delay which will give you delays between sequential ROS messages for a topic (NOT between multiple topics)

You can also increase the number of iterations, or include more images of your target in the overlap of the two cameras.

lsorgi commented 1 year ago

thx!