cannot create StereoBM object
I am trying to get disparity maps from a pair of webcams when I try to initialize a StereoBM object using one of these StereoBM sbm; //or StereoBM sbm(); //or StereoBM sbm(BASIC_PRESET, 16*5, 21);
it dosent work I keep getting these errors
src/goneFishin.cpp: In function ‘int main(int, char**)’: /src/goneFishin.cpp:73:12: error: cannot declare variable ‘sbm’ to be of abstract type ‘cv::StereoBM’ /usr/local/include/opencv2/calib3d.hpp:349:20: note: because the following virtual functions are pure within ‘cv::StereoBM’: /usr/local/include/opencv2/calib3d.hpp:325:26: note: virtual void cv::StereoMatcher::compute(cv::InputArray, cv::InputArray, cv::OutputArray) /usr/local/include/opencv2/calib3d.hpp:328:25: note: virtual int cv::StereoMatcher::getMinDisparity() const /usr/local/include/opencv2/calib3d.hpp:329:26: note: virtual void cv::StereoMatcher::setMinDisparity(int) /usr/local/include/opencv2/calib3d.hpp:331:25: note: virtual int cv::StereoMatcher::getNumDisparities() const /usr/local/include/opencv2/calib3d.hpp:332:26: note: virtual void cv::StereoMatcher::setNumDisparities(int) /usr/local/include/opencv2/calib3d.hpp:334:25: note: virtual int cv::StereoMatcher::getBlockSize() const /usr/local/include/opencv2/calib3d.hpp:335:26: note: virtual void cv::StereoMatcher::setBlockSize(int) /usr/local/include/opencv2/calib3d.hpp:337:25: note: virtual int cv::StereoMatcher::getSpeckleWindowSize() const /usr/local/include/opencv2/calib3d.hpp:338:26: note: virtual void cv::StereoMatcher::setSpeckleWindowSize(int) /usr/local/include/opencv2/calib3d.hpp:340:25: note: virtual int cv::StereoMatcher::getSpeckleRange() const /usr/local/include/opencv2/calib3d.hpp:341:26: note: virtual void cv::StereoMatcher::setSpeckleRange(int) /usr/local/include/opencv2/calib3d.hpp:343:25: note: virtual int cv::StereoMatcher::getDisp12MaxDiff() const /usr/local/include/opencv2/calib3d.hpp:344:26: note: virtual void cv::StereoMatcher::setDisp12MaxDiff(int) /usr/local/include/opencv2/calib3d.hpp:356:25: note: virtual int cv::StereoBM::getPreFilterType() const /usr/local/include/opencv2/calib3d.hpp:357:26: note: virtual void cv::StereoBM::setPreFilterType(int) /usr/local/include/opencv2/calib3d.hpp:359:25: note: virtual int cv::StereoBM::getPreFilterSize() const /usr/local/include/opencv2/calib3d.hpp:360:26: note: virtual void cv::StereoBM::setPreFilterSize(int) /usr/local/include/opencv2/calib3d.hpp:362:25: note: virtual int cv::StereoBM::getPreFilterCap() const /usr/local/include/opencv2/calib3d.hpp:363:26: note: virtual void cv::StereoBM::setPreFilterCap(int) /usr/local/include/opencv2/calib3d.hpp:365:25: note: virtual int cv::StereoBM::getTextureThreshold() const /usr/local/include/opencv2/calib3d.hpp:366:26: note: virtual void cv::StereoBM::setTextureThreshold(int) /usr/local/include/opencv2/calib3d.hpp:368:25: note: virtual int cv::StereoBM::getUniquenessRatio() const /usr/local/include/opencv2/calib3d.hpp:369:26: note: virtual void cv::StereoBM::setUniquenessRatio(int) /usr/local/include/opencv2/calib3d.hpp:371:25: note: virtual int cv::StereoBM::getSmallerBlockSize() const /usr/local/include/opencv2/calib3d.hpp:372:26: note: virtual void cv::StereoBM::setSmallerBlockSize(int) /usr/local/include/opencv2/calib3d.hpp:374:26: note: virtual cv::Rect cv::StereoBM::getROI1() const /usr/local/include/opencv2/calib3d.hpp:375:26: note: virtual void cv::StereoBM::setROI1(cv ...
looks like you're using opencv3, but your code is from opencv2 ?
have a look at the StereoBM sample