From 15c41c046333d2e42352d1e7ab92e224fb2b55d6 Mon Sep 17 00:00:00 2001 From: Benjamin Loison <12752145+Benjamin-Loison@users.noreply.github.com> Date: Sat, 6 Apr 2024 00:03:50 +0200 Subject: [PATCH] Add and use `imageDenoisedNpArray` to ease using other denoisers --- datasets/raise/extract_noise.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datasets/raise/extract_noise.py b/datasets/raise/extract_noise.py index fe9fcd2..968e6c4 100755 --- a/datasets/raise/extract_noise.py +++ b/datasets/raise/extract_noise.py @@ -20,7 +20,8 @@ def treatImage(imageFileName): imageFilePath = f'{imagesFolderPath}/{imageFileName}' imagePil = Image.open(imageFilePath) imageNpArray = img_as_float(np.array(imagePil)) - imageNoiseNpArray = imageNpArray - denoise_tv_chambolle(imageNpArray, weight=0.2, channel_axis=-1) + imageDenoisedNpArray = denoise_tv_chambolle(imageNpArray, weight=0.2, channel_axis=-1) + imageNoiseNpArray = imageNpArray - imageDenoisedNpArray if mean is None: mean = imageNoiseNpArray else: