mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 18:27:23 +02:00
Merge pull request #1489 from remmel/dev_nocudapipeline
Draft Reconstruction pipeline
This commit is contained in:
commit
a9abd29019
4 changed files with 53 additions and 2 deletions
|
@ -20,8 +20,8 @@ parser.add_argument('-I', '--inputRecursive', metavar='FOLDERS/IMAGES', type=str
|
||||||
default=[],
|
default=[],
|
||||||
help='Input folders containing all images recursively.')
|
help='Input folders containing all images recursively.')
|
||||||
|
|
||||||
parser.add_argument('-p', '--pipeline', metavar='photogrammetry/panoramaHdr/panoramaFisheyeHdr/MG_FILE', type=str, default='photogrammetry',
|
parser.add_argument('-p', '--pipeline', metavar='photogrammetry/panoramaHdr/panoramaFisheyeHdr/cameraTracking/photogrammetryDraft/MG_FILE', type=str, default='photogrammetry',
|
||||||
help='"photogrammetry", "panoramaHdr", "panoramaFisheyeHdr", "cameraTracking" pipeline or a Meshroom file containing a custom pipeline to run on input images. '
|
help='"photogrammetry", "panoramaHdr", "panoramaFisheyeHdr", "cameraTracking", "photogrammetryDraft" pipeline or a Meshroom file containing a custom pipeline to run on input images. '
|
||||||
'Requirements: the graph must contain one CameraInit node, '
|
'Requirements: the graph must contain one CameraInit node, '
|
||||||
'and one Publish node if --output is set.')
|
'and one Publish node if --output is set.')
|
||||||
|
|
||||||
|
|
|
@ -557,3 +557,47 @@ def photogrammetryAndCameraTracking(inputImages=list(), inputViewpoints=list(),
|
||||||
|
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
|
|
||||||
|
def photogrammetryDraft(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output='', graph=None):
|
||||||
|
"""
|
||||||
|
Create a new Graph with a complete photogrammetry pipeline without requiring a NVIDIA CUDA video card. Something also named Draft Meshing.
|
||||||
|
More information on that pipeline https://github.com/alicevision/meshroom/wiki/Draft-Meshing
|
||||||
|
|
||||||
|
Args:
|
||||||
|
inputImages (list of str, optional): list of image file paths
|
||||||
|
inputViewpoints (list of Viewpoint, optional): list of Viewpoints
|
||||||
|
output (str, optional): the path to export reconstructed model to
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Graph: the created graph
|
||||||
|
"""
|
||||||
|
if not graph:
|
||||||
|
graph = Graph('PhotogrammetryDraft')
|
||||||
|
with GraphModification(graph):
|
||||||
|
sfmNodes = sfmPipeline(graph)
|
||||||
|
sfmNode = sfmNodes[-1]
|
||||||
|
|
||||||
|
meshing = graph.addNewNode('Meshing',
|
||||||
|
input=sfmNode.output)
|
||||||
|
|
||||||
|
meshFiltering = graph.addNewNode('MeshFiltering',
|
||||||
|
inputMesh=meshing.outputMesh)
|
||||||
|
texturing = graph.addNewNode('Texturing',
|
||||||
|
input=meshing.output,
|
||||||
|
inputMesh=meshFiltering.outputMesh)
|
||||||
|
|
||||||
|
cameraInit = sfmNodes[0]
|
||||||
|
|
||||||
|
if inputImages:
|
||||||
|
cameraInit.viewpoints.extend([{'path': image} for image in inputImages])
|
||||||
|
if inputViewpoints:
|
||||||
|
cameraInit.viewpoints.extend(inputViewpoints)
|
||||||
|
if inputIntrinsics:
|
||||||
|
cameraInit.intrinsics.extend(inputIntrinsics)
|
||||||
|
|
||||||
|
if output:
|
||||||
|
graph.addNewNode('Publish', output=output, inputFiles=[texturing.outputMesh,
|
||||||
|
texturing.outputMaterial,
|
||||||
|
texturing.outputTextures])
|
||||||
|
|
||||||
|
return graph
|
||||||
|
|
|
@ -436,6 +436,10 @@ ApplicationWindow {
|
||||||
text: "Camera Tracking (experimental)"
|
text: "Camera Tracking (experimental)"
|
||||||
onTriggered: ensureSaved(function() { _reconstruction.new("cameratracking") })
|
onTriggered: ensureSaved(function() { _reconstruction.new("cameratracking") })
|
||||||
}
|
}
|
||||||
|
Action {
|
||||||
|
text: "Photogrammetry Draft (No CUDA)"
|
||||||
|
onTriggered: ensureSaved(function() { _reconstruction.new("photogrammetrydraft") })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
id: openActionItem
|
id: openActionItem
|
||||||
|
|
|
@ -496,6 +496,9 @@ class Reconstruction(UIGraph):
|
||||||
elif p.lower() == "cameratracking":
|
elif p.lower() == "cameratracking":
|
||||||
# default camera tracking pipeline
|
# default camera tracking pipeline
|
||||||
self.setGraph(multiview.cameraTracking())
|
self.setGraph(multiview.cameraTracking())
|
||||||
|
elif p.lower() == "photogrammetrydraft":
|
||||||
|
# photogrammetry pipeline in draft mode (no cuda)
|
||||||
|
self.setGraph(multiview.photogrammetryDraft())
|
||||||
else:
|
else:
|
||||||
# use the user-provided default photogrammetry project file
|
# use the user-provided default photogrammetry project file
|
||||||
self.load(p, setupProjectFile=False)
|
self.load(p, setupProjectFile=False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue