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.

Installation

Windows

  1. (If not already done:) Install Anaconda
  2. Create conda env conda env create -f https://raw.githubusercontent.com/bbo-lab/calibcam/main/environment.yml
  3. Switch to calibcam environment: conda activate calibcam

Usage

Windows

  1. From [repository]/boards, copy the appropriate board into the calibration video directory and rename to board.npy
  2. Open Anaconda prompt via Start Menu
  3. Switch to calibcam environment: conda activate calibcam
  4. Run the program with python -m calibcam --videos [LIST OF VIDEOS TO INCLUDE]

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 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()

Board

Besides the videos, each calibration folder (folder of first video) needs to contain a file board.npy. For the boards at BBO, files are available in the boards directory of the repository. Else, files must be created, containing a dict with the following entries:

* boardWidth: int - number of checkerboard squares
* boardHeight: int - number of checkerboard squares
* square_size_real: float - Absolute edge length of checkerboard squares, unit determines unit of calibration
* marker_size: float - Relative marker size
* dictionary_type: int - Aruco dictionary type

These values are used to create the board in the following way:

board = cv2.aruco.CharucoBoard_create(board_params['boardWidth'],
                                          board_params['boardHeight'],
                                          board_params['square_size_real'],
                                          board_params['marker_size'] * board_params['square_size_real'],
                                          cv2.aruco.getPredefinedDictionary( 
                                              board_params['dictionary_type']))

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-2.3.1.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

bbo_calibcam-2.3.1-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file bbo-calibcam-2.3.1.tar.gz.

File metadata

  • Download URL: bbo-calibcam-2.3.1.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bbo-calibcam-2.3.1.tar.gz
Algorithm Hash digest
SHA256 d9261352af429e0d1bf81b717cd50ac63c3517e0b65e89035190225db4255123
MD5 77103b1952040131a075b230762a81b4
BLAKE2b-256 3d123f17f8e51e5fa08a7e0fd69a08cd02d601c31bc01a1334b30aa098460416

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bbo_calibcam-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bbo_calibcam-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcddc4161e87db58d4b0b7b38059108c27e6e16fed28b861ebba0dd6a88300ba
MD5 9720a474431272eaded793ab27ee63ce
BLAKE2b-256 2613b7b9fc37c94ecc5ab47796e9e1ee3080571adb69a4a90691865d06b4a026

See more details on using hashes here.

Supported by

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