一、配置
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 <opencv2/imgproc/types_c.h>
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 <opencv2/opencv.hpp> 将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
|