#+TITLE: mrcal commandline tools

A number of commandline tools are available for common tasks, obviating the need
to write any code. The available tools, with links to their manpages:

* Calibration
- [[file:mrcal-calibrate-cameras.html][=mrcal-calibrate-cameras=]]: Calibrate N cameras. This is the main tool to solve
  "calibration" problems, and a [[file:how-to-calibrate.org][how-to page]] describes this specific use case.
- [[file:mrcal-cull-corners.html][=mrcal-cull-corners=]]: Filters a =corners.vnl= on stdin to cut out some points.
  Used primarily for testing

* Visualization
:PROPERTIES:
:CUSTOM_ID: commandline-tools-visualization
:END:
- [[file:mrcal-show-projection-diff.html][=mrcal-show-projection-diff=]]: visualize the difference in projection between N
  models due to intrinsics shifts
- [[file:mrcal-show-stereo-pair-diff.html][=mrcal-show-stereo-pair-diff=]]: visualize the difference between two camera
  pairs due to intrinsics+extrinsics shifts
- [[file:mrcal-show-projection-uncertainty.html][=mrcal-show-projection-uncertainty=]]: visualize the expected projection error
  due to uncertainty in the calibration-time input
- [[file:mrcal-show-valid-intrinsics-region.html][=mrcal-show-valid-intrinsics-region=]]: visualize the region where a model's
  intrinsics are valid
- [[file:mrcal-show-geometry.html][=mrcal-show-geometry=]]: show a visual representation of the geometry
  represented by some camera models on disk, and optionally, the chessboard
  observations used to compute that geometry
- [[file:mrcal-show-distortion-off-pinhole.html][=mrcal-show-distortion-off-pinhole=]]: visualize the deviation of a specific
  lens model from a pinhole model
- [[file:mrcal-show-splined-model-correction.html][=mrcal-show-splined-model-correction=]]: visualize the projection corrections
  defined by a splined model
- [[file:mrcal-show-residuals-board-observation.html][=mrcal-show-residuals-board-observation=]]: visualize calibration residuals for
  one or more observations of a board
- [[file:mrcal-show-residuals.html][=mrcal-show-residuals=]]: visualize calibration residuals in an imager
- [[file:mrcal-show-model-resolution.html][=mrcal-show-model-resolution=]]: visualize the angular resolution across the
  imager

* Camera model manipulation
- [[file:mrcal-convert-lensmodel.html][=mrcal-convert-lensmodel=]]: Fits the behavior of one lens model to another
- [[file:mrcal-graft-models.html][=mrcal-graft-models=]]: Combines the intrinsics of one cameramodel with the
  extrinsics of another
- [[file:mrcal-to-cahvor.html][=mrcal-to-cahvor=]]: Converts a model stored in the native =.cameramodel= file
  format to the =.cahvor= format. This exists for compatibility only, and does
  not touch the data: any lens model may be used
- [[file:mrcal-from-cahvor.html][=mrcal-from-cahvor=]]: Converts a model stored in the =.cahvor= file format to
  the =.cameramodel= format. This exists for compatibility only, and does not
  touch the data: any lens model may be used
- [[file:mrcal-to-kalibr.html][=mrcal-to-kalibr=]]: Converts a model stored in the native =.cameramodel= file
  format to the =.yaml= format used by [[https://github.com/ethz-asl/kalibr][kalibr]].
- [[file:mrcal-from-kalibr.html][=mrcal-from-kalibr=]]: Converts a model stored in =.yaml= files used by [[https://github.com/ethz-asl/kalibr][kalibr]]
  to the =.cameramodel= format.
- [[file:mrcal-from-ros.html][=mrcal-from-ros=]]: Converts a model stored in =.yaml= files used by [[https://www.ros.org/][ROS]] and
  [[https://opencv.org/][OpenCV]] to the =.cameramodel= format.

* Reprojection
- [[file:mrcal-reproject-image.html][=mrcal-reproject-image=]]: Given image(s) and lens model(s), produces a new set
  of images that observe the same scene with a different model. Several flavors
  of functionality are included here, such as undistortion-to-pinhole,
  re-rotation, and remapping to infinity.
- [[file:mrcal-reproject-points.html][=mrcal-reproject-points=]]: Given two lens models and a set of pixel coodinates,
  maps them from one lens model to the other

* Miscellaneous utilities
- [[file:mrcal-is-within-valid-intrinsics-region.html][=mrcal-is-within-valid-intrinsics-region=]]: Augments a vnlog of pixel
  coordinates with a column indicating whether or not each point lies within
  the valid-intrinsics region

* Stereo and triangulation
- [[file:mrcal-stereo.html][=mrcal-stereo=]]: Dense stereo processing. Given pairs of images captured by a
  given pair of camera models, runs stereo matching to produce disparity and
  range images.
- [[file:mrcal-triangulate.html][=mrcal-triangulate=]]: Sparse stereo processing. Given a pair of images captured
  by a given pair of camera models, reports the range to a queried feature and
  its sensitivities to all the inputs. Very useful in diagnosing accuracy issues
  in the intrinsics and extrinsics.
