NAME
mrcal-graft-models - Combines the intrinsics of one cameramodel with the extrinsics of another
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-modelsintrinsics.cameramodelextrinsics.cameramodel> joint.cameramodelCombinedintrinsics from 'intrinsics.cameramodel'Extrinsics from 'exrinsics.cameramodel'$ mrcal-show-projection-diffjoint.cameramodelextrinsics.cameramodel[A plot pops up showing a low difference, just representing the two sets ofintrinsics. The recalibrated models have a large implied extrinsicsdifference, but the diff tool computed and applised the impliedtransformation]$ mrcal-show-projection-diff--radius 0joint.cameramodelextrinsics.cameramodel[A plot pops up showing a high difference. Here the diff tool didn't apply theimplied transformation, so the differences in extrinsics are evident. Thushere, joint.cameramodel is not a drop-in replacement forextrinsics.cameramodel]$ mrcal-graft-models--radius -1intrinsics.cameramodelextrinsics.cameramodel> joint.cameramodelTransformation cam1 <-- cam0: rotation: 8.429 degrees, translation: [0. 0. 0.] mCombinedintrinsics from 'intrinsics.cameramodel'Extrinsics from 'exrinsics.cameramodel'$ mrcal-show-projection-diff--radius 0joint.cameramodelextrinsics.cameramodel[A plot pops up showing a low difference. The graft tool applied the impliedtransformation, so the models match without the diff tool needing to transformanything. Thus here, joint.cameramodel IS a drop-in replacement forextrinsics.cameramodel]
DESCRIPTION
This tool combines intrinsics and extrinsics from different sources into a single model. The output is written to standard output.
A common use case is a system where the intrinsics are calibrated prior to moving the cameras to their final location, and then computing the extrinsics separately after the cameras are moved.
If we have computed such a combined model, and we decide to recompute the intrinsics afterwards, we can graft the new intrinsics to the previous extrinsics. By default, this wouldn't be a drop-in replacement for the previous model, since the intrinsics come with an implied geometric transformation, which will be different in the new intrinsics. By passing a non-zero --radius value, we can compute and apply the implied geometric transformation, so the combined model would be usable as a drop-in replacement.
The implied transformation logic is controlled by a number of commandline arguments, same ones as 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 asked. Pass --radius with a non-zero argument to compute and apply the implied transformation.
OPTIONS
POSITIONAL ARGUMENTS
intrinsics Input camera model for the intrinsics. If "-" is given,we read standard input. Both the intrinsics andextrinsics sources may not be "-"extrinsics Input camera model for the extrinsics. If "-" is given,we read standard input. Both the intrinsics andextrinsics sources may not be "-"
OPTIONAL ARGUMENTS
-h, --help show this help message and exit--gridn GRIDN GRIDN Used if we're computing the implied-by-the-intrinsicstransformation. How densely we should sample theimager. By default we use a 60x40 grid--distance DISTANCE Used if we're computing the implied-by-the-intrinsicstransformation. By default we compute the impliedtransformation for points infinitely far away from thecamera. If we want to look closer in, the desiredobservation distance can be given in this argument. Wecan also fit multiple distances at the same time bypassing them here in a comma-separated, whitespace-lesslist--where WHERE WHERE Used if we're computing the implied-by-the-intrinsicstransformation. Center of the region of interest usedfor the transformation fit. It is usually impossiblefor the models to match everywhere, but focusing on aparticular area can work better. The impliedtransformation will be fit to match as large aspossible an area centered on this argument. If omitted,we will focus on the center of the imager--radius RADIUS Used if we're computing the implied-by-the-intrinsicstransformation. Radius of the region of interest. If==0 (the default), we do NOT fit an impliedtransformation at all. If <0, we use a "reasonable"value: the whole imager if we're using uncertainties,or min(width,height)/6 if --no-uncertainties. To fitwith data across the whole imager in either case, passin a very large radius--no-uncertainties Used if we're computing the implied-by-the-intrinsicstransformation. By default we use the uncertainties inthe model to weigh the fit. This will focus the fit onthe confident region in the models without --where or--radius. The computation will run faster with --no-uncertainties, but the default --where and --radius mayneed to be adjusted
REPOSITORY
<https://www.github.com/dkogan/mrcal>
AUTHOR
Dima Kogan, "<[email protected]>"
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