Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to build from source on aarch64, opencv 4.* - FAQ #148

Open
zoldaten opened this issue Sep 2, 2023 · 0 comments
Open

how to build from source on aarch64, opencv 4.* - FAQ #148

zoldaten opened this issue Sep 2, 2023 · 0 comments

Comments

@zoldaten
Copy link

zoldaten commented Sep 2, 2023

Screenshot_1

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. changes
sed -i 's/++11/++14/g' CMakeLists.txt
nano CMakeLists.txt
    find_package(OpenCV 4.0 QUIET)
     ...
    find_package(Eigen3 NO_MODULE)
    find_package(Pangolin REQUIRED)

1.1.DBow
nano Thirdparty/DBoW2/CMakeLists.txt
find_package(OpenCV 4.0 QUIET)

2.Pangolin

cd ~
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
git checkout eab3d3449a33a042b1ee7225e1b8b593b1b21e3e
mkdir build && cd build
cmake     -DCMAKE_BUILD_TYPE=Release     -DCMAKE_INSTALL_PREFIX=/usr/local     -DBUILD_EXAMPLES=OFF     -DBUILD_PANGOLIN_DEPTHSENSE=OFF     -DBUILD_PANGOLIN_FFMPEG=OFF     -DBUILD_PANGOLIN_LIBDC1394=OFF     -DBUILD_PANGOLIN_LIBJPEG=OFF     -DBUILD_PANGOLIN_LIBOPENEXR=OFF     -DBUILD_PANGOLIN_LIBPNG=OFF     -DBUILD_PANGOLIN_LIBTIFF=OFF     -DBUILD_PANGOLIN_LIBUVC=OFF     -DBUILD_PANGOLIN_LZ4=OFF     -DBUILD_PANGOLIN_OPENNI=OFF     -DBUILD_PANGOLIN_OPENNI2=OFF     -DBUILD_PANGOLIN_PLEORA=OFF     -DBUILD_PANGOLIN_PYTHON=OFF     -DBUILD_PANGOLIN_TELICAM=OFF     -DBUILD_PANGOLIN_UVC_MEDIAFOUNDATION=OFF     -DBUILD_PANGOLIN_V4L=OFF     -DBUILD_PANGOLIN_ZSTD=OFF     ..
make -j4 && sudo make install

3.changes

nano /home/rock/ORB_SLAM2/include/ORBextractor.h
    //#include <opencv/cv.h>
      #include <opencv2/opencv.hpp>
  1. 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.cc

  2. add #include <opencv2/opencv.hpp> to
    /ORB_SLAM2/src/FrameDrawer.cc

  3. add

#include <opencv2/imgproc/types_c.h>
#include <opencv2/opencv.hpp>
using namespace cv;

to:
/ORB_SLAM2/include/System.h
/ORB_SLAM2/include/PnPsolver.h

  1. 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;

  2. add

#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

@zoldaten zoldaten changed the title how to build from source jn aarch64 - FAQ how to build from source on aarch64, opencv 4.* - FAQ Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant