问题描述
- opencv3.0 error C2065: SurfFeatureDetector未定义标识符
-
编程环境:win7旗舰版+opencv3.0(含opencv_contrib-master)+vs2013我在opencv3.0下使用SURF算法提取特征时出现了以下错误:error C2065: “SurfFeatureDetector”未定义标识符
我在nonfree.hpp文件下查看了SurfFeatureDetector的定义,在路径“opencv2/xfeatures2d/nonfree.hpp”下可以找到nonfree.hpp(这个路径是用CMAKE 编译 opencv_contrib-master下 源代码后下的相应路径)。 在nonfree.hpp中明明可以看到SURF类的定义和SurfFeatureDetector的类型定义,nonfree.hpp下的一段代码如下
class CV_EXPORTS_W SURF : public Feature2D
{
public:
/**
@param hessianThreshold Threshold for hessian keypoint detector used in SURF.
@param nOctaves Number of pyramid octaves the keypoint detector will use.
@param nOctaveLayers Number of octave layers within each octave.
@param extended Extended descriptor flag (true - use extended 128-element descriptors; false - use
64-element descriptors).
@param upright Up-right or rotated features flag (true - do not compute orientation of features;
false - compute orientation).
*/
CV_WRAP static Ptr create(double hessianThreshold=100,
int nOctaves = 4, int nOctaveLayers = 3,
bool extended = false, bool upright = false);CV_WRAP virtual void setHessianThreshold(double hessianThreshold) = 0; CV_WRAP virtual double getHessianThreshold() const = 0; CV_WRAP virtual void setNOctaves(int nOctaves) = 0; CV_WRAP virtual int getNOctaves() const = 0; CV_WRAP virtual void setNOctaveLayers(int nOctaveLayers) = 0; CV_WRAP virtual int getNOctaveLayers() const = 0; CV_WRAP virtual void setExtended(bool extended) = 0; CV_WRAP virtual bool getExtended() const = 0; CV_WRAP virtual void setUpright(bool upright) = 0; CV_WRAP virtual bool getUpright() const = 0;
};
typedef SURF SurfFeatureDetector;
typedef SURF SurfDescriptorExtractor;我已经在VC++包含目录中添加了include, opencv 和 opencv2三个文件夹下的路径。也在连接器中添加了相应的*.lib文件。#include "opencv2/xfeatures2d/nonfree.hpp"时也没有报错,为什么还是提示SurfFeatureDetector是未定义的标识符呢?
解决方案
error C2065: “SurfFeatureDetector”: 未声明的标识符
error C2065: “_lpw”: 未声明的标识符
error C2065: “GUID_NULL”: 未声明的标识符
解决方案二:
你好 , 你的问题得到解决了吗,,我也遇到了
解决方案三:
希望大神指点一下。。。