ubuntu16.04 安装colmap

1、获取源码:

git clone https://github.com/colmap/colmap

zip -r colmap.zip colmap #将下载的colmap打包,备用

2.安装eigen3.3.7:参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107302389

3.安装Ceres2.0.2:参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107289419

4.安装依赖库:

sudo apt-get install git
 
sudo apt-get install cmake
 
sudo apt-get install build-essential
 
sudo apt-get install libboost-program-options-dev
 
sudo apt-get install libboost-filesystem-dev
 
sudo apt-get install libboost-graph-dev
 
sudo apt-get install libboost-regex-dev
 
sudo apt-get install libboost-system-dev
 
sudo apt-get install libboost-test-dev
 
sudo apt-get install libeigen3-dev
 
sudo apt-get install libsuitesparse-dev
 
sudo apt-get install libfreeimage-dev
 
sudo apt-get install libgoogle-glog-dev
 
sudo apt-get install libgflags-dev
 
sudo apt-get install libglew-dev
 
sudo apt-get install qtbase5-dev
 
sudo apt-get install libqt5opengl5-dev
 
sudo apt-get install libcgal-dev

sudo apt-get install libcgal-qt5-dev

5.编译安装:

cd colmap
 
git checkout dev
 
mkdir build
 
cd build
 
cmake ..
 
make
 
sudo make install

6.运行

colmap -h  #查看colmap命令参数

colmap run #运行,出现图像界面

 

在编译的make环节,如果出现如下问题:

/home/zqzy/3DReconstructionCode/colmap/src/base/reconstruction.cc: In member function ‘void colmap::Reconstruction::ExtractColorsForAllImages(const string&)’:
/home/zqzy/3DReconstructionCode/colmap/src/base/reconstruction.cc:1242:12: error: ‘Index’ is not a member of ‘Eigen’
       for (Eigen::Index i = 0; i < color.size(); ++i) {
            ^
/home/zqzy/3DReconstructionCode/colmap/src/base/reconstruction.cc:1242:32: error: ‘i’ was not declared in this scope
       for (Eigen::Index i = 0; i < color.size(); ++i) {
                                ^
src/CMakeFiles/colmap.dir/build.make:518: recipe for target 'src/CMakeFiles/colmap.dir/base/reconstruction.cc.o' failed
make[2]: *** [src/CMakeFiles/colmap.dir/base/reconstruction.cc.o] Error 1
CMakeFiles/Makefile2:968: recipe for target 'src/CMakeFiles/colmap.dir/all' failed
make[1]: *** [src/CMakeFiles/colmap.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

ubuntu16.04 安装colmap_第1张图片

安装的eigen版本不对,我出现上面的错误,是因为之前安装了 eigen3.2.10

需要卸载eigen3.2.10,参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107302219

重新安装eigen3.3.7:参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107302389

重新安装eigen3.3.7后,需要卸载之前安装的Ceres,参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107301472

重新安装Ceres2.0.0,参考:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/107289419

最后,重新对colmap进行编译,即可

 

参考:https://blog.csdn.net/X_kh_2001/article/details/82591978

           https://www.cnblogs.com/feifanrensheng/p/9119059.html

           https://blog.csdn.net/weixin_40127330/article/details/100114915#commentBox

你可能感兴趣的:(三维重建,安装colmap,ubuntu16.04)