mrcal-from-kalibr - Converts a kalibr-formatted camera model to the .cameramodel file format
$ mrcal-from-kalibr model.yaml
Wrote model-cam0.cameramodel
Wrote model-cam1.cameramodel
File formats supported by mrcal are described at http://mrcal.secretsauce.net/cameramodels.html#cameramodel-file-formats
This tool converts the given model(s) to the mrcal-native .cameramodel file format. No changes to the content are made; this is purely a format converter (the mrcal-convert-lensmodel tool fits different lens models instead). Model filenames are given on the commandline. Output is written to the same directory, with the same filename, but annotated with the camera name from the data file, and with a .cameramodel extension.
If the model is omitted or given as "-", the input is read from standard input, and the output is written to standard output
Unlike mrcal .cameramodel files where one camera is described by one file, the .yaml files used by kalibr are intended to describe multiple cameras. This format conversion tool will write out multiple .cameramodel file to represent the given data. To select a single camera, pass --camera CAMERA.
By default we set the extrinsics of camera-0 as they appear in the input: the "previous" camera from camera-0 is used as the reference coordinate system. If we want to force camera-0 to have an identity transform, pass --cam0-at-reference. Usually this will be the case anyway in the input data, but this option makes sure.
The kalibr format is described at https://github.com/ethz-asl/kalibr/wiki/Yaml-formats
At this time we only support
- LENSMODEL_PINHOLE
- LENSMODEL_OPENCV4
- LENSMODEL_CAHVOR (experimental)
- LENSMODEL_CAHVORE (experimental)
which corresponds to
camera_model == 'pinhole' and distortion_model in ('radtan','none')
model Input camera model; '-' to read standard input
-h, --help show this help message and exit
--cam0-at-reference By default we set the extrinsics of camera-0 as they
appear in the input. If we want to force camera-0 to
have an identity transform, pass --cam0-at-reference.
Usually this will be the case anyway in the input data,
but this option makes sure
--camera CAMERA Kalibr model files may contain multiple cameras,
selected by this argument. If omitted, all available
cameras will be read. If given, we read JUST the one
requested camera
--force, -f By default existing files are not overwritten. Pass
--force to overwrite them without complaint
--outdir OUTDIR Directory to write the output models into. If omitted,
we write the output models to the same directory as the
input models
https://www.github.com/dkogan/mrcal
Dima Kogan, <dima@secretsauce.net>
Copyright (c) 2017-2023 California Institute of Technology ("Caltech"). U.S. Government sponsorship acknowledged. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0