单目视觉SLAM: Monoslam scenelib2 by Davison


补充:

`````````````````````````````````

EKFmonocularSLAM (matlab)  

1-Point RANSAC for EKF Filtering. Application to Real-Time Structure from Motion and Visual Odometry

```````````````````````````````````````````````


scenelib2: github: https://github.com/hanmekim/SceneLib2/tree/upgrade  (c++)

scenelib1:

  项目介绍 :http://www.doc.ic.ac.uk/~ajd/software.html

  相关论文 :   http://www.doc.ic.ac.uk/~ajd/publications.html

          SceneLib 1.0 (May 2006) is the latest release of my open source C++ library for real-time SLAM, and incorporates for the first timefull support for real-time MonoSLAM.

          Note however that SceneLib is now unmaintained, and is tricky to compile on modern systems. As of 2012, if you are interested in MonoSLAM I would recommendSceneLib2, written by Hanme Kim. This is a great re-implementation, with the same functionality as the original software but updated to use modern libraries and tools such as Eigen, Pangolin and CMake; and can be run either on my original file sequences or with a live USB camera.

这是英国帝国理工大学的Andrew J. Davison教授提出的实时slam开源库(2006),首次实现实时单目视觉slam效果。1版运行安装过于繁琐且不支持USB,2012Hanme Kim实现了改版,改后采用cmake的编译方式,其中也充分使用了Eigen(矩阵运算), Pangolin(显示相关)的库,而且可以采用多种相机格式,包括usb。。

=====================

一. 安装

   1.1    ubuntu 12.04 请按照工程中说明文档安装。一般都会成功。

   1.2   ubuntu 14.04

主要是在ffmpeg  Pangolin  安装会有问题,至少我遇到了。

ffmpeg被 libav 取代 ,参见说明。   ppa安装

ffmpeg had removed repo of Ubuntu, instead of libav. you should add ppa:

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg gstreamer0.10-ffmpeg

Uvc.cpp failing

====》 利用cmake_gui 进行cmake.


二. 准备:EKFSLAM 流程伪代码

      这个工程使用的是ekfslam的方式,你得要熟悉下基于已知环境ekfslam和未知环境EKFSLAM.

就例如人工路标处理(采用第一种),自然路标时(landmark采用第二种,马氏距离(manhalanobis distance) 达到一定程度)

1. 已知环境

2. 未知环境 : 对观测的landmark质量作评估(ML)。


               


三. scenelib 理论说明

 

  借用牛津大学 Paul Smith的ppt进行说明。

3.1 主要特点



1.  利用已知的模板建立世界坐标系。
2.  采用EKFSLAM的算法进行。
3.  landmark的管理: feature_model
part_feature_model
full_feature_mode
4.  初始化新特征时采取了粒子滤波的形式
 单目无法得到深度信息,只能利用刚开始时初始化已知的landmark物理信息,后利用相机的
运动来估计新andmark的深度信息
5. 特征跟踪与主动搜索的设计


注: 理清主线程.


3.2 变量说明

                                     系统坐标


 

1.  相机状态Xv   13维
(3笛卡尔坐标  4四元素 3线速度 3角速度)

2.   相机位姿 Xp 7 维                    


yi每个特征的3d位置  

Multivariate normal distribution

高斯分布
系统状态量   


3.3 Extended Kalman Filter

预测过程:



相机运动: 状态转移函数f(x,u);            先验估计



相机运动: 状态转移函数f(x,u);
            先验估计


t时刻的状态与t时刻的速度,一定时间后到达t+1时刻,预测就是估计t+1时刻的状态。
(注意时刻的对应性)

观测更新




测量模型属于后验估计。它强调的是当前t时刻的观测所表现的关系。

参考:运动估计时有个相机与landmark的t+1时刻估计,这是粗略的,到底在t+1时刻怎么样呢,t+1当前观测应该更具说服力点(如果当前观测值准确)。

那相机与特征的两相对关系有两种描述:
1)先验模型的运动预测(全局性) 表现的结果(局部性)(我叫它观测预测) :  h(x') 
2)后验的当前观测: z  。           (局部性)

===》一般先验存在累计误差,不定性大点,后验相对准确点,但是后验是局部性相对值,要体现全局又得依赖运动预测。
==》 为了减小偏差,那就得对两者进行融合。==》ekf更新

融合的依据又是什么呢:协方差
协方差越大,离散度越大,可信度越低。
=>对比测量协方差与观测协方差 ->调节EKF增益。


注意:map到image的映射。


3.4 测量步骤:特征提取与特征管理

opencv学习-feature-Shi-Tomasi corner detector

   Landmarks are identified from interest points detection. TheShi and Thomasi detector is used to define
salient points. The detection is based on local extrema of the gradient analysis of 15x15 pixels patches. The
eigenvalues of the following matrix are used to assess the quality of a potential interest point,through a
threshold (note that this is a symetric, definite positive matrix)




1. 提取的是显著性的图像块。                                                   
2. 一旦提取作为长期landmark使用。

3. 稀疏的landmark集不断增加无限储存。
(其实这可以很好的与闭环和图优化结合起来)                      

                                               
                             
×主动搜索:椭圆搜索
       特征更新协方差矩阵-->椭圆


模板匹配    via 显著相关性搜索

主动地图管理


粒子滤波估计特征(单目深度) Monocular Feature Initialisation with Depth Particles

There is no depth information from a single image. We need motion to recover this last piece of information.
This is done thanks to a particule filter. When an interest point is selected, we only know that this point
belongs to a certain line, called the epipolar line. To estimate where the point lies on this epipolar line, the
line is uniformly sampled by a given number of particules, where each particule represents a depth
hypothesis.
Of course, it is not possible with such a technique to sample the complete epipolar line, as it is
semi-infinite. A maximal depth hypothesis, related to the size of the environnement, limits the search zone.




系统状态的维护:

加入新landmark 的到状态变量与协方差矩阵

从状态变量与协方差矩阵删landmark 



四. SceneLib Libraries库说明

性能:



-------------------------------------

库说明

生成索引网页


运动模型类

测量模型

Fully-initialised 特征

Partially-initialised 特征

Monoslam库

主要函数:GoOneStep




五. 思考


     

Limitations 

From a theoritical point of view, there are several limits to this approach:

  • It is based on a EKF, which is a rough linearization (first order only). Is it thus prone to divergence. Moreover, one needs to tune the noise parameters, which can only be done by trials. Finally, it is very difficult for the filter to recover from a false landmark association. To help with this issue, we use many landmarks and we remove the "bad" landmarks.
  • The particule filter can be very slow to converge without good discriminant movements (such as translations), which can lead towards divergence.
  • This approch is based on visual interest points, and therefore is not possible in uniform environments.

On top of these issues, we faced some more practical problems, mainly linked to the video recorder:

  • The video recorder we had (only a camera, not a real video recorder) was not suited for this use:
    • The auto-focus changes the focal length automatically. Calibration was consequently not meaningful. That is why we used the camera in a restraint range of distance, to remain close to the valid region of the observation model (which uses a constant focal length).
      The camera parameters in the observation model were tuned manually to get an acceptable reprojection in the first pictures (based on the manually measured landmarks).
    • To reduce the distorsion, we decided to zoom in. The drawback of this method is a limited viewing-angle, making mapping more difficult (only a very limited area of the room is visible at a time).
    • The interlaced capture mode leads to blur in case of fast motion. By chance, the robusteness of the tracking overcame this limitation easily.
    • The automatic exposure capture could lead to significant change in the illumination of the landmarks. The normalization step of the patches-based description is a efficient way to make the traking robust regarding this issue.
  • Initial landmarks position: without a bench test, we could only have very rough measurements, which limits the precision of the whole system. Practically, this problem was not as bad as one could think it would be.

Conclusion 

Thanks to this project, we got a chance to learn a lot about SLAM, about the issues you have to face when implementing a real demonstrator, in particular with a standard camera, and about all these details no one ever talks about but which can ask for quite some time to work on...
To sum up, we were very happy of this project which was a lot of fun, and we are glad that we got a working result under these realistic conditions, and that with little time and no specific tools.

A few ideas to go further...

  • Using "inverse depth" parametrization
  • Using an UKF (Unscented Kalman Filter) instead of the EKF
  • Rao-Blackwellizing the filter (see FastSLAM)
  • Using the optical flow

六. 后记

  本人也是初学,看了点源码,对于期间涉及到的一些知识,谈谈自己的见解同时给后来想了解这个工程的同学提供点参考。想详细研究的请自行看论文与源码。主要是考虑国内直接介绍性文档太少,为帮助与我一样入门级同学写此博文,提供相应资料。由于水平有限,如有误导在此道歉,也欢迎大家批评指正。先写到这,后面有新的想法再补充。大家如果有后续相关文献提供参考,希望能够留言给出,大家共同学习进步。

相关资料集:链接: http://pan.baidu.com/s/1bnx3BZp密码: w7xx

=====================================================================================================================

参考:

scenelib2: github: https://github.com/hanmekim/SceneLib2/tree/upgrade

scenelib1:  项目介绍 :http://www.doc.ic.ac.uk/~ajd/software.html  相关论文 :   http://www.doc.ic.ac.uk/~ajd/publications.html

MATLAB Implementation of MonoSLAM: reproduce Professor Davison's 2003 paper "Real-Time Simultaneous Localisation and Mapping with a Single Camera",(推荐)




 

  • 5
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值