openCV 已经用新版本改变了特征检测器/描述符(和往常一样)。我已经找到了,我需要添加
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/nonfree/features2d.hpp"
但是,它仍然不起作用。我得到的错误是:
error: ‘cv::SIFT::DetectorParams’ has not been declare
我使用标准命令进行构建
gcc `pkg-config --cflags --libs opencv` -o descriptorExtractor main.cpp
并且所有库等都应该正确链接
pkg-config --cflags --libs opencv
-I/opt/ros/fuerte/include/opencv -I/opt/ros/fuerte/include -L/opt/ros/fuerte/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab
openCV又怎么了?请不要问我为什么我需要来自 openCV 而不是来自其他软件或二进制文件的 SIFT,我只需要它......