mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-22 21:46:28 +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()
|
graph = multiview.photogrammetryPipeline()
|
||||||
if args.input:
|
if args.input:
|
||||||
cameraInit = graph.findNodeCandidates("CameraInit")
|
cameraInit = graph.findNode("CameraInit")
|
||||||
cameraInit.imageDirectory.value = args.input
|
cameraInit.imageDirectory.value = args.input
|
||||||
|
|
||||||
if args.save:
|
if args.save:
|
||||||
|
|
|
@ -631,16 +631,16 @@ class Graph(BaseObject):
|
||||||
pattern = re.compile(nodeNameExpr)
|
pattern = re.compile(nodeNameExpr)
|
||||||
return [v for k, v in self._nodes.objects.items() if pattern.match(k)]
|
return [v for k, v in self._nodes.objects.items() if pattern.match(k)]
|
||||||
|
|
||||||
def findNodes(self, nodesExpr):
|
def findNode(self, nodeExpr):
|
||||||
out = []
|
candidates = self.findNodeCandidates('^' + nodeExpr)
|
||||||
for nodeName in nodesExpr:
|
|
||||||
candidates = self.findNodeCandidates('^' + nodeName)
|
|
||||||
if not candidates:
|
if not candidates:
|
||||||
raise KeyError('No node candidate for "{}"'.format(nodeName))
|
raise KeyError('No node candidate for "{}"'.format(nodeExpr))
|
||||||
elif len(candidates) > 1:
|
elif len(candidates) > 1:
|
||||||
raise KeyError('Multiple node candidates for "{}": {}'.format(nodeName, str([c.name for c in candidates])))
|
raise KeyError('Multiple node candidates for "{}": {}'.format(nodeExpr, str([c.name for c in candidates])))
|
||||||
out.append(candidates[0])
|
return candidates[0]
|
||||||
return out
|
|
||||||
|
def findNodes(self, nodesExpr):
|
||||||
|
return [self.findNode(nodeName) for nodeName in nodesExpr]
|
||||||
|
|
||||||
def edge(self, dstAttributeName):
|
def edge(self, dstAttributeName):
|
||||||
return self._edges.get(dstAttributeName)
|
return self._edges.get(dstAttributeName)
|
||||||
|
|
|
@ -6,16 +6,19 @@ from .core.graph import Graph
|
||||||
def photogrammetryPipeline():
|
def photogrammetryPipeline():
|
||||||
# type: () -> Graph
|
# type: () -> Graph
|
||||||
graph = Graph('pipeline')
|
graph = Graph('pipeline')
|
||||||
|
|
||||||
cameraInit = graph.addNewNode('CameraInit',
|
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',
|
featureExtraction = graph.addNewNode('FeatureExtraction',
|
||||||
input=cameraInit.outputSfm)
|
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',
|
featureMatching = graph.addNewNode('FeatureMatching',
|
||||||
input=cameraInit.outputSfm,
|
input=cameraInit.outputSfm,
|
||||||
featuresDirectory=featureExtraction.output)
|
featuresDirectory=featureExtraction.output,
|
||||||
|
imagePairsList=imageMatching.output)
|
||||||
structureFromMotion = graph.addNewNode('StructureFromMotion',
|
structureFromMotion = graph.addNewNode('StructureFromMotion',
|
||||||
input=cameraInit.outputSfm,
|
input=cameraInit.outputSfm,
|
||||||
featuresDirectory=featureExtraction.output,
|
featuresDirectory=featureExtraction.output,
|
||||||
|
@ -33,3 +36,5 @@ def photogrammetryPipeline():
|
||||||
texturing = graph.addNewNode('Texturing',
|
texturing = graph.addNewNode('Texturing',
|
||||||
mvsConfig=meshing.mvsConfig)
|
mvsConfig=meshing.mvsConfig)
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,13 @@ class ImageMatching(desc.CommandLineNode):
|
||||||
uid=[0],
|
uid=[0],
|
||||||
isOutput=False,
|
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(
|
tree = desc.File(
|
||||||
label='Tree',
|
label='Tree',
|
||||||
description='''Input name for the vocabulary tree file.''',
|
description='''Input name for the vocabulary tree file.''',
|
||||||
|
@ -22,8 +29,8 @@ class ImageMatching(desc.CommandLineNode):
|
||||||
)
|
)
|
||||||
output = desc.File(
|
output = desc.File(
|
||||||
label='Output',
|
label='Output',
|
||||||
description='''Filepath to the output file with the list of selected image pairs. Optional parameters:''',
|
description='''Filepath to the output file with the list of selected image pairs.''',
|
||||||
value='{cache}/{nodeType}/{uid0}/',
|
value='{cache}/{nodeType}/{uid0}/imageMatches.txt',
|
||||||
uid=[],
|
uid=[],
|
||||||
isOutput=True,
|
isOutput=True,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue