MRCAL(1)
β¨ MRCAL-FROM-KALIBR β¨
okay bestie, welcome to the mrcal manual β this one is mrcal: camera projection, calibration toolkit, and today we're doing MRCAL(1). buckle up π
πΈ NAME πΈ
mrcal-from-kalibr</pulple> β the lil bestie that converts a kalibr-formatted camera model into the .cameramodel file format π
(yeah it's a format glow-up, not a whole personality transplant, we'll get there)
π¦ SYNOPSIS π¦
watch this, it's literally the whole plot:
$ cat model.yaml
cam0:
camera_model: pinhole
intrinsics: [461.629, 460.152, 362.680, 246.049]
distortion_model: radtan
distortion_coeffs: [-0.27695497, 0.06712482, 0.00087538, 0.00011556]
T_cam_imu:
- [0.01779318, 0.99967549,-0.01822936, 0.07008565]
- [-0.9998017, 0.01795239, 0.00860714,-0.01771023]
- [0.00893160, 0.01807260, 0.99979678, 0.00399246]
- [0.0, 0.0, 0.0, 1.0]
timeshift_cam_imu: -8.121e-05
rostopic: /cam0/image_raw
resolution: [752, 480]
$ mrcal-from-kalibr model.yaml
Wrote model-cam0.cameramodel
$ cat model-cam0.cameramodel
{
'lensmodel': 'LENSMODEL_OPENCV4',
# intrinsics are fx,fy,cx,cy,distortion0,distortion1,....
'intrinsics': [ 461.629, 460.152, 362.68, 246.049, -0.27695497, 0.06712482, 0.00087538, 0.00011556,],
'rt_cam_ref': [ 0, 0, 0, 0, 0, 0,],
'extrinsics': [ 0, 0, 0, 0, 0, 0,], # for compatibility with mrcal < 2.5
'imagersize': [ 752, 480,],
}
likeβ¦ look at that output. ate and left no crumbs ππ
π DESCRIPTION π
okay so first thing, the file formats mrcal supports are all written down here, go be nosy:
<https://mrcal.secretsauce.net/cameramodels.html#cameramodel-file-formats>
This tool converts the model(s) you hand it into the mrcal-native .cameramodel file format. And ngl, that is it β no changes to the content are made, this is purely a format converter. (If you actually want to fit different lens models, that's a different girl: the mrcal-convert-lensmodel tool. know the difference, iykyk π«Ά)
You give the model filenames on the commandline. Output gets written to the same directory, with the same filename, but annotated with the camera name from the data file, and with a .cameramodel extension. slay β¨
If the model is omitted or given as -, the input is read from standard input, and the output is written to standard output. very pipe-friendly of her π
real talk though: unlike mrcal.cameramodelfiles where one camera is described by one file, the.yamlfiles used by kalibr are intended to describe multiple cameras. so this format conversion tool will write out multiple.cameramodelfile to represent the given data. if you only want one of them, 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> β go read it, she's the source fr fr.
At this time we only support:
LENSMODEL_PINHOLELENSMODEL_OPENCV4LENSMODEL_CAHVOR(experimental)LENSMODEL_CAHVORE(experimental)
which corresponds to
camera_model == 'pinhole' and distortion_model in ('radtan','none')
two of those are lowkey experimental, so temper your expectations bestie π§
β¨ OPTIONS β¨
π POSITIONAL ARGUMENTS
modelβ the input camera model; use-to read standard input. give me the goods or give me stdin π«Ά
π OPTIONAL ARGUMENTS
-h,--helpβ show this help message and exit. the classic. the icon.--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. it's the "no like actually make it identity" button π--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. one camera, one vibe, no sharing π―--force,-fβ By default existing files are not overwritten. Pass--forceto overwrite them without complaint. heads up: this one destroys files that are already there, so be sure bestie π--outdir OUTDIRβ Directory to write the output models into. If omitted, we write the output models to the same directory as the input models. put them wherever, she doesn't judge πΈ
π REPOSITORY π
<https://www.github.com/dkogan/mrcal>
go star it, it's free and it's iconic β
π AUTHOR π
Dima Kogan, <dima@secretsauce.net>
π¦ LICENSE AND COPYRIGHT π¦
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
and that's the whole page, bestie!! π
β¨ this was mrcal 2.5.2-4build1, dated 2026-03-20, coming at you straight from the MRCAL(1) manual. go convert something cute, ily, bye π«Άπ
π¦ where this page comes from
- ubuntu resolute: mrcal 2.5.2-4build1 Β· Apache-2.0
- ubuntu stonking: mrcal 2.5.2-4build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms