11

I am trying to understand the disparity mapping functions of opencv I came across two methods cv2.StereoSGBM_create and cv2.StereoBM_create I don't quite understand the difference.

Also, what are the properties of the functions such as numDisparities or setSpeckleRange etc

BigZee
  • 456
  • 5
  • 22
  • 3
    For SGBM, see: [Stereo Processing by Semi-Global Matching and Mutual Information](https://core.ac.uk/download/pdf/11134866.pdf). For BM, you should have some information and reference [here](http://www.diegm.uniud.it/fusiello/teaching/mvg/stereo.pdf). – Catree Aug 09 '18 at 02:57
  • 1
    @Catree are there more functions for disparity mapping? – BigZee Aug 09 '18 at 06:42
  • 1
    there are more functions in `cv::cuda` here's the overview: https://docs.opencv.org/3.4.1/d2/d6e/classcv_1_1StereoMatcher.html – jodis Aug 10 '18 at 01:39

1 Answers1

7

The definitions of all the arguments are given at the bottom of the documentation page here

In block matching or cv2.StereoBM_create() the disparity is computed by comparing the sum of absolute differences (SAD) of each 'block' of pixels. In semi-global block matching or cv2.StereoSGBM_create() forces similar disparity on neighbouring blocks. This creates a more complete disparity map but is more computationally expensive.

Paper that discusses 'block matching'

Paper that discusses 'semi-global block matching'

r4bb1t
  • 1,033
  • 2
  • 13
  • 36