opencv3 确定图像强角点-goodFeaturesToTrack函数
2015-11-05 23:11
309 查看
#include<iostream> #include<opencv2/opencv.hpp> #include<vector> using namespace cv; using namespace std; int main() { Mat srcImage = imread("2.jpg"); imshow("【原图】", srcImage); //因为强角点检测函数的输入图像是一个单通道的图像,所以,先对原图像进行图像空间的转换 Mat grayImage; cvtColor(srcImage, grayImage, CV_BGR2GRAY); //开始进行强角点检测 //先配置需要的函数参数 vector<Point2f> dstPoint2f; goodFeaturesToTrack(grayImage, dstPoint2f, 200, 0.01, 10, Mat(), 3); //遍历每个点,进行绘制,便于显示 Mat dstImage; srcImage.copyTo(dstImage); for (int i = 0; i < (int)dstPoint2f.size(); i++) { circle(dstImage, dstPoint2f[i], 3, Scalar(theRNG().uniform(0, 255), theRNG().uniform(0, 255), theRNG().uniform(0, 255)) , 2, 8); } imshow("【检测到的角点图】", dstImage); waitKey(0); return 0; }
相关文章推荐
- C语言开发Linux下web服务器(支持GET/POST,SSL,目录显示等)
- opencv3 实现模版匹配-鼠标事件
- 用IIS配置反向代理实现方法(图文)
- opencv3 实现模版匹配-matchTemplate函数
- opencv3 计算一维直方图-灰度直方图的计算
- opencv3 计算反向投影-鼠标事件
- opencv3 计算反向投影-calcBackProject函数-滚动条
- linux c/c++ 后台开发常用算法之:md5算法c++版实现
- nginx不浏览直接下载文件
- linux用户的增加
- opencv3 计算二维直方图-H-S直方图
- opencv3 绘制一维直方图-灰度直方图的绘制-柱状图
- opencv3 绘制一维直方图-灰度直方图的绘制
- opencv3 绘制二维直方图-H-S直方图
- opencv3 绘制BGR三色直方图-柱状图
- opencv3 绘制BGR三色直方图
- opencv3 对比直方图-compareHist函数
- 提升vps网速
- Nginx之location 匹配规则详解
- nginx下载文件 apk ios