OpenMVS 安装使用教程

使用 OpenMVS 进行稠密重建、曲面重建和网格优化等。

手动编译安装

源码地址:https://github.com/cdcseacave/openMVS

本文的编译环境和实验平台:WSL version: 2.6.1.0, Ubuntu 22.04

  • 第一步,使用以下命令安装一个新环境:
1
2
3
4
5
6
7
8
9
10
11
$ wsl --install -d Ubuntu-22.04
Launching Ubuntu 22.04 LTS...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
#输入用户名密码什么的
Enter new UNIX username:
New password:
Retype new password:
passwd: password updated successfully
Installation successful!

(可以参照本文移动安装位置,不再赘述)

  • 第二步,安装工具与依赖项:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -----------------Tools-----------------
sudo apt update && sudo apt upgrade -y
sudo apt install git cmake g++ python3-dev libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev build-essential
# -----------------Dependencies-----------------
# Eigen
git clone https://gitlab.com/libeigen/eigen.git --branch 3.4
cd eigen && mkdir build && cd build
cmake ..
make && sudo make install && cd ../..
# Boost
sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev
libboost-system-dev libboost-serialization-dev
# OpenCV
sudo apt-get -y install libopencv-dev
# CGAL
sudo apt-get -y install libcgal-dev libcgal-qt5-dev
# VCGLib
git clone https://github.com/cdcseacave/VCG.git vcglib

# -----------------OpenMVS-----------------
git clone --recurse-submodules https://github.com/cdcseacave/openMVS.git
mv vcglib ./openMVS/libs
cd openMVS
git checkout v2.3.0
git submodule update --init --recursive
mkdir make && cd make
cmake .. -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT=../libs/vcglib -DCMAKE_CXX_FLAGS="-w"
cmake --build . -j8

CMake

(如上图所示,编译成功。)

使用说明

以稠密重建为例:

cd ~,浅克隆一个文件夹: git clone --depth=1 https://github.com/cdcseacave/openMVS_sample.git

然后 cd ~/openMVS/make,运行:

1
$ ./bin/DensifyPointCloud -w ~/openMVS_sample -i scene.mvs -o test_dense.mvs

OpenMVS

就能在 openMVS_sample 文件夹下看到输出文件了。

然后按照这篇博客安装 Meshlab,然后导入.ply文件即可。

example

Author

Aununo Gan

Posted on

2025-09-18

Updated on

2025-09-18

Licensed under