Add a new stereo matching validator for multiple camera calibration #678
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR add a new stereo matching validator to validate and visualize the result of multiple camera calibration. It uses the calibration result (the yaml file) from the last
kalibr_calibrate_cameras
step, undistorts and recitifies the images, and then run a stereo matcher to calculate the disparity map. No Calibration Target is Required in This Validator.The stereo disparity map offers an intuitive, direct and comprehensive way to quickly visualize the calibration result. For example, a successful calibration may yield the following disparity results:
(with opencv
sgbm
stereo matcher)(with opencv
bm
stereo matcher)The depth of the ground plane and object surface is uniform and smooth.
While a bad calibration result leads to failed stereo matching (because of poor rectification) , resulting in a disparity map looks like this
Note there are lots of speckles and the ground plane is missing.
Usage:
python kalibr_camera_validator_stereo_match --cam ${path-to-camchain.yaml} --matcher bm --scale 2
or
python kalibr_camera_validator_stereo_match --cam ${path-to-camchain.yaml} --matcher sgbm --scale 2
the
--matcher
option selects the stereo matching algorithm (bm
orsgbm
). The--scale
option determines how many times we downsample the image to speed up stereo matching .