当前位置:网站首页>常用库安装
常用库安装
2022-07-26 11:00:00 【AutoGalaxy】
一. DBoW2
github的DBoW2不能替代ORBSLAM2内部的库,ORBSLAM2多实现了一些函数在内部,别再尝试了,再尝试得动源码。
之所以下载这个库,是因为你目前想手写一个ORBSLAM2,谁知道,ORBSLAM2内部自带的词袋模型只适用DBoW2,而不适用DBoW3,因此,你必须得自己引入DBoW2,这里就需要对比ORBSLAM2里面的DBoW2的CMakeLists文件了!
1. 先给出库的github下载地址:dorian3d/DBoW2: Enhanced hierarchical bag-of-word library for C++ (github.com)
https://github.com/dorian3d/DBoW2
下面是github的CMakeList文件

下面是ORBSLAM2里面的DBoW2的CMakeLists文件

可以看到orbslam2的dbow2代码跟github上的有一些区别
2. 开始正式移植
首先,移植关注的点应该在于:
(1)add_library生成的库包含什么文件
(2)生成的库名是什么样,生成的库类型(静态/共享)
(3)库链接了什么库
针对第(1)点
ORBSLAM2包含如下的文件


而github里面包含的文件如下
![]()
可以看见 第一点是不相同的,因此若编译出错,可以考虑一下这里是否少了DUtils库的内容
针对第(2)点
ORBSLAM2的是DBoW2
github的是${PROJECT_NAME},而${PROJECT_NAME}的值又是DBoW2,因此二者相同
针对第(3)点
ORBSLAM2 链接了如下

库类型是SHARED
github里面链接了如下
库类型是SHARED
综述所上可得,只有第一点不太相同,因此如果运行出错,大概率是由于第(1)点少了DUtils库导致的。
3. 最后也是最重要的一点,既然没有选择安装这个库,那么ORBSLAM2是如何包含头文件的呢?
我们都知道引用一个库包含以下两步骤
(1)包含头文件目录
(2)链接库文件
orbslam2太残暴了,它直接下面这样引用的

边栏推荐
- 菜鸟看源码之SparseArray
- MySQL数据库的简单使用
- 1837. Sum of digits under k-ary representation
- Pyqt5 rapid development and practice 3.1 QT designer quick start
- Bash shell learning notes (V)
- Linkedblockingqueue of novice source code
- Newbie sees the source code arraydeque
- Pytest fixture decorator
- Bash shell learning notes (I)
- Pyqt5 rapid development and practice Chapter 1 understanding pyqt5
猜你喜欢
随机推荐
Bash shell学习笔记(三)
easyui01
Drbl diskless startup + Clonezilla network backup and restore system
ISO 639:1988 : Code for the representation of names of languages
【转载】多元高斯分布(The Multivariate normal distribution)
easyui03
Traversal recursion + iteration of binary tree
静态路由和动态路由
复现php一句话木马
C notes
MySQL basic knowledge summary
easyui04
SparkSQL的UDF及分析案例,220725,
菜鸟看源码之ArrayList
There is an unhandled exception at 0x003b66c3 in MFC: 0xc000041d: unhandled exception encountered during user callback
Bash shell学习笔记(四)
Interview knowledge points
Novice source code hashtable
Classic Bluetooth connection process
Why give up NPM and turn to yarn
https://github.com/dorian3d/DBoW2








