Hi Kristian,
As per my understanding you would like to improve the results obtained of disparity map generated using “disparityBM” function. After reviewing the information provided, here are some suggestions to improve the results:
1. Improvement in camera calibration:
- Follow the workflow outlined in the document provided below to enhance calibration accuracy: https://in.mathworks.com/help/vision/ug/using-the-stereo-camera-calibrator-app.html
- Ensure that the calibration data is captured under the same conditions as the rest of the experiment to maintain consistency.
2. Mismatched stereo pair:
- Verify that both cameras have the same intrinsic and extrinsic parameters to ensure accurate depth estimation.
3. Tuning disparity range and other parameters of “disparityBM” function:
- The default “BlockSize” parameter is not changed in the code. Consider tuning “BlockSize” parameter. Small block will results in more detailed disparity map but also more noise. On the other hand, a larger block gives smoother disparity map with less details and fails near boundaries.
- For detailed instructions on tuning the disparity range using the "disparityBM" function, refer to the "Choosing Range of Disparity" subsection in the document provided: https://www.mathworks.com/help/vision/ref/disparitybm.html
4. Try different disparity mapping method:
- Semi-global matching is more computationally expensive than block matching, but it can produce high-quality results. It is recommended to try both algorithms and compare their results for the specific application.
- For instance, I have implemented the "disparityBM" algorithm. Subsequently, I compared these results with those obtained using the "disparitySGM" method.
5. Image post-processing
- Consider applying Morphological transformation such as dilation or smoothing using gaussian blurr to the disparityMap.
Please note that the provided links below contain documentation that you may find helpful for further reference:
- Best practices to prepare camera and capture images for “stereo vision camera calibration app” https://in.mathworks.com/help/vision/ug/prepare-camera-and-capture-images.html
- MATLAB documentation on “disparitySGM” function: https://in.mathworks.com/help/vision/ref/disparitysgm.html
- MATLAB documentation on Morphological filtering https://in.mathworks.com/help/images/morphological-filtering.html
Hope this helps!
Regards,
Aishwarya