特征提取、匹配以及位姿计算(2D-2D)--参考视觉SLAM十四讲7.4

该程序展示了如何利用ORB特征检测器进行2D图像匹配,并通过特征匹配估计两个图像间的相对姿态。首先,ORB检测器用于找出图像的关键点并计算其描述符。接着,BFMatcher进行匹配并筛选有效匹配。最后,通过找到的基础矩阵、本质矩阵和 homography 进行位姿计算。
摘要由CSDN通过智能技术生成

#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
using namespace std;
using namespace cv;

void pose_estimation_2d2d
(std::vector<KeyPoint> keypoints1,
std::vector<KeyPoint> keypoints2,
std::vector<DMatch> matches,
Mat& R,Mat & t);

void find_feature_match
(Mat imag1,Mat imag2,
vector<KeyPoint> &keypoints1,
vector<KeyPoint> &keypoints2,
vector<DMatch>& matches);

Point2d pixel2cam ( const Point2d& p, const Mat& K );

int main(int argc, char **argv)
{
/* if(argc !=3){
cout<<"usage:feature_extraction img1 img2"<<endl;
return 1;
}*/
//读取图像
Mat imag1=imread(&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值