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
- (If not already done:) Install Anaconda
- Create conda env
conda env create -f https://raw.githubusercontent.com/bbo-lab/calibcam/main/environment.yml
- Switch to calibcam environment:
conda activate calibcam
Usage
Windows
- From
[repository]/boards
, copy the appropriate board into the calibration video directory and rename toboard.npy
- Open Anaconda prompt via Start Menu
- Switch to calibcam environment:
conda activate calibcam
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bbo-calibcam-2.1.4.tar.gz
.
File metadata
- Download URL: bbo-calibcam-2.1.4.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7d3395e8c1bee2ded523af872144977648b24c9f121ff51c8bf58a327abf043 |
|
MD5 | 6206d5d72f3f8fbd491ceede65b04888 |
|
BLAKE2b-256 | 7d968d704add15737dd6e7c11c6303a45dd2eed236642004955872341d3dc56b |
File details
Details for the file bbo_calibcam-2.1.4-py3-none-any.whl
.
File metadata
- Download URL: bbo_calibcam-2.1.4-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2cb3078fa8f6281d10b9f1b7200e7374cf3b8b3f81a66b98dfc64a6971f6cb |
|
MD5 | 1e3e45243ee1076235f5f4a9f0741dd0 |
|
BLAKE2b-256 | 11b40463b0066877a3a5cc96b009d74086ca57316de4b47a4f2e9d84f72a7b13 |