mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 17:06:35 +02:00
[multiview] add 'sfmAugmentation' function
This commit is contained in:
parent
b596bdffca
commit
f939b36999
1 changed files with 46 additions and 0 deletions
|
@ -139,3 +139,49 @@ def mvsPipeline(graph, sfm=None):
|
||||||
meshing,
|
meshing,
|
||||||
texturing
|
texturing
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def sfmAugmentation(graph, sourceSfm, withMVS=False):
|
||||||
|
"""
|
||||||
|
Create a SfM augmentation inside 'graph'.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
graph (Graph/UIGraph): the graph in which nodes should be instantiated
|
||||||
|
sourceSfm (Node, optional): if specified, connect the MVS pipeline to this StructureFromMotion node
|
||||||
|
withMVS (bool): whether to create a MVS pipeline after the augmented SfM branch
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
tuple: the created nodes (sfmNodes, mvsNodes)
|
||||||
|
"""
|
||||||
|
cameraInit = graph.addNewNode('CameraInit')
|
||||||
|
|
||||||
|
featureExtraction = graph.addNewNode('FeatureExtraction',
|
||||||
|
input=cameraInit.output)
|
||||||
|
imageMatchingMulti = graph.addNewNode('ImageMatchingMultiSfM',
|
||||||
|
input=featureExtraction.input,
|
||||||
|
featuresFolder=featureExtraction.output
|
||||||
|
)
|
||||||
|
featureMatching = graph.addNewNode('FeatureMatching',
|
||||||
|
input=imageMatchingMulti.outputCombinedSfM,
|
||||||
|
featuresFolder=imageMatchingMulti.featuresFolder,
|
||||||
|
imagePairsList=imageMatchingMulti.output)
|
||||||
|
structureFromMotion = graph.addNewNode('StructureFromMotion',
|
||||||
|
input=featureMatching.input,
|
||||||
|
featuresFolder=featureMatching.featuresFolder,
|
||||||
|
matchesFolder=featureMatching.output)
|
||||||
|
graph.addEdge(sourceSfm.output, imageMatchingMulti.inputB)
|
||||||
|
|
||||||
|
sfmNodes = [
|
||||||
|
cameraInit,
|
||||||
|
featureMatching,
|
||||||
|
imageMatchingMulti,
|
||||||
|
featureMatching,
|
||||||
|
structureFromMotion
|
||||||
|
]
|
||||||
|
|
||||||
|
mvsNodes = []
|
||||||
|
|
||||||
|
if withMVS:
|
||||||
|
mvsNodes = mvsPipeline(graph, structureFromMotion)
|
||||||
|
|
||||||
|
return sfmNodes, mvsNodes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue