Merge pull request #1719 from alicevision/AddNLMeansDenoisingOpenCVInImageProcessingNode

Add nl means denoising open cv in image processing node
This commit is contained in:
Fabien Castan 2022-12-13 22:48:30 +01:00 committed by GitHub
commit 82ae95ef3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -287,6 +287,55 @@ Convert or apply filtering to the input images.
enabled=lambda node: node.noiseFilter.noiseEnabled.value,
),
]),
desc.GroupAttribute(name="nlmFilter", label="NL Means Denoising (8 bits)",
description="NL Means Denoising Parameters.\n This implementation only works on 8-bit images, so the colors can be reduced and clamped.",
joinChar=":", groupDesc=[
desc.BoolParam(
name='nlmFilterEnabled',
label='Enable',
description='Use Non-local Mean Denoising from OpenCV to denoise images',
value=False,
uid=[0],
),
desc.FloatParam(
name='nlmFilterH',
label='H',
description='Parameter regulating filter strength for luminance component.\n'
'Bigger H value perfectly removes noise but also removes image details, smaller H value preserves details but also preserves some noise.',
value=5.0,
range=(1.0, 1000.0, 0.01),
uid=[0],
enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
),
desc.FloatParam(
name='nlmFilterHColor',
label='HColor',
description='Parameter regulating filter strength for color components. Not necessary for grayscale images.\n'
'Bigger HColor value perfectly removes noise but also removes image details, smaller HColor value preserves details but also preserves some noise.',
value=10.0,
range=(0.0, 1000.0, 0.01),
uid=[0],
enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
),
desc.IntParam(
name='nlmFilterTemplateWindowSize',
label='Template Window Size',
description='Size in pixels of the template patch that is used to compute weights. Should be odd.',
value=7,
range=(1, 101, 2),
uid=[0],
enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
),
desc.IntParam(
name='nlmFilterSearchWindowSize',
label='Search Window Size',
description='Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time.',
value=21,
range=(1, 1001, 2),
uid=[0],
enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
),
]),
desc.ChoiceParam(
name='outputFormat',
label='Output Image Format',