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
- (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.4.1.tar.gz
.
File metadata
- Download URL: bbo-calibcam-2.4.1.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab2a61d698ee558ca531b6ec119cb5857e4dd5604089ad20951083a8acd5797 |
|
MD5 | 1a07fd690b15d741baf5c2f6663847b7 |
|
BLAKE2b-256 | da7a29730ba2491790690eddd42c2461d21822b786186203b0904c6b2b2a6ca3 |
File details
Details for the file bbo_calibcam-2.4.1-py3-none-any.whl
.
File metadata
- Download URL: bbo_calibcam-2.4.1-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c96f9097d161620c4554adf3f4bb08469625f0985d9cbc026c5a77609c73098a |
|
MD5 | 3a3c09e52c7b256da1b70b70d908d11c |
|
BLAKE2b-256 | 7996576886847ef9a09fbab29a55434c861fd22ffb732d1d2334cf80765c25f6 |