Skip to main content

Calibrate intrinsic and extrinsic parameters of cameras with charuco boards

Project description

calibcam

A charuco based calibrator for camera setups (intrinsic and extrinsic parameters), including omnidirectional cameras.

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.

See calibcamlib for a library for triangualtion, reprojection etc.

Board

calibcam uses Charuco boards for calibration. The board needs to be presented in different angles, positions and distances to each camera. 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.

Creation

See board.py in example folder for the generation of both printable PNG and board configuration file for calibcam.

Installation

Install bbo-calibcam via pip, 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.
  3. 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.
  4. Check reprojection error at the end of the output. Median errors should be <0.5px.

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.

Format

Result

multicam_calibration.npy/mat/yml holds a dictionary/struct with the calibration result. 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()

Project details


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.0.1.tar.gz (38.7 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.0.1-py2.py3-none-any.whl (45.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for bbo_calibcam-4.0.1.tar.gz
Algorithm Hash digest
SHA256 543094381238c7adf003b06d48bea7917326437c025ebf50ab8e883cf6fe6212
MD5 9e7872e3c6b7de2adf2391db997b35b6
BLAKE2b-256 f4d22ee22e7b4dffdd37cd118ee18b27e986b4394ab45beaacda809df81d6b22

See more details on using hashes here.

File details

Details for the file bbo_calibcam-4.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bbo_calibcam-4.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2e3f35c65d399429b8c33d26e61d738db7d483867142fe6ab5b16b25185f9dd2
MD5 13d06db53589a856d8fa1cf10cd93c49
BLAKE2b-256 51d7cfb437edac8d22d0568b88bdd1737b3ebaaa0bd7e6ebc67b6d01452e4336

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page