OpenCV Stereo Disparity map using StereoBM, shows only borders

asked 2015-07-18 16:15:35 -0500

I am new to image processing and made a DIY stereo setup using two Playstation EYE camera.

The baseline is 10cm. I finished the calibration and am able to obtain a disparity map using StereoBM module in OpenCV. The following image shows the disparity map I am getting from my stereo setup after some adjustment of the parameters.

Disparity Map from my stereo setup

In the above images my hand is closer to the camera than the doors of my room. Is the above image a good disparity map? What does the huge black spaces within each boundary mean? does it mean the black region within each boundary has undefined disparity? Shouldn't it be filled withing the borders and smooth? I would appreciate any suggestion regarding this. Thanks in advance. Also if it helps I am generating disparity map using following snippet of code and my cameras are not synchronized yet.

Mat disp, disp8; 
sbm->compute(imgULeftG, imgURightG, disp); //imgULeftG->Grayscale image from left camera,
//imgURightG->Grayscale image from right camera
double minVal;
double maxVal;
minMaxLoc(disp, &minVal, &maxVal);
disp.convertTo(disp8, CV_8U, 255 / (maxVal - minVal));
imshow("imageLeft", imgULeft);
imshow("imageRight", imgURight);
imshow(dispWindow, disp8);
edit retag flag offensive close merge delete