zoukankan      html  css  js  c++  java
  • AGAST特征点,AgastFeatureDetector

    AGAST特征点,算法速度比FAST和FASTER更快。

    【函数】

    Ptr<AgastFeatureDetector> create( int threshold=10, bool nonmaxSuppression=true, int type=AgastFeatureDetector::OAST_9_16 );

    【参数】

    threshold——阈值

    nonmaxSuppression——非极大值抑制

    type——邻域类型

    【案例】

    #include <opencv2/opencv.hpp>
    #include <iostream>
    using namespace std;
    using namespace cv;
    
    int main()
    {
        Mat srcImage = imread("D:/sunflower.png");
            Mat srcGrayImage;
            if (srcImage.channels() == 3)
            {
                cvtColor(srcImage,srcGrayImage,CV_RGB2GRAY);
            }
            else
            {
                srcImage.copyTo(srcGrayImage);
            }
            vector<KeyPoint>detectKeyPoint;
            Mat keyPointImage;
    
            Ptr<AgastFeatureDetector> agast = AgastFeatureDetector::create();
            agast->detect(srcGrayImage,detectKeyPoint);
            drawKeypoints(srcImage,detectKeyPoint,keyPointImage,Scalar(0,0,255),DrawMatchesFlags::DEFAULT);
    
            imshow("src image",srcImage);
            imshow("keyPoint",keyPointImage);
    
            waitKey(0);
            return 0;
    }
  • 相关阅读:
    java语言基础
    常用4种限流算法介绍及比较
    如何用Redis实现分布式锁
    翻转字符串
    JAVA之io流
    JAVA之Collections集合
    【转】IT行业岗位以及发展方向
    JAVA之字符串
    JAVA之数组
    Linux之判断字符串是否为空
  • 原文地址:https://www.cnblogs.com/xixixing/p/12470174.html
Copyright © 2011-2022 走看看