项目中需要用到colmap软件,在这里记录一下流程
COLMAP安装官网
1、首先需要安装依赖:
sudo apt-get install \
git \
cmake \
build-essential \
libboost-program-options-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-system-dev \
libboost-test-dev \
libeigen3-dev \
libsuitesparse-dev \
libfreeimage-dev \
libmetis-dev \
libgoogle-glog-dev \
libgflags-dev \
libglew-dev \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev
2、Ubuntu 16.04/18.04 需要安装 CGAL Qt5 package:
sudo apt-get install libcgal-qt5-dev
3、安装ceres,ceres2.0.0安装可以看另一篇博客ceres安装,包含了安装方法以及问题解决,同时给出了pyceres安装方法
这里简单列一下官网方法:
sudo apt-get install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout $(git describe --tags) # Checkout the latest release
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j
sudo make install
4、最后安装colmap
git clone https://github.com/colmap/colmap.git
cd colmap
git checkout dev
mkdir build
cd build
cmake ..
make -j
sudo make install
5、安装colmap报错Failed to find installed Eigen CMake configuration :
这里一看就是eigen版本的问题,更换eigen版本为3.3.4,流程没什么特别的,关键在于从官网eigengit clone的时候,发现不论分支怎么选最后clone下来的都是同样的版本(安装后运行 cat /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h 指令都是一样的),需要额外git checkout 3.3.4来切换分支版本
locate eigen3
sudo rm -rf /usr/local/share/pkgconfig/eigen3.pc /usr/local/share/eigen3 /usr/local/include/eigen3
git clone https://gitlab.com/libeigen/eigen.git
git checkout 3.3.4
midir build
cd build
cmake ..
make
sudo make install
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
cat /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h
注意!!!
一定要切换eigen分支,否则也可以直接下载对应版本压缩包
6、运行colmap
colmap -h
colmap gui