Rename hdri into panoramaHdr

This commit is contained in:
Fabien Castan 2020-09-05 01:16:51 +02:00
parent f20db3abe3
commit 589856ecdc
5 changed files with 29 additions and 29 deletions

View file

@ -10,7 +10,7 @@ meshroom.setupEnvironment()
import meshroom.core.graph import meshroom.core.graph
from meshroom import multiview from meshroom import multiview
parser = argparse.ArgumentParser(description='Launch the full photogrammetry or HDRI pipeline.') parser = argparse.ArgumentParser(description='Launch the full photogrammetry or Panorama HDR pipeline.')
parser.add_argument('-i', '--input', metavar='SFM/FOLDERS/IMAGES', type=str, nargs='*', parser.add_argument('-i', '--input', metavar='SFM/FOLDERS/IMAGES', type=str, nargs='*',
default=[], default=[],
help='Input folder containing images or folders of images or file (.sfm or .json) ' help='Input folder containing images or folders of images or file (.sfm or .json) '
@ -19,8 +19,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/hdri/MG_FILE', type=str, default='photogrammetry', parser.add_argument('-p', '--pipeline', metavar='photogrammetry/panoramaHdr/panoramaFisheyeHdr/MG_FILE', type=str, default='photogrammetry',
help='"photogrammetry" pipeline, "hdri" pipeline or a Meshroom file containing a custom pipeline to run on input images. ' help='"photogrammetry" pipeline, "panotamaHdr" pipeline, "panotamaFisheyeHdr" 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.')
@ -112,12 +112,12 @@ with multiview.GraphModification(graph):
if args.pipeline.lower() == "photogrammetry": if args.pipeline.lower() == "photogrammetry":
# default photogrammetry pipeline # default photogrammetry pipeline
multiview.photogrammetry(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph) multiview.photogrammetry(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph)
elif args.pipeline.lower() == "hdri": elif args.pipeline.lower() == "panoramahdr":
# default hdri pipeline # default panorama Hdr pipeline
multiview.hdri(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph) multiview.panoramaHdr(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph)
elif args.pipeline.lower() == "hdrifisheye": elif args.pipeline.lower() == "panoramafisheyehdr":
# default hdriFisheye pipeline # default panorama Fisheye Hdr pipeline
multiview.hdriFisheye(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph) multiview.panoramaFisheyeHdr(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output, graph=graph)
else: else:
# custom pipeline # custom pipeline
graph.load(args.pipeline) graph.load(args.pipeline)

View file

@ -143,9 +143,9 @@ def findFilesByTypeInFolder(folder, recursive=False):
return output return output
def hdri(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output='', graph=None): def panoramaHdr(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output='', graph=None):
""" """
Create a new Graph with a complete HDRI pipeline. Create a new Graph with a Panorama HDR pipeline.
Args: Args:
inputImages (list of str, optional): list of image file paths inputImages (list of str, optional): list of image file paths
@ -156,9 +156,9 @@ def hdri(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output=''
Graph: the created graph Graph: the created graph
""" """
if not graph: if not graph:
graph = Graph('HDRI') graph = Graph('PanoramaHDR')
with GraphModification(graph): with GraphModification(graph):
nodes = hdriPipeline(graph) nodes = panoramaHdrPipeline(graph)
cameraInit = nodes[0] cameraInit = nodes[0]
if inputImages: if inputImages:
cameraInit.viewpoints.extend([{'path': image} for image in inputImages]) cameraInit.viewpoints.extend([{'path': image} for image in inputImages])
@ -173,18 +173,18 @@ def hdri(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output=''
return graph return graph
def hdriFisheye(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output='', graph=None): def panoramaFisheyeHdr(inputImages=None, inputViewpoints=None, inputIntrinsics=None, output='', graph=None):
if not graph: if not graph:
graph = Graph('HDRI-Fisheye') graph = Graph('PanoramaFisheyeHDR')
with GraphModification(graph): with GraphModification(graph):
hdri(inputImages, inputViewpoints, inputIntrinsics, output, graph) panoramaHdr(inputImages, inputViewpoints, inputIntrinsics, output, graph)
for panoramaInit in graph.nodesByType("PanoramaInit"): for panoramaInit in graph.nodesByType("PanoramaInit"):
panoramaInit.attribute("useFisheye").value = True panoramaInit.attribute("useFisheye").value = True
return graph return graph
def hdriPipeline(graph): def panoramaHdrPipeline(graph):
""" """
Instantiate an HDRI pipeline inside 'graph'. Instantiate an PanoramaHDR pipeline inside 'graph'.
Args: Args:
graph (Graph/UIGraph): the graph in which nodes should be instantiated graph (Graph/UIGraph): the graph in which nodes should be instantiated

View file

@ -69,7 +69,7 @@ class MeshroomApp(QApplication):
help='Import images to reconstruct from specified folder and sub-folders.') help='Import images to reconstruct from specified folder and sub-folders.')
parser.add_argument('-s', '--save', metavar='PROJECT.mg', type=str, default='', parser.add_argument('-s', '--save', metavar='PROJECT.mg', type=str, default='',
help='Save the created scene.') help='Save the created scene.')
parser.add_argument('-p', '--pipeline', metavar='MESHROOM_FILE/photogrammetry/hdri', type=str, default=os.environ.get("MESHROOM_DEFAULT_PIPELINE", "photogrammetry"), parser.add_argument('-p', '--pipeline', metavar='MESHROOM_FILE/photogrammetry/panoramaHdr/panoramaFisheyeHdr', type=str, default=os.environ.get("MESHROOM_DEFAULT_PIPELINE", "photogrammetry"),
help='Override the default Meshroom pipeline with this external graph.') help='Override the default Meshroom pipeline with this external graph.')
parser.add_argument("--verbose", help="Verbosity level", default='warning', parser.add_argument("--verbose", help="Verbosity level", default='warning',
choices=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],) choices=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],)

View file

@ -340,12 +340,12 @@ ApplicationWindow {
onTriggered: ensureSaved(function() { _reconstruction.new("photogrammetry") }) onTriggered: ensureSaved(function() { _reconstruction.new("photogrammetry") })
} }
Action { Action {
text: "HDRI" text: "Panorama HDR"
onTriggered: ensureSaved(function() { _reconstruction.new("hdri") }) onTriggered: ensureSaved(function() { _reconstruction.new("panoramahdr") })
} }
Action { Action {
text: "HDRI Fisheye" text: "Panorama Fisheye HDR"
onTriggered: ensureSaved(function() { _reconstruction.new("hdriFisheye") }) onTriggered: ensureSaved(function() { _reconstruction.new("panoramahdrfisheyehdr") })
} }
} }
Action { Action {

View file

@ -484,12 +484,12 @@ class Reconstruction(UIGraph):
if p.lower() == "photogrammetry": if p.lower() == "photogrammetry":
# default photogrammetry pipeline # default photogrammetry pipeline
self.setGraph(multiview.photogrammetry()) self.setGraph(multiview.photogrammetry())
elif p.lower() == "hdri": elif p.lower() == "panoramahdr":
# default hdri pipeline # default panorama hdr pipeline
self.setGraph(multiview.hdri()) self.setGraph(multiview.panoramaHdr())
elif p.lower() == "hdrifisheye": elif p.lower() == "panoramafisheyehdr":
# default hdri pipeline # default panorama fisheye hdr pipeline
self.setGraph(multiview.hdriFisheye()) self.setGraph(multiview.panoramaFisheyeHdr())
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)