.\" Automatically generated by Pod::Man 4.14 (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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MRCAL 1" .TH MRCAL 1 "2023-01-30" "mrcal 2.2" "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\-calibrate\-cameras \- Calibrate some synchronized, stationary cameras .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& $ mrcal\-calibrate\-cameras \& \-\-corners\-cache corners.vnl \& \-\-lensmodel LENSMODEL_OPENCV8 \& \-\-focal 1700 \-\-object\-spacing 0.01 \-\-object\-width\-n 10 \& \-\-outdir /tmp \& \-\-pairs \& \*(Aqleft*.png\*(Aq \*(Aqright*.png\*(Aq \& \& ... lots of output as the solve runs ... \& Done! \& RMS reprojection error: 1.9 pixels \& Worst reprojection error: 7.8 pixels \& Noutliers: 319 out of 17100 total points: 1.9% of the data \& \& Wrote /tmp/camera0\-0.cameramodel \& Wrote /tmp/camera0\-1.cameramodel .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This tool uses the generic mrcal platform to solve a common specific problem of N\-camera calibration using observations of a chessboard. Please see the mrcal documentation at for details. .SH "OPTIONS" .IX Header "OPTIONS" .SS "\s-1POSITIONAL ARGUMENTS\s0" .IX Subsection "POSITIONAL ARGUMENTS" .Vb 10 \& images A glob\-per\-camera for the images. Include a glob for \& each camera. It is assumed that the image filenames in \& each glob are of of the form xxxNNNyyy where xxx and \& yyy are common to all images in the set, and NNN \& varies. This NNN is a frame number, and identical \& frame numbers across different globs signify a time\- \& synchronized observation. I.e. you can pass \& \*(Aqleft*.jpg\*(Aq and \*(Aqright*.jpg\*(Aq to find images \& \*(Aqleft0.jpg\*(Aq, \*(Aqleft1.jpg\*(Aq, ..., \*(Aqright0.jpg\*(Aq, \& \*(Aqright1.jpg\*(Aq, ... .Ve .SS "\s-1OPTIONAL ARGUMENTS\s0" .IX Subsection "OPTIONAL ARGUMENTS" .Vb 10 \& \-h, \-\-help show this help message and exit \& \-\-lensmodel LENSMODEL \& Which lens model we\*(Aqre using. This is a string \& "LENSMODEL_....". Required unless we have a \-\-seed. \& See L \& for notes about how to select a model \& \-\-focal FOCAL Initial estimate of the focal length, in pixels. \& Required unless \-\-seed is given. See \& L for \& notes about how to estimate a focal length. This is \& either a single value to use for all the cameras, or a \& comma\-separated whitespace\-less list of values to use \& for each camera. If such a list is given, it must \& match the number of cameras being calibrated \& \-\-imagersize IMAGERSIZE IMAGERSIZE \& Size of the imager. This is only required if we pass \& \-\-corners\-cache AND if none of the image files on disk \& actually exist and if we don\*(Aqt have a \-\-seed. If we do \& have a \-\-seed, the \-\-imagersize values must match the \& \-\-seed exactly \& \-\-outdir OUTDIR Directory for the output camera models \& \-\-object\-spacing OBJECT_SPACING \& Width of each square in the calibration board, in \& meters \& \-\-object\-width\-n OBJECT_WIDTH_N \& How many points the calibration board has per \& horizontal side. If omitted we default to 10 \& \-\-object\-height\-n OBJECT_HEIGHT_N \& How many points the calibration board has per vertical \& side. If omitted, we assume a square object, setting \& height=width \& \-\-seed SEED A comma\-separated whitespace\-less list of camera model \& globs to use as a seed for the intrinsics and \& extrinsics. The number of models must match the number \& of cameras exactly. Expanded globs are sorted \& alphanumerically. This is useful to bootstrap the \& solve or to validate an existing set of models, or to \& recompute just the extrinsics or just the intrinsics \& of a solve. If omitted, we estimate a seed. Exclusive \& with \-\-focal. If given, \-\-imagersize is omitted or it \& must match EXACTLY with whatever is in the \-\-seed \& models \& \-\-jobs JOBS, \-j JOBS How much parallelization we want. Like GNU make. \& Affects only the chessboard corner finder. If we are \& reading a cache file, this does nothing \& \-\-corners\-cache CORNERS_CACHE \& Path to the corner\-finder results. If this file \& exists, I use the corners in this file. If it doesn\*(Aqt \& exist, I invoke mrgingham to compute the corners, and \& I write the results to that path. And THEN I compute \& the calibration off those observations. This file is a \& vnlog with legend "# filename x y level" (exactly what \& mrgingham reports). Each rown is an observed corners. \& If an image had no observations, a single row \& "filename \- \- \-" is expected. The "level" is the \& decimation level used in detecting that corner. "0" \& means "full\-resolution", "1" means "half\-resolution", \& "2" means "quarter\-resolution" and so on. A level of \& "\-" or <0 means "skip this point". This is how \& incomplete board observations are specified. A file \& with a missing "level" column will fill in "0" for all \& corners. A non\-mrgingham grid detector may be used by \& running that separately, and using this option to read \& the output. A detector may output weights instead of a \& decimation level in the last column. Pass \-\-corners\- \& cache\-has\-weights to interpret the data in that way \& \-\-corners\-cache\-has\-weights \& By default the corners we read in \-\-corners\-cache have \& columns "filename x y level". If the last column is a \& weight instead of a decimation level, pass this \& option. This is useful to support non\-mrgingham \& chessboard detectors \& \-\-pairs By default, we are calibrating a set of N independent \& cameras. If we actually have a number of stereo pairs, \& pass this argument. It changes the filename format of \& the models written to disk (cameraPAIR\- \& INDEXINPAIR.cameramodel), and will report some \& uncertainties about geometry inside each pair. \& Consecutive cameras in the given list are paired up, \& and an even number of cameras is required \& \-\-skip\-regularization \& By default we apply regularization in the solver in \& the final optimization. This discourages obviously\- \& wrong solutions, but can introduce a bias. With this \& option, regularization isn\*(Aqt applied \& \-\-skip\-outlier\-rejection \& By default we throw out outliers. This option turns \& that off \& \-\-skip\-extrinsics\-solve \& Keep the seeded extrinsics, if given. Allowed only if \& \-\-seed \& \-\-skip\-intrinsics\-solve \& Keep the seeded intrinsics, if given. Allowed only if \& \-\-seed \& \-\-skip\-calobject\-warp\-solve \& By default we assume the calibration target is \& slightly deformed, and we compute this deformation. If \& we want to assume that it is flat, pass this option. \& \-\-valid\-intrinsics\-region\-parameters VALID_INTRINSICS_REGION_PARAMETERS VALID_INTRINSICS_REGION_PARAMETERS VALID_INTRINSICS_REGION_PARAMETERS VALID_INTRINSICS_REGION_PARAMETERS VALID_INTRINSICS_REGION_PARAMETERS \& For convenience we compute a valid\-intrinsics region \& to describe the results of the calibration. This is a \& watered\-down interpretation of the projection \& uncertainty that is easy to interpret. The logic \& computing this is somewhat crude, and may go away in \& the future. The defaults should be reasonable, so if \& in doubt, leave these alone. The intent is to produce \& usable output even if we\*(Aqre using a lean lens model \& where the computed uncertainty is always overly \& optimistic. We bin the observations into a grid, and \& use mrcal._report_regional_statistics() to get the \& residual statistics in each bin. We then contour the \& bins to produce the valid\-intrinsics region. If we\*(Aqre \& using a rich lens model (LENSMODEL_SPLINED_...), then \& we only look at the uncertainty, and not at the other \& statistics. This argument takes 5 parameters. The \& uncertainty is computed at a range \& valid_intrinsics_region_parameters[4]. If <= 0, I look \& out to infinity. The default is 0. A region is valid \& only if the projection uncertainty < \& valid_intrinsics_region_parameters[0] * \& observed_pixel_uncertainty. The default is 1. A region \& is valid only if the mean\-abs\-residuals is < \& valid_intrinsics_region_parameters[1] (only for lean \& models). The default is 0.5. A region is valid only if \& the residuals stdev is < \& valid_intrinsics_region_parameters[2] * \& observed_pixel_uncertainty (only for lean models). The \& default is 1.5. A region is valid only if it contains \& at least valid_intrinsics_region_parameters[3] \& observations (only for lean models). The default is 3. \& \-\-verbose\-solver By default the final stage of the solver doesn\*(Aqt say \& much. This option turns on verbosity to get lots of \& diagnostics. This is generally not very useful to end \& users \& \-\-explore After the solve open an interactive shell to examine \& the solution .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 (\*(L"Caltech\*(R"). U.S. Government sponsorship acknowledged. All rights reserved. .PP Licensed under the Apache License, Version 2.0 (the \*(L"License\*(R"); You may obtain a copy of the License at .PP .Vb 1 \& http://www.apache.org/licenses/LICENSE\-2.0 .Ve