####仅作为笔记
环境要求:
Ubuntu 14.04, 15.04 or 16.04
CMake
OpenGL
CUDA >= 7.0
OpenNI2
SuiteSparse
Eigen
Boost
zlib
libjpeg
OpenCV
DLib @ 330bdc10576f6bcb55e0bd85cd5296f39ba8811a
DBoW2 @ 4a6eed2b3ae35ed6837c8ba226b55b30faaf419d
DLoopDetector @ 84bfc56320371bed97cab8aad3aa9561ca931d3f
iSAM
PCL
Pangolin
贴出build.sh的内容,为了便于找到错误,分别安装:
#!/bin/bash
mkdir deps &> /dev/null
cd deps
#Add necessary extra repos
version=$(lsb_release -a 2>&1)
if [[ $version == *"14.04"* ]] ; then
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
rm cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo add-apt-repository -y ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install -y libpcl-all
elif [[ $version == *"15.04"* ]] ; then
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1504/x86_64/cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1504_7.5-18_amd64.deb
rm cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y libpcl-dev yasm libvtk5-qt4-dev
else
echo "Don't use this on anything except 14.04 or 15.04"
exit
fi
sudo apt-get install -y cmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-7-jdk freeglut3-dev python-vtk libvtk-java libglew-dev cuda-7-5 libsuitesparse-dev
#Installing Pangolin
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ../ -DAVFORMAT_INCLUDE_DIR=""
make -j8
cd ../..
if [[ $version == *"15.04"* ]] ; then
#Up to date OpenNI2 only included in the 14.04 PCL PPA
git clone https://github.com/occipital/OpenNI2.git
cd OpenNI2
make -j8
cd ..
#15.04 needs ffmpeg to stop OpenCVs build dying, otherwise DBoW won't build (which also won't build with OpenCV3, hurray dependencies!)
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg/
git reset --hard cee7acfcfc1bc806044ff35ff7ec7b64528f99b1
./configure --enable-shared
make -j8
sudo make install
sudo ldconfig
cd ..
rm -rf ffmpeg
fi
#Building OpenCV from scratch without Qt and with nonfree
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9.zip
rm opencv-2.4.9.zip
cd opencv-2.4.9
mkdir build
cd build
cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF -D WITH_OPENCL=OFF -D WITH_OPENMP=ON -D INSTALL_C_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D WITH_QT=OFF -D WITH_OPENGL=OFF -D WITH_VTK=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF ..
make -j8
sudo make install
echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf
sudo ldconfig
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/bash.bashrc
source /etc/bash.bashrc
cd ../..
rm -rf opencv-2.4.9
#DLib for place recognition
git clone https://github.com/dorian3d/DLib.git
cd DLib
git reset --hard 330bdc10576f6bcb55e0bd85cd5296f39ba8811a
mkdir build
cd build
cmake ../
make -j8
sudo make install
cd ../..
rm -rf DLib
#DBoW2 for place recognition
git clone https://github.com/dorian3d/DBoW2.git
cd DBoW2
git reset --hard 4a6eed2b3ae35ed6837c8ba226b55b30faaf419d
mkdir build
cd build
cmake ../
make -j8
sudo make install
cd ../..
rm -rf DBoW2
#DLoopDetector for place recognition
git clone https://github.com/dorian3d/DLoopDetector.git
cd DLoopDetector
git reset --hard 84bfc56320371bed97cab8aad3aa9561ca931d3f
mkdir build
cd build
cmake ../
make -j8
sudo make install
cd ../..
rm -rf DLoopDetector
#iSAM for pose graph optimisation
wget http://people.csail.mit.edu/kaess/isam/isam_v1_7.tgz
tar -xvf isam_v1_7.tgz
rm isam_v1_7.tgz
cd isam_v1_7
mkdir build
cd build
cmake ..
make -j8
sudo make install
cd ../..
rm -rf isam_v1_7
#Actually build Kintinuous
cd ..
mkdir build
cd build
cmake ../src
make -j8
- 依赖
sudo apt-get install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann-dev libeigen3-dev libboost-all-dev libvtk5-qt4-dev libvtk6.2 libvtk5-dev libqhull* libusb-dev libgtest-dev git-core freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphviz mono-complete qt-sdk openjdk-7-jdk openjdk-7-jre
- cuda
#安装Nvidia驱动的两种方式
https://blog.csdn.net/linhai1028/article/details/79445722?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.edu_weight
或者
https://blog.csdn.net/weixin_42546496/article/details/88640174?utm_medium=distribute.wap_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-10.wap_blog_relevant_no_pic2&depth_1-utm_source=distribute.wap_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-10.wap_blog_relevant_no_pic2
#安装cuda和cudnn
https://blog.csdn.net/wanzhen4330/article/details/81699769
http://blog.sina.com.cn/s/blog_4b0020f30102xgfz.html
- PCL
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release-DBUILD_GPU=OFF -DBUILD_apps=OFF -DBUILD_examples=OFF ..
make -j4
sudo make install
- OpenNI2
git clone https://github.com/occipital/OpenNI2.git
cd OpenNI2
make -j4
##在编译Kintinuous时手动加入lib库路径
- OpenCV
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9.zip
rm opencv-2.4.9.zip
cd opencv-2.4.9
mkdir build
cd build
cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF -D WITH_OPENCL=OFF -D WITH_OPENMP=ON -D INSTALL_C_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D WITH_QT=OFF -D WITH_OPENGL=OFF -D WITH_VTK=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF ..
make -j4
sudo make install
echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf
sudo ldconfig
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/bash.bashrc
source /etc/bash.bashrc
cd ../..
sudo rm -rf opencv-2.4.9
- DBoW2、DLib、DLoopDetector、iSAM
#DLib for place recognition
git clone https://github.com/dorian3d/DLib.git
cd DLib
git reset --hard 330bdc10576f6bcb55e0bd85cd5296f39ba8811a
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
sudo rm -rf DLib
#DBoW2 for place recognition
git clone https://github.com/dorian3d/DBoW2.git
cd DBoW2
git reset --hard 4a6eed2b3ae35ed6837c8ba226b55b30faaf419d
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
sudo rm -rf DBoW2
#DLoopDetector for place recognition
git clone https://github.com/dorian3d/DLoopDetector.git
cd DLoopDetector
git reset --hard 84bfc56320371bed97cab8aad3aa9561ca931d3f
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
sudo rm -rf DLoopDetector
#iSAM for pose graph optimisation
wget http://people.csail.mit.edu/kaess/isam/isam_v1_7.tgz
tar -xvf isam_v1_7.tgz
rm isam_v1_7.tgz
cd isam_v1_7
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd ../..
sudo rm -rf isam_v1_7
- 安装Kintinuous
git clone https://github.com/mp3guy/Kintinuous.git
cd Kintinuous
mkdir build
cd build
cmake ../src
make -j4
- 运行
#数据集:
http://www.cs.nuim.ie/research/vision/data/loop.klg
cd Kintinuous/build
./Kintinuous -s 7 -v ../vocab.yml.gz -l loop.klg -ri -fl -od
指令参数在https://github.com/mp3guy/Kintinuous里注明,需要自取。
- 测试结果