Skip to main content

calibcam

PyPI Python

A command line tool for charuco-based calibration of multi-camera setups (intrinsic and extrinsic parameters), including omnidirectional cameras.

OpenCV, the popular computer vision library, provides tools for camera calibration, but they are not designed for multi-camera setups. calibcam fills this gap by providing a pipeline for multi-camera calibration.

Multi-camera calibration in calibcam works as follows:

First, OpenCV is used for single camera calibration, followed by an initial estimation of camera positions and orientations. Subsequently, all intrinsic and extrinsic parameters are optimised for reprojection error using Jax autograd.

Major features:

  • Allows calibration of camera setups consisting of multiple lens types ex: a combination of omnidirectional and pinhole cameras.
  • Flexibility to fix or optimize individual intrinsic and extrinsic parameters as needed, allowing users to leverage prior knowledge or constraints about their camera setup.
  • Modular pipeline allows users to perform individual steps of the calibration process, such as detection, single camera calibration, and multi-camera calibration.
  • Direct video support (.mp4 or .ccv) for calibration data input, given the videos are synchronised or have a constant frame offset.
  • Generates plots in the output for visualisation of the calibration result, including spread of detections across cameras and reprojection error.

Note: See calibcamlib for a library for triangualtion, reprojection etc.

Board and data collection

calibcam uses Charuco boards for calibration (example board image below). See tools/board.py for the generation of both printable PNG and board configuration file for calibcam.

Example Charuco Board

The board needs to be presented in different angles, positions and distances to each camera (important for accurate single camera calibration). Relative camera positions are estimated from frames in which the board is visible in multiple cameras. We recommend recording with 2 fps while moving the board around, spending around a minute on each camera.

Installation

Install bbo-calibcam via pip

pip install bbo-calibcam

or create conda environment from environment.yml:

conda env create -f https://raw.githubusercontent.com/bbo-lab/calibcam/main/environment.yml

Usage

  1. Collect data as described in Board section.
  2. Run calibcam with:
python -m calibcam --videos [LIST OF VIDEOS TO INCLUDE] --board [PATH TO BOARD.NPY file]

We recommend keeping a copy of the board file with the videos for documentation purposes.

  1. Check number of detections per camera in the output. Values should range between 80 and 300. If too few detections are made, check recording conditions (lighting, blur ...) and collect new calibration data. If too many frames are detected, convergence may be slow or run out of memory. Reduce detections adding a frame skip with --frame_step.
  2. Check reprojection error at the end of the output. Median errors should be <0.5px.

Format

Result

Generated multicam_calibration.npy/mat/yml holds a dictionary/struct with the calibration results. The filed "calibs" holds an array of calibration dictionarys/structs with entries

* 'rvec_cam': (3,) - Rotation vector of the respective cam (world->cam)
* 'tvec_cam': (3,) - Translation vector of the respective cam (world->cam)
* 'A': (3,3) - Camera matrix
* 'k': (5,) - Camera distortion coefficients

For further structure, refer to camcalibrator.build_result()

BBO internal MATLAB use only:

Use MATLAB function mcl = cameralib.helper.mcl_from_calibcam([PATH TO MAT FILE OUTPUT OF CALIBRATION]) from bboanlysis_m to generate an MCL file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bbo_calibcam-4.2.0.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bbo_calibcam-4.2.0-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file bbo_calibcam-4.2.0.tar.gz.

File metadata

  • Download URL: bbo_calibcam-4.2.0.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for bbo_calibcam-4.2.0.tar.gz
Algorithm Hash digest
SHA256 945b884c1198758e3a306bbdc02be966fc1a6d8462e430d10b7349fd703efc84
MD5 9f2938a9a47efecb648f85cb69c0d6d9
BLAKE2b-256 cb6efeb5e8a3352b0c5a82fef7ef2a330efff04e662f1708b09e114bde0d37e4

See more details on using hashes here.

File details

Details for the file bbo_calibcam-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: bbo_calibcam-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for bbo_calibcam-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6af4a6e73aed0cb1235c5ff0a6d959b8486263f2c64113d4990448e8f9a64011
MD5 7a0f1539ae22139ddd6f4b7cd9580897
BLAKE2b-256 f2920f1161becad42c444f84b838960bf4311d7a591daa0fe28c1c6f02562e98

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.2.0 This release

2 files

4.0.1

2 files

3.0.7

2 files

3.0.6

2 files

3.0.5

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.4.2

2 files

2.4.1

2 files

2.3.1

2 files

2.2.0

2 files

2.1.5

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page