#include <unistd.h>
#include <opencv2/imgproc/types_c.h>
#include <opencv2/opencv.hpp>
using namespace cv;
and change CV_LOAD_IMAGE_UNCHANGED to IMREAD_UNCHANGED (should looks like - imRGB = cv::imread(string(argv[3])+"/"+vstrImageFilenamesRGB[ni],IMREAD_UNCHANGED);
in files:
nano /home/rock/ORB_SLAM2/Examples/RGB-D/rgbd_tum.cc
/ORB_SLAM2/Examples/Stereo/stereo_kitti.cc
/ORB_SLAM2/Examples/Stereo/stereo_kitti.cc
/ORB_SLAM2/Examples/Stereo/stereo_euroc.cc
/ORB_SLAM2/Examples/Monocular/mono_tum.cc
/ORB_SLAM2/Examples/Monocular/mono_kitti.cc
/ORB_SLAM2/Examples/Monocular/mono_euroc.cc
i do not pretend to full wiki but i built it successfully after several attempts. here what i fixed.
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2 && cd ORB_SLAM2
1.1.DBow nano Thirdparty/DBoW2/CMakeLists.txt find_package(OpenCV 4.0 QUIET)
2.Pangolin
3.changes
add
#include <unistd.h>
to files: /ORB_SLAM2/src/LoopClosing.cc /ORB_SLAM2/src/System.cc /ORB_SLAM2/src/Tracking.cc /ORB_SLAM2/src/LocalMapping.cc /ORB_SLAM2/src/Viewer.ccadd
#include <opencv2/opencv.hpp>
to /ORB_SLAM2/src/FrameDrawer.ccadd
to: /ORB_SLAM2/include/System.h /ORB_SLAM2/include/PnPsolver.h
fix ORB_SLAM2/include/LoopClosing.h : before:
Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
after:Eigen::aligned_allocator<std::pair<KeyFrame* const, g2o::Sim3> > > KeyFrameAndPose;
add
and change
CV_LOAD_IMAGE_UNCHANGED
toIMREAD_UNCHANGED
(should looks like -imRGB = cv::imread(string(argv[3])+"/"+vstrImageFilenamesRGB[ni],IMREAD_UNCHANGED);
in files: nano /home/rock/ORB_SLAM2/Examples/RGB-D/rgbd_tum.cc /ORB_SLAM2/Examples/Stereo/stereo_kitti.cc /ORB_SLAM2/Examples/Stereo/stereo_kitti.cc /ORB_SLAM2/Examples/Stereo/stereo_euroc.cc /ORB_SLAM2/Examples/Monocular/mono_tum.cc /ORB_SLAM2/Examples/Monocular/mono_kitti.cc /ORB_SLAM2/Examples/Monocular/mono_euroc.cc