@@ -22,7 +22,7 @@ def createParser():
22
22
required .add_argument ("--sfm-type" ,
23
23
type = str ,
24
24
help = "Select SfM type: global or incremental" ,
25
- choices = ["global" , "incremental" ],
25
+ choices = ["global" , "incremental" , "incrementalv2" ],
26
26
required = True )
27
27
28
28
pipelines = parser .add_argument_group ("Pipelines to run (min. 1 required)" )
@@ -162,7 +162,9 @@ def createParser():
162
162
def createCommands (args ):
163
163
imageListingOptions = []
164
164
computeFeaturesOptions = []
165
+ computePairsOptions = []
165
166
computeMatchesOptions = []
167
+ geometricFilterOptions = []
166
168
incrementalSFMOptions = []
167
169
globalSFMOptions = []
168
170
densifyPointCloudOptions = []
@@ -218,11 +220,13 @@ def createCommands(args):
218
220
if args .upright :
219
221
computeFeaturesOptions += ["-u" , "1" ]
220
222
223
+ # Geometric filter options
224
+ if args .geomodel != None :
225
+ geometricFilterOptions += ["-g" , args .geomodel ]
226
+
221
227
# OpenMVG Match Matches
222
228
if args .ratio != None :
223
229
computeMatchesOptions += ["-r" , args .ratio ]
224
- if args .geomodel != None :
225
- computeMatchesOptions += ["-g" , args .geomodel ]
226
230
if args .matching != None :
227
231
computeMatchesOptions += ["-n" , args .matching ]
228
232
@@ -282,21 +286,37 @@ def createCommands(args):
282
286
"command" : [os .path .join (openmvgBin , "openMVG_main_ComputeFeatures" ), "-i" , os .path .join (matchesDirectory , "sfm_data.json" ), "-o" , matchesDirectory , "-m" , "SIFT" ] + computeFeaturesOptions
283
287
})
284
288
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
+
285
294
commands .append ({
286
295
"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
288
302
})
289
303
290
304
# Select pipeline type
291
305
if pipelineType == "global" :
292
306
commands .append ({
293
307
"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
295
309
})
296
310
if pipelineType == "incremental" :
297
311
commands .append ({
298
312
"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
300
320
})
301
321
302
322
if args .colorize :
0 commit comments