Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LdrToHdrMerge node: Add a checkbox enabling the manual setting of the reference bracket for HDR merging #1849

Merged
merged 7 commits into from
Feb 14, 2023
3 changes: 1 addition & 2 deletions meshroom/nodes/aliceVision/LdrToHdrCalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class LdrToHdrCalibration(desc.AVCommandLineNode):
description="Bypass HDR creation and use the medium bracket as the source for the next steps",
value=False,
uid=[0],
group='internal',
enabled= lambda node: node.nbBrackets.value != 1,
),
desc.ChoiceParam(
Expand Down Expand Up @@ -158,7 +157,7 @@ class LdrToHdrCalibration(desc.AVCommandLineNode):
]

def processChunk(self, chunk):
if chunk.node.nbBrackets.value == 1 or chunk.node.byPass.value:
if chunk.node.nbBrackets.value == 1:
return
super(LdrToHdrCalibration, self).processChunk(chunk)

Expand Down
19 changes: 18 additions & 1 deletion meshroom/nodes/aliceVision/LdrToHdrMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,31 @@ class LdrToHdrMerge(desc.AVCommandLineNode):
range=(0, 10, 1),
uid=[0],
),
desc.BoolParam(
name='offsetRefBracketIndexEnabled',
label='Manually Specify Ref Bracket',
description='Manually specify the reference bracket index to control the exposure of the HDR image.',
value=False,
uid=[0],
group='user', # not used directly on the command line
),
desc.IntParam(
name='offsetRefBracketIndex',
label='Offset Ref Bracket Index',
description='Zero to use the center bracket. +N to use a more exposed bracket or -N to use a less exposed backet.',
value=1,
range=(-4, 4, 1),
uid=[0],
enabled= lambda node: node.nbBrackets.value != 1,
enabled= lambda node: (node.nbBrackets.value != 1 and node.offsetRefBracketIndexEnabled.value),
),
desc.FloatParam(
name='meanTargetedLumaForMerging',
label='Targeted Luminance For Merging',
description='Expected mean luminance of the HDR images used to compute the final panorama',
value=0.4,
range=(0.0, 1.0, 0.01),
uid=[0],
enabled= lambda node: (node.nbBrackets.value != 1 and not node.offsetRefBracketIndexEnabled.value),
),
desc.BoolParam(
name='byPass',
Expand Down
18 changes: 16 additions & 2 deletions meshroom/nodes/aliceVision/LdrToHdrSampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,23 @@ class LdrToHdrSampling(desc.AVCommandLineNode):
description="Bypass HDR creation and use the medium bracket as the source for the next steps",
value=False,
uid=[0],
group='internal',
enabled= lambda node: node.nbBrackets.value != 1,
),
desc.ChoiceParam(
name='calibrationMethod',
label='Calibration Method',
description="Method used for camera calibration \n"
" * Linear: Disable the calibration and assumes a linear Camera Response Function. If images are encoded in a known colorspace (like sRGB for JPEG), the images will be automatically converted to linear. \n"
" * Debevec: This is the standard method for HDR calibration. \n"
" * Grossberg: Based on learned database of cameras, it allows to reduce the CRF to few parameters while keeping all the precision. \n"
" * Laguerre: Simple but robust method estimating the minimal number of parameters. \n"
" * Robertson: First method for HDR calibration in the literature. \n",
values=['linear', 'debevec', 'grossberg', 'laguerre'],
value='debevec',
exclusive=True,
uid=[0],
enabled= lambda node: node.byPass.enabled and not node.byPass.value,
),
desc.IntParam(
name='channelQuantizationPower',
label='Channel Quantization Power',
Expand Down Expand Up @@ -164,7 +178,7 @@ class LdrToHdrSampling(desc.AVCommandLineNode):
]

def processChunk(self, chunk):
if chunk.node.nbBrackets.value == 1 or chunk.node.byPass.value:
if chunk.node.nbBrackets.value == 1:
return
super(LdrToHdrSampling, self).processChunk(chunk)

Expand Down
3 changes: 2 additions & 1 deletion meshroom/pipelines/panoramaFisheyeHdr.mg
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"byPass": "{LdrToHdrSampling_1.byPass}",
"input": "{LdrToHdrSampling_1.input}",
"userNbBrackets": "{LdrToHdrSampling_1.userNbBrackets}",
"workingColorSpace": "{LdrToHdrSampling_1.workingColorSpace}"
"workingColorSpace": "{LdrToHdrSampling_1.workingColorSpace}",
"calibrationMethod": "{LdrToHdrSampling_1.calibrationMethod}"
},
"nodeType": "LdrToHdrCalibration",
"position": [
Expand Down
3 changes: 2 additions & 1 deletion meshroom/pipelines/panoramaHdr.mg
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"byPass": "{LdrToHdrSampling_1.byPass}",
"input": "{LdrToHdrSampling_1.input}",
"userNbBrackets": "{LdrToHdrSampling_1.userNbBrackets}",
"workingColorSpace": "{LdrToHdrSampling_1.workingColorSpace}"
"workingColorSpace": "{LdrToHdrSampling_1.workingColorSpace}",
"calibrationMethod": "{LdrToHdrSampling_1.calibrationMethod}"
},
"nodeType": "LdrToHdrCalibration",
"position": [
Expand Down