Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Big different between StereoSGBM and gpu::StereoBM_GPU

Hello there,

I try to generate disparity of stereo image by using OpenCV and optimize performance by using GPU but the results of them are different.

StereoSGBM initialize

StereoSGBM sbm;
sbm.SADWindowSize = 3;
sbm.numberOfDisparities = 144;
sbm.preFilterCap = 63;
sbm.minDisparity = -39;
sbm.uniquenessRatio = 10;
sbm.speckleWindowSize = 100;
sbm.speckleRange = 32;
sbm.disp12MaxDiff = 1;
sbm.fullDP = false;
sbm.P1 = 216;
sbm.P2 = 864;
sbm(grayLeftCurrentFrameCPU, grayRightCurrentFrameCPU, resultCurrentFrameCPU);
normalize(resultCurrentFrameCPU, resultNorCurrentFrameCPU, 0, 255, CV_MINMAX, CV_8U);

gpu::StereoBM_GPU initialize

gpu::StereoBM_GPU *bm = new gpu::StereoBM_GPU();
bm->preset = gpu::StereoBM_GPU::BASIC_PRESET;
bm->ndisp = 48;
bm->winSize = 5;
bm->operator()(grayLeftCurrentFrameGPU, grayRightCurrentFrameGPU, resultCurrentFrameGPU);
gpu::normalize(resultCurrentFrameGPU, resultNorCurrentFrameGPU, 0, 255, CV_MINMAX, CV_8U);

Thanks!

(StereoSBM)

StereoSGBM

(gpu::StereoBM_GPU) gpu::StereoBM_GPU

Big different between StereoSGBM and gpu::StereoBM_GPU

Hello there,

I try to generate disparity of stereo image by using OpenCV and optimize performance by using GPU but the results of them are different.

StereoSGBM initialize

StereoSGBM sbm;
sbm.SADWindowSize = 3;
sbm.numberOfDisparities = 144;
sbm.preFilterCap = 63;
sbm.minDisparity = -39;
sbm.uniquenessRatio = 10;
sbm.speckleWindowSize = 100;
sbm.speckleRange = 32;
sbm.disp12MaxDiff = 1;
sbm.fullDP = false;
sbm.P1 = 216;
sbm.P2 = 864;
sbm(grayLeftCurrentFrameCPU, grayRightCurrentFrameCPU, resultCurrentFrameCPU);
normalize(resultCurrentFrameCPU, resultNorCurrentFrameCPU, 0, 255, CV_MINMAX, CV_8U);

gpu::StereoBM_GPU initialize

gpu::StereoBM_GPU *bm = new gpu::StereoBM_GPU();
bm->preset = gpu::StereoBM_GPU::BASIC_PRESET;
bm->ndisp = 48;
bm->winSize = 5;
bm->operator()(grayLeftCurrentFrameGPU, grayRightCurrentFrameGPU, resultCurrentFrameGPU);
gpu::normalize(resultCurrentFrameGPU, resultNorCurrentFrameGPU, 0, 255, CV_MINMAX, CV_8U);

Anyone know why? Thanks!

(StereoSBM)

StereoSGBM

(gpu::StereoBM_GPU) gpu::StereoBM_GPU

click to hide/show revision 3
retagged

updated 2014-03-03 11:46:51 -0600

berak gravatar image

Big different between StereoSGBM and gpu::StereoBM_GPU

Hello there,

I try to generate disparity of stereo image by using OpenCV and optimize performance by using GPU but the results of them are different.

StereoSGBM initialize

StereoSGBM sbm;
sbm.SADWindowSize = 3;
sbm.numberOfDisparities = 144;
sbm.preFilterCap = 63;
sbm.minDisparity = -39;
sbm.uniquenessRatio = 10;
sbm.speckleWindowSize = 100;
sbm.speckleRange = 32;
sbm.disp12MaxDiff = 1;
sbm.fullDP = false;
sbm.P1 = 216;
sbm.P2 = 864;
sbm(grayLeftCurrentFrameCPU, grayRightCurrentFrameCPU, resultCurrentFrameCPU);
normalize(resultCurrentFrameCPU, resultNorCurrentFrameCPU, 0, 255, CV_MINMAX, CV_8U);

gpu::StereoBM_GPU initialize

gpu::StereoBM_GPU *bm = new gpu::StereoBM_GPU();
bm->preset = gpu::StereoBM_GPU::BASIC_PRESET;
bm->ndisp = 48;
bm->winSize = 5;
bm->operator()(grayLeftCurrentFrameGPU, grayRightCurrentFrameGPU, resultCurrentFrameGPU);
gpu::normalize(resultCurrentFrameGPU, resultNorCurrentFrameGPU, 0, 255, CV_MINMAX, CV_8U);

Anyone know why? Thanks!

(StereoSBM)

StereoSGBM

(gpu::StereoBM_GPU) gpu::StereoBM_GPU

click to hide/show revision 4
retagged

updated 2014-03-03 11:47:03 -0600

berak gravatar image

Big different between StereoSGBM and gpu::StereoBM_GPU

Hello there,

I try to generate disparity of stereo image by using OpenCV and optimize performance by using GPU but the results of them are different.

StereoSGBM initialize

StereoSGBM sbm;
sbm.SADWindowSize = 3;
sbm.numberOfDisparities = 144;
sbm.preFilterCap = 63;
sbm.minDisparity = -39;
sbm.uniquenessRatio = 10;
sbm.speckleWindowSize = 100;
sbm.speckleRange = 32;
sbm.disp12MaxDiff = 1;
sbm.fullDP = false;
sbm.P1 = 216;
sbm.P2 = 864;
sbm(grayLeftCurrentFrameCPU, grayRightCurrentFrameCPU, resultCurrentFrameCPU);
normalize(resultCurrentFrameCPU, resultNorCurrentFrameCPU, 0, 255, CV_MINMAX, CV_8U);

gpu::StereoBM_GPU initialize

gpu::StereoBM_GPU *bm = new gpu::StereoBM_GPU();
bm->preset = gpu::StereoBM_GPU::BASIC_PRESET;
bm->ndisp = 48;
bm->winSize = 5;
bm->operator()(grayLeftCurrentFrameGPU, grayRightCurrentFrameGPU, resultCurrentFrameGPU);
gpu::normalize(resultCurrentFrameGPU, resultNorCurrentFrameGPU, 0, 255, CV_MINMAX, CV_8U);

Anyone know why? Thanks!

(StereoSBM)

StereoSGBM

(gpu::StereoBM_GPU) gpu::StereoBM_GPU