Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2017-04-25 22:38:56 -0600

Nbb gravatar image

StereoBinaryBM::create crashes

I am trying to compute the disparity map for my stereo pair but the program keeps crashing when I create the stereo matching object. It crashes at this line

 auto sbm = cv::stereo::StereoBinaryBM::create(0, 9);

with this error.

OpenCV Error: Assertion failed (val > 10) in cv::stereo::Matching::setMaxDisparity, file C:\ProgramFiles\Bin\opencv_contrib-master\modules\stereo\include\opencv2/stereo/matching.hpp, line 379

StereoBinaryBM::create crashes

I am trying to compute the disparity map for my stereo pair but the program keeps crashing when I create the stereo matching object. It crashes at this line

 auto sbm = cv::stereo::StereoBinaryBM::create(0, 9);

with this error.

OpenCV Error: Assertion failed (val > 10) in cv::stereo::Matching::setMaxDisparity, file C:\ProgramFiles\Bin\opencv_contrib-master\modules\stereo\include\opencv2/stereo/matching.hpp, line 379

This code I have works fine though

    auto sgbm = cv::stereo::StereoBinarySGBM::create(
        -64,   //min disparity          
        192,   //num disparities
        5,     //block size         
        600,   //P1
        2400,  //P2
        10,    //disparity max difference
        4,     //pre-filter cap
        1,     //uniqueness ratio
        150,   //speckle window size
        2,     //speckle range
        cv::StereoSGBM::MODE_SGBM);

StereoBinaryBM::create crashes

I am trying to compute the disparity map for my stereo pair but the program keeps crashing when I create the stereo matching object. It crashes at this line

 auto sbm = cv::stereo::StereoBinaryBM::create(0, 9);

with this error.

OpenCV Error: Assertion failed (val > 10) in cv::stereo::Matching::setMaxDisparity, file C:\ProgramFiles\Bin\opencv_contrib-master\modules\stereo\include\opencv2/stereo/matching.hpp, line 379

This code I have works fine though

    auto sgbm = cv::stereo::StereoBinarySGBM::create(
        -64,   //min disparity          
        192,   //num disparities
        5,     //block size         
        600,   //P1
        2400,  //P2
        10,    //disparity max difference
        4,     //pre-filter cap
        1,     //uniqueness ratio
        150,   //speckle window size
        2,     //speckle range
        cv::StereoSGBM::MODE_SGBM);

EDIT: It works now when I use

auto sbm = cv::stereo::StereoBinaryBM::create(64, 9);

but now it crashes at sbm->compute(im_00, im_01, disparity); without mentioning any error.

StereoBinaryBM::create StereoBinaryBM crashes

I am trying to compute the disparity map for my stereo pair but the program keeps crashing when I create the stereo matching object. It crashes at this line

 auto sbm = cv::stereo::StereoBinaryBM::create(0, 9);

with this error.

OpenCV Error: Assertion failed (val > 10) in cv::stereo::Matching::setMaxDisparity, file C:\ProgramFiles\Bin\opencv_contrib-master\modules\stereo\include\opencv2/stereo/matching.hpp, line 379

This code I have works fine though

    auto sgbm = cv::stereo::StereoBinarySGBM::create(
        -64,   //min disparity          
        192,   //num disparities
        5,     //block size         
        600,   //P1
        2400,  //P2
        10,    //disparity max difference
        4,     //pre-filter cap
        1,     //uniqueness ratio
        150,   //speckle window size
        2,     //speckle range
        cv::StereoSGBM::MODE_SGBM);

EDIT: It works now when I use

auto sbm = cv::stereo::StereoBinaryBM::create(64, 9);

but now it crashes at sbm->compute(im_00, im_01, disparity); without mentioning any error.