首页 > 其他 > 详细

AGAST特征点,AgastFeatureDetector

时间:2020-03-12 17:36:58      阅读:609      评论:0      收藏:0      [点我收藏+]

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;
}

 

AGAST特征点,AgastFeatureDetector

原文:https://www.cnblogs.com/xixixing/p/12470174.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!