https://www.cnblogs.com/anqiang1995/p/7398218.html

opencv2中SurfFeatureDetector、SurfDescriptorExtractor、BruteForceMatcher在opencv3中发生了改变。具体如何完成特征点匹配呢?示例如下:

//寻找关键点

int minHessian = 700;

Ptr<SURF>detector = SURF::create(minHessian);

detector->detect( srcImage1, keyPoint1 );

detector->detect( srcImage2, keyPoints2 );

//绘制特征关键点

Mat img_keypoints_1; Mat img_keypoints_2;

drawKeypoints( srcImage1, keypoints_1, img_keypoints_1, Scalar::all(-1), DrawMatchesFlags::DEFAULT );

drawKeypoints( srcImage2, keypoints_2, img_keypoints_2, Scalar::all(-1), DrawMatchesFlags::DEFAULT );

//显示效果图

imshow("特征点检测效果图1", img_keypoints_1 );

imshow("特征点检测效果图2", img_keypoints_2 );

//计算特征向量

Ptr<SURF>extractor = SURF::create();

Mat descriptors1, descriptors2;

extractor->compute( srcImage1, keyPoint1, descriptors1 );

extractor->compute( srcImage2, keyPoints2, descriptors2 );

//使用BruteForce进行匹配

Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce");

std::vector< DMatch > matches;

matcher->match( descriptors1, descriptors2, matches );

//绘制从两个图像中匹配出的关键点

Mat imgMatches;

drawMatches( srcImage1, keyPoint1, srcImage2, keyPoints2, matches, imgMatches );//进行绘制

//显示

imshow("匹配图", imgMatches );

3.x的特征检测:

  • 算法:SURF,SIFT,BRIEF,FREAK
  • 类:cv::xfeatures2d::SURF
  1. cv::xfeatures2d::SIFT
  2. cv::xfeatures::BriefDescriptorExtractor
  3. cv::xfeatures2d::FREAK
  4. cv::xfeatures2d::StarDetector
  • 需要进行以下几步
  1. 加入opencv_contrib
  2. 包含opencv2/xfeatures2d.hpp
  3. using namepsace cv::xfeatures2d
  4. 使用create(),detect(),compute(),detectAndCompute()

opencv3中surfDetector中使用的更多相关文章

  1. 在OpenCV3.1.0中使用SIFT,SURF算法

    写在前边: 1.我使用的是python2.7 + OpenCV3.1.0 2.OpenCV3.0.0+的文档有很大问题,很多文档写的还是OpenCV2.0+, OpenCV3.0+根本用不了,其中有一 ...

  2. Firebug中调试中的js脚本中中文内容显示为乱码

    Firebug中调试中的js脚本中中文内容显示为乱码 设置 页面 UFT-8 编码没用, 解决方法:点击 "Firebug"工具栏 中的"选项"---" ...

  3. C#中DataTable中的Compute方法使用收集

    原文: C#中DataTable中的Compute方法使用收集 Compute函数的参数就两个:Expression,和Filter. Expresstion是计算表达式,关于Expression的详 ...

  4. js中== 和===中的区别

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  5. win7中VS2010中安装CSS3.0问题解决方法

    win7中VS2010中安装CSS3.0问题解决方法   在安装Standards Update for VS2010 SP1后,VS2010中没有CSS3.0问题,以下是我的解决方法 1.首先去官网 ...

  6. cocos2dx常见的46中+22中动作详解

    cocos2dx常见的46中+22中动作详解 分类: iOS2013-10-16 00:44 1429人阅读 评论(0) 收藏 举报 bool HelloWorld::init(){    ///// ...

  7. Nhibernate中 Many-To-One 中lazy="proxy" 延迟不起作用的原因

    2010-07-15 12:10 by 彭白洋, 322 阅读, 0 评论, 收藏, 编辑 NHibernate中 Many-To-One 中lazy="proxy" 延迟不起作用 ...

  8. IOS获取物理尺寸中7Plus中获取的是7的物理尺寸

    IOS获取物理尺寸中7Plus中获取的是7的物理尺寸: 在开发调试过程中我的7Plus手机获取[uiscreen mainscreen].bounds为750  .1334. 解决方案:在手机中的显示 ...

  9. 【转】Java中字符串中子串的查找共有四种方法(indexof())

    原文网址:http://wfly2004.blog.163.com/blog/static/1176427201032692927349/ Java中字符串中子串的查找共有四种方法,如下:1.int ...

随机推荐

  1. TI低功耗蓝牙(BLE)介绍【转】

    转自:http://blog.csdn.net/ooakk/article/details/7302425 TI低功耗蓝牙(BLE)介绍 本文档翻译和修改自参考资料:CC2540Bluetooth L ...

  2. eclipse的快捷键(常用)

    ctrl+shift+r 全局查找java类 ctrl +h       全局查找包含某某内容的文件位置 ctrl +alt+h  右击方法名 选择open call hierarchy

  3. 深入理解JAVA虚拟机原理之内存分配策略(二)

    更多Android高级架构进阶视频学习请点击:https://space.bilibili.com/474380680 1.对象优先在Eden分配 大多情况,对象在新生代Eden区分配.当Eden区没 ...

  4. python调用tushare获取A股上市公司基础信息

    接口:stock_company 描述:获取上市公司基础信息 积分:用户需要至少120积分才可以调取,具体请参阅最下方积分获取办法 注:tushare库下载和初始化教程,请查阅我之前的文章 输入参数 ...

  5. uoj#244. 【UER #7】短路

    题目 orz myy 这个矩形对称的性质非常优美,所以我们只需要考虑一个\(\frac{1}{4}\)的矩阵,即一个倒三角形 现在我们要求的是从\((1,1)\)到三角形对边上每个点的最短路,不难发现 ...

  6. springfox-swagger原理解析与使用过程中遇到的坑

    swagger简介 swagger确实是个好东西,可以跟据业务代码自动生成相关的api接口文档,尤其用于restful风格中的项目,开发人员几乎可以不用专门去维护rest api,这个框架可以自动为你 ...

  7. 实现简单的PHP接口,以及使用js/jquery ajax技术调用此接口

    主要介绍下如何编写简单的php接口,以及使用js/jquery的ajax技术调用此接口. Php接口文件(check.php): <?php $jsonp_supporter = $_GET[‘ ...

  8. etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc等配置文件区别

    什么是交互式shell和非交互式shell,什么是login shell 和non-login shell. 交互式模式:就是shell等待你的输入,并且执行你提交的命令.这种模式被称作交互式是因为s ...

  9. iOS录音后播放声音变小的解决方法

    目前需求是录音之后再播放出来.经常会出现播放声音变很小的情况. 解决方法: if (recorder.recording){ [recorder stop]; } [[AVAudioSession s ...

  10. vagrant ssh try

    Vagrantfile add Vagrant.configure("2") do |config| config.vm.network "private_network ...