opencv 2.4 SIFT编译错误

时间:2012-07-15 02:00:57

标签: opencv compiler-errors sift

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,而不是从其他软件或二进制文件中获取SIFT,我只需要它...

1 个答案:

答案 0 :(得分:0)

我记不太清楚......但我认为问题在于我没有使用

cv::initModule_nonfree();