|
Camera calibration uses OpenCV. Only checkerboard pattern is supported.
|
|
Intrinsic calibration uses OpenCV's `calibrateCamera()`. Only checkerboard pattern is supported.
|
|
|
|
|
|
Calibration options can be passed via command line to `ftl-calibrate`. Possible options are shown at program start.
|
|
|
|
|
|
|
|
## Intrinsic calibration
|
|
## Intrinsic calibration
|
|
|
|
|
|
Intrinsic calibration parameters are stored in `~/.config/ftl/intrinsics.yml`. Intrinsic parameters do not change and it should not be necessary to re-calibrate once good calibration is acquired.
|
|
Intrinsic parameters are used to correct lens distortions, so it is important that the pattern is on as flat surface as possible (so distortion from board's shape is much less than lens distortion). For focal length and principal point, pattern should be shown in various angles and cameras, however extreme angles (over 45 degrees) should be avoided as corners might not be detected as accurately. The field of view should be completely covered by the calibration patterns. For distortion parameter calibration, focal length and principal point should be fixed to get a stable calibration.
|
|
|
|
|
|
Intrinsic parameters are used to correct lens distortions, so it is important that the pattern is on as flat surface as possible (so distortion from board's shape is much less than lens distortion). Pattern should be shown in various angles and cameras field of view should be completely covered by the patterns (in multiple images).
|
|
|
|
|
|
|
|
Useful parameters:
|
|
|
|
* `iter`: In grid mode, how many grids are required for calibration. In normal mode, how many calibration pattern views are required.
|
|
|
|
* `delay`: (approximate) delay between attempts to capture the pattern.
|
|
|
|
|
|
|
|
## Stereo calibration
|
|
|
|
|
|
|
|
Pair calibration can be done with `ftl-calibrate --stereo`
|
|
|
|
|
|
|
|
* `alpha`: scaling parameter (see OpenCV documentation for `stereoRectify()`).
|
|
|
|
|
|
|
|
## Extrinsic calibration for all cameras
|
|
## Extrinsic calibration for all cameras
|
|
|
|
|
|
Extrinsic parameters for all cameras can be calibrated using `calibrate-multi` application. Possible configuration options are visible on start.
|
|
Extrinsic calibration will calculate pose of each all camera. Rectification parameters are calculated from poses. Additionally intrinsic parameters can be further adjusted. It is a good idea to fix as many parameters in advance as possible, distortion coefficients at minimum.
|
|
|
|
|
|
Calibration will calculate extrinsic parameters for all cameras and calculate stereo rectification parameters for each node.
|
|
|
|
|
|
|
|
> **IMPORTANT:** `use_intrinsics` must be set false on nodes before running calibration (disables rectification, unrectified images and parameters are used).
|
|
|
|
|
|
|
|
#### Options
|
|
|
|
|
|
|
|
* `load_input` *false*
|
|
|
|
|
|
|
|
Load previously saved calibration data. Set to false to capture data from cameras.
|
|
|
|
|
|
|
|
* `save_input` *false*
|
|
|
|
|
|
|
|
Save calibration input for debugging purposes or for re-calibration with different parameters. Calibration point and images are saved to `calibration_data_dir`
|
|
|
|
|
|
|
|
|
|
|
|
* `calibration_data_dir` *./*
|
|
|
|
|
|
|
|
see save_input and load_input.
|
|
|
|
|
|
|
|
* `save_extrinsic` *true*
|
|
|
|
|
|
|
|
Save new extrinsic parameters to `output_directory`.
|
|
|
|
|
|
|
|
* `save_intrinsic` *false*
|
|
|
|
|
|
|
|
Save optimized intrinsic parameters to `output_directory`
|
|
|
|
|
|
|
|
* `output_directory` *./*
|
|
|
|
|
|
|
|
see save_intrinsic and save_extrinsic.
|
|
|
|
|
|
|
|
* `registration_file` *FTL_LOCAL_CONFIG_ROOT/registration.json*
|
|
|
|
|
|
|
|
Where extrinsic (stereo) parameters are saved (used in reconstruction)
|
|
|
|
|
|
|
|
* `optimize_intrinsic` *false*
|
|
|
|
|
|
|
|
Intrinsic camera parameters are optimized during bundle adjustment.
|
|
|
|
|
|
|
|
* `n_views` *500*
|
|
|
|
|
|
|
|
How many times all cameras must see the pattern. **Note:** calibration app does not verify that visibility graph is connected (or how good visibility is).
|
|
|
|
|
|
|
|
* `min_visible` *3*
|
|
|
|
|
|
|
|
Minimum number of cameras which must see the pattern at the same time. If pattern is visible in less cameras, points are not used.
|
|
|
|
|
|
|
|
Calibration application calculates stereo rectification extrinsic parameters and saves them in "<node>-extrinsic.yml" files in directory specified by `output_directory` (this can be on shared folder and nodes can use these directly, or they can be manually copied).
|
|
|
|
|
|
|
|
Calibration input is saved when `save_input` is enabled. Files (images and data file) are saved in directory set in `calibration_data_dir`. Calibration can be re-run from the data by enabling `load_input`.
|
|
|
|
|
|
|
|
Intrinsic optimization requires more data than only calibrating extrinsic parameters.
|
|
|
|
|
|
|
|
Errors during calibration can be cause by inaccurate intrinsic parameters, not having enough data or having bad data.
|
|
The calibration object/pattern should cover working volume as completely as possible.
|
|
|
|
|
|
Calibration target is two (ID0 and ID1) 10cm ArUco 5x5 markers spaced at 250mm from each other. Template can be downloaded below.
|
|
Extrinsic calibration consists of following steps:
|
|
|
|
* Initial pairwise pose estimation (if necessary). All pairwise poses are estimated and points are triangulated. Existing poses can be used (if explicitly enabled).
|
|
|
|
* Initial poses are calculated from pair poses by building chains.
|
|
|
|
* Points are estimated with median 3d point of triangulations.
|
|
|
|
* Bundle adjustment is performed on initial points and poses.
|
|
|
|
|
|
# Attachments
|
|
# Attachments
|
|
|
|
|
... | | ... | |