OpenCV AGAST特征检测
  Jk5625xsZPHl 2023年11月02日 65 0

AGAST(Adaptive and Generic Accelerated Segment Test)角点域的特征匹配算法是一种计算二元决策树(角检测器)的技术, 通过组合两棵树,角点检测器自动适应环境,并为图像区域提供最有效的决策树,只有一个像素延迟。因此,它产生了一个角检测器,该检测器速度更快且无需进行训练,同时保持与(完整)FAST 角检测器相同的角响应和可重复性。我们将此检测器称为 AGAST。

API介绍

static Ptr<AgastFeatureDetector> create( int threshold=10,bool nonmaxSuppression=true,AgastFeatureDetector::DetectorType type = AgastFeatureDetector::OAST_9_16);
/*******************************************************************
*			threshold: 				响应阈值			
*			nonmaxSuppression:	    是否做非最大抑制
*			type:					邻域类型
*********************************************************************/
virtual void detect( InputArray image,std::vector<KeyPoint>& keypoints,InputArray mask=noArray());
/*******************************************************************
*			image: 				输入图				
*			keypoints:	        角点信息
*			mask:				计算亚像素角点区域大小			
*********************************************************************/
void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray outImage,const Scalar& color=Scalar::all(-1), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );
/*******************************************************************
*			image: 				输入图				
*			keypoints:	        角点信息
*			outImage:			计算亚像素角点区域大小
*			color:  			颜色
*			flags:				标记			
*********************************************************************/

综合代码

#include <iostream>
#include <map>
#include <new>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
class AGASTFeature
{
public:
	AGASTFeature() :img(imread("mm.jpg"))
	{
		result["img"] = img;
	}
	void TestAGAST()
	{
		Ptr<AgastFeatureDetector> agast = AgastFeatureDetector::create();
		agast->detect(img, point);
		drawKeypoints(img, point, result["agast"], Scalar(255, 0, 255));
	}
	void Show()
	{
		for (auto& v : result)
		{
			imshow(v.first, v.second);
		}
		waitKey(0);
	}
protected:
	Mat img;
	vector<KeyPoint> point;
	map<string, Mat> result;
};
int  main()
{
	unique_ptr<AGASTFeature> p(new AGASTFeature);
	p->TestAGAST();
	p->Show();
	return 0;
}

OpenCV AGAST特征检测_#include


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  gBkHYLY8jvYd   2023年12月06日   50   0   0 #includecii++
  gBkHYLY8jvYd   2023年11月19日   27   0   0 #includecic++
  gBkHYLY8jvYd   2023年11月19日   14   0   0 #includeios数据
  gBkHYLY8jvYd   2023年11月19日   26   0   0 #include子树结点
  gBkHYLY8jvYd   2023年11月19日   24   0   0 #includei++数据
  gBkHYLY8jvYd   2023年11月19日   27   0   0 #include数组ci
  gBkHYLY8jvYd   2023年12月10日   18   0   0 #include邻域灰度图像
  gBkHYLY8jvYd   2023年12月10日   22   0   0 #include数组i++
  gBkHYLY8jvYd   2023年12月06日   19   0   0 #includeios数据
  gBkHYLY8jvYd   2023年12月08日   21   0   0 #includecii++
  gBkHYLY8jvYd   2023年11月19日   24   0   0 #includeiosci
  gBkHYLY8jvYd   2023年11月14日   31   0   0 #includei++升序
  gBkHYLY8jvYd   2023年11月22日   23   0   0 #include十进制高精度
  gBkHYLY8jvYd   2023年11月22日   26   0   0 #includeiosci
Jk5625xsZPHl