总体流程按照
https://colmap.github.io/install.html
中来进行
Build from Source
COLMAP builds on all major platforms (Linux, Mac, Windows) with little effort. First, checkout the latest source code:
git clone https://github.com/colmap/colmap
The latest stable version lives in the master branch and the latest development version lives in the dev branch.
On Linux and Mac it is generally recommended to follow the installation instructions below, which use the system package managers to install the required dependencies. Alternatively, there is a Python build script that builds COLMAP and its dependencies locally. This script is useful under Windows and on a (cluster) system if you do not have root access under Linux or Mac.
Linux
Recommended dependencies: CUDA (at least version 7.X)
Dependencies from the default Ubuntu repositories:
sudo apt-get install \ git \ cmake \ build-essential \ libboost-program-options-dev \ libboost-filesystem-dev \ libboost-graph-dev \ libboost-regex-dev \ libboost-system-dev \ libboost-test-dev \ libeigen3-dev \ libsuitesparse-dev \ libfreeimage-dev \ libgoogle-glog-dev \ libgflags-dev \ libglew-dev \ qtbase5-dev \ libqt5opengl5-dev \ libcgal-dev
Under Ubuntu 16.04/18.04 the CMake configuration scripts of CGAL are broken and you must also install the CGAL Qt5 package:
sudo apt-get install libcgal-qt5-dev
Install Ceres Solver:
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 sudo make install
Configure and compile COLMAP:
git clone https://github.com/colmap/colmap.git cd colmap git checkout dev mkdir build cd build cmake .. make sudo make install
Under newer Ubuntu versions it might be necessary to explicitly select the used GCC version due to compatiblity issues with CUDA, which can be done as:
CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake ..
Run COLMAP:
colmap -h colmap gui
遇到几个问题:
1.Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)”
解决方案:
sudo apt install libglew-dev
2.CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): CMakeLists.txt:147 (find_package)
解决方案:
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
3.找不到FreeImage
解决方案:
sudo apt-get install libfreeimage3 libfreeimage-dev
4.CMake could not find OpenGL in Ubuntu
解决方案:
sudo apt-get install freeglut3-dev
5.CMAKE_PREFIX_PATH doesn't help CMake in finding Qt5
解决方案:
sudo apt-get install qtbase5-dev sudo apt-get install qtdeclarative5-dev
6.ceres-solver和eigen要从github 下载下来然后mkdir build cd build cmake .. make sudo make install 一系列来进行安装
命令行操作请参考(第一个比较靠谱,可以直接复制)
https://colmap.github.io/cli.html
以及
https://blog.csdn.net/X_kh_2001/article/details/82591978
|