diff --git a/datasets/raise/split_and_compare_prnus_of_subgroups.py b/datasets/raise/split_and_compare_prnus_of_subgroups.py index 5e385bb..a44021f 100755 --- a/datasets/raise/split_and_compare_prnus_of_subgroups.py +++ b/datasets/raise/split_and_compare_prnus_of_subgroups.py @@ -30,14 +30,15 @@ rmss = [] minColor = None maxColor = None +returnSingleColorChannelImage = lambda singleColorChannelImage, _minColor, _maxColor: singleColorChannelImage + for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else []) + [False], 'Compute extremes'): + rescaleIfNeeded = returnSingleColorChannelImage if computeExtremes else rescaleRawImageForDenoiser for subgroupImageIndex in tqdm(range(numberOfImagesPerSubgroup), 'Subgroup image index'): for subgroupIndex in tqdm(range(NUMBER_OF_SUBGROUPS), 'Subgroup'): imageIndex = (subgroupIndex * NUMBER_OF_SUBGROUPS) + subgroupImageIndex imageFileName = imagesFileNames[imageIndex] imageFilePath = f'{IMAGES_FOLDER}/{imageFileName}' - returnSingleColorChannelImage = lambda singleColorChannelImage, _minColor, _maxColor: singleColorChannelImage - rescaleIfNeeded = returnSingleColorChannelImage if computeExtremes else rescaleRawImageForDenoiser singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color), minColor, maxColor) for color in Color} multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)