1、安装Ubuntu自带库
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、安装CGAL Qt5 package
sudo apt-get install libcgal-qt5-dev
3、 安装Ceres Solver
如果是仅仅为了安装colmap可以这样安装ceres
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
#有时候git clone不了,可以用这个
# wget http://ceres-solver.org/ceres-solver-2.1.0.tar.gz
# tar -zxvf ceres-solver-2.1.0.tar.gz
# cd ceres-solver-2.1.0
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j #(注意:有时候make -j会失败,这时候需要先执行nproc命令查看本机cpu核数量,比如是40,那么就要执行make -j80指令)
sudo make install
Ceres的完整安装过程如下
①安装需要的所有依赖
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse (optional)
sudo apt-get install libsuitesparse-dev
②编译安装Ceres
wget http://ceres-solver.org/ceres-solver-2.1.0.tar.gz
tar -zxvf ceres-solver-2.1.0.tar.gz
cd ceres-solver-2.1.0
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.1.0
make -j3 #(注意:有时候make -j会失败,这时候需要先执行nproc命令查看本机cpu核数量,比如是40,那么就要执行make -j80指令)
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
make install
4、编译colmap
cd ../../
git clone https://github.com/colmap/colmap.git
cd colmap
git checkout dev
mkdir build
cd build
(特别注意:此时先用conda deactivate命令确保退出conda环境,再执行下面命令,否则会报错libfreeimage.so:对‘TIFFTileRowSize@LIBTIFF_4.0’未定义的引用;因为默认情况是在conda的base环境下进行,colmap安装的时候有变量跟anaconda重了)
cmake .. #(可能会报错,解决方案看下面)
make -j #(注意:有时候make -j会失败,这时候需要先执行nproc命令查看本机cpu核数量,比如是40,那么就要执行make -j80指令)
sudo make install
执行cmake ..
指令的时候出现报错,解决方案如下:
5、运行colmap
colmap -h
colmap gui
注意:第一次运行时可能会出现以下报错
此时,只需要在终端执行命令即可解决问题:
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
文章来源:https://www.toymoban.com/news/detail-762297.html
参考链接:colmap安装与实践
Ceres官网下载安装
Colmap官网下载安装文章来源地址https://www.toymoban.com/news/detail-762297.html
到了这里,关于linux下colmap的安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!