资源简介
角点检测:Harris角点及Shi-Tomasi角点检测
参考博客:http://blog.csdn.net/xiaowei_cqu/article/details/7805206
参考博客:http://blog.csdn.net/xiaowei_cqu/article/details/7805206
代码片段和文件信息
/**
* @function cornerDemo.cpp
* @brief Demo code for detecting corners using Harris-Stephens method and Shi-Tomasi method
* @author Wei Lan http://blog.csdn.net/xiaowei_cqu
*/
#include
#include
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/core/core.hpp“
#include “opencv2/legacy/legacy.hpp“
#include “opencv2/nonfree/nonfree.hpp“
#include “opencv2/highgui/highgui.hpp“
#include “opencv2/calib3d/calib3d.hpp“
#include
using namespace cv;
using namespace std;
//Global variables
Mat src src_graydst_norm_scaled;
int thresh = 110;
int max_thresh = 150;
int maxCorners = 23;
int maxTrackbar = 100;
char* source_window = “Source image“;
char* corners_window = “Corners detected“;
/// Function header
void cornerHarris_demo( int void* );
void cornerShiTomasi_demo( int void* );
int main( )
{
src = imread(“images\\corner.png“1);
cvtColor( src src_gray CV_BGR2GRAY );
/// Create a window and a trackbar
namedWindow( source_window CV_WINDOW_AUTOSIZE );
createTrackbar( “Harris: “ source_window &thresh max_thresh cornerHarris_demo );
createTrackbar( “ShiTomasi:“ source_window &maxCorners maxTrackbar cornerShiTomasi_demo );
namedWindow( corners_window CV_WINDOW_AUTOSIZE );
namedWindow( source_window CV_WINDOW_AUTOSIZE );
cornerHarris_demo( 0 0 );
cornerShiTomasi_demo( 0 0 );
waitKey(0);
return(0);
}
void cornerHarris_demo( int void* )
{
Mat dst dst_norm;
dst = Mat::zeros( src.size() CV_32FC1 );
/// Detector parameters
int blockSize = 2;
int apertureSize = 3;
double k = 0.04;
/// Detecting corners
cornerHarris( src_gray dst blockSize apertureSize k BORDER_DEFAULT );
/// Normalizing
normalize( dst dst_norm 0 255 NORM_MINMAX CV_32FC1 Mat() );
convertScaleAbs( dst_norm dst_norm_scaled );
/// Drawing a circle around corners
for( int j = 0; j < dst_norm.rows ; j++ )
{ for( int i = 0; i < dst_norm.cols; i++ )
{
if( (int) dst_norm.at(ji) > thresh )
{
circle( dst_norm_scaled Point( i j ) 5 Scalar(0) -1 8 0 );
circle(srcPoint( i j ) 5 Scalar(25500) -1 8 0 );
}
}
}
/// Showing the result
imshow( corners_window dst_norm_scaled );
imshow( source_window src );
}
void cornerShiTomasi_demo( int void* )
{
if( maxCorners < 1 ) { maxCorners = 1; }
/// Parameters for Shi-Tomasi algorithm
vector corners;
double qualityLevel = 0.01;
double minDistance = 10;
int blockSize = 3;
bool useHarrisDetector = false;
double k = 0.04;
/// Copy the source image
Mat cormat;
/// Apply corner detection :Determines strong corners on an image.
goodFeaturesToTrack( src_gray
corners
maxCorners
qualityLevel
minDistance
Mat()
blockSize
useHarr
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26055 2002-12-01 23:38 corner.png
文件 3354 2012-07-31 13:33 cornerDemo.cpp
文件 887610 2012-07-30 18:44 Good Features to Track.pdf
文件 1129984 2012-07-30 19:09 Harris角点检测.ppt
相关资源
- Shielden试用次数、天数破解专用工具
- CamShift算法详解
- opencv 实现 meanshift 的目标跟踪
- springboot + shiro + mybatis-plus + beetl后台管
- tianshiqqjiedong.zip
- 基于多层石墨烯的频选表面的微波吸
- 图像拼接技术及其实现
- 跟我学Shiro教程.rar
- shiro反序列化复现.zip
- Fashion-MNIST
- Principles of Magnetic Resonance Imaging by Ni
- fashion_mnist数据集已转成csv文件
- springMVC+hibernate+spring+shiro整合
- [计算机图形学].(美国)Peter.Shirley
- Shiro学习,以及与SpringMVC整合,标签注
- ssm整合shrio框架
- 计算机图形学.Peter.Shirley.pdf
- iOS 7 Programming Pushing the Limit
- Bioinformatics with R Cookbook-Packt Publishin
- 通用考试系统V2019
- fashion-mnist数据集和论文
- 设计模式实训教程ppt+类图+代码
- 图像拼接的经典论文
- 互联网+商业计划书70份.7z
- renlianshibie-keras.zip
- 高仿小米商城对应的后台管理系统
- intallshield 6.22 专业版 + 东方语言包
- 船舶图片数据集
- 虹膜识别代码
- BNF-寇申海.rar
评论
共有 条评论