1

Recently I'm using the Middlebury Stereo Datasets 2005 for generating the disparity map. Only the dataset Art, Dolls and Reindeer will be used. The requirement is to generate the disparity map with only view1.png and view5.png for each set.

I've tried to generate the depth map directly with both cv2.StereoSGBM and cv2.StereoBM which didn't really give out a satisfying result, here is the result of Art with the StereoSGBM code:

imgL = cv2.imread('./Art/view1.png', cv2.IMREAD_GRAYSCALE)
imgR = cv2.imread('./Art/view5.png', cv2.IMREAD_GRAYSCALE)
win_size = 3
stereo = cv2.StereoSGBM_create(
    minDisparity=20,
    numDisparities=200,
    blockSize=7,
    uniquenessRatio=10,
    speckleWindowSize=3,
    speckleRange=1,
    P1=8 * 3 * win_size ** 2,
    P2=32 * 3 * win_size ** 2,
)
disparity_SGBM = stereo.compute(imgL, imgR)

enter image description here

Other than just StereoSGBM and StereoBM, I also saw people using feature mathcing method with ORB / SIFT for running cv2.warpPerspective before computing the depth map, however, the way it transform seems failed (the right side): enter image description here

After generating depth maps with the above methods, I have also implement the wlsd filter but I got confused with the lambda and sigma value. I would like to ask how should I implement these method to enhance the output

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Xenox
  • 43
  • 4

0 Answers0