logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mrcal-from-kalibr - Converts a kalibr-formatted camera model to the .cameramodel file format

Author

       Dima Kogan, "<dima@secretsauce.net>"

Description

       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')

Name

       mrcal-from-kalibr - Converts a kalibr-formatted camera model to the .cameramodel file format

Options

POSITIONALARGUMENTS
         model                Input camera model; '-' to read standard input

   OPTIONALARGUMENTS
         -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

Repository

       <https://www.github.com/dkogan/mrcal>

Synopsis

         $ mrcal-from-kalibr model.yaml
         Wrote model-cam0.cameramodel
         Wrote model-cam1.cameramodel

See Also