博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ORB特征检测与匹配
阅读量:3978 次
发布时间:2019-05-24

本文共 1490 字,大约阅读时间需要 4 分钟。

ORB特征原理:

/* *@function ORB_Detect.cpp *@brief 使用ORB特征对目标进行检测和匹配 *@author ltc *@date 14:45 Thursday,December 3rd,2015*/#include
#include
#include
#include
#include
using namespace std;using namespace cv;vector
ransac(vector
queryKeyPoint,vector
trainKeyPoint,vector
matches);int main(int argc,char* argv[]){ Mat queryImage,trainImage; queryImage=imread("4.jpg",IMREAD_COLOR); trainImage=imread("3.jpg",IMREAD_COLOR); ORB orb; vector
queryKeyPoint,trainKeyPoint; Mat queryDescriptor,trainDescriptor; orb(queryImage,Mat(),queryKeyPoint,queryDescriptor); orb(trainImage,Mat(),trainKeyPoint,trainDescriptor); drawKeypoints(queryImage,queryKeyPoint,queryImage); drawKeypoints(trainImage,trainKeyPoint,trainImage); cout<
<
matches; matcher.match(queryDescriptor,trainDescriptor,matches); vector
ransac_matches; ransac_matches=ransac(queryKeyPoint,trainKeyPoint,matches); Mat image_match;// drawMatches(queryImage,queryKeyPoint,trainImage,trainKeyPoint,matches,image_match); drawMatches(queryImage,queryKeyPoint,trainImage,trainKeyPoint,ransac_matches,image_match); imshow("image_match",image_match); waitKey(0); return 0;}vector
ransac(vector
queryKeyPoint,vector
trainKeyPoint,vector
matches){ vector
ransac_matches; vector
queryPoint(matches.size()),trainPoint(matches.size()); for(int i=0;i
inlierMask(matches.size()); Mat H=findHomography(queryPoint,trainPoint,RANSAC,3,inlierMask); for(size_t i=0;i
匹配结果:

你可能感兴趣的文章
用datetime和pytz来转换时区
查看>>
python解决导出excel文件时中文文件名乱码
查看>>
Django操作NOSQL(MongoDB)数据库
查看>>
Failed to load JavaHL Library
查看>>
linux学习方法
查看>>
linux中nohup命令的用法
查看>>
vim代码智能提示功能及相关配置
查看>>
linux常用命令——ps
查看>>
linux常用命令——lsof
查看>>
nginx安装手册
查看>>
Nginx配置文件详细说明
查看>>
Nginx负载均衡
查看>>
CMD常用命令
查看>>
JavaScript之回调函数
查看>>
编程中同步/异步;阻塞/非阻塞
查看>>
第一个Java程序
查看>>
conda创建python环境
查看>>
pytorch学习入门:什么是pytorch+安装
查看>>
机器学习中ground truth的解释
查看>>
使用朴素贝叶斯进行分本分类
查看>>