Auroratan 2017-02-18 03:41 采纳率: 0%
浏览 5000

opencv的 FastFeatureDetector fast(40)怎么用不了

#include

#include
#include
#include
#include

using namespace cv;

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

       Mat image;
       image = imread("1.jpg");
       // 存储为关键点
       std::vector<KeyPoint> keyPoints;
       // 定义特征检测
        FastFeatureDetector fast(40);        // 检测的阈值为40  “cv::FastFeatureDetector”: 不能实例化抽象类


       // 特征点检测
       fast.detect(image,keyPoints);
       drawKeypoints(image, keyPoints, image, Scalar::all(255), DrawMatchesFlags::DRAW_OVER_OUTIMG);
       imshow("FAST feature", image);
       waitKey(0);
return a.exec();

}

error: C2259: “cv::FastFeatureDetector”: 不能实例化抽象类
error: C2664: “cv::FastFeatureDetector::FastFeatureDetector(cv::FastFeatureDetector &&)”: 无法将参数 1 从“int”转换为“const cv::FastFeatureDetector &”

  • 写回答

4条回答 默认 最新

  • 饿二饿二饿 2017-08-24 03:09
    关注

    http://docs.opencv.org/3.0-beta/doc/user_guide/ug_features2d.html
    试了是楼上的还是不行
    去google了一下

     FastFeatureDetector fast(40);
    fast.detect(image,keypoints);
    

    改为:

     Ptr<FeatureDetector> fast=FastFeatureDetector::create(40);
        fast->detect(image, keypoints);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序