mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 09:47:20 +02:00
Merge pull request #2668 from alicevision/dev/exportImages
[nodes] Add nodes for versatile image exporting
This commit is contained in:
commit
aa0943e4bf
2 changed files with 150 additions and 0 deletions
83
meshroom/nodes/aliceVision/ExportImages.py
Normal file
83
meshroom/nodes/aliceVision/ExportImages.py
Normal file
|
@ -0,0 +1,83 @@
|
|||
__version__ = "1.0"
|
||||
|
||||
from meshroom.core import desc
|
||||
from meshroom.core.utils import VERBOSE_LEVEL
|
||||
|
||||
|
||||
class ExportImages(desc.AVCommandLineNode):
|
||||
commandLine = 'aliceVision_exportImages {allParams}'
|
||||
size = desc.DynamicNodeSize('input')
|
||||
parallelization = desc.Parallelization(blockSize=40)
|
||||
commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}'
|
||||
|
||||
category = 'Export'
|
||||
documentation = '''
|
||||
Export images referenced in the input sfmData by transforming
|
||||
them to adapt to the required target intrinsics. For example, the target
|
||||
intrinsics may be the same without the distortion.
|
||||
'''
|
||||
|
||||
inputs = [
|
||||
desc.File(
|
||||
name="input",
|
||||
label="SfMData",
|
||||
description="Input SfMData file. Contains the original intrinsics of the images.",
|
||||
value="",
|
||||
),
|
||||
desc.File(
|
||||
name="target",
|
||||
label="Target",
|
||||
description="This sfmData file contains the required intrinsics for the output images.",
|
||||
value="",
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name="outputFileType",
|
||||
label="Output File Type",
|
||||
description="Output file type for the exported images.",
|
||||
value="exr",
|
||||
values=["jpg", "png", "tif", "exr"],
|
||||
advanced=True,
|
||||
),
|
||||
desc.BoolParam(
|
||||
name="evCorrection",
|
||||
label="Correct Images Exposure",
|
||||
description="Apply a correction on images' exposure value.",
|
||||
value=False,
|
||||
advanced=True,
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name="namingMode",
|
||||
label="Naming mode",
|
||||
description="image naming mode :\n"
|
||||
" - viewid: viewid.ext.\n"
|
||||
" - frameid: Frameid.ext.\n"
|
||||
" - keep: Keep original name.\n",
|
||||
value="frameid",
|
||||
values=["viewid", "frameid", "keep"],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name="verboseLevel",
|
||||
label="Verbose Level",
|
||||
description="Verbosity level (fatal, error, warning, info, debug, trace).",
|
||||
values=VERBOSE_LEVEL,
|
||||
value="info",
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
desc.File(
|
||||
name="output",
|
||||
label="Images Folder",
|
||||
description="Output folder.",
|
||||
value=desc.Node.internalFolder,
|
||||
),
|
||||
desc.File(
|
||||
name="undistorted",
|
||||
label="Undistorted Images",
|
||||
description="List of undistorted images.",
|
||||
semantic="image",
|
||||
value=desc.Node.internalFolder + "<VIEW_ID>.{outputFileTypeValue}",
|
||||
group="",
|
||||
advanced=True,
|
||||
),
|
||||
]
|
67
meshroom/nodes/aliceVision/IntrinsicsTransforming.py
Normal file
67
meshroom/nodes/aliceVision/IntrinsicsTransforming.py
Normal file
|
@ -0,0 +1,67 @@
|
|||
__version__ = "1.0"
|
||||
|
||||
from meshroom.core import desc
|
||||
from meshroom.core.utils import VERBOSE_LEVEL
|
||||
|
||||
class IntrinsicsTransforming(desc.AVCommandLineNode):
|
||||
commandLine = 'aliceVision_intrinsicsTransforming {allParams}'
|
||||
size = desc.DynamicNodeSize('input')
|
||||
|
||||
category = 'Utils'
|
||||
documentation = '''
|
||||
Transforms all intrinsics in the sfmData to a new type.
|
||||
'''
|
||||
|
||||
inputs = [
|
||||
desc.File(
|
||||
name="input",
|
||||
label="Input SfMData",
|
||||
description="Input SfMData file.",
|
||||
value="",
|
||||
),
|
||||
desc.File(
|
||||
name="inputTracks",
|
||||
label="Input Tracks",
|
||||
description="Input Tracks file.",
|
||||
value="",
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name="type",
|
||||
label="Camera Type",
|
||||
description="Mathematical model used to represent a camera:\n"
|
||||
" - pinhole: Simplest projective camera model without optical distortion "
|
||||
"(focal and optical center).\n"
|
||||
" - equirectangular: Projection model used in panoramas.\n",
|
||||
value="pinhole",
|
||||
values=["pinhole", "equidistant", "equirectangular"],
|
||||
),
|
||||
desc.FloatParam(
|
||||
name="fakeFov",
|
||||
label="Virtual FOV",
|
||||
description="If the input intrinsic is not a pinhole but the output is, what is the virtual FOV requested.",
|
||||
value=90.0,
|
||||
range=(1.0, 179.0, 0.1),
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name="verboseLevel",
|
||||
label="Verbose Level",
|
||||
description="Verbosity level (fatal, error, warning, info, debug, trace).",
|
||||
values=VERBOSE_LEVEL,
|
||||
value="info",
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
desc.File(
|
||||
name="output",
|
||||
label="Output SfMData",
|
||||
description="Output SfMData file.",
|
||||
value=desc.Node.internalFolder + "sfmData.abc",
|
||||
),
|
||||
desc.File(
|
||||
name="outputTracks",
|
||||
label="Output Tracks",
|
||||
description="Output Tracks file.",
|
||||
value=desc.Node.internalFolder + "tracksFile.json",
|
||||
),
|
||||
]
|
Loading…
Add table
Reference in a new issue