diff --git a/datasets/raise/extract_noise.py b/datasets/raise/extract_noise.py index 429e03d..21491b5 100755 --- a/datasets/raise/extract_noise.py +++ b/datasets/raise/extract_noise.py @@ -125,15 +125,16 @@ def treatImage(imageFileName, computeExtremes = False, color = None): mean = ((mean * numberOfImagesInMean) + imageNoiseNpArray) / (numberOfImagesInMean + 1) numberOfImagesInMean += 1 -# Assuming same intensity scale across color channels. -for imageFileName in tqdm(imagesFileNames, 'Computing extremes of images'): - for color in colors: - treatImage(imageFileName, computeExtremes = True, color = color) +if minColor is None or maxColor is None: + # Assuming same intensity scale across color channels. + for imageFileName in tqdm(imagesFileNames, 'Computing extremes of images'): + for color in colors: + treatImage(imageFileName, computeExtremes = True, color = color) -# To skip this step next time. -# Maybe thanks to `rawpy.RawPy` fields, possibly stating device maximal value, can avoid doing so to some extent. -print(f'{minColor=}') -print(f'{maxColor=}') + # To skip this step next time. + # Maybe thanks to `rawpy.RawPy` fields, possibly stating device maximal value, can avoid doing so to some extent. + print(f'{minColor=}') + print(f'{maxColor=}') if denoiser == 'mean': means = {}