Ubuntu16.04下Kintinuous的配置

配了两个星期环境终于能运行Kintinuous辣!写个博客记录一下配置过程和遇到的坑


配置过程:

配置使用的源码是https://github.com/mp3guy/Kintinuous

配置过程主要参考https://www.aliyun.com/jiaocheng/138151.html这篇教程,也参考了一些其他教程,所以有的细节可能有遗忘

系统是ubuntu16.04系统,并且为了配环境重装,不知道不是新安装的系统会不会存在依赖冲突的情况

 

亲测自带的build.sh不能用orz


首先cmake,git这种基本工具装好

 

安装CUDA:

安装的是cuda8.0,9.0会出问题(坑死我了

参考这篇装的cuda:https://oldpan.me/archives/ubuntu16-04-install-cuda9-1-solution


首先在官网下载.run文件,然后Ctrl+Alt+F1进入命令行模式,sudo service lightdm stop 关闭图形化界面

然后更新一下系统:

sudo apt-get upgrade

sudo apt-get upgrade -y

sudo apt-get dist-upgrade -y

之后sudo ./被我遗忘的文件名.run 运行run文件,注意如果已经安装了NVIDIA驱动则这时候是否安装驱动要选择否。

之后配置环境变量,sudo vim /etc/profile,之后在最后添加:

exportPATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
exportLD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\
                                                  ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

重启后nvcc -V可以检查是否安装成功

 

安装依赖项

sudo apt-get install -ycmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-8-jdkfreeglut3-dev python-vtk libvtk-java libglew-dev cuda-7-5 libsuitesparse-devopenexr

 

安装eigen

这里注意经过测试3.3和3.2版本都是不行的,3.1版本可以(坑死我*2

安装之后要将/usr/local/include/eigen3复制到/usr/include/eigen3

 

配置OpenNI

sudo apt-get install git g++python libusb-1.0-0-dev libudev-dev openjdk-8-jdk freeglut3-dev graphvizdoxygen

(要是哪个包安装报错就把那个删掉重新运行,然后自行搜索那个包怎么装

git clone https://github.com/occipital/OpenNI2

cd OpenNI2

make -j4

sudo vim /etc/udev/rules.d/51-kinect.rules

向文件中添加:

UBSYSTEM=="usb",ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0",MODE:="0666", OWNER:="root", GROUP:="video"SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad",MODE:="0666", OWNER:="root", GROUP:="video"SUBSYSTEM=="usb", ATTR{idVendor}=="045e",ATTR{idProduct}=="02ae", MODE:="0666",OWNER:="root", GROUP:="video" SUBSYSTEM=="usb",ATTR{idVendor}=="045e", ATTR{idProduct}=="02c2",MODE:="0666", OWNER:="root", GROUP:="video"SUBSYSTEM=="usb", ATTR{idVendor}=="045e",ATTR{idProduct}=="02be", MODE:="0666",OWNER:="root", GROUP:="video" SUBSYSTEM=="usb",ATTR{idVendor}=="045e", ATTR{idProduct}=="02bf",MODE:="0666", OWNER:="root", GROUP:="video"

 

配置libfreenet

命令:(${OPENNI2_DIR}需要改成openni2对应安装目录)

git clone https://github.com/OpenKinect/libfreenect.git

cdlibfreenect

mkdir build

cd build

cmake ..-DBUILD_OPENNI2_DRIVER=ON

make -j4

cp -Llib/OpenNI2-FreenectDriver/libFreenectDriver.so {OPENNI2_DIR}/Bin/x64-Release/OpenNI2/Driver

 

配置OpenGL:

sudo apt-get install build-essential

sudo apt-get installlibgl1-mesa-dev

 

配置OpenCV2.4.13

sudo apt-get install build-essentiallibgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmakepython-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-devlibopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-devlibxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-commontexlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-devlibswscale-dev

cd opencv-2.4.13

mkdir build

cd build

cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF -DWITH_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 -DBUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CUDA=OFF -DBUILD_opencv_gpu=OFF ..

make -j4

sudo make install

 

配置DLib

git clone https://github.com/dorian3d/DLib.git

cd DLib

git reset --hard330bdc10576f6bcb55e0bd85cd5296f39ba8811a

mkdir build

cd build

cmake ../

make -j4

sudo make install

这里我出现了“set OpenCV_FOUND to false”的问题,这时候只要按照错误提示找到对应.cmake文件,在文件最后加上”set (OpenCV_FOUND 1)”就可以了。

 

配置DBow2

git clone https://github.com/dorian3d/DBoW2.git

cd DBoW2

git reset --hard4a6eed2b3ae35ed6837c8ba226b55b30faaf419d

mkdir build

cd build

cmake ../

make -j4

sudo make install

 

配置DLoopDetector

git clone https://github.com/dorian3d/DLoopDetector.git

cd DLoopDetector

git reset --hard84bfc56320371bed97cab8aad3aa9561ca931d3f

mkdir build

cd build

cmake ../

make -j4

sudo make install

 

配置iSAM

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

 

配置PCL

sudo apt-get install g++ cmakecmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann-devlibeigen3-dev libboost-all-dev libvtk5-qt4-dev libvtk6.2 libvtk5-dev libqhull* libusb-dev libgtest-dev git-core freeglut3-devpkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphvizmono-complete qt-sdk 

git clonehttps://github.com/PointCloudLibrary/pcl.git

cdpcl

mkdir build

cdbuild

cmake -DCMAKE_BUILD_TYPE=Release-DBUILD_GPU=OFF -DBUILD_apps=OFF -DBUILD_examples=OFF ..

make -j8

sudo make install

sudo ldconfig

 

配置Pangolin

sudo apt-get install libglew-dev

sudo apt-get install libboost-devlibboost-thread-dev libboost-filesystem-dev

sudo apt-get installlibpython2.7-dev

sudo apt-get install ffmpeg libavcodec-devlibavutil-dev libavformat-dev libswscale-dev

sudo apt-get installlibdc1394-22-dev libraw1394-dev

sudo apt-get install libjpeg-devlibpng12-dev libtiff5-dev libopenexr-dev

git clone https://github.com/stevenlovegrove/Pangolin

cd Pangolin/build

cmake -DCPP11_NO_BOOST=1 ..

make -j

 

运行Kintinuous

git clone https://github.com/mp3guy/Kintinuous

cd Kintinuous

mkdir build

cd build

cmake ../src

make -j4

 

/Kintinuous/src/CMakeLists.txt文件中第39行中CUDA_ARCH_BIN “20 30 35 50 52 “52后添加一项61,即改为”20 30 35 50 52 61”,保存退出。

 

之后在http://www.cs.nuim.ie/research/vision/data/loop.klg下载loop.klg保存至/Kintinuous/build文件夹下,输入命令
./Kintinuous -s 7-v ../vocab.yml.gz -l loop.klg -ri -fl -od 

就可以运行了


总之就是碰到报错就谷歌,实在改不好就重装

运行之后是这样的:

Ubuntu16.04下Kintinuous的配置_第1张图片

不明觉厉系列,以后慢慢学习~

你可能感兴趣的:(计算机视觉)