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

Uploaded Source

Built Distribution

bbo_calibcam-2.2.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bbo-calibcam-2.2.0.tar.gz
Algorithm Hash digest
SHA256 cb862706f89b221f5c10cc7ea966b930c1a9fa1e523e2292ebb5f342d3a7fa2a
MD5 e9c2f82f533a62510d586dcaebfae299
BLAKE2b-256 e13e684963e11ee4129d1c08404006336221ee1f671fe1d12f5fd6d5f2212ac4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bbo_calibcam-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64b929c9a83adb694299e2ce0cd1d48bfa6578f01dbe42ea6c12bf3468d6ddc3
MD5 33c4520b80a6238a570c52848730fd48
BLAKE2b-256 1304779ac7694ef88c18ec13c46081c3ee20ad0efb73923b3926f40529e085df

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