[multiview] Use SfMData as input in MVS pipeline

This commit is contained in:
Grégoire De Lillo 2018-08-08 18:33:05 +02:00
parent f8d761c564
commit ce25724023
7 changed files with 90 additions and 39 deletions

View file

@ -122,20 +122,26 @@ def mvsPipeline(graph, sfm=None):
prepareDenseScene = graph.addNewNode('PrepareDenseScene',
input=sfm.output if sfm else "")
cameraConnection = graph.addNewNode('CameraConnection',
ini=prepareDenseScene.ini)
input=prepareDenseScene.input,
imagesFolder=prepareDenseScene.output)
depthMap = graph.addNewNode('DepthMap',
ini=cameraConnection.ini)
input=cameraConnection.input,
cameraPairsMatrixFolder=cameraConnection.output,
imagesFolder=cameraConnection.imagesFolder)
depthMapFilter = graph.addNewNode('DepthMapFilter',
depthMapFolder=depthMap.output,
ini=depthMap.ini)
input=depthMap.input,
cameraPairsMatrixFolder=depthMap.cameraPairsMatrixFolder,
depthMapFolder=depthMap.output)
meshing = graph.addNewNode('Meshing',
input=depthMapFilter.input,
cameraPairsMatrixFolder=depthMapFilter.cameraPairsMatrixFolder,
depthMapFolder=depthMapFilter.depthMapFolder,
depthMapFilterFolder=depthMapFilter.output,
ini=depthMapFilter.ini)
depthMapFilterFolder=depthMapFilter.output)
meshFiltering = graph.addNewNode('MeshFiltering',
input=meshing.output)
texturing = graph.addNewNode('Texturing',
ini=meshing.ini,
input=meshing.input,
imagesFolder=depthMap.imagesFolder,
inputDenseReconstruction=meshing.outputDenseReconstruction,
inputMesh=meshFiltering.output)

View file

@ -6,20 +6,27 @@ from meshroom.core import desc
class CameraConnection(desc.CommandLineNode):
internalFolder = desc.Node.internalFolder
commandLine = 'aliceVision_cameraConnection {allParams}'
size = desc.DynamicNodeSize('ini')
size = desc.DynamicNodeSize('input')
inputs = [
desc.File(
name="ini",
label='MVS Configuration file',
description='',
name='input',
label='Input',
description='SfMData file.',
value='',
uid=[0],
),
desc.File(
name='imagesFolder',
label='Images Folder',
description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.',
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,
@ -27,3 +34,13 @@ class CameraConnection(desc.CommandLineNode):
),
]
outputs = [
desc.File(
name='output',
label='Output',
description='Output folder for the camera pairs matrix file.',
value=desc.Node.internalFolder,
uid=[],
)
]

View file

@ -6,15 +6,29 @@ from meshroom.core import desc
class DepthMap(desc.CommandLineNode):
commandLine = 'aliceVision_depthMapEstimation {allParams}'
gpu = desc.Level.INTENSIVE
size = desc.DynamicNodeSize('ini')
size = desc.DynamicNodeSize('input')
parallelization = desc.Parallelization(blockSize=3)
commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}'
inputs = [
desc.File(
name="ini",
label='MVS Configuration File',
description='',
name='input',
label='Input',
description='SfMData file.',
value='',
uid=[0],
),
desc.File(
name='cameraPairsMatrixFolder',
label='Camera Pairs Matrix Folder',
description='Camera pairs matrix folder.',
value='',
uid=[0],
),
desc.File(
name='imagesFolder',
label='Images Folder',
description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.',
value='',
uid=[0],
),

View file

@ -6,25 +6,32 @@ from meshroom.core import desc
class DepthMapFilter(desc.CommandLineNode):
commandLine = 'aliceVision_depthMapFiltering {allParams}'
gpu = desc.Level.NORMAL
size = desc.DynamicNodeSize('ini')
size = desc.DynamicNodeSize('input')
parallelization = desc.Parallelization(blockSize=10)
commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}'
inputs = [
desc.File(
name="ini",
label="MVS Configuration file",
description="",
value="",
name='input',
label='Input',
description='SfMData file.',
value='',
uid=[0],
),
),
desc.File(
name='cameraPairsMatrixFolder',
label='Camera Pairs Matrix Folder',
description='Camera pairs matrix folder.',
value='',
uid=[0],
),
desc.File(
name="depthMapFolder",
label="Depth Map Folder",
description="Input depth map folder",
value="",
uid=[0],
),
),
desc.IntParam(
name="nNearestCams",
label="Number of Nearest Cameras",

View file

@ -11,12 +11,19 @@ class Meshing(desc.CommandLineNode):
inputs = [
desc.File(
name="ini",
label='MVS Configuration file',
description='',
name='input',
label='Input',
description='SfMData file.',
value='',
uid=[0],
),
),
desc.File(
name='cameraPairsMatrixFolder',
label='Camera Pairs Matrix Folder',
description='Camera pairs matrix folder.',
value='',
uid=[0],
),
desc.File(
name="depthMapFolder",
label='Depth Maps Folder',

View file

@ -6,6 +6,8 @@ from meshroom.core import desc
class PrepareDenseScene(desc.CommandLineNode):
commandLine = 'aliceVision_prepareDenseScene {allParams}'
size = desc.DynamicNodeSize('input')
parallelization = desc.Parallelization(blockSize=40)
commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}'
inputs = [
desc.File(
@ -27,15 +29,6 @@ class PrepareDenseScene(desc.CommandLineNode):
]
outputs = [
desc.File(
name='ini',
label='MVS Configuration file',
description='',
value=desc.Node.internalFolder + 'mvs.ini',
uid=[],
group='', # not a command line arg
),
desc.File(
name='output',
label='Output',

View file

@ -9,9 +9,16 @@ class Texturing(desc.CommandLineNode):
ram = desc.Level.INTENSIVE
inputs = [
desc.File(
name='ini',
label='MVS Configuration file',
description='',
name='input',
label='Input',
description='SfMData file.',
value='',
uid=[0],
),
desc.File(
name='imagesFolder',
label='Images Folder',
description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.',
value='',
uid=[0],
),