NAME
mrcal-show-residuals - Visualize calibration residuals in an imager
SYNOPSIS
$ mrcal-show-residuals --vectorfield left.cameramodel... a plot pops up showing the vector field of residuals for this camera
DESCRIPTION
This tool supports several different modes, selected by the commandline arguments. Exactly one of these mode options must be given:
--vectorfield Visualize the optimized residuals as a vector field. Eachvector runs from the observed chessboard corner to itsprediction at the optimal solution.--magnitudes Visualize the optimized residual magnitudes as color-codedpoints. Similar to --vectorfield, but instead of a vector, eachresidual is plotted as a colored circle, coded by the MAGNITUDEof the error. This is usually more legible.--directions Visualize the optimized residual directions as color-codedpoints. Similar to --vectorfield, but instead of a vector, eachresidual is plotted as a colored circle, coded by the DIRECTIONof the error. This is very useful in detecting biases caused bya poorly-fitting lens model: these show up as clusters ofsimilar color, instead of a random distribution.--regional Visualize the optimized residuals, broken up by region. The imagerof a camera is subdivided into bins. The residual statistics arethen computed for each bin separately. We can then clearly seeareas of insufficient data (observation counts will be low). Andwe can clearly see lens-model-induced biases (non-zero mean) andwe can see heteroscedasticity (uneven standard deviation). Themrcal-calibrate-cameras tool uses these metrics to construct avalid-intrinsics region for the models it computes. This serves asa quick/dirty method of modeling projection reliability, which canbe used even if projection uncertainty cannot be computed.--histogram Visualize the distribution of the optimized residuals. We displaya histogram of residuals and overlay it with an idealizedgaussian distribution.
OPTIONS
POSITIONAL ARGUMENTS
model Camera model that contains the optimization_inputsthat describe the solve. The displayed observationsmay come from ANY of the cameras in the solve, notnecessarily the one given by this model
OPTIONAL ARGUMENTS
-h, --help show this help message and exit--vectorfield Visualize the optimized residuals as a vector field--magnitudes Visualize the optimized residual magnitudes as color-coded points--directions Visualize the optimized residual directions as color-coded points--regional Visualize the optimized residuals, broken up by region--histogram Visualize the distribution of the optimized residuals--histogram-this-cameraIf given, we show the histogram for residuals for THIScamera only. Otherwise (by default) we display theresiduals for all the cameras in this solve. Implies--histogram--valid-intrinsics-regionIf given, I overlay the valid-intrinsics regions ontothe plot. Applies to all the modes except --histogram--gridn GRIDN GRIDN How densely we should bin the imager. By default weuse a 20x14 grid of bins. Applies only if --regional--binwidth BINWIDTH The width of binds used for the histogram. Defaults to0.02 pixels. Applies only if --histogram--vectorscale VECTORSCALEScale all the vectors by this factor. Useful toimprove legibility if the vectors are too small tosee. Applies only if --vectorfield--cbmax CBMAX Maximum range of the colorbar used in --vectorfield,--magnitudes. If omitted, we autoscale--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--hardcopy HARDCOPY Write the output to disk, instead of making aninteractive plot. If --regional, then several plotsare made, and the --hardcopy argument is a base name:"--hardcopy /a/b/c/d.pdf" will produce plots in"/a/b/c/d.XXX.pdf" where XXX is the type of plot beingmade--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