MRCAL(1)
πΈ MRCAL(1) β mrcal: camera projection, calibration toolkit πΈ
okay bestie, welcome to the mrcal-from-ros page π (that's the manual for section 1, MRCAL, iykyk). it's a lil tool that eats ROS/OpenCV camera models and spits out .cameramodel files. no glow-up, no makeover β just a format glow-transfer. let's go β¨
π NAME π
mrcal-from-ros β literally just converts a ROS/OpenCV-formatted camera model into the .cameramodel file format. that's it, that's the whole job, and she does it flawlessly π
π¦ SYNOPSIS π¦
like. picture this. you have a yaml. it's giving very OpenCV:
$ cat model1.yaml
image_width: 2448
image_height: 2050
camera_name: prosilica
camera_matrix:
rows: 3
cols: 3
data: [4827.94, 0, 1223.5, 0, 4835.62, 1024.5, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.41527, 0.31874, -0.00197, 0.00071, 0]
rectification_matrix:
rows: 3
cols: 3
data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
rows: 3
cols: 4
data: [4827.94, 0, 1223.5, 0, 0, 4835.62, 1024.5, 0, 0, 0, 1, 0]
and then you hit her with the classic:
$ mrcal-from-ros model1.yaml model2.yaml
Wrote model1.cameramodel
Wrote model2.cameramodel
and boom π₯ now you got this:
$ cat model1.cameramodel
{
'lensmodel': 'LENSMODEL_OPENCV5',
# intrinsics are fx,fy,cx,cy,distortion0,distortion1,....
'intrinsics': [ 4827.94, 4835.62, 1223.5, 1024.5, -0.41527, 0.31874, -0.00197, 0.00071, 0,],
'rt_cam_ref': [ 0, 0, 0, 0, 0, 0,],
'extrinsics': [ 0, 0, 0, 0, 0, 0,], # for compatibility with mrcal < 2.5
'imagersize': [ 2448, 2050,],
}
and if you're feeling β¨pipelineβ¨ energy, she reads from stdin too:
$ rostopic echo -n1 -b tst.bag /camera/camera_info \
| head -n -1 \
| mrcal-from-ros \
> model.cameramodel
not me piping rosbag topics straight into a cameramodel π iconic behavior fr fr
β¨ DESCRIPTION β¨
the file formats mrcal supports are all written down over here, go look:
<https://mrcal.secretsauce.net/cameramodels.html#cameramodel-file-formats>
so like, what does this tool actually do? it takes the model(s) you hand it and converts them to the cameramodel file format. no changes to the content are made β bestie, she is purely a format converter π«Ά. she does not fit anything, she does not remix, she does not pick a different lens model. (that's a whole different girl: the mrcal-convert-lensmodel tool, which actually fits different lens models. know the difference π
)
you give her model filenames on the commandline. output gets written to the same directory, with the same filename, but with a .cameramodel extension. slay.
if the model is omitted, or you literally just pass "-", then the input is read from standard input and the output is written to standard output. very stdin/stdout of her π
note: there's no corresponding mrcal-to-ros tool at this time, because the behavior of such a tool isn't well-defined. talk to me if this would be useful to you, so we can clarify what it should do, exactly. π (yes that's a real invitation, come say hi)
π OPTIONS π
π POSITIONAL ARGUMENTS
modelβ the input camera model. hand it over, bestie π
πΈ OPTIONAL ARGUMENTS
-h,--helpβ show this help message and exit. the "wait what does this do again" button β¨--force,-fβ by default, existing files are not overwritten. pass--forceto overwrite them without complaint. no questions asked, no warnings, she just goes π--outdir OUTDIRβ directory to write the output models into. if omitted, we write the output models to the same directory as the input models. very "where do you want it" energy π
π REPOSITORY π
<https://www.github.com/dkogan/mrcal>
come through, star the repo, it's giving main character energy β
π§ AUTHOR π§
Dima Kogan, "<dima@secretsauce.net>" β the icon, the legend, the moment π
π 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
okay that's the whole page, you're officially fluent in mrcal-from-ros π¦ this was mrcal 2.5.2-4build1, dated 2026-03-20, and it lives in manual section MRCAL(1). go convert something cute, bestie π
β¨π
π¦ 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