首页 / 操作系统 / Linux / 关于OpenCV3.0 beta 编译出现ORB那边的错误的解决
好久没碰opencv了,现在已经3.0 beta了。今天编译遇到了error: cannot declare variable ‘orb’ to be of abstract type ‘cv::ORB原因是ORB这个类不能再这么调用了。在opencv 根目录找到opencvroot/samples/gpu/performance/tests.cpp修改成如下代码。TEST(ORB) { Mat src = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE); if (src.empty()) throw runtime_error("can"t open ../data/aloeL.jpg"); //ORB orb(4000); Ptr<ORB> orb = ORB::create(4000,1.2f,8,31,0,2,ORB::HARRIS_SCORE,31,20); vector<KeyPoint> keypoints; Mat descriptors;
CV_WRAP static Ptr<ORB> create(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31, int fastThreshold=20);
// returns the descriptor size in bytes int descriptorSize() const; // returns the descriptor type int descriptorType() const; // returns the default norm type int defaultNorm() const;
// Compute the ORB_Impl features and descriptors on an image <strong>void detectAndCompute( InputArray image, InputArray mask, std::vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false );</strong>
protected:
int nfeatures; double scaleFactor; int nlevels; int edgeThreshold; int firstLevel; int wta_k; int scoreType; int patchSize; int fastThreshold; }; 希望有人遇到这样的问题的时候,能够得到解答。 此外还有就是使用最新的cuda6.5的时候一定要在gui的cmake 中将CUDA_ARCH_BIN 设置为2.0 2.1(2.0) 3.0 3.5不要带1.1 .1.2 1.3等等之类的,因为cuda6.5不支持这些老显卡了。--------------------------------------分割线 --------------------------------------Ubuntu Linux下安装OpenCV2.4.1所需包 http://www.linuxidc.com/Linux/2012-08/68184.htmUbuntu 12.04 安装 OpenCV2.4.2 http://www.linuxidc.com/Linux/2012-09/70158.htmCentOS下OpenCV无法读取视频文件 http://www.linuxidc.com/Linux/2011-07/39295.htmUbuntu 12.04下安装OpenCV 2.4.5总结 http://www.linuxidc.com/Linux/2013-06/86704.htmUbuntu 10.04中安装OpenCv2.1九步曲 http://www.linuxidc.com/Linux/2010-09/28678.htm基于QT和OpenCV的人脸识别系统 http://www.linuxidc.com/Linux/2011-11/47806.htm[翻译]Ubuntu 14.04, 13.10 下安装 OpenCV 2.4.9 http://www.linuxidc.com/Linux/2014-12/110045.htm--------------------------------------分割线 --------------------------------------OpenCV的详细介绍:请点这里 OpenCV的下载地址:请点这里本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-01/112506.htm