BabelCalib: A Universal Approach to Calibrating Central Cameras. In ICCV (2021)

Overview

BabelCalib: A Universal Approach to Calibrating Central Cameras

Paper Datasets Conference Poster Youtube

This repository contains the MATLAB implementation of the BabelCalib calibration framework.

Method overview and result. (left) BabelCalib pipeline: the camera model proposal step ensures a good initialization (right) example result showing residuals of reprojected corners of test images.


Projection of calibration target from estimated calibration. Detected corners are red crosses, target projected using initial calibration are blue squares and using the final calibration are cyan circles.

Description

BabelCalib is a calibration framework that can estimate camera models for all types of central projection cameras. Calibration is robust and fully automatic. BabelCalib provides models for pinhole cameras with additive distortion as well as omni-directional cameras and catadioptric rigs. The supported camera models are listed under the solvers directory. BabelCalib supports calibration targets made of a collection of calibration boards, i.e., multiple planar targets. The method is agnostic to the pattern type on the calibration boards. It is robust to inaccurately localized corners, outlying detections and occluded targets.

Table of Contents


Installation

You need to clone the repository. The required library Visual Geometry Toolkit is added as a submodule. Please clone the repository with submodules:

git clone --recurse-submodules https://github.com/ylochman/babelcalib

If you already cloned the project without submodules, you can run

git submodule update --init --recursive 

Calibration

Calibration is performed by the function calibrate.m. The user provides the 2D<->3D correspondence of the corner detections in the captured images as well as the coordinates of the calibration board fiducials and the absolute poses of the calibration boards. Any calibration board of the target may be partially or fully occluded in a calibration image. The camera model is returned as well as diagnostics about the calibration.

function [model, res, corners, boards] = calibrate(corners, boards, imgsize, varargin)

Parameters:

  • corners : type corners
  • boards : type boards
  • imgsize : 1x2 array specifying the height and width of the images; all images in a capture are assumed to have the same dimensions.
  • varargin : optional arguments

Returns

Evaluation

BabelCalib adopts the train-test set methodology for fitting and evaluation. The training set contains the images used for calibration, and the test set contains held-out images for evaluation. Evaluating a model on test-set images demonstrates how well a calibration generalizes to unseen imagery. During testing, the intriniscs are kept fixed and only the poses of the camera are regressed. The RMS re-projection error is used to assess calibration quality. The poses are estimated by get_poses.m:

function [model, res, corners, boards] = get_poses(intrinsics, corners, boards, imgsize, varargin)

Parameters:

  • intrinsics : type model
  • corners : type corners
  • boards : type boards
  • imgsize : 1x2 array specifies the height and width of the images; all the images are assumed to have the same dimensions
  • varargin : optional arguments

Returns

Type Defintions

corners : 1xN struct array

Contains the set of 2D<->3D correspondences of the calibration board fiducials to the detected corners in each image. Here, we let N be the number of images; Kn be the number of detected corners in the n-th image, where (n=1,...,N); and B be the number of planar calibration boards.

field data type description
x 2xKn array 2D coordinates specifying the detected corners
cspond 2xKn array correspondences, where each column is a correspondence and the first row contains the indices to points and the second row contains indices to calibration board fiducials

boards : 1xB struct array

Contains the set of absolute poses for each of the B calibration boards of the target, where (b=1,...,B) indexes the calibration boards. Also specifies the coordinates of the fiducials on each of the calibration boards.

field data type description
Rt 3x4 array absolute orientation of each pose is encoded in the 3x4 pose matrix
X 2xKb array 2D coordinates of the fiducials on board b of the target. The coordinates are specified with respect to the 2D coordinate system attached to each board

model : struct

Contains the intrinsics and extrinsics of the regressed camera model. The number of parameters of the back-projection or projection model, denoted C, depends on the chosen camera model and model complexity.

field data type description
proj_model str name of the target projection model
proj_params 1xC array parameters of the projection/back-projection function
K 3x3 array camera calibration matrix (relating to A in the paper: K = inv(A))
Rt 3x4xN array camera poses stacked along the array depth

res : struct

Contains the information about the residuals, loss and initialization (minimal solution). Here, we let K be the total number of corners in all the images.

field data type description
loss double loss value
ir double inlier ratio
reprojerrs 1xK array reprojection errors
rms double root mean square reprojection error
wrms double root mean square weighted reprojection error (Huber weights)
info type info

info : struct

Contains additional information about the residuals, loss and initialization (minimal solution).

field data type description
dx 2xK array re-projection difference vectors: dx = x - x_hat
w 1xK array Huber weights on the norms of dx
residual 2xK array residuals: residual = w .* dx
cs 1xK array (boolean) consensus set indicators (1 if inlier, 0 otherwise)
min_model type model model corresponding to the minimal solution
min_res type res residual info corresponding to the minimal solution

cfg

cfg contains the optional configurations. Default values for the optional parameters are loaded from parse_cfg.m. These values can be changed by using the varargin parameter. Parameters values passed in by varargin take precedence. The varargin format is 'param_1', value_1, 'param_2', value_2, .... The parameter descriptions are grouped by which component of BabelCalib they change.

Solver configurations:

  • final_model - the selected camera model (default: 'kb')
  • final_complexity - a degree of the polynomial if the final model is polynomial, otherwise ignored (default: 4)

Sampler configurations:

  • min_trial_count - minimum number of iterations (default: 20)
  • max_trial_count - maximum number of iterations (default: 50)
  • max_num_retries - maximum number of sampling tries in the case of a solver failure (default: 50)
  • confidence - confidence rate (default: 0.995)
  • sample_size - the number of 3D<->2D correspondences that are sampled for each RANSAC iteration (default: 14)

RANSAC configurations:

  • display - toggles the display of verbose output of intermediate steps (default: true)
  • display_freq - frequency of output during the iterations of robust sampling. (default: 1)
  • irT - minimum inlier ratio to perform refinement (default: 0)

Refinement configurations:

  • reprojT - reprojection error threshold (default: 1.5)
  • max_iter - maximum number of iterations on the refinement (default: 50)

Examples and wrappers

2D<->3D correspondences

BabelCalib provides a convenience wrapper calib_run_opt1.m for running the calibration calibrate.m with a training set and evaluating get_poses.m with a test set.

Deltille

The Deltille detector is a robust deltille and checkerboard detector. It comes with detector library, example detector code, and MATLAB bindings. BabelCalib provides functions for calibration and evaluation using the Deltille software's outputs. Calibration from Deltille detections requires format conversion which is peformed by import_ODT.m. A complete example of using calibrate and get_poses with import_ODT is provided in calib_run_opt2.m.

Citation

If you find this work useful in your research, please consider citing:

@InProceedings{Lochman-ICCV21,
    title     = {BabelCalib: A Universal Approach to Calibrating Central Cameras},
    author    = {Lochman, Yaroslava and Liepieshov, Kostiantyn and Chen, Jianhui and Perdoch, Michal and Zach, Christopher and Pritts, James},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    year      = {2021},
}

License

The software is licensed under the MIT license. Please see LICENSE for details.

Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX.

Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX. The repository combines a class agnostic object localizer to first detect the objects in the image

Ibai Gorordo 24 Nov 14, 2022
Pytorch implementation of RED-SDS (NeurIPS 2021).

Recurrent Explicit Duration Switching Dynamical Systems (RED-SDS) This repository contains a reference implementation of RED-SDS, a non-linear state s

Abdul Fatir 10 Dec 02, 2022
Junction Tree Variational Autoencoder for Molecular Graph Generation (ICML 2018)

Junction Tree Variational Autoencoder for Molecular Graph Generation Official implementation of our Junction Tree Variational Autoencoder https://arxi

Wengong Jin 418 Jan 07, 2023
A time series processing library

Timeseria Timeseria is a time series processing library which aims at making it easy to handle time series data and to build statistical and machine l

Stefano Alberto Russo 11 Aug 08, 2022
PAthological QUpath Obsession - QuPath and Python conversations

PAQUO: PAthological QUpath Obsession Welcome to paquo 👋 , a library for interacting with QuPath from Python. paquo's goal is to provide a pythonic in

Bayer AG 60 Dec 31, 2022
Cross-modal Retrieval using Transformer Encoder Reasoning Networks (TERN). With use of Metric Learning and FAISS for fast similarity search on GPU

Cross-modal Retrieval using Transformer Encoder Reasoning Networks This project reimplements the idea from "Transformer Reasoning Network for Image-Te

Minh-Khoi Pham 5 Nov 05, 2022
Official repo for our 3DV 2021 paper "Monocular 3D Reconstruction of Interacting Hands via Collision-Aware Factorized Refinements".

Monocular 3D Reconstruction of Interacting Hands via Collision-Aware Factorized Refinements Yu Rong, Jingbo Wang, Ziwei Liu, Chen Change Loy Paper. Pr

Yu Rong 41 Dec 13, 2022
SLAMP: Stochastic Latent Appearance and Motion Prediction

SLAMP: Stochastic Latent Appearance and Motion Prediction Official implementation of the paper SLAMP: Stochastic Latent Appearance and Motion Predicti

Kaan Akan 34 Dec 08, 2022
cisip-FIRe - Fast Image Retrieval

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major bi

CISiP Lab 39 Nov 25, 2022
Visualize Camera's Pose Using Extrinsic Parameter by Plotting Pyramid Model on 3D Space

extrinsic2pyramid Visualize Camera's Pose Using Extrinsic Parameter by Plotting Pyramid Model on 3D Space Intro A very simple and straightforward modu

JEONG HYEONJIN 106 Dec 28, 2022
Pytorch implementation of Each Part Matters: Local Patterns Facilitate Cross-view Geo-localization https://arxiv.org/abs/2008.11646

[TCSVT] Each Part Matters: Local Patterns Facilitate Cross-view Geo-localization LPN [Paper] NEWs Prerequisites Python 3.6 GPU Memory = 8G Numpy 1.

46 Dec 14, 2022
Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.

HiddenLayer A lightweight library for neural network graphs and training metrics for PyTorch, Tensorflow, and Keras. HiddenLayer is simple, easy to ex

Waleed 1.7k Dec 31, 2022
This code is for our paper "VTGAN: Semi-supervised Retinal Image Synthesis and Disease Prediction using Vision Transformers"

ICCV Workshop 2021 VTGAN This code is for our paper "VTGAN: Semi-supervised Retinal Image Synthesis and Disease Prediction using Vision Transformers"

Sharif Amit Kamran 25 Dec 08, 2022
CVPR 2021

Smoothing the Disentangled Latent Style Space for Unsupervised Image-to-image Translation [Paper] | [Poster] | [Codes] Yahui Liu1,3, Enver Sangineto1,

Yahui Liu 37 Sep 12, 2022
FastFace: Lightweight Face Detection Framework

Light Face Detection using PyTorch Lightning

Ömer BORHAN 75 Dec 05, 2022
Empowering journalists and whistleblowers

Onymochat Empowering journalists and whistleblowers Onymochat is an end-to-end encrypted, decentralized, anonymous chat application. You can also host

Samrat Dutta 19 Sep 02, 2022
DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation

DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation This repository is the implementation of DynaTune paper. This folder

4 Nov 02, 2022
UniFormer - official implementation of UniFormer

UniFormer This repo is the official implementation of "Uniformer: Unified Transf

SenseTime X-Lab 573 Jan 04, 2023
EquiBind: Geometric Deep Learning for Drug Binding Structure Prediction

EquiBind: geometric deep learning for fast predictions of the 3D structure in which a small molecule binds to a protein

Hannes Stärk 355 Jan 03, 2023
A highly efficient, fast, powerful and light-weight anime downloader and streamer for your favorite anime.

AnimDL - Download & Stream Your Favorite Anime AnimDL is an incredibly powerful tool for downloading and streaming anime. Core features Abuses the dev

KR 759 Jan 08, 2023