Make denoise
arguments depend on denoiser
This commit is contained in:
parent
caf7025504
commit
3a4f774e28
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user