爱听雨 2015-10-14 06:19 采纳率: 0%
浏览 7746

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是未定义的标识符呢?
  • 写回答

4条回答 默认 最新

  • QWE12312356 2018-04-08 06:11
    关注

    using namespace cv::xfeatures2d

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog