[nodes] ImageProcessing: update NL Means parameters' description and default value

Change HColor default value from 5 to 10 as advised in the documentation
of OpenCV's non-local means denoising. Also update the description of the
H and HColor parameters so that they are easier to understand. The name
of the parameters is also updated to match with parameters from other
groups.
This commit is contained in:
Candice Bentéjac 2022-12-05 15:58:04 +01:00
parent 12c3fce7b1
commit 826b57eeca

View file

@ -287,49 +287,53 @@ Convert or apply filtering to the input images.
enabled=lambda node: node.noiseFilter.noiseEnabled.value, enabled=lambda node: node.noiseFilter.noiseEnabled.value,
), ),
]), ]),
desc.GroupAttribute(name="nlmFilter", label="NL Means Denoising", description="NL Means Denoising Parameters.", joinChar=":", groupDesc=[ 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( desc.BoolParam(
name='denoiseEnabled', name='nlmFilterEnabled',
label='Enable', label='Enable',
description='Use Non-local Mean Denoising from OpenCV to denoise images', description='Use Non-local Mean Denoising from OpenCV to denoise images',
value=False, value=False,
uid=[0], uid=[0],
), ),
desc.FloatParam( desc.FloatParam(
name='filteringParamH', name='nlmFilterH',
label='H', label='H',
description='Parameter regulating filter strength. Bigger H value perfectly removes noise but also removes image details, smaller H value preserves details but also preserves some noise.', 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, value=5.0,
range=(1.0, 1000.0, 0.01), range=(1.0, 1000.0, 0.01),
uid=[0], uid=[0],
enabled=lambda node: node.nlmFilter.denoiseEnabled.value, enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
), ),
desc.FloatParam( desc.FloatParam(
name='filteringParamHForColorComponents', name='nlmFilterHColor',
label='HColor', label='HColor',
description='Parameter regulating filter strength for color images only. Normally same as Filtering Parameter H. Not necessary for grayscale images', description='Parameter regulating filter strength for color components. Not necessary for grayscale images.\n'
value=5.0, '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), range=(0.0, 1000.0, 0.01),
uid=[0], uid=[0],
enabled=lambda node: node.nlmFilter.denoiseEnabled.value, enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
), ),
desc.IntParam( desc.IntParam(
name='templateWindowSize', name='nlmFilterTemplateWindowSize',
label='Template Window Size', label='Template Window Size',
description='Size in pixels of the template patch that is used to compute weights. Should be odd.', description='Size in pixels of the template patch that is used to compute weights. Should be odd.',
value=7, value=7,
range=(1, 101, 2), range=(1, 101, 2),
uid=[0], uid=[0],
enabled=lambda node: node.nlmFilter.denoiseEnabled.value, enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
), ),
desc.IntParam( desc.IntParam(
name='searchWindowSize', name='nlmFilterSearchWindowSize',
label='Search Window Size', 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.', 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, value=21,
range=(1, 1001, 2), range=(1, 1001, 2),
uid=[0], uid=[0],
enabled=lambda node: node.nlmFilter.denoiseEnabled.value, enabled=lambda node: node.nlmFilter.nlmFilterEnabled.value,
), ),
]), ]),
desc.ChoiceParam( desc.ChoiceParam(