Add and use getImageFilePath
This commit is contained in:
parent
3c4cf90b19
commit
fcbccb3b5c
@ -53,6 +53,11 @@ numberOfTrainingImages = int(minimumNumberOfImagesCameras * TRAINING_PORTION)
|
||||
numberOfTestingImages = minimumNumberOfImagesCameras - int(minimumNumberOfImagesCameras * TRAINING_PORTION)
|
||||
cameraTestingImagesNoise = {}
|
||||
|
||||
def getImageFilePath(camera, cameraImageIndex):
|
||||
imageFileName = imagesCamerasFileNames[camera][cameraImageIndex]
|
||||
imageFilePath = f'{IMAGES_CAMERAS_FOLDER[camera]}/{imageFileName}'
|
||||
return imageFilePath
|
||||
|
||||
from utils import silentTqdm
|
||||
#tqdm = silentTqdm
|
||||
|
||||
@ -65,9 +70,7 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
print('Extracting noise of testing images')
|
||||
for camera in tqdm(IMAGES_CAMERAS_FOLDER, 'Camera'):
|
||||
for cameraTestingImageIndex in tqdm(range(numberOfTestingImages), 'Camera testing image index'):
|
||||
# Should make a function
|
||||
imageFileName = imagesCamerasFileNames[camera][numberOfTrainingImages + cameraTestingImageIndex]
|
||||
imageFilePath = f'{IMAGES_CAMERAS_FOLDER[camera]}/{imageFileName}'
|
||||
imageFilePath = getImageFilePath(camera, numberOfTrainingImages + cameraTestingImageIndex)
|
||||
print(f'{imageFilePath=}')
|
||||
|
||||
# Should make a function
|
||||
@ -80,8 +83,7 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
cameraTestingImagesNoise[camera] = cameraTestingImagesNoise.get(camera, []) + [imagePrnuEstimateNpArray]
|
||||
for cameraTrainingImageIndex in tqdm(range(minimumNumberOfImagesCameras if computeExtremes else numberOfTrainingImages), 'Camera training image index'):
|
||||
for cameraIndex, camera in enumerate(tqdm(IMAGES_CAMERAS_FOLDER, 'Camera')):
|
||||
imageFileName = imagesCamerasFileNames[camera][cameraTrainingImageIndex]
|
||||
imageFilePath = f'{IMAGES_CAMERAS_FOLDER[camera]}/{imageFileName}'
|
||||
imageFilePath = getImageFilePath(camera, cameraTrainingImageIndex)
|
||||
singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color)[:minimalColorChannelCameraResolution[0],:minimalColorChannelCameraResolution[1]], minColor, maxColor) for color in Color}
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user