Skip to content

Commit 3b2bb84

Browse files
authored
v2.0.1 (#809)
1 parent c658b72 commit 3b2bb84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1024
-319
lines changed

.appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ for:
4848
# remove outdated versions
4949
- vcpkg remove --outdated --recurse
5050
# install dependencies
51-
- vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv vcglib glew glfw3
51+
- vcpkg install --recurse --triplet %VCPKG_ARCH% zlib boost-iostreams boost-program-options boost-system boost-serialization eigen3 cgal[core] opencv glew glfw3
5252
- cd "%APPVEYOR_BUILD_FOLDER%"
5353
# preserve contents of selected directories and files across project builds
5454
cache:
5555
- 'C:\tools\vcpkg\installed'
5656
build_script:
5757
- if "%platform%"=="Win32" set CMAKE_ARCH=-A"x86"
5858
- if "%platform%"=="x64" set CMAKE_ARCH=-A"x64"
59+
- git clone https://github.com/cdcseacave/VCG.git
5960
- mkdir bin && cd bin
60-
- cmake -G"Visual Studio 16 2019" %CMAKE_ARCH% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" ..
61+
- cmake -G"Visual Studio 16 2019" %CMAKE_ARCH% -DCMAKE_BUILD_TYPE=%Configuration% -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCG_ROOT="$APPVEYOR_BUILD_FOLDER/VCG" ..
6162
- cmake --build . --target ALL_BUILD --config %Configuration% -- /maxcpucount:4
6263
-
6364
#------------------

BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ make && sudo make install
145145
Library usage
146146
-------------------
147147

148-
In order to use *OpenMVS* as a third-party libray in your project, first compile it as described above or simply use `vcpgk`:
148+
In order to use *OpenMVS* as a third-party library in your project, first compile it as described above or simply use `vcpgk`:
149149
```
150150
vcpkg install openmvs
151151
```

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PROJECT(OpenMVS)
3131

3232
SET(OpenMVS_MAJOR_VERSION 2)
3333
SET(OpenMVS_MINOR_VERSION 0)
34-
SET(OpenMVS_PATCH_VERSION 0)
34+
SET(OpenMVS_PATCH_VERSION 1)
3535
SET(OpenMVS_VERSION ${OpenMVS_MAJOR_VERSION}.${OpenMVS_MINOR_VERSION}.${OpenMVS_PATCH_VERSION})
3636

3737
# List configuration options

MvgMvsPipeline.py

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
17. Fuse disparity-maps DensifyPointCloud
3737
3838
positional arguments:
39-
input_dir the directory wich contains the pictures set.
40-
output_dir the directory wich will contain the resulting files.
39+
input_dir the directory which contains the pictures set.
40+
output_dir the directory which will contain the resulting files.
4141
4242
optional arguments:
4343
-h, --help show this help message and exit
@@ -54,6 +54,14 @@
5454
Passthrough:
5555
Option to be passed to command lines (remove - in front of option names)
5656
e.g. --1 p ULTRA to use the ULTRA preset in openMVG_main_ComputeFeatures
57+
For example, running the script
58+
[MvgMvsPipeline.py input_dir output_dir --steps 0 1 2 3 4 5 11 12 13 15 --1 p HIGH n 8 --3 n HNSWL2]
59+
[--steps 0 1 2 3 4 5 11 12 13 15] runs only the desired steps
60+
[--1 p HIGH n 8] where --1 refer to openMVG_main_ComputeFeatures,
61+
p refers to describerPreset option and set to HIGH, and n refers
62+
to numThreads and set to 8. The second step (Compute matches),
63+
[--3 n HNSWL2] where --3 refer to openMVG_main_ComputeMatches,
64+
n refers to nearest_matching_method option and set to HNSWL2
5765
"""
5866

5967
import os
@@ -65,8 +73,10 @@
6573

6674
if sys.platform.startswith('win'):
6775
PATH_DELIM = ';'
76+
FOLDER_DELIM = '\\'
6877
else:
6978
PATH_DELIM = ':'
79+
FOLDER_DELIM = '/'
7080

7181
# add this script's directory to PATH
7282
os.environ['PATH'] += PATH_DELIM + os.path.dirname(os.path.abspath(__file__))
@@ -188,37 +198,37 @@ def __init__(self):
188198
["-i", "%input_dir%", "-o", "%matches_dir%", "-d", "%camera_file_params%"]],
189199
["Compute features", # 1
190200
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeFeatures"),
191-
["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT"]],
201+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT"]],
192202
["Compute pairs", # 2
193203
os.path.join(OPENMVG_BIN, "openMVG_main_PairGenerator"),
194-
["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%/pairs.bin"]],
204+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-o", "%matches_dir%"+FOLDER_DELIM+"pairs.bin"]],
195205
["Compute matches", # 3
196206
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeMatches"),
197-
["-i", "%matches_dir%/sfm_data.json", "-p", "%matches_dir%/pairs.bin", "-o", "%matches_dir%/matches.putative.bin", "-n", "AUTO"]],
207+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-p", "%matches_dir%"+FOLDER_DELIM+"pairs.bin", "-o", "%matches_dir%"+FOLDER_DELIM+"matches.putative.bin", "-n", "AUTO"]],
198208
["Filter matches", # 4
199209
os.path.join(OPENMVG_BIN, "openMVG_main_GeometricFilter"),
200-
["-i", "%matches_dir%/sfm_data.json", "-m", "%matches_dir%/matches.putative.bin", "-o", "%matches_dir%/matches.f.bin"]],
210+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-m", "%matches_dir%"+FOLDER_DELIM+"matches.putative.bin", "-o", "%matches_dir%"+FOLDER_DELIM+"matches.f.bin"]],
201211
["Incremental reconstruction", # 5
202212
os.path.join(OPENMVG_BIN, "openMVG_main_SfM"),
203-
["-i", "%matches_dir%/sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%", "-s", "INCREMENTAL"]],
213+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%", "-s", "INCREMENTAL"]],
204214
["Global reconstruction", # 6
205215
os.path.join(OPENMVG_BIN, "openMVG_main_SfM"),
206-
["-i", "%matches_dir%/sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%", "-s", "GLOBAL", "-M", "%matches_dir%/matches.e.bin"]],
216+
["-i", "%matches_dir%"+FOLDER_DELIM+"sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%", "-s", "GLOBAL", "-M", "%matches_dir%"+FOLDER_DELIM+"matches.e.bin"]],
207217
["Colorize Structure", # 7
208218
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeSfM_DataColor"),
209-
["-i", "%reconstruction_dir%/sfm_data.bin", "-o", "%reconstruction_dir%/colorized.ply"]],
219+
["-i", "%reconstruction_dir%"+FOLDER_DELIM+"sfm_data.bin", "-o", "%reconstruction_dir%"+FOLDER_DELIM+"colorized.ply"]],
210220
["Structure from Known Poses", # 8
211221
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeStructureFromKnownPoses"),
212-
["-i", "%reconstruction_dir%/sfm_data.bin", "-m", "%matches_dir%", "-f", "%matches_dir%/matches.f.bin", "-o", "%reconstruction_dir%/robust.bin"]],
222+
["-i", "%reconstruction_dir%"+FOLDER_DELIM+"sfm_data.bin", "-m", "%matches_dir%", "-f", "%matches_dir%"+FOLDER_DELIM+"matches.f.bin", "-o", "%reconstruction_dir%"+FOLDER_DELIM+"robust.bin"]],
213223
["Colorized robust triangulation", # 9
214224
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeSfM_DataColor"),
215-
["-i", "%reconstruction_dir%/robust.bin", "-o", "%reconstruction_dir%/robust_colorized.ply"]],
225+
["-i", "%reconstruction_dir%"+FOLDER_DELIM+"robust.bin", "-o", "%reconstruction_dir%"+FOLDER_DELIM+"robust_colorized.ply"]],
216226
["Control Points Registration", # 10
217227
os.path.join(OPENMVG_BIN, "ui_openMVG_control_points_registration"),
218-
["-i", "%reconstruction_dir%/sfm_data.bin"]],
228+
["-i", "%reconstruction_dir%"+FOLDER_DELIM+"sfm_data.bin"]],
219229
["Export to openMVS", # 11
220230
os.path.join(OPENMVG_BIN, "openMVG_main_openMVG2openMVS"),
221-
["-i", "%reconstruction_dir%/sfm_data.bin", "-o", "\"%mvs_dir%/scene.mvs\"", "-d", "\"%mvs_dir%/images\""]],
231+
["-i", "%reconstruction_dir%"+FOLDER_DELIM+"sfm_data.bin", "-o", "%mvs_dir%"+FOLDER_DELIM+"scene.mvs", "-d", "%mvs_dir%"+FOLDER_DELIM+"images"]],
222232
["Densify point cloud", # 12
223233
os.path.join(OPENMVS_BIN, "DensifyPointCloud"),
224234
["scene.mvs", "--dense-config-file", "Densify.ini", "--resolution-level", "1", "--number-views", "8", "-w", "\"%mvs_dir%\""]],
@@ -259,6 +269,15 @@ def apply_conf(self, conf):
259269
o2.append(co)
260270
s[2] = o2
261271

272+
def replace_opt(self, idx, str_exist, str_new):
273+
""" replace each existing str_exist with str_new per opt value in step idx data """
274+
s = self.steps_data[idx]
275+
o2 = []
276+
for o in s[2]:
277+
co = o.replace(str_exist, str_new)
278+
o2.append(co)
279+
s[2] = o2
280+
262281

263282
CONF = ConfContainer()
264283
STEPS = StepsStore()
@@ -270,9 +289,9 @@ def apply_conf(self, conf):
270289
"\r\n".join(("\t%i. %s\t %s" % (t, STEPS[t].info, STEPS[t].cmd) for t in range(STEPS.length())))
271290
)
272291
PARSER.add_argument('input_dir',
273-
help="the directory wich contains the pictures set.")
292+
help="the directory which contains the pictures set.")
274293
PARSER.add_argument('output_dir',
275-
help="the directory wich will contain the resulting files.")
294+
help="the directory which will contain the resulting files.")
276295
PARSER.add_argument('--steps',
277296
type=int,
278297
nargs="+",
@@ -282,7 +301,7 @@ def apply_conf(self, conf):
282301
" \r\n".join([k + " = " + str(PRESET[k]) for k in PRESET]) +
283302
" \r\ndefault : " + PRESET_DEFAULT)
284303

285-
GROUP = PARSER.add_argument_group('Passthrough', description="Option to be passed to command lines (remove - in front of option names)\r\ne.g. --1 p ULTRA to use the ULTRA preset in openMVG_main_ComputeFeatures")
304+
GROUP = PARSER.add_argument_group('Passthrough', description="Option to be passed to command lines (remove - in front of option names)\r\ne.g. --1 p ULTRA to use the ULTRA preset in openMVG_main_ComputeFeatures\r\nFor example, running the script as follows,\r\nMvgMvsPipeline.py input_dir output_dir --1 p HIGH n 8 --3 n ANNL2\r\nwhere --1 refer to openMVG_main_ComputeFeatures, p refers to\r\ndescriberPreset option which HIGH was chosen, and n refers to\r\nnumThreads which 8 was used. --3 refer to second step (openMVG_main_ComputeMatches),\r\nn refers to nearest_matching_method option which ANNL2 was chosen")
286305
for n in range(STEPS.length()):
287306
GROUP.add_argument('--'+str(n), nargs='+')
288307

@@ -297,7 +316,7 @@ def mkdir_ine(dirname):
297316
os.mkdir(dirname)
298317

299318

300-
# Absolute path for input and ouput dirs
319+
# Absolute path for input and output dirs
301320
CONF.input_dir = os.path.abspath(CONF.input_dir)
302321
CONF.output_dir = os.path.abspath(CONF.output_dir)
303322

@@ -324,7 +343,7 @@ def mkdir_ine(dirname):
324343
try:
325344
CONF.steps = PRESET[CONF.preset]
326345
except KeyError:
327-
sys.exit("Unkown preset %s, choose %s" % (CONF.preset, ' or '.join([s for s in PRESET])))
346+
sys.exit("Unknown preset %s, choose %s" % (CONF.preset, ' or '.join([s for s in PRESET])))
328347
elif not CONF.steps:
329348
CONF.steps = PRESET[PRESET_DEFAULT]
330349

@@ -336,9 +355,14 @@ def mkdir_ine(dirname):
336355
if 4 in CONF.steps: # GeometricFilter
337356
if 6 in CONF.steps: # GlobalReconstruction
338357
# Set the geometric_model of ComputeMatches to Essential
339-
STEPS[4].opt = STEPS[4].opt.replace("/matches.f.bin", "/matches.e.bin")
358+
STEPS.replace_opt(4, FOLDER_DELIM+"matches.f.bin", FOLDER_DELIM+"matches.e.bin")
340359
STEPS[4].opt.extend(["-g", "e"])
341360

361+
if 15 in CONF.steps: # TextureMesh
362+
if 14 not in CONF.steps: # RefineMesh
363+
# RefineMesh step is not run, use ReconstructMesh output
364+
STEPS.replace_opt(15, "scene_dense_mesh_refine.mvs", "scene_dense_mesh.mvs")
365+
342366
for cstep in CONF.steps:
343367
printout("#%i. %s" % (cstep, STEPS[cstep].info), effect=INVERSE)
344368

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# OpenMVS: open Multi-View Stereo reconstruction library
22

3+
[![Watch reconstruction](https://i.imgur.com/S4L0E6r.jpeg)](https://sketchfab.com/models/3aedcdd22c31447199c18dd9aec5d952/embed)
4+
35
## Introduction
46

57
[OpenMVS (Multi-View Stereo)](http://cdcseacave.github.io/openMVS) is a library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community. While there are mature and complete open-source projects targeting Structure-from-Motion pipelines (like [OpenMVG](https://github.com/openMVG/openMVG)) which recover camera poses and a sparse 3D point-cloud from an input set of images, there are none addressing the last part of the photogrammetry chain-flow. *OpenMVS* aims at filling that gap by providing a complete set of algorithms to recover the full surface of the scene to be reconstructed. The input is a set of camera poses plus the sparse point-cloud and the output is a textured mesh. The main topics covered by this project are:

0 commit comments

Comments
 (0)