SceneLib2是一款开源slam算法,该算法在已知尺寸参照物附近徘徊时,相机姿态与特征点坐标估计比较精确,但是当相机视野远离参照物时,误差会变得越来越大。所以并不适合在大场景的应用。
下面介绍下本软件在64位ubuntu16.04下的安装方法。
下面是该代码的安装流程:
****************
* Installation *
****************
1.Install various development related packages
$ sudo apt-get install build-essential
$ sudo apt-get install git cmake
$ sudo apt-get install freeglut3-dev libglu-dev libglew-dev
$ sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev
2.Install Engen3
$ sudo apt-get install libeigen3-dev
3.Install Boost
$ sudo apt-get install libboost-all-dev
4.Install OpenCV
$ cd MY_EXTERNAL_LIBRARIES_DIRECTORY
$ wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2
$ tar xvf OpenCV-2.4.2.tar.bz2
$ cd OpenCV-2.4.2
$ mkdir BUILD
$ cd BUILD
$ cmake ..
$ make -j4
$ sudo make install
5.Install Pangolin
$ cd MY_EXTERNAL_LIBRARIES_DIRECTORY
$ git clone https://github.com/stevenlovegrove/Pangolin.git
$ cd Pangolin
$ mkdir BUILD
$ cd BUILD
$ cmake ..
$ make -j4
$ sudo make install
6.Install SceneLib2
$ cd MY_WORK_DIRECTORY
$ git clone git://github.com/hanmekim/SceneLib2.git SceneLib2
$ cd SceneLib2
$ mkdir BUILD
$ cd BUILD
$ cmake ..
$ make -j4
7.Download an example image sequence
$ cd MY_IMAGE_DIRECTORY
$ wget www.doc.ic.ac.uk/~ajd/Scene/Release/testseqmonoslam.tar.gz
$ tar xvf testseqmonoslam.tar.gz
本人安装过程中遇见如下问题以及解决方案:
1.安装ffmpeg时出现的问题,解决方法:
使用如下安装指令安装ffmpeg
sudo apt install ffmpeg --fix-missing
2.我使用的opencv是2.4.3版本, 编译时遇见关于ffmpeg的问题。
解决方法:
修改opencv源码
Renamed CodecID to AVCodecID in modules/highgui/src/cap_ffmpeg_impl.hpp(https://github.com/opencv/opencv/issues/689)
#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
typedef AVCodecID CodecID;
#endif
3.Pangolin需要修改源码,否则运行最后的软件时会显示:
terminate called after throwing an instance of 'std::runtime_error'
what(): Pangolin X11: Unable to retrieve framebuffer options
将源码目录Pangolin\src\display\device下的display_x11.cpp文件做如下修改:
staticint visual_attribs[] =
{
GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE ,
8,
GLX_GREEN_SIZE ,
8,
GLX_BLUE_SIZE ,
8,
GLX_ALPHA_SIZE ,
8,
GLX_DEPTH_SIZE ,
24,
GLX_STENCIL_SIZE ,
8,
GLX_DOUBLEBUFFER , glx_doublebuffer ? True : False,
//GLX_SAMPLE_BUFFERS , glx_sample_buffers,
// GLX_SAMPLES , glx_sample_buffers >
0 ? glx_samples : 0,
None
};
4.安装libxmu-dev libxi-dev
sudo apt install libxmu-dev libxi-dev
接下来即可在64位的ubuntu16.04环境中安装完成SceneLib2。