- pure python
- initial solution based on A Toolbox for Easily Calibrating Omnidirectional Cameras (Davide Scaramuzza, Agostino Martinelli, Roland Siegwart)
- Optimized solution via Levenberg–Marquardt algorithm on reprojection error
- Lie algebra based extrinsics optimization
- Corner detection (see
python -m omnicalib.detect --help
for detailed argument description)
python -m omnicalib.detect --chessboard <rows> <columns> <square-size> --max-dim <max-dim> --threads <threads> <image-folder>
The file detections.pickle
is written, which contains a pickled dictionary with the following format
{
'detections': {
<image_path_0>: {'image_points': <image_points>, 'object_points': <object_points>},
...
}
- Image paths (
pathlib.Path
) are absolute image_points
aretorch.Tensor
with shapeN x 2
and dtypetorch.float64
object_points
aretorch.Tensor
with shapeN x 3
and dtypetorch.float64
and third colum, the z coordinate, all zeros
If an external corner detection method is used, this file can simply be written manually.
- Calibration (see
python -m omnicalib --help
for detailed argument description)
python -m omnicalib --degree <degree> detections.pickle
A calibration.yml
file (see example_calibration.yml) containing
extrinsics
as list of3 x 4
matricespoly_incident_angle_to_radius
, a polynom that converts incident angle to image radiuspoly_radius_to_z
, a polynom that converts radius to z component of view vectorprincipal_point
in pixel
Install the latest wheel with
pip install https://github.com/tasptz/py-omnicalib/releases/download/<wheel_url>
For a detailed description see method.md.
Play with the calibration on simulated data with the provided jupyter lab notebook. It generates randomized data for the following ideal projection models
- equidistant
- stereographic
- orthographic
- equisolid
, see Large Area 3D Human Pose Detection Via Stereo Reconstruction in Panoramic Cameras for a detailed description.
Jupyter lab notebook, example results
If you would like to reference this work, see the following BibTeX suggestion
@misc{pyomnicalib,
author = {Pönitz, Thomas},
title = {Python Omnidirectional Camera Calibration},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/tasptz/py-omnicalib}}
}