[英]Impossible to create SIFT detector and extractor
我正在尝试使用以下代码检测SIFT关键点:
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/nonfree/features2d.hpp"
[...]
Ptr<FeatureDetector> detector = FeatureDetector::create( "SIFT" );
vector<KeyPoint> keyPoints;
detector->detect( image, keyPoints );
The problem is that my detector pointer points to nowhere after that last line, and no error is shown in the console.
我正在使用QtCreator,我的.pro文件包含:
LIBS += -lopencv_nonfree
CONFIG += link_pkgconfig
PKGCONFIG += opencv
所以我的makefile包含:
LIBS = $(SUBLIBS) -lopencv_nonfree [...] /usr/local/lib/libopencv_nonfree.so [...]
加载库时没有错误。
我已经按照这些说明安装了opencv。
我忘了打电话给cv::initModule_nonfree();
在做其他事情之前。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.