Convert Figma logo to code with AI

ethz-asl logokalibr

The Kalibr visual-inertial calibration toolbox

4,351
1,400
4,351
96

Top Related Projects

2,544

GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.

A large scale non-linear optimization library

3,039

g2o: A General Framework for Graph Optimization

77,899

Open Source Computer Vision Library

5,575

A massively spiffy yet delicately unobtrusive compression library.

2,007

C++ implementation of Lie Groups using Eigen.

Quick Overview

Kalibr is an open-source toolbox for calibrating multiple sensors, including cameras, IMUs, and laser scanners. It provides a flexible framework for sensor calibration, supporting various sensor combinations and calibration patterns. Kalibr is particularly useful for robotics and computer vision applications where accurate sensor calibration is crucial.

Pros

  • Supports multiple sensor types and combinations (e.g., camera-IMU, multi-camera, camera-laser)
  • Provides accurate calibration results with uncertainty estimates
  • Offers a user-friendly GUI for visualization and parameter adjustment
  • Actively maintained and supported by the robotics community

Cons

  • Steep learning curve for new users
  • Requires specific calibration targets and careful data collection
  • Can be computationally intensive for complex sensor setups
  • Limited documentation for advanced use cases

Code Examples

# Initialize a multi-camera calibration
import kalibr_calibrate_cameras as kcc

config_file = "multicam_config.yaml"
bag_file = "calibration_data.bag"

kcc.main(["--bag", bag_file, "--topics", "/cam0/image_raw", "/cam1/image_raw", "--models", "pinhole-radtan", "pinhole-radtan", "--target", "aprilgrid.yaml", "--show-extraction"])
# Perform camera-IMU calibration
import kalibr_calibrate_imu_camera as kcic

config_file = "camchain-imucam.yaml"
imu_yaml = "imu.yaml"
bag_file = "imu_cam_calibration.bag"

kcic.main(["--bag", bag_file, "--cam", config_file, "--imu", imu_yaml, "--target", "aprilgrid.yaml"])
# Validate calibration results
import kalibr_validate_calibration as kvc

camchain_file = "camchain-imucam-result.yaml"
imu_yaml = "imu.yaml"
bag_file = "validation_data.bag"

kvc.main(["--cam", camchain_file, "--imu", imu_yaml, "--bag", bag_file])

Getting Started

  1. Install Kalibr:

    git clone https://github.com/ethz-asl/kalibr.git
    cd kalibr
    ./install.sh
    
  2. Prepare calibration target:

    • Print AprilGrid or Checkerboard pattern
    • Create target YAML file with dimensions
  3. Collect calibration data:

    • Record ROS bag with sensor data
    • Ensure good coverage of calibration target
  4. Run calibration:

    kalibr_calibrate_cameras --bag calibration_data.bag --topics /cam0/image_raw /cam1/image_raw --models pinhole-radtan pinhole-radtan --target aprilgrid.yaml
    
  5. Analyze results:

    • Check calibration report
    • Validate using kalibr_validate_calibration

Competitor Comparisons

2,544

GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.

Pros of GTSAM

  • More comprehensive library for factor graph optimization and SLAM
  • Supports a wider range of applications beyond camera calibration
  • Active development with frequent updates and contributions

Cons of GTSAM

  • Steeper learning curve due to its broader scope
  • May be overkill for simple camera calibration tasks
  • Requires more setup and configuration for specific use cases

Code Comparison

Kalibr (Python):

import kalibr_common as kc
import kalibr_camera_calibration as kcc

calibrator = kcc.CameraCalibrator()
calibrator.loadData(bag_file)
calibrator.calibrate()

GTSAM (C++):

#include <gtsam/geometry/Cal3_S2.h>
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h>

gtsam::NonlinearFactorGraph graph;
gtsam::Cal3_S2::shared_ptr K(new gtsam::Cal3_S2(fx, fy, s, u0, v0));
graph.add(gtsam::PriorFactor<gtsam::Cal3_S2>(1, *K, noise_model));

Summary

GTSAM offers a more versatile toolset for various optimization problems, including SLAM and sensor fusion, while Kalibr focuses specifically on camera and IMU calibration. GTSAM's flexibility comes at the cost of increased complexity, whereas Kalibr provides a more streamlined experience for its targeted use case.

A large scale non-linear optimization library

Pros of Ceres Solver

  • More general-purpose optimization library, suitable for a wide range of problems
  • Highly optimized and efficient, with support for large-scale problems
  • Extensive documentation and active community support

Cons of Ceres Solver

  • Steeper learning curve for beginners in optimization
  • Requires more manual setup and configuration for specific problems

Code Comparison

Kalibr (Python-based camera calibration):

import kalibr_common as kc
import kalibr_camera_calibration as kcc

calibrator = kcc.CameraCalibrator()
calibrator.loadData(bag_file)
calibrator.calibrate()

Ceres Solver (C++ optimization problem):

#include "ceres/ceres.h"

ceres::Problem problem;
ceres::Solver::Options options;
ceres::Solver::Summary summary;

problem.AddResidualBlock(/* ... */);
ceres::Solve(options, &problem, &summary);

Kalibr is more focused on camera calibration tasks, providing a higher-level interface for this specific application. Ceres Solver offers a lower-level, more flexible framework for general optimization problems, requiring more explicit problem formulation but allowing for a broader range of applications.

3,039

g2o: A General Framework for Graph Optimization

Pros of g2o

  • More general-purpose optimization framework, suitable for a wider range of problems
  • Highly efficient implementation, particularly for large-scale optimization
  • Extensive documentation and examples available

Cons of g2o

  • Steeper learning curve due to its more complex architecture
  • Less focused on camera and IMU calibration tasks specifically
  • Requires more setup and configuration for specific use cases

Code Comparison

g2o example (graph optimization):

g2o::SparseOptimizer optimizer;
optimizer.setAlgorithm(new g2o::OptimizationAlgorithmLevenberg);

g2o::VertexSE3* v = new g2o::VertexSE3;
v->setEstimate(Eigen::Isometry3d::Identity());
optimizer.addVertex(v);

Kalibr example (camera-IMU calibration):

kalibr_calibrate_imu_camera --target april_6x6.yaml \
    --cam camchain.yaml \
    --imu imu.yaml \
    --bag calibration_data.bag \
    --output-folder output_calibration
77,899

Open Source Computer Vision Library

Pros of OpenCV

  • Broader scope: Comprehensive computer vision library with a wide range of functionalities
  • Larger community: More extensive user base, documentation, and third-party resources
  • Multi-language support: Bindings for Python, Java, and other languages

Cons of OpenCV

  • Less specialized: Not focused on camera calibration like Kalibr
  • Steeper learning curve: Due to its extensive feature set, it can be overwhelming for beginners
  • Heavier resource usage: Larger library size and potentially higher memory footprint

Code Comparison

Kalibr (Python):

import kalibr_common as kc
import kalibr_camera_calibration as kcc

calibrator = kcc.CameraCalibration()
calibrator.loadData(bag_file)
calibrator.calibrate()

OpenCV (Python):

import cv2
import numpy as np

ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None)

Both libraries offer camera calibration functionality, but Kalibr is more specialized for this task, while OpenCV provides a broader range of computer vision tools. Kalibr's approach is more automated and tailored for ROS environments, whereas OpenCV's method requires more manual setup but offers greater flexibility for various calibration scenarios.

5,575

A massively spiffy yet delicately unobtrusive compression library.

Pros of zlib

  • Widely used and battle-tested compression library
  • Lightweight and efficient implementation
  • Extensive cross-platform support

Cons of zlib

  • Limited to compression/decompression functionality
  • Less active development compared to Kalibr
  • Fewer advanced features for specialized use cases

Code Comparison

zlib (compression example):

z_stream strm;
deflateInit(&strm, Z_DEFAULT_COMPRESSION);
deflate(&strm, Z_FINISH);
deflateEnd(&strm);

Kalibr (camera calibration example):

import kalibr
calibrator = kalibr.EurocCalibrator()
calibrator.loadDataset(dataset_path)
calibrator.calibrate()
calibrator.saveResults(output_path)

Summary

zlib is a focused, widely-adopted compression library, while Kalibr is a specialized toolbox for sensor calibration in robotics. zlib offers simplicity and broad compatibility, but Kalibr provides more advanced features for its specific domain. The code examples highlight their different purposes: zlib for data compression and Kalibr for complex calibration tasks.

2,007

C++ implementation of Lie Groups using Eigen.

Pros of Sophus

  • Lightweight and focused on Lie groups and algebras
  • Easier to integrate into existing C++ projects
  • More actively maintained with recent updates

Cons of Sophus

  • Limited scope compared to Kalibr's comprehensive calibration tools
  • Lacks GUI and visualization features
  • May require additional libraries for full functionality in robotics applications

Code Comparison

Sophus example (transformation composition):

Sophus::SE3d T1, T2;
Sophus::SE3d T_composed = T1 * T2;

Kalibr example (camera calibration):

import kalibr
calibrator = kalibr.CameraCalibrator()
calibrator.loadImages(image_folder)
calibrator.calibrate()

Summary

Sophus is a specialized library for Lie group operations, while Kalibr is a comprehensive toolkit for sensor calibration. Sophus is more suitable for projects requiring efficient geometric computations, whereas Kalibr excels in multi-sensor calibration tasks. The choice between them depends on the specific requirements of your robotics or computer vision project.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Kalibr

ROS1 Ubuntu 20.04 ROS1 Ubuntu 18.04 ROS1 Ubuntu 16.04

Introduction

Kalibr is a toolbox that solves the following calibration problems:

  1. Multi-Camera Calibration: Intrinsic and extrinsic calibration of a camera-systems with non-globally shared overlapping fields of view with support for a wide range of camera models.
  2. Visual-Inertial Calibration (CAM-IMU): Spatial and temporal calibration of an IMU w.r.t a camera-system along with IMU intrinsic parameters
  3. Multi-Inertial Calibration (IMU-IMU): Spatial and temporal calibration of an IMU w.r.t a base inertial sensor along with IMU intrinsic parameters (requires 1-aiding camera sensor).
  4. Rolling Shutter Camera Calibration: Full intrinsic calibration (projection, distortion and shutter parameters) of rolling shutter cameras.

To install follow the install wiki page instructions for which you can either use Docker or install from source in a ROS workspace. Please find more information on the wiki pages of this repository. For questions or comments, please open an issue on Github.

News / Events

  • Nov 24, 2022 - Some new visualization of trajectory and IMU rate for the generated report along with fixed support for exporting poses to file (see PR #578,#581,#582)
  • May 3, 2022 - Support for Ubuntu 20.04 along with Docker scripts have been merged into master via PR #515. A large portion was upgrading to Python 3. A special thanks to all the contributors that made this possible. Additionally, contributed fixes for the different validation and visualization scripts have been merged.
  • Febuary 3, 2020 - Initial Ubuntu 18.04 support has been merged via PR #241. Additionally, support for inputting an initial guess for focal length can be provided from the cmd-line on failure to initialize them.
  • August 15, 2018 - Double sphere camera models have been contributed to the repository via PR #210. If you are interested you can refer to the paper for a nice overview of the models in the repository.
  • August 25, 2016 - Rolling shutter camera calibration support was added as a feature via PR #65. The paper provides details for those interested.
  • May 18, 2016 - Support for multiple IMU-to-IMU spacial and IMU intrinsic calibration was released.
  • June 18, 2014 - Initial public release of the repository.

Authors

  • Paul Furgale
  • Hannes Sommer
  • Jérôme Maye
  • Jörn Rehder
  • Thomas Schneider (email)
  • Luc Oth

References

The calibration approaches used in Kalibr are based on the following papers. Please cite the appropriate papers when using this toolbox or parts of it in an academic publication.

  1. Joern Rehder, Janosch Nikolic, Thomas Schneider, Timo Hinzmann, Roland Siegwart (2016). Extending kalibr: Calibrating the extrinsics of multiple IMUs and of individual axes. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), pp. 4304-4311, Stockholm, Sweden.
  2. Paul Furgale, Joern Rehder, Roland Siegwart (2013). Unified Temporal and Spatial Calibration for Multi-Sensor Systems. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Tokyo, Japan.
  3. Paul Furgale, T D Barfoot, G Sibley (2012). Continuous-Time Batch Estimation Using Temporal Basis Functions. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), pp. 2088–2095, St. Paul, MN.
  4. J. Maye, P. Furgale, R. Siegwart (2013). Self-supervised Calibration for Robotic Systems, In Proc. of the IEEE Intelligent Vehicles Symposium (IVS)
  5. L. Oth, P. Furgale, L. Kneip, R. Siegwart (2013). Rolling Shutter Camera Calibration, In Proc. of the IEEE Computer Vision and Pattern Recognition (CVPR)

Acknowledgments

This work is supported in part by the European Union's Seventh Framework Programme (FP7/2007-2013) under grants #269916 (V-Charge), and #610603 (EUROPA2).

License (BSD)

Copyright (c) 2014, Paul Furgale, Jérôme Maye and Jörn Rehder, Autonomous Systems Lab, ETH Zurich, Switzerland
Copyright (c) 2014, Thomas Schneider, Skybotix AG, Switzerland
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the Autonomous Systems Lab and Skybotix AG.

  4. Neither the name of the Autonomous Systems Lab and Skybotix AG nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTONOMOUS SYSTEMS LAB AND SKYBOTIX AG ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL the AUTONOMOUS SYSTEMS LAB OR SKYBOTIX AG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.