diff --git a/datasets/raise/extract_noise.py b/datasets/raise/extract_noise.py index 3b330c2..74eaeaf 100755 --- a/datasets/raise/extract_noise.py +++ b/datasets/raise/extract_noise.py @@ -60,8 +60,14 @@ def treatImage(imageFileName, computeExtremes = False): else: imagePil = Image.open(imageFilePath) imageNpArray = img_as_float(np.array(imagePil)) - # As the arguments differ from a denoiser to the other should use a match instead. - imageDenoisedNpArray = denoise(imageNpArray, rescale_sigma=True) + # Could make not `.nef` compatible. + match denoiser: + case 'wavelet': + imageDenoisedNpArray = denoise(imageNpArray, rescale_sigma=True) + case 'bilateral': + imageDenoisedNpArray = denoise(imageNpArray, sigma_color=0.05, sigma_spatial=15) + case 'tv_chambolle': + imageDenoisedNpArray = denoise(imageNpArray, weight=0.2) imageNoiseNpArray = imageNpArray - imageDenoisedNpArray if mean is None: mean = imageNoiseNpArray