#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp" using namespace cv; void readme(); /** @function main */
int main( int argc, char** argv )
{
if( argc != )
{ return -; } Mat img_1 = imread( argv[], CV_LOAD_IMAGE_GRAYSCALE );
Mat img_2 = imread( argv[], CV_LOAD_IMAGE_GRAYSCALE ); if( !img_1.data || !img_2.data )
{ return -; } //-- Step 1: Detect the keypoints using SURF Detector
int minHessian = ; SurfFeatureDetector detector( minHessian ); std::vector<KeyPoint> keypoints_1, keypoints_2; detector.detect( img_1, keypoints_1 );
detector.detect( img_2, keypoints_2 ); //-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor; Mat descriptors_1, descriptors_2; extractor.compute( img_1, keypoints_1, descriptors_1 );
extractor.compute( img_2, keypoints_2, descriptors_2 ); //-- Step 3: Matching descriptor vectors with a brute force matcher
BruteForceMatcher< L2<float> > matcher;
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches ); //-- Draw matches
Mat img_matches;
drawMatches( img_1, keypoints_1, img_2, keypoints_2, matches, img_matches ); //-- Show detected matches
imshow("Matches", img_matches ); waitKey(); return ;
} /** @function readme */
void readme()
{ std::cout << " Usage: ./SURF_descriptor <img1> <img2>" << std::endl; }

最新文章

  1. Socket.io和Redis写Realtime App 之express初试
  2. SQL注入的字符串连接函数
  3. RabbitMQ(五) -- topics
  4. Java中定义Map常量,List常量
  5. HttpClient 教程 (A)
  6. windows和ubuntu下gif动态图片的制作
  7. 关于man和help的区别
  8. 使用WITH AS提高性能简化嵌套SQL
  9. C#基础总结之二循环控制-运算符
  10. Python入门笔记(11):集合
  11. 八皇后,回溯与递归(Python实现)
  12. 1.10 编程之美-双线程下载[double threads to download]
  13. pivot 与 unpivot 函数是SQL05新提供的2个函数 灰常灰常的实用
  14. PERCONA-TOOLKIT : pt-ioprofile分析IO情况
  15. CSAPP(深入理解计算机系统)读后感
  16. 关于HttpsURLConnection的连接问题
  17. Objective-C Blocks测试题与解析
  18. centos java环境搭建
  19. LINUX服务器搭建和常用配置介绍
  20. sublime中编辑服务器上的文件

热门文章

  1. HDU 1298 T9 字典树+DFS
  2. SQL基础教程(第2版)第3章 聚合与排序:3-1 对表进行聚合查询
  3. 对PHP-GC(垃圾回收)的一点理解
  4. tensorflow笔记(北大网课实战)
  5. DDL&amp;DML
  6. Java--类初始化
  7. STM32重映射
  8. JavaScript—瀑布流
  9. jsp的appilication.getInitParameter()方法无法获取到值的问题
  10. linux 离线安装mysql7或者8