NAME
mrcal-show-projection-diff - Visualize the difference in projection between N models
SYNOPSIS
$ mrcal-show-projection-diff before.cameramodel after.cameramodel... a plot pops up showing how these two models differ in their projections
DESCRIPTION
The operation of this tool is documented at
L<http://mrcal.secretsauce.net/differencing.html>
This tool visualizes the results of mrcal.projection_diff()
It is often useful to compare the projection behavior of two camera models. For instance, one may want to validate a calibration by comparing the results of two different chessboard dances. Or one may want to evaluate the stability of the intrinsics in response to mechanical or thermal stresses. This tool makes these comparisons, and produces a visualization of the results.
In the most common case we're given exactly 2 models to compare. We then display the projection difference as either a vector field or a heat map. If we're given more than 2 models, then a vector field isn't possible and we instead display as a heatmap the standard deviation of the differences between models 1..N and model0.
The top-level operation of this tool:
- Grid the imager - Unproject each point in the grid using one camera model - Apply a transformation to map this point from one camera's coord system to the
other. How we obtain this transformation is described below - Project the transformed points to the other camera - Look at the resulting pixel difference in the reprojection
Several arguments control how we obtain the transformation. Top-level logic:
if --intrinsics-only:Rt10 = identity_Rt()else:if --radius 0:Rt10 = relative_extrinsics(models)else:Rt10 = implied_Rt10__from_unprojections()
The details of how the comparison is computed, and the meaning of
OPTIONS
THE ARGUMENTS
controlling this, are in the docstring of mrcal.projection_diff().
POSITIONAL ARGUMENTS
models Camera models to diff
OPTIONAL ARGUMENTS
-h, --help show this help message and exit--gridn GRIDN GRIDN How densely we should sample the imager. By default weuse a 60x40 grid--distance DISTANCE Has an effect only without --intrinsics-only. Theprojection difference varies depending on the range tothe observed world points, with the queried range setin this argument. If omitted we look out to infinity.We can also fit multiple distances at the same time bypassing them here in a comma-separated, whitespace-less list. If multiple distances are given, we fit theimplied-by-the-intrinsics transformation using ALL thedistances, but we display the difference for the FIRSTdistance given.--intrinsics-only If given, we evaluate the intrinsics of each lens inisolation by assuming that the coordinate systems ofeach camera line up exactly--where WHERE WHERE Center of the region of interest for this diff. Usedonly without --intrinsics-only and without "--radius0". It is usually impossible for the models to matcheverywhere, but focusing on a particular area can workbetter. The implied transformation will be fit tomatch as large as possible an area centered on thisargument. If omitted, we will focus on the center ofthe imager--radius RADIUS Radius of the region of interest. If ==0, we do NOTfit an implied transformation at all, but use thetransformations in the models. If omitted or <0, weuse a "reasonable" value: the whole imager if we'reusing uncertainties, or min(width,height)/6 if --no-uncertainties. To fit with data across the wholeimager in either case, pass in a very large radius--observations If given, I show where the chessboard corners wereobserved at calibration time. These should correspondto the low-diff regions.--valid-intrinsics-regionIf given, I overlay the valid-intrinsics regions ontothe plot--cbmax CBMAX Maximum range of the colorbar--title TITLE Title string for the plot. Overrides the defaulttitle. Exclusive with --extratitle--extratitle EXTRATITLEAdditional string for the plot to append to thedefault title. Exclusive with --title--vectorfield Plot the diff as a vector field instead of as a heatmap. The vector field contains more information(magnitude AND direction), but is less clear at aglance--vectorscale VECTORSCALEIf plotting a vectorfield, scale all the vectors bythis factor. Useful to improve legibility if thevectors are too small to see--directions If given, the plots are color-coded by the directionof the error, instead of the magnitude--no-uncertainties Used only without --intrinsics-only and without "--radius 0". By default we use the uncertainties in themodel to weigh the fit. This will focus the fit on theconfident region in the models without --where or--radius. The computation will run faster with --no-uncertainties, but the default --where and --radiusmay need to be adjusted--hardcopy HARDCOPY Write the output to disk, instead of making aninteractive plot--terminal TERMINAL gnuplotlib terminal. The default is good almostalways, so most people don't need this option--set SET Extra 'set' directives to gnuplotlib. Can be givenmultiple times--unset UNSET Extra 'unset' directives to gnuplotlib. Can be givenmultiple times
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