MRCAL(1)
π MRCAL(1) π
okay so bestie, listen up: this is mrcal-graft-models, part of the mrcal camera projection + calibration toolkit, and it's genuinely one of the most useful little gremlins in the whole box. it takes the intrinsics from one cameramodel and the extrinsics from another and grafts them together like the world's most careful plant parent. πͺ΄β¨
πΈ NAME πΈ
mrcal-graft-models β combines the intrinsics of one cameramodel with the extrinsics of another. it's giving frankenstein but make it geometrically valid. π
β¨ SYNOPSIS β¨
# We have intrinsics.cameramodel containing improved intrinsics from a later
# calibration, and extrinsics.cameramodel that has the old intrinsics, but the
# right extrinsics
$ mrcal-graft-models
intrinsics.cameramodel
extrinsics.cameramodel
> joint.cameramodel
Combined
intrinsics from 'intrinsics.cameramodel'
Extrinsics from 'exrinsics.cameramodel'
$ mrcal-show-projection-diff
joint.cameramodel
extrinsics.cameramodel
[A plot pops up showing a low difference, just representing the two sets of
intrinsics. The recalibrated models have a large implied extrinsics
difference, but the diff tool computed and applised the implied
transformation]
$ mrcal-show-projection-diff
--radius 0
joint.cameramodel
extrinsics.cameramodel
[A plot pops up showing a high difference. Here the diff tool didn't apply the
implied transformation, so the differences in extrinsics are evident. Thus
here, joint.cameramodel is not a drop-in replacement for
extrinsics.cameramodel]
$ mrcal-graft-models
--radius -1
intrinsics.cameramodel
extrinsics.cameramodel
> joint.cameramodel
Transformation cam1 <-- cam0: rotation: 8.429 degrees, translation: [0. 0. 0.] m
Combined
intrinsics from 'intrinsics.cameramodel'
Extrinsics from 'exrinsics.cameramodel'
$ mrcal-show-projection-diff
--radius 0
joint.cameramodel
extrinsics.cameramodel
[A plot pops up showing a low difference. The graft tool applied the implied
transformation, so the models match without the diff tool needing to transform
anything. Thus here, joint.cameramodel IS a drop-in replacement for
extrinsics.cameramodel]
like, look at that whole glow-up arc in the last example. from "not a drop-in replacement" to "IS a drop-in replacement". character development fr fr. ππ
π¦ DESCRIPTION π¦
so this tool combines intrinsics and extrinsics from different sources into a single model. the output gets written to standard output. no file gets touched unless you redirect it, okay? you're the main character of the redirection. π
a common use case is a system where the intrinsics get calibrated before the cameras are moved to their final location, and then the extrinsics get computed separately after the cameras are moved. classic. we love a two-phase calibration moment. β¨
now here's the tea: if we've computed such a combined model, and we then decide to recompute the intrinsics afterwards, we can graft the new intrinsics onto the previous extrinsics. but by default this would NOT be a drop-in replacement for the previous model, because the intrinsics come with an implied geometric transformation, and that implied transformation will be different in the new intrinsics. π
by passing a non-zero --radius value, we can compute and apply that implied geometric transformation, so the combined model becomes usable as a drop-in replacement. slay. π₯
the implied transformation logic is controlled by a number of commandline arguments β the same ones used by the mrcal-show-projection-diff tool. the only difference in options is that THIS tool uses --radius 0 by default, so we do not compute or apply the implied transformation unless you explicitly ask. pass --radius with a non-zero argument to compute and apply the implied transformation. periodt. π
bestie warning: if you forget the --radius non-zero thing, you do NOT get the drop-in-replacement magic. the default is intentionally "do nothing extra". don't come crying to me. π«Ά
π OPTIONS π
π POSITIONAL ARGUMENTS
intrinsicsβ input camera model for the intrinsics. if-is given, we read standard input. both the intrinsics and extrinsics sources may not be-. pick one, bestie, not both. πextrinsicsβ input camera model for the extrinsics. if-is given, we read standard input. both the intrinsics and extrinsics sources may not be-. same deal, same drama. π«Ά
π§ OPTIONAL ARGUMENTS
-h,--helpβ show this help message and exit. the classic escape hatch. πͺβ¨--gridn GRIDN GRIDNβ used if we're computing the implied-by-the-intrinsics transformation. how densely we should sample the imager. by default we use a 60x40 grid. more grid = more sample-y = more compute-y. you decide. π--distance DISTANCEβ used if we're computing the implied-by-the-intrinsics transformation. by default we compute the implied transformation for points infinitely far away from the camera. if we want to look closer in, the desired observation distance can be given in this argument. we can also fit multiple distances at the same time by passing them here in a comma-separated, whitespace-less list. so like, no spaces, okay? none. π«--where WHERE WHEREβ used if we're computing the implied-by-the-intrinsics transformation. center of the region of interest used for the transformation fit. it is usually impossible for the models to match everywhere, but focusing on a particular area can work better. the implied transformation will be fit to match as large as possible an area centered on this argument. if omitted, we will focus on the center of the imager. main character energy: centered. π―--radius RADIUSβ used if we're computing the implied-by-the-intrinsics transformation. radius of the region of interest. if==0(the default), we do NOT fit an implied transformation at all. if<0, we use a "reasonable" value: the whole imager if we're using uncertainties, ormin(width,height)/6if--no-uncertainties. to fit with data across the whole imager in either case, pass in a very large radius. this one option is literally the whole plot twist of this tool. π--no-uncertaintiesβ used if we're computing the implied-by-the-intrinsics transformation. by default we use the uncertainties in the model to weigh the fit. this will focus the fit on the confident region in the models without--whereor--radius. the computation will run faster with--no-uncertainties, but the default--whereand--radiusmay need to be adjusted. speed vs. vibes, pick your fighter. β‘
π REPOSITORY π
<https://www.github.com/dkogan/mrcal>
π 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
okay that's the whole thing, bestie. mrcal 2.5.2-4build1, dated 2026-03-20 β go forth and graft your models. you got this. πβ¨ππ¦πΈ
π¦ 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