1.Prerequisites
1.1 C++11 or C++0x Compiler
We use the new thread and chrono functionalities of C++11.所以需要安装C++11编译器,运行:
$ sudo apt-get install gcc g++
1.2 Pangolin
We use [Pangolin](https://github.com/stevenlovegrove/Pangolin) for visualization and user interface. Dowload and install instructions can be found at: https://github.com/stevenlovegrove/Pangolin.
$ sudo apt-get install libglew-dev #安装Glew
$ sudo apt-get install cmake #安装CMake
#安装Boost
$ sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
$ sudo apt-get install libpython2.7-dev #安装Python2 / Python3
#下载、编译、安装Pangolin:
$ git clone https://github.com/stevenlovegrove/Pangolin.git
$ cd Pangolin
$ mkdir build
$ cd build
$ cmake -DCPP11_NO_BOOST=1 ..
$ make
$ sudo make install
1.3 OpenCV(2.4.13)
We use [OpenCV](http://opencv.org) to manipulate images and features. Dowload and install instructions can be found at: http://opencv.org. **Required at leat 2.4.3. Tested with OpenCV 2.4.11 and OpenCV 3.2**.
$ sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
$ unzip opencv-2.4.13.zip
$ cd opencv-2.4.13;mkdir build;cd build;
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -DCUDA_GENERATION=Kepler ..
$ make
$ sudo make install
#在其中写入: /usr/local/lib
sudo gedit /etc/ld.so.conf.d/opencv.conf
#在文件末尾写入:
#PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
#export PKG_CONFIG_PATH
sudo ldconfig sudo gedit/etc/bash.bashrc
#source此脚本
source /etc/bash.bashrc