Skip to content

Stitching and fusion of on-board surround view BEV real world image sequences, odometer estimation and output of large pixel map

Notifications You must be signed in to change notification settings

cuixing158/Visual-Based-Odometry-Estimation2

Repository files navigation

Visual-Based Odometry Estimation2

Sponsor View Visual-Based-Odometry-Estimation2 on File Exchange

This repo is an enhanced version of Visual-Based Odometry Estimation. In addition to supporting the existing features(following Features), it adds loop detection and graph optimization, supports efficient C/C++ code generation, allows for deep customization with a C++ OpenCV MEX interface, and enables hybrid programming!

Features

  • Real-time application construction without the need to predefine the map size
  • Pixel maps correspond directly to physical maps, facilitating easy query and localization
  • Based on pure image algorithm only (no IMU, GPS, WheelEncoder, etc. to assist).
  • Supports embedded C/C++ code generation

Requirements

MathWorks Products(<www.mathworks.com>)

  • MATLAB® R2022b or later
  • Computer Vision Toolbox™
  • Image Processing Toolbox™
  • Navigation Toolbox™

Open C++ Library:

  • OpenCV 4.x(Open Source Computer Vision Library)

Complier

  • C++ Compiler (e.g., GCC, Clang, or MSVC)

Loop closure detection and optimization

姿态图节点图优化:

poseGraphOptim

全局像素图像优化前:

beforeOptim

全局像素图像优化后:

afterOptim

集成的DBOW3使用MATLAB的ORB特征,检索效果略好于matlab build-in 的bof。为便于对比,算法设置同样的参数配置,top9 view,queryID分别选取283、300、2087与上述进行对比。

测试基准:使用MATLAB内建函数detectORBFeaturesextractFeatures默认设置的结果特征输入给原始DBOW3,每张图片提取的特征数定固定为为尽可能多(HXW,一般典型特征点数量5000左右),无均匀处理。2687张480x640图片提取的词袋特征耗时17min左右!

queryID=283,DBOW3表现,同样,绿色框为re-ranking的最佳选择:
bof1

queryID=300,DBOW3表现,同样,绿色框为re-ranking的最佳选择:
bof1

queryID=2087,DBOW3表现,同样,绿色框为re-ranking的最佳选择:
bof1

另外关于loopClosure运作机理详细情况请参阅窥探loop closure姿态图优化的运作机理

Performance

硬件:4 cores,Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz,754G RAM
软件:Ubuntu20.04,MATLAB R2023a,OpenCV 4.6.0

词袋生成性能

benchmark: 使用最初提供的的$480\times640$大小灰度图像,共2687张图像,典型每张图像最多能检测到4000~5000个orb特征点。

  • OpenCV内建函数detectAndCompute的ORB特征检测器除了numFeatures参数其他均按照默认设置
  • MATLAB内建函数detectORBFeaturesextractFeatures使用同OpenCV的默认设置

分别在本2D SLAM主模块中将提取到的ORB特征输入给原始C++版本的DBOW3,测试生成词袋特征性能和最相似分数分布,见下表。

#Max features(numFeatures) Time consuming generation of database.yml.gz Most similarity score distribution(mode)
DBOW3(opencv extract image features input) 2000 >7.15min 0.2
DBOW3(MATLAB extract image features input) 1000 3.3min 0.17
DBOW3(MATLAB extract image features input) 2000 7.15min 0.2
DBOW3(MATLAB extract image features input) all 17min 0.4

从上表可知:生成词袋特征耗时主要受到#Max features(numFeatures)因素的影响,这主要是因为特征较多时候,创建视觉单词计算量较大,聚类,TF-IDF都会受到影响,相似性分数分布普遍较高,符合我们直观感受。可根据实际情况斟酌选用组合。

数据序列化/反序列化性能

对于MATLAB结构体数据序列化/反序列化,支持针对任意通用MATLAB结构体数据结构,不依赖具体的数据类型,并认真做了实践比较,参考见下表:

serializers Size Load Avg Time(sec) Save Avg Time(sec)
opencv(yml.gz) 145M 17.27 25.52
cereal(binary) 110M 0.49 0.51
boost 待测 待测 待测
matlab内置(mat) 84M 0.76 5.06
自己方法实现的 110M 0.42 0.43
typedef struct imageViewSt {
    cv::Mat descriptors;
    std::vector<cv::Point2d> keyPoints;
} imageViewSt;

与之对应MATLAB数据结构体imageViewSt为

struct array with fields:
    Features
    Points

存储数据设计为含有1198个结构体的数组,每个结构体有两个域段FeaturesPoints,其Features为$2000\times32$大小的uint8数据,Points为$2000\times2$大小的double数据,在C++和MATLAB环境下数据类型和大小均保持一致!测试脚本见unitTestSuitsAndBenchMarkcereal_benchmark。关于boost未测,但可参考此处间接比较。

Function Dependency Graph

graph

Image Localization

利用已经建好的地图,加载视觉特征,然后随机给定一定位图片,定位效果图如下:
orb_performance

About

Stitching and fusion of on-board surround view BEV real world image sequences, odometer estimation and output of large pixel map

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published