谷歌开源了一套sfm的解决方案theia,他需要依赖不少三方库,由于本身不少三方库不稳定,导致很容易出现不兼容现象。
eigen
eigen安装是很容易的,由于这个包仅仅只有头文件,所以可以无脑设置一下头文件包含路径即可,值得注意的是,如果使用apt-get install libeigen3-dev安装,会安装到测试版本,可能会造成一些别的麻烦,因此建议从官网下载一个稳定版本,截止2018年7月,最新的稳定版本为eigen3.3.4.
代码下载后,直接输入
mkdir build
cd ./build
cmake ..
make
make install
OpenImageIO
OpenImageIO是谷歌新做的一个和图像处理有关的库,github上有源码,可以直接git clone. 但由于这个库更新较快,和theia版本有冲突,所以需要安装特定版本才能把theia编译通过,命令如下:
git clone https://github.com/OpenImageIO/oiio.git
cd ./oiio
git checkout RB-1.7 //!< 1.8未测试能否通过,其他版本均不能正常通过(截止2018年7月)
mkdir build
cd ./build
apt-get install freeglut3-dev
apt-get install libxmu-dev
cmake ..
make -j
make install
ceres-solver
ceres-solver安装比较简单,可直接根据文档安装成功,但是由于版本不兼容会导致theia编译失败,此时需要打开theia的文件,注释几行:
bundle_adjustment/bundle_adjust_two_views.cc
solver_options->num_linear_solver_threads = options.num_threads;
bundle_adjustment/bundle_adjuster.cc
solver_options->num_linear_solver_threads = options.num_threads;
global_pose_estimation/nonlinear_position_estimator.cc
solver_options_.num_linear_solver_threads = options_.num_threads;