Awful disparity map using StereoBM

asked 2015-07-17 16:59:05 -0500

Markov Alex gravatar image

Hello. I am trying to make cloud point from pair of images. I am using StereoBM to create disparity map, but results is very, very bad. image description

My code on github.

I see lot of tutorials, such this, but I can't create good disparity map. I also trying to use StereoSGBM, but results is same. My images are rectified well and this is a pruf (it's an optical flow from stereo images, all lines are horizontal)

image description

How can I do good disparity map? Hope you'll help.


  1. I can't find SADWindowSize in StereoBM.
  2. I heared about Graph Cut algorytm, but I can't find it in OpenCV.
edit retag flag offensive close merge delete


Try understanding the parameters you are adjusting. The values you appear to be using are not good choices. Understanding the simplest stereo block matching algorithm will help you, I suggest you consult Google Scholar for papers.

Throwaway99 gravatar imageThrowaway99 ( 2015-07-17 18:07:19 -0500 )edit

Try the default stereo_matching sample:

mshabunin gravatar imagemshabunin ( 2015-07-20 07:47:47 -0500 )edit

Probably it won't help to you, but it may be useful to someone else.

I think you are using captured images conversly. You are should swap getted images from your camera, so that left capture image becomes "right.jpg" and right capture image becomes "left.jpg". In my case it is worked.

AkaNew gravatar imageAkaNew ( 2018-02-11 01:44:09 -0500 )edit

I just want to restore top source - this

Arthur Cetus gravatar imageArthur Cetus ( 2019-10-31 10:57:49 -0500 )edit