mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 21:16:29 +02:00
Use imageMatching node in the multiview pipeline
This commit is contained in:
parent
84945c52bb
commit
6e270ad6a9
4 changed files with 29 additions and 17 deletions
|
@ -28,7 +28,7 @@ if not args.output and not args.save:
|
|||
|
||||
graph = multiview.photogrammetryPipeline()
|
||||
if args.input:
|
||||
cameraInit = graph.findNodeCandidates("CameraInit")
|
||||
cameraInit = graph.findNode("CameraInit")
|
||||
cameraInit.imageDirectory.value = args.input
|
||||
|
||||
if args.save:
|
||||
|
|
|
@ -631,16 +631,16 @@ class Graph(BaseObject):
|
|||
pattern = re.compile(nodeNameExpr)
|
||||
return [v for k, v in self._nodes.objects.items() if pattern.match(k)]
|
||||
|
||||
def findNodes(self, nodesExpr):
|
||||
out = []
|
||||
for nodeName in nodesExpr:
|
||||
candidates = self.findNodeCandidates('^' + nodeName)
|
||||
def findNode(self, nodeExpr):
|
||||
candidates = self.findNodeCandidates('^' + nodeExpr)
|
||||
if not candidates:
|
||||
raise KeyError('No node candidate for "{}"'.format(nodeName))
|
||||
raise KeyError('No node candidate for "{}"'.format(nodeExpr))
|
||||
elif len(candidates) > 1:
|
||||
raise KeyError('Multiple node candidates for "{}": {}'.format(nodeName, str([c.name for c in candidates])))
|
||||
out.append(candidates[0])
|
||||
return out
|
||||
raise KeyError('Multiple node candidates for "{}": {}'.format(nodeExpr, str([c.name for c in candidates])))
|
||||
return candidates[0]
|
||||
|
||||
def findNodes(self, nodesExpr):
|
||||
return [self.findNode(nodeName) for nodeName in nodesExpr]
|
||||
|
||||
def edge(self, dstAttributeName):
|
||||
return self._edges.get(dstAttributeName)
|
||||
|
|
|
@ -6,16 +6,19 @@ from .core.graph import Graph
|
|||
def photogrammetryPipeline():
|
||||
# type: () -> Graph
|
||||
graph = Graph('pipeline')
|
||||
|
||||
cameraInit = graph.addNewNode('CameraInit',
|
||||
sensorDatabase=os.environ.get('ALICEVISION_SENSOR_DB', 'sensor_width_camera_database.txt'))
|
||||
|
||||
sensorDatabase=os.environ.get('ALICEVISION_SENSOR_DB', None))
|
||||
featureExtraction = graph.addNewNode('FeatureExtraction',
|
||||
input=cameraInit.outputSfm)
|
||||
# TODO: imageMatching
|
||||
imageMatching = graph.addNewNode('ImageMatching',
|
||||
input=cameraInit.outputSfm,
|
||||
featuresDirectory=featureExtraction.output,
|
||||
tree=os.environ.get('ALICEVISION_VOCTREE', None),
|
||||
)
|
||||
featureMatching = graph.addNewNode('FeatureMatching',
|
||||
input=cameraInit.outputSfm,
|
||||
featuresDirectory=featureExtraction.output)
|
||||
featuresDirectory=featureExtraction.output,
|
||||
imagePairsList=imageMatching.output)
|
||||
structureFromMotion = graph.addNewNode('StructureFromMotion',
|
||||
input=cameraInit.outputSfm,
|
||||
featuresDirectory=featureExtraction.output,
|
||||
|
@ -33,3 +36,5 @@ def photogrammetryPipeline():
|
|||
texturing = graph.addNewNode('Texturing',
|
||||
mvsConfig=meshing.mvsConfig)
|
||||
return graph
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,13 @@ class ImageMatching(desc.CommandLineNode):
|
|||
uid=[0],
|
||||
isOutput=False,
|
||||
)
|
||||
featuresDirectory = desc.File(
|
||||
label='Features Directory',
|
||||
description='''Directory containing the extracted features and descriptors. By default, it is the directory containing the SfMData.''',
|
||||
value='',
|
||||
uid=[0],
|
||||
isOutput=False,
|
||||
)
|
||||
tree = desc.File(
|
||||
label='Tree',
|
||||
description='''Input name for the vocabulary tree file.''',
|
||||
|
@ -22,8 +29,8 @@ class ImageMatching(desc.CommandLineNode):
|
|||
)
|
||||
output = desc.File(
|
||||
label='Output',
|
||||
description='''Filepath to the output file with the list of selected image pairs. Optional parameters:''',
|
||||
value='{cache}/{nodeType}/{uid0}/',
|
||||
description='''Filepath to the output file with the list of selected image pairs.''',
|
||||
value='{cache}/{nodeType}/{uid0}/imageMatches.txt',
|
||||
uid=[],
|
||||
isOutput=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue