|
|
Camera calibration is done using OpenCV library. Only checkerboard pattern is supported.
|
|
|
Camera calibration uses OpenCV. Only checkerboard pattern is supported.
|
|
|
|
|
|
Calibration data is stored in `~/.config/ftl/intrinsics.yml` and `~/.config/ftl/extrinsics.yml`.
|
|
|
Calibration options can be passed via command line to `ftl-calibrate`. Possible options are shown at program start.
|
|
|
|
|
|
Re-projection error after calibration should be below 0.2.
|
|
|
## 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.
|
|
|
|
|
|
Calibration pattern should be shown relatively close to the camera. Pattern should not be tilted. 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).
|
|
|
|
|
|
## Stereo calibration
|
|
|
|
|
|
Stereo calibration pattern should be shown in various distances and angles. Calibration grid helps and is enabled by default (can be disabled with `use_grid`, note that `iter` and `delay` should likely also be adjusted).
|
|
|
|
|
|
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.
|
|
|
* `alpha`: scaling parameter (see OpenCV documentation for `stereoRectify()`).
|
|
|
|
|
|
Final RMS error should be less than 0.5
|
|
|
|
|
|
Parameters are stored in `~/.config/ftl/extrinsics.yml`.
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
> The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails. [[src]](https://docs.opencv.org/4.1.0/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a)
|
|
|
|
|
|
There seems to be some odd issues (calibration goes completely off) if using too small pattern (checkerboard).
|
|
|
|
|
|
# References
|
|
|
* [calib.io: Calibration Best Practices](https://calib.io/blogs/knowledge-base/calibration-best-practices)
|
|
|
* [calib.io: Pattern Generator](https://calib.io/pages/camera-calibration-pattern-generator), note the instructions on printing
|
... | ... | |