Skip to content

Commit 8054e55

Browse files
committed
Fix openmvg command line arguments
1 parent d0e0386 commit 8054e55

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

pipeline.py

+26-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def createParser():
2222
required.add_argument("--sfm-type",
2323
type = str,
2424
help = "Select SfM type: global or incremental",
25-
choices = ["global", "incremental"],
25+
choices = ["global", "incremental", "incrementalv2"],
2626
required = True)
2727

2828
pipelines = parser.add_argument_group("Pipelines to run (min. 1 required)")
@@ -162,7 +162,9 @@ def createParser():
162162
def createCommands(args):
163163
imageListingOptions = []
164164
computeFeaturesOptions = []
165+
computePairsOptions = []
165166
computeMatchesOptions = []
167+
geometricFilterOptions = []
166168
incrementalSFMOptions = []
167169
globalSFMOptions = []
168170
densifyPointCloudOptions = []
@@ -218,11 +220,13 @@ def createCommands(args):
218220
if args.upright:
219221
computeFeaturesOptions += ["-u", "1"]
220222

223+
# Geometric filter options
224+
if args.geomodel != None:
225+
geometricFilterOptions += ["-g", args.geomodel]
226+
221227
# OpenMVG Match Matches
222228
if args.ratio != None:
223229
computeMatchesOptions += ["-r", args.ratio]
224-
if args.geomodel != None:
225-
computeMatchesOptions += ["-g", args.geomodel]
226230
if args.matching != None:
227231
computeMatchesOptions += ["-n", args.matching]
228232

@@ -282,21 +286,37 @@ def createCommands(args):
282286
"command": [os.path.join(openmvgBin, "openMVG_main_ComputeFeatures"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-o", matchesDirectory, "-m", "SIFT"] + computeFeaturesOptions
283287
})
284288

289+
commands.append({
290+
"title": "Compute matching pairs",
291+
"command": [os.path.join(openmvgBin, "openMVG_main_PairGenerator"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-o", os.path.join(matchesDirectory, "pairs.bin")]
292+
})
293+
285294
commands.append({
286295
"title": "Compute matches",
287-
"command": [os.path.join(openmvgBin, "openMVG_main_ComputeMatches"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-o", matchesDirectory] + computeMatchesOptions
296+
"command": [os.path.join(openmvgBin, "openMVG_main_ComputeMatches"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-p", os.path.join(matchesDirectory, "pairs.bin"), "-o", os.path.join(matchesDirectory, "matches.putative.bin")] + computeMatchesOptions
297+
})
298+
299+
commands.append({
300+
"title": "Filter matches",
301+
"command": [os.path.join(openmvgBin, "openMVG_main_GeometricFilter"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", os.path.join(matchesDirectory, "matches.putative.bin"), "-o", os.path.join(matchesDirectory, "matches.f.bin")] + geometricFilterOptions
288302
})
289303

290304
# Select pipeline type
291305
if pipelineType == "global":
292306
commands.append({
293307
"title": "Do Global reconstruction",
294-
"command": [os.path.join(openmvgBin, "openMVG_main_GlobalSfM"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", matchesDirectory, "-o", reconstructionDirectory] + globalSFMOptions
308+
"command": [os.path.join(openmvgBin, "openMVG_main_SfM"), "-s", "GLOBAL", "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", matchesDirectory, "-o", reconstructionDirectory] + globalSFMOptions
295309
})
296310
if pipelineType == "incremental":
297311
commands.append({
298312
"title": "Do incremental/sequential reconstruction",
299-
"command": [os.path.join(openmvgBin, "openMVG_main_IncrementalSfM"), "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", matchesDirectory, "-o", reconstructionDirectory] + incrementalSFMOptions
313+
"command": [os.path.join(openmvgBin, "openMVG_main_SfM"), "-s", "INCREMENTAL", "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", matchesDirectory, "-o", reconstructionDirectory] + incrementalSFMOptions
314+
})
315+
316+
if pipelineType == "incremental2":
317+
commands.append({
318+
"title": "Do incremental/sequential reconstruction",
319+
"command": [os.path.join(openmvgBin, "openMVG_main_SfM"), "-s", "INCREMENTALV2", "-i", os.path.join(matchesDirectory, "sfm_data.json"), "-m", matchesDirectory, "-o", reconstructionDirectory] + incrementalSFMOptions
300320
})
301321

302322
if args.colorize:

0 commit comments

Comments
 (0)