- Increase the block size
- Post-process the disparity map by applying a median filter
Accurate stereo reconstruction of high resolution image
9 views (last 30 days)
Show older comments
Meghana Dinesh
on 3 Jun 2015
Commented: Meghana Dinesh
on 6 Jun 2015
I am doing stereo calibration and scene reconstruction. The disparity map I obtain is much better than what I was initially getting. Because my disparity is high, I have set:
DisparityRange = [192,352]
I will not be able to decrease the disparity (it's around 300 pixels when manually calculated using rectified images).
I have tried to decrease disparity by moving the object away. Disparity does decrease, so does accuracy. I am using a 10MP image sensor so I can get high accuracy. The baseline is 70mm. With this baseline, I want to get a reconstructed object as accurate as possible.
My disparity map is shown in the figure below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150797/image.png)
Using this, I am getting gaps in my reconstructed object.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150798/image.png)
I want to remove these gaps from reconstructed scene. This is what I've tried:
point_cloud_smooth = smooth3(point_cloud,'gaussian');
The output of this plot seemed to be stretched, and not interpolated.
Are there any other ways by which I can get a better and accurate Reconstructed scene?
Mean Reprojection error after calibrating my setup is 0.3261.
Do you have any inputs?
I have uploaded here stereo parameters and a pair of stereo images (from Camera A and B respectively). I have also attached the point cloud of object (one which is filtered, i.e. points with high variance in z values are NaN).
0 Comments
Accepted Answer
Dima Lisin
on 3 Jun 2015
Hi Meghana,
I am glad that you are getting better results! There are a couple of things you can try to fill in the holes in your disparity map:
Good luck!
2 Comments
Dima Lisin
on 4 Jun 2015
Hi Meghana,
The DistanceThreshold parameter gives you a way to verify consistency of the matches. If you set it, it will make the function match each pixel from left image to the right image, and then back from right image into the left image. The DistanceThreshold is the limit on how far off you can be on your backward match. So this is probably not going to help you here.
Try other values for the BlockSize. Evidently, 25 makes things worse. Try other values less then 25. And definitely try applying the median filter to the resulting disparity map using medfilt2.
More Answers (1)
xikang
on 5 Jun 2015
This is what I get with blocksize=15. I think the gaussian filter should not be added before the disparity function. It will make the disparity map worse. You may add any filter on the disparity Map image though.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177294/image.jpeg)
See Also
Categories
Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!