nerf数据准备 colmap(windows,ubuntu)

windows

colmap
nerf数据准备 colmap(windows,ubuntu)_第1张图片
下载解压后运行
nerf数据准备 colmap(windows,ubuntu)_第2张图片
nerf数据准备 colmap(windows,ubuntu)_第3张图片

数据准备
在这里插入图片描述

准备工作文件夹,images存放文件,sparse存放colmap结果文件
nerf数据准备 colmap(windows,ubuntu)_第4张图片
nerf数据准备 colmap(windows,ubuntu)_第5张图片
nerf数据准备 colmap(windows,ubuntu)_第6张图片
nerf数据准备 colmap(windows,ubuntu)_第7张图片
nerf数据准备 colmap(windows,ubuntu)_第8张图片
nerf数据准备 colmap(windows,ubuntu)_第9张图片
导出模型在sparse下的0文件夹
nerf数据准备 colmap(windows,ubuntu)_第10张图片
nerf数据准备 colmap(windows,ubuntu)_第11张图片

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

ubuntu16.04/18.04执行下面语句

sudo apt-get install libcgal-qt5-dev

下载Ceres Solver
注意如果有anaconda,将anaconda改名(名字加个1什么的),避免干扰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
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j
sudo make install

如果访问不了google官网可以用下面替换,注意要切合2.00或2.1.0分支,不能拉起master

git clone https://github.com/ceres-solver/ceres-solver.git

colmap克隆

git clone https://github.com/colmap/colmap
cd colmap
git checkout dev
mkdir build
cd build
cmake ..
make -j
sudo make install

验证

colmap -h
colmap gui

colmap处理数据和windwos一样,准备好工作目录,新建images文件夹存放照片,新建sparse文件夹

图像特征提取
相机内参已知的话通过ImageReader.camera_params传入

colmap feature_extractor --database_path database.db --image_path images --ImageReader.camera_model SIMPLE_PINHOLE --ImageReader.camera_params "1813.3334,1920,1080"

相机内参未知

colmap feature_extractor --database_path database.db --image_path images --ImageReader.camera_model SIMPLE_PINHOLE 

图像特征匹配

colmap exhaustive_matcher --database_path database.db

相机位姿求解与优化

mkdir sparse
colmap mapper --datase_path database.db --image_path images --out_path sparse

你可能感兴趣的:(#,虚拟机,ubuntu,linux,python)