FAST特征点检测——opencv
来源:互联网 发布:快速排序算法举例说明 编辑:程序博客网 时间:2024/05/18 12:34
实现方法一:
#include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/features2d/features2d.hpp" //需要添加该头文件 #include <iostream> using namespace cv;using namespace std;int main(int argc, char** argv){ Mat src, gray; src = imread("D:\\ff.jpg"); if (!src.data) return -1; //彩色图像转换为灰度图像 cvtColor(src, gray, CV_BGR2GRAY); //定义特征点KeyPoint向量 vector<KeyPoint> keyPoints; //调用FAST函数,阈值选为55 FAST(gray, keyPoints, 55); int total = keyPoints.size(); //在原图上画出特征点 for (int i = 0; i < total; i++) { circle(src, Point((int)keyPoints[i].pt.x, (int)keyPoints[i].pt.y), 2, Scalar(0, 0, 255), -1, 8, 0); } namedWindow("Corners", CV_WINDOW_AUTOSIZE); imshow("Corners", src); waitKey(0); return 0;}
实现方法二:
#include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/features2d/features2d.hpp" #include <iostream> using namespace cv;using namespace std;int main(int argc, char** argv){ Mat src, gray; src = imread("D:\\8888.PNG"); if (!src.data) return -1; cvtColor(src, gray, CV_RGB2GRAY); std::vector<KeyPoint> keyPoints; cv::Ptr<cv::FastFeatureDetector> fast=cv::FastFeatureDetector::create(55); //特征点检测 fast->detect(gray, keyPoints); //在原图上画出特征点 drawKeypoints(src, keyPoints, src, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_OVER_OUTIMG); imshow("FAST feature", src); waitKey(0); return 0;}
0 0
- FAST特征点检测——opencv
- OpenCV中feature2D学习——FAST特征点检测
- OPENCV FAST特征点检测
- 特征点匹配——FAST特征点检测
- OpenCV学习笔记(四十六)——FAST特征点检测features2D
- OpenCV学习笔记(四十六)——FAST特征点检测features2D
- OpenCV学习笔记(四十六)——FAST特征点检测features2D
- Fast特征点检测
- FAST特征点检测
- FAST特征点检测
- FAST特征点检测
- FAST特征点检测
- Fast特征点检测
- FAST特征点检测
- FAST特征点检测
- OpenCV中feature2D学习——FAST特征点检测与SIFT/SURF/BRIEF特征提取与匹配
- 【opencv】特征点检测方法--GFTT,SIFT,FAST,SURF
- 【opencv】特征点检测方法--GFTT,SIFT,FAST,SURF
- Android学习笔记043之Shape详解
- 实参与形参
- 《构建之法》读书笔记——第17章 人、绩效和职业道德
- 数据结构实验之图论六:村村通公路
- Python爬虫demo
- FAST特征点检测——opencv
- FreeModbus源码详解
- nginx安装SSL证书
- 【Python】Python 简介
- GreenDao3.0的项目搭建及简单使用
- 友盟分享新浪分享出现sso package or sign error
- Uboot引导内核之前的应该确保的几个点
- hunnuoj11187—多连块拼图(湖南第七届省赛)
- 造成循环引用的情况