这部分并不难,主要用到了一个词袋模型(BoW),对两幅图像的特征点进行匹配。
创建字典:一个单词是某一类特征的集合,字典生成是个聚类问题,可使用K-meams算法。
匹配相似性:暴力计算量太大,可用二分查找提升效率,以及k叉树表达字典(层次聚类)
目录:
feature_training.cpp
loop_closure.cpp
feature_training.cpp
#include "DBoW3/DBoW3.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <iostream>
#include <vector>
#include <string>
using namespace cv;
using namespace std;
/***************************************************
* 本节演示了如何根据data/目录下的十张图训练字典
* ************************************************/
int main( int argc, char** argv )
{
// 1.读入10张图像
cout<<"reading images... "<<endl;
vector<Mat> images;
for ( int i=0; i<10; i++ )
{
string path = "./data/"+to_string(i+1)+".png";//to_string数值转为字符串
images.push_

本文总结了视觉SLAM中回环检测的字典创建过程,使用词袋模型(BoW)对图像特征点进行聚类。通过K-means算法创建字典,并采用二分查找和k叉树提升匹配效率。在`feature_training.cpp`中,读取图像并创建字典,而在`loop_closure.cpp`中,加载字典进行回环检测的匹配操作。
最低0.47元/天 解锁文章
685

被折叠的 条评论
为什么被折叠?



