关于ORB-SLAM2、VI_ORB_SLAM2的编译问题 Opencv4.4.0

1.关于Opencv4.42.缺少头文件3、头文件失效4、Opencv定义更换5、

1.关于Opencv4.4

报错:

OpenCV > 2.4.3 not found.

– Configuring incomplete, errors occurred!

修改cmakelist.txt,将opencv3.0改为4.4,一个是orbslam2文件夹,另一个是DBoW2文件夹。

find_package(OpenCV 4.4 QUIET)

if(NOT OpenCV_FOUND)

find_package(OpenCV 2.4.3 QUIET)

if(NOT OpenCV_FOUND)

message(FATAL_ERROR "OpenCV > 2.4.3 not found.")

endif()

endif()

2.缺少头文件

报错:

error: ’usleep’ was not declared in this scope

可能还有一些关于usleep的错误

报错的文件包括:mono_euroc.cc、mono_kitti.cc、mono_tum.cc、rgbd_tum.cc、stereo_euroc.cc、stereo_kitti.cc、LoopClosing.cc、System.cc、Viewer.cc 在报错的文件上添加:

#include

3、头文件失效

报错:

fatal error: opencv/cv.h: 没有那个文件或目录

#include

报错文件:ORBextractor.h

#include

替换为

#include

#include

4、Opencv定义更换

报错:

error:'CV_LOAD_IMAGE_UNCHANGED' was not declared in this scope

报错的文件包括:mono_euroc.cc、mono_kitti.cc、mono_tum.cc、rgbd_tum.cc、stereo_euroc.cc、stereo_kitti.cc

CV_LOAD_IMAGE_UNCHANGED

替换为

cv::IMREAD_UNCHANGED

5、

报错:

/usr/include/c++/9/bits/stl_map.h:122:71: error: static assertion failed: std::map must have the same value_type as its allocator

122 | static_assert(is_same::value,

^~~~~

报错文件:LoopClosing.h

typedef map,

Eigen::aligned_allocator > > KeyFrameAndPose;

替换为

typedef map,

Eigen::aligned_allocator > > KeyFrameAndPose;

相关文章

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: