From 0445d98f522a28bfd8d59da66daa0f6ac334e638 Mon Sep 17 00:00:00 2001 From: Benjamin Loison <12752145+Benjamin-Loison@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:07:11 +0200 Subject: [PATCH] Clean `datasets/raise/extract_noise.py` --- datasets/raise/extract_noise.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/datasets/raise/extract_noise.py b/datasets/raise/extract_noise.py index 6ddc706..d57946f 100755 --- a/datasets/raise/extract_noise.py +++ b/datasets/raise/extract_noise.py @@ -17,8 +17,6 @@ mean = None numberOfImagesInMean = 0 import csv -import magic -import re deviceFiles = {} resolutionFiles = {} @@ -32,19 +30,13 @@ with open('RAISE_all.csv') as csvfile: device = row['Device'] resolution = row['Image Size'] deviceFiles[file] = device - #resolutionFiles[file] = resolution image = Image.open(f'{imagesFolderPath}/{file}') - #t = magic.from_file(f'{imagesFolderPath}/{file}.png') resolution = image.size - resolutionFiles[file] = resolution#re.search('(\d+) x (\d+)', t).groups() - #print(device, resolution) + resolutionFiles[file] = resolution #files[f'{file}.png'] = row imagesFileNames = os.listdir(imagesFolderPath) -#print(len(imagesFileNames)) -# imageFileName.replace('.png', '') imagesFileNames = [imageFileName for imageFileName in imagesFileNames if deviceFiles[imageFileName] == 'Nikon D7000' and resolutionFiles[imageFileName] == (4946, 3278)] -#print(len(imagesFileNames)) def treatImage(imageFileName): global mean, numberOfImagesInMean