[nodes] Add support for multiple features & matches folders

This commit is contained in:
Grégoire De Lillo 2018-06-06 11:55:20 +02:00 committed by Yann Lanthony
parent b0d8cf208b
commit 236a82ece8
4 changed files with 167 additions and 142 deletions

View file

@ -13,22 +13,27 @@ class FeatureMatching(desc.CommandLineNode):
desc.File(
name='input',
label='Input',
description='''SfMData file.''',
description='SfMData file.',
value='',
uid=[0],
),
desc.ChoiceParam(
name='geometricModel',
label='Geometric Model',
description='Geometric validation method to filter features matches:\n'
' * f: fundamental matrix\n'
' * e: essential matrix\n'
' * h: homography matrix\n'
' * hg: homography growing\n'
' * none: no geometric filtering',
value='f',
values=['f', 'e', 'h', 'hg', 'none'],
exclusive=True,
desc.ListAttribute(
elementDesc=desc.File(
name="featuresFolder",
label="Features Folder",
description="",
value="",
uid=[0],
),
name="featuresFolders",
label="Features Folders",
description="Folder(s) containing the extracted features and descriptors."
),
desc.File(
name='imagePairsList',
label='Image Pairs List',
description='Path to a file which contains the list of image pairs to match.',
value='',
uid=[0],
),
desc.ChoiceParam(
@ -42,20 +47,6 @@ class FeatureMatching(desc.CommandLineNode):
uid=[0],
joinChar=',',
),
desc.File(
name='featuresFolder',
label='Features Folder',
description='''Path to a folder containing the extracted features.''',
value='',
uid=[0],
),
desc.File(
name='imagePairsList',
label='Image Pairs List',
description='''Path to a file which contains the list of image pairs to match.''',
value='',
uid=[0],
),
desc.ChoiceParam(
name='photometricMatchingMethod',
label='Photometric Matching Method',
@ -80,19 +71,18 @@ class FeatureMatching(desc.CommandLineNode):
exclusive=True,
uid=[0],
),
desc.BoolParam(
name='savePutativeMatches',
label='Save Putative Matches',
description='''putative matches.''',
value=False,
uid=[0],
),
desc.BoolParam(
name='guidedMatching',
label='Guided Matching',
description='''the found model to improve the pairwise correspondences.''',
value=False,
uid=[0],
desc.ChoiceParam(
name='geometricModel',
label='Geometric Model',
description='Geometric validation method to filter features matches: \n'
' * fundamental_matrix\n'
' * essential_matrix\n'
' * homography_matrix\n'
' * homography_growing',
value=['fundamental_matrix'],
values=['fundamental_matrix', 'essential_matrix', 'homography_matrix', 'homography_growing'],
exclusive=False,
uid=[0]
),
desc.FloatParam(
name='distanceRatio',
@ -105,42 +95,55 @@ class FeatureMatching(desc.CommandLineNode):
desc.IntParam(
name='maxIteration',
label='Max Iteration',
description='''Maximum number of iterations allowed in ransac step.''',
description='Maximum number of iterations allowed in ransac step.',
value=2048,
range=(1, 20000, 1),
uid=[0],
),
desc.IntParam(
name='maxMatches',
label='Max Matches',
description='Maximum number of matches to keep.',
value=0,
range=(0, 10000, 1),
uid=[0],
),
desc.BoolParam(
name='savePutativeMatches',
label='Save Putative Matches',
description='putative matches.',
value=False,
uid=[0],
),
desc.BoolParam(
name='guidedMatching',
label='Guided Matching',
description='the found model to improve the pairwise correspondences.',
value=False,
uid=[0],
),
desc.BoolParam(
name='exportDebugFiles',
label='Export Debug Files',
description='''debug files (svg, dot).''',
description='debug files (svg, dot).',
value=False,
uid=[],
),
desc.IntParam(
name='maxMatches',
label='Max Matches',
description='''Maximum number pf matches to keep.''',
value=0,
range=(0, 10000, 1),
uid=[0],
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (fatal, error, warning, info, debug, trace).''',
description='verbosity level (fatal, error, warning, info, debug, trace).',
value='info',
values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
exclusive=True,
uid=[],
)
]
outputs = [
desc.File(
name='output',
label='Output',
description='''Path to a folder in which computed matches will be stored.''',
label='Output Folder',
description='Path to a folder in which computed matches will be stored.',
value='{cache}/{nodeType}/{uid0}/',
uid=[],
),

View file

@ -12,28 +12,40 @@ class ImageMatching(desc.CommandLineNode):
desc.File(
name='input',
label='Input',
description='''SfMData file .''',
description='SfMData file .',
value='',
uid=[0],
),
desc.File(
name='featuresFolder',
label='Features Folder',
description='''Folder containing the extracted features and descriptors. By default, it is the folder containing the SfMData.''',
value='',
desc.ListAttribute(
elementDesc=desc.File(
name="featuresFolder",
label="Features Folder",
description="",
value="",
uid=[0],
),
name="featuresFolders",
label="Features Folders",
description="Folder(s) containing the extracted features and descriptors."
),
desc.File(
name='tree',
label='Tree',
description='''Input name for the vocabulary tree file.''',
description='Input name for the vocabulary tree file.',
value=os.environ.get('ALICEVISION_VOCTREE', ''),
uid=[0],
),
desc.File(
name='weights',
label='Weights',
description='Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.',
value='',
uid=[0],
),
desc.IntParam(
name='minNbImages',
label='Minimal Number of Images',
description='''Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.''',
description='Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.',
value=200,
range=(0, 500, 1),
uid=[0],
@ -41,7 +53,7 @@ class ImageMatching(desc.CommandLineNode):
desc.IntParam(
name='maxDescriptors',
label='Max Descriptors',
description='''Limit the number of descriptors you load per image. Zero means no limit.''',
description='Limit the number of descriptors you load per image. Zero means no limit.',
value=500,
range=(0, 100000, 1),
uid=[0],
@ -49,22 +61,15 @@ class ImageMatching(desc.CommandLineNode):
desc.IntParam(
name='nbMatches',
label='Nb Matches',
description='''The number of matches to retrieve for each image (If 0 it will retrieve all the matches).''',
description='The number of matches to retrieve for each image (If 0 it will retrieve all the matches).',
value=50,
range=(0, 1000, 1),
uid=[0],
),
desc.File(
name='weights',
label='Weights',
description='''Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.''',
value='',
uid=[0],
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (fatal, error, warning, info, debug, trace).''',
description='verbosity level (fatal, error, warning, info, debug, trace).',
value='info',
values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
exclusive=True,
@ -75,8 +80,8 @@ class ImageMatching(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output',
description='''Filepath to the output file with the list of selected image pairs.''',
label='Output List File',
description='Filepath to the output file with the list of selected image pairs.',
value='{cache}/{nodeType}/{uid0}/imageMatches.txt',
uid=[],
),

View file

@ -13,44 +13,56 @@ class ImageMatchingMultiSfM(desc.CommandLineNode):
desc.File(
name='input',
label='Input A',
description='''SfMData file .''',
description='SfMData file .',
value='',
uid=[0],
),
desc.File(
name='inputB',
label='Input B',
description='''SfMData file .''',
description='SfMData file .',
value='',
uid=[0],
),
desc.ListAttribute(
elementDesc=desc.File(
name="featuresFolder",
label="Features Folder",
description="",
value="",
uid=[0],
),
name="featuresFolders",
label="Features Folders",
description="Folder(s) containing the extracted features and descriptors."
),
desc.File(
name='tree',
label='Tree',
description='Input name for the vocabulary tree file.',
value=os.environ.get('ALICEVISION_VOCTREE', ''),
uid=[0],
),
desc.File(
name='weights',
label='Weights',
description='Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.',
value='',
uid=[0],
),
desc.ChoiceParam(
name='modeMultiSfM',
label='Multiple SfM mode',
description='''Image matching multiple SfM mode. "a_ab" for images in input SfMData A plus between A and B. "a_b" for images between input SfMData A and B''',
description='Image matching multiple SfM mode.\n"a_ab" for images in input SfMData A plus between A and B.\n"a_b" for images between input SfMData A and B.',
value='a_ab',
values=['a_ab', 'a_b'],
exclusive=True,
uid=[0],
),
desc.File(
name='featuresFolder',
label='Features Folder',
description='''Folder containing the extracted features and descriptors. By default, it is the folder containing the SfMData.''',
value='',
uid=[0],
),
desc.File(
name='tree',
label='Tree',
description='''Input name for the vocabulary tree file.''',
value=os.environ.get('ALICEVISION_VOCTREE', ''),
uid=[0],
),
desc.IntParam(
name='minNbImages',
label='Minimal Number of Images',
description='''Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.''',
description='Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.',
value=200,
range=(0, 500, 1),
uid=[0],
@ -58,7 +70,7 @@ class ImageMatchingMultiSfM(desc.CommandLineNode):
desc.IntParam(
name='maxDescriptors',
label='Max Descriptors',
description='''Limit the number of descriptors you load per image. Zero means no limit.''',
description='Limit the number of descriptors you load per image. Zero means no limit.',
value=500,
range=(0, 100000, 1),
uid=[0],
@ -66,22 +78,15 @@ class ImageMatchingMultiSfM(desc.CommandLineNode):
desc.IntParam(
name='nbMatches',
label='Nb Matches',
description='''The number of matches to retrieve for each image (If 0 it will retrieve all the matches).''',
description='The number of matches to retrieve for each image (If 0 it will retrieve all the matches).',
value=50,
range=(0, 1000, 1),
uid=[0],
),
desc.File(
name='weights',
label='Weights',
description='''Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.''',
value='',
uid=[0],
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (fatal, error, warning, info, debug, trace).''',
description='verbosity level (fatal, error, warning, info, debug, trace).',
value='info',
values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
exclusive=True,
@ -92,15 +97,15 @@ class ImageMatchingMultiSfM(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output',
description='''Filepath to the output file with the list of selected image pairs.''',
label='Output List File',
description='Filepath to the output file with the list of selected image pairs.',
value='{cache}/{nodeType}/{uid0}/imageMatches.txt',
uid=[],
),
desc.File(
name='outputCombinedSfM',
label='Output Combined SfM',
description='''Path for the combined SfMData file''',
description='Path for the combined SfMData file',
value='{cache}/{nodeType}/{uid0}/combineSfM.sfm',
uid=[],
),

View file

@ -17,20 +17,30 @@ class StructureFromMotion(desc.CommandLineNode):
value='',
uid=[0],
),
desc.File(
name='featuresFolder',
label='Features Folder',
description='Path to a folder containing the extracted features.',
value='',
desc.ListAttribute(
elementDesc=desc.File(
name="featuresFolder",
label="Features Folder",
description="",
value="",
uid=[0],
),
desc.File(
name='matchesFolder',
label='Matches Folder',
description='Path to a folder in which computed matches are stored.',
value='',
name="featuresFolders",
label="Features Folders",
description="Folder(s) containing the extracted features and descriptors."
),
desc.ListAttribute(
elementDesc=desc.File(
name="matchesFolder",
label="Matches Folder",
description="",
value="",
uid=[0],
),
name="matchesFolders",
label="Matches Folders",
description="Folder(s) in which computed matches are stored."
),
desc.ChoiceParam(
name='describerTypes',
label='Describer Types',
@ -43,13 +53,13 @@ class StructureFromMotion(desc.CommandLineNode):
joinChar=',',
),
desc.ChoiceParam(
name='interFileExtension',
label='Inter File Extension',
description='Extension of the intermediate file export.',
value='.abc',
values=('.abc', '.ply'),
name='localizerEstimator',
label='Localizer Estimator',
description='Estimator type used to localize cameras (acransac, ransac, lsmeds, loransac, maxconsensus).',
value='acransac',
values=['acransac', 'ransac', 'lsmeds', 'loransac', 'maxconsensus'],
exclusive=True,
uid=[],
uid=[0],
),
desc.BoolParam(
name='useLocalBA',
@ -67,13 +77,14 @@ class StructureFromMotion(desc.CommandLineNode):
range=(2, 10, 1),
uid=[0],
),
desc.ChoiceParam(
name='localizerEstimator',
label='Localizer Estimator',
description='Estimator type used to localize cameras (acransac, ransac, lsmeds, loransac, maxconsensus).',
value='acransac',
values=['acransac', 'ransac', 'lsmeds', 'loransac', 'maxconsensus'],
exclusive=True,
desc.IntParam(
name='maxNumberOfMatches',
label='Maximum Number of Matches',
description='Maximum number of matches per image pair (and per feature type). \n'
'This can be useful to have a quick reconstruction overview. \n'
'0 means no limit.',
value=0,
range=(0, 50000, 1),
uid=[0],
),
desc.IntParam(
@ -95,14 +106,6 @@ class StructureFromMotion(desc.CommandLineNode):
range=(2, 10, 1),
uid=[0],
),
desc.IntParam(
name='maxNumberOfMatches',
label='Maximum Number of Matches',
description='Maximum number of matches per image pair (and per feature type). \n'
'This can be useful to have a quick reconstruction overview. \n'
'0 means no limit.',
value=0,
range=(0, 50000, 1),
uid=[0],
),
desc.File(
@ -119,6 +122,15 @@ class StructureFromMotion(desc.CommandLineNode):
value='',
uid=[0],
),
desc.ChoiceParam(
name='interFileExtension',
label='Inter File Extension',
description='Extension of the intermediate file export.',
value='.abc',
values=('.abc', '.ply'),
exclusive=True,
uid=[],
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
@ -133,21 +145,21 @@ class StructureFromMotion(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output SfM data file',
label='Output SfMData File',
description='Path to the output sfmdata file',
value='{cache}/{nodeType}/{uid0}/sfm.abc',
uid=[],
),
desc.File(
name='outputViewsAndPoses',
label='Output SfM data file',
label='Output SfMData File',
description='''Path to the output sfmdata file with cameras (views and poses).''',
value='{cache}/{nodeType}/{uid0}/cameras.sfm',
uid=[],
),
desc.File(
name='extraInfoFolder',
label='Output',
label='Output Folder',
description='Folder for intermediate reconstruction files and additional reconstruction information files.',
value='{cache}/{nodeType}/{uid0}/',
uid=[],