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 coordinates).

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

Uploaded Source

Built Distribution

bbo_calibcam-2.1.5-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bbo-calibcam-2.1.5.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.6

File hashes

Hashes for bbo-calibcam-2.1.5.tar.gz
Algorithm Hash digest
SHA256 cc6d2cb54df1fdfc4806f1c252b2abd6892e09d8d6a19ea0b93751976e438c07
MD5 3c268bffbe1063e2cf9760031a3cb435
BLAKE2b-256 096cfa9a0ed57b567c60fe6ef1ff93c626d08eca72526d7520b372b1e4d73e5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bbo_calibcam-2.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2b11c74c766bbae76e0527b6051d896904a0233f11123e450df166c37073cfb4
MD5 320e83a4c453cf453f484070f605adab
BLAKE2b-256 dfa0026c2d9330217a5bbaee1a5271de14046bc9dee770b058e36dde994ce699

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