OpenCV stereoBM抽象错误

时间:2013-12-16 22:39:21

标签: c++ opencv

我正在尝试使用两个校正后的图像来使用openCV 2.4.7来计算视差图。 当我尝试初始化或声明StereoBMStereoSGBM对象时:

StereoBM sbm;
//or
StereoBM sbm();
//or
StereoBM sbm(BASIC_PRESET, 16*5, 21);

我收到以下错误消息:

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::Rect)
/usr/local/include/opencv2/calib3d.hpp:377:26: note:     virtual cv::Rect cv::StereoBM::getROI2() const
/usr/local/include/opencv2/calib3d.hpp:378:26: note:     virtual void cv::StereoBM::setROI2(cv::Rect)

我一直在四处寻找,似乎没有其他人有这个问题。我错过了一些明显的东西,或做错了什么?

0 个答案:

没有答案