From 4a8232f23ee2e94142609459982dc632eb90b1ca Mon Sep 17 00:00:00 2001 From: demoulinv Date: Fri, 20 Jan 2023 15:32:11 +0100 Subject: [PATCH] [HDR sampling and calib nodes] Add calibrationMethod as parameter at sampling. Link calibrationMethod parameter of calib node to sampling node's calibrationMethod parameter in both HDR pipelines. --- meshroom/nodes/aliceVision/LdrToHdrSampling.py | 18 ++++++++++++++++-- meshroom/pipelines/panoramaFisheyeHdr.mg | 3 ++- meshroom/pipelines/panoramaHdr.mg | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/meshroom/nodes/aliceVision/LdrToHdrSampling.py b/meshroom/nodes/aliceVision/LdrToHdrSampling.py index 997e7516..570a7be0 100644 --- a/meshroom/nodes/aliceVision/LdrToHdrSampling.py +++ b/meshroom/nodes/aliceVision/LdrToHdrSampling.py @@ -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', @@ -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) diff --git a/meshroom/pipelines/panoramaFisheyeHdr.mg b/meshroom/pipelines/panoramaFisheyeHdr.mg index ebaa15d2..761a68f3 100644 --- a/meshroom/pipelines/panoramaFisheyeHdr.mg +++ b/meshroom/pipelines/panoramaFisheyeHdr.mg @@ -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": [ diff --git a/meshroom/pipelines/panoramaHdr.mg b/meshroom/pipelines/panoramaHdr.mg index 2da01a00..4248feaa 100644 --- a/meshroom/pipelines/panoramaHdr.mg +++ b/meshroom/pipelines/panoramaHdr.mg @@ -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": [