.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MRCAL 1" .TH MRCAL 1 2024-02-04 "mrcal 2.3-4.1~exp1" "mrcal: camera projection, calibration toolkit" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME mrcal\-show\-projection\-diff \- Visualize the difference in projection between N models .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& $ mrcal\-show\-projection\-diff before.cameramodel after.cameramodel \& ... a plot pops up showing how these two models differ in their projections .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The operation of this tool is documented at .PP .Vb 1 \& L .Ve .PP This tool visualizes the results of mrcal.\fBprojection_diff()\fR .PP 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. .PP 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. .PP The top-level operation of this tool: .PP \&\- 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 .PP Several arguments control how we obtain the transformation. Top-level logic: .PP .Vb 7 \& if \-\-intrinsics\-only: \& Rt10 = identity_Rt() \& else: \& if \-\-radius 0: \& Rt10 = relative_extrinsics(models) \& else: \& Rt10 = implied_Rt10_\|_from_unprojections() .Ve .PP The details of how the comparison is computed, and the meaning of .SH OPTIONS .IX Header "OPTIONS" .SS "THE ARGUMENTS" .IX Subsection "THE ARGUMENTS" controlling this, are in the docstring of mrcal.\fBprojection_diff()\fR. .SS "POSITIONAL ARGUMENTS" .IX Subsection "POSITIONAL ARGUMENTS" .Vb 1 \& models Camera models to diff .Ve .SS "OPTIONAL ARGUMENTS" .IX Subsection "OPTIONAL ARGUMENTS" .Vb 10 \& \-h, \-\-help show this help message and exit \& \-\-gridn GRIDN GRIDN How densely we should sample the imager. By default we \& use a 60x40 grid \& \-\-distance DISTANCE Has an effect only without \-\-intrinsics\-only. The \& projection difference varies depending on the range to \& the observed world points, with the queried range set \& in this argument. If omitted we look out to infinity. \& We can also fit multiple distances at the same time by \& passing them here in a comma\-separated, whitespace\- \& less list. If multiple distances are given, we fit the \& implied\-by\-the\-intrinsics transformation using ALL the \& distances, but we display the difference for the FIRST \& distance given. \& \-\-intrinsics\-only If given, we evaluate the intrinsics of each lens in \& isolation by assuming that the coordinate systems of \& each camera line up exactly \& \-\-where WHERE WHERE Center of the region of interest for this diff. Used \& only without \-\-intrinsics\-only and without "\-\-radius \& 0". 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 \& \-\-radius RADIUS Radius of the region of interest. If ==0, we do NOT \& fit an implied transformation at all, but use the \& transformations in the models. If omitted or <0, we \& use a "reasonable" value: the whole imager if we\*(Aqre \& using uncertainties, or min(width,height)/6 if \-\-no\- \& uncertainties. To fit with data across the whole \& imager in either case, pass in a very large radius \& \-\-observations If given, I show where the chessboard corners were \& observed at calibration time. These should correspond \& to the low\-diff regions. \& \-\-valid\-intrinsics\-region \& If given, I overlay the valid\-intrinsics regions onto \& the plot \& \-\-cbmax CBMAX Maximum range of the colorbar \& \-\-title TITLE Title string for the plot. Overrides the default \& title. Exclusive with \-\-extratitle \& \-\-extratitle EXTRATITLE \& Additional string for the plot to append to the \& default title. Exclusive with \-\-title \& \-\-vectorfield Plot the diff as a vector field instead of as a heat \& map. The vector field contains more information \& (magnitude AND direction), but is less clear at a \& glance \& \-\-vectorscale VECTORSCALE \& If plotting a vectorfield, scale all the vectors by \& this factor. Useful to improve legibility if the \& vectors are too small to see \& \-\-directions If given, the plots are color\-coded by the direction \& of the error, instead of the magnitude \& \-\-no\-uncertainties Used only without \-\-intrinsics\-only and without "\-\- \& radius 0". 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 \-\-where or \& \-\-radius. The computation will run faster with \-\-no\- \& uncertainties, but the default \-\-where and \-\-radius \& may need to be adjusted \& \-\-hardcopy HARDCOPY Write the output to disk, instead of making an \& interactive plot \& \-\-terminal TERMINAL gnuplotlib terminal. The default is good almost \& always, so most people don\*(Aqt need this option \& \-\-set SET Extra \*(Aqset\*(Aq directives to gnuplotlib. Can be given \& multiple times \& \-\-unset UNSET Extra \*(Aqunset\*(Aq directives to gnuplotlib. Can be given \& multiple times .Ve .SH REPOSITORY .IX Header "REPOSITORY" .SH AUTHOR .IX Header "AUTHOR" Dima Kogan, \f(CW\*(C`\*(C'\fR .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright (c) 2017\-2021 California Institute of Technology ("Caltech"). U.S. Government sponsorship acknowledged. All rights reserved. .PP Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at .PP .Vb 1 \& http://www.apache.org/licenses/LICENSE\-2.0 .Ve