BigZee
BigZee

Reputation: 496

What is the difference between cv2.StereoSGBM_create() and cv2.StereoBM_create() functions for disparity mapping on opencv3?

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

Upvotes: 11

Views: 9953

Answers (1)

r4bb1t
r4bb1t

Reputation: 1165

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'

Upvotes: 8

Related Questions