Omnidirectional Camera Calibration
Key features
- 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
Usage
- Corner detection (see
python -m omnicalib.detect --help
for detailed argument description)
python -m omnical.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 omnical --degree <degree> detections.pickle
Result
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
Method
For a detailed description see method.md.
Simulation
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.