Remove potential chronological bias

This commit is contained in:
Benjamin Loison 2024-04-27 16:10:20 +02:00
parent e9dc28dc2a
commit b0fa01c6c4
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -6,6 +6,7 @@ from utils import denoise
from skimage import img_as_float
import sys
import os
from random import shuffle
sys.path.insert(0, '../../algorithms/distance/')
@ -16,10 +17,11 @@ DENOISER = 'wavelet'
IMAGES_FOLDER = 'flat-field/TIF'
imagesFileNames = os.listdir(IMAGES_FOLDER)
# To not have a bias (chronological for instance) when split to make subgroups.
shuffle(imagesFileNames)
numberOfImagesPerSubgroup = len(imagesFileNames) // NUMBER_OF_SUBGROUPS
numberOfImagesThresholds = range(numberOfImagesPerSubgroup, numberOfImagesPerSubgroup + 1)
# Assume random image order to not introduce a bias.
subgroupsPrnuEstimatesNpArray = []
for subgroupIndex in tqdm(range(NUMBER_OF_SUBGROUPS), 'Subgroup'):
imagesPrnuEstimateNpArray = []