VDO-SLAM配置

一、配置
1. opencv
OpenCV version >= 3.4
查看方式:pkg-config --modversion opencv
安装方式:OpenCV源码安装

2. g2o
g2o >= 3.1.0

3. 下载
cd && git clone https://gitcode.net/mirrors/halajun/VDO_SLAM.git VDO-SLAM
cd VDO-SLAM
chmod +x build.sh
./build.sh

4. 编译
4.1 缺少xfeatures2d文件
从https://gitcode.net/opencv/opencv_contrib/-/tree/4.x/modules/xfeatures2d/include/opencv2
处下载文件和文件夹,粘贴到/usr/include/opencv2中

4.2 DRAW_OVER_OUTIMG
cv::drawKeypoints(… , 1); 改为 cv::drawKeypoints(… , cv::DrawMatchesFlags::DRAW_OVER_OUTIMG);

4.3 CV_GRAY2RGB not declared
/home/howtoloveyou/VDO-SLAM/src/Tracking.cc:496:35: error: ‘CV_GRAY2RGB’ was not declared in this scope
496 | cvtColor(mImGray, mImBGR, CV_GRAY2RGB);
| ^~~~~~~~~~~
添加头文件:#include

4.4 error: ‘CV_FILLED’ was not declared in this scope
CV_FILLED改为:cv::FILLED

4.5 error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope
添加头文件:#include
将CV_LOAD_IMAGE_UNCHANGED替换为cv::IMREAD_UNCHANGED

4.6 error: ‘readOpticalFlow’ is not a member of ‘cv::optflow’; did you mean ‘calcOpticalFlowSF’?
cv::optflow::readOpticalFlow改为:cv::readOpticalFlow

5. 运行
下载 demo-kitti,解压到VDO-SLAM下,通过如下的命令运行:
cd ~/VDO_SLAM && ./example/vdo_slam example/kitti-0000-0013.yaml demo-kitti/
 

你可能感兴趣的:(ubuntu)