1
0
Fork 0

fix errors in local std denoising

This commit is contained in:
Sean Sube 2023-12-29 23:19:35 -06:00
parent 6a004816af
commit f6134dafc6
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,8 @@ class BlendDenoiseLocalStdStage(BaseStage):
_params: ImageParams, _params: ImageParams,
sources: StageResult, sources: StageResult,
*, *,
strength: int = 3, strength: int = 5,
range: int = 4,
stage_source: Optional[Image.Image] = None, stage_source: Optional[Image.Image] = None,
callback: Optional[ProgressCallback] = None, callback: Optional[ProgressCallback] = None,
**kwargs, **kwargs,
@ -33,7 +34,7 @@ class BlendDenoiseLocalStdStage(BaseStage):
return StageResult.from_arrays( return StageResult.from_arrays(
[ [
remove_noise(source, threshold=strength)[0] remove_noise(source, threshold=strength, deviation=range)[0]
for source in sources.as_numpy() for source in sources.as_numpy()
] ]
) )
@ -98,7 +99,7 @@ def remove_noise(
# skip if the central pixels have already been masked by a previous artifact # skip if the central pixels have already been masked by a previous artifact
if np.any(result_mask[i - 1 : i + 1, j - 1 : j + 1] > 0): if np.any(result_mask[i - 1 : i + 1, j - 1 : j + 1] > 0):
pass continue
# Extract region from each channel # Extract region from each channel
region_red = image[i_min:i_max, j_min:j_max, 0] region_red = image[i_min:i_max, j_min:j_max, 0]