Make getImageFilePath
call implicit
This commit is contained in:
parent
d696edeb3f
commit
591d7dc74a
@ -58,7 +58,8 @@ def getImageFilePath(camera, cameraImageIndex):
|
||||
imageFilePath = f'{IMAGES_CAMERAS_FOLDER[camera]}/{imageFileName}'
|
||||
return imageFilePath
|
||||
|
||||
def getMultipleColorsImage(imageFilePath):
|
||||
def getMultipleColorsImage(camera, cameraImageIndex):
|
||||
imageFilePath = getImageFilePath(camera, cameraImageIndex)
|
||||
singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color)[:minimalColorChannelCameraResolution[0],:minimalColorChannelCameraResolution[1]], minColor, maxColor) for color in Color}
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
return multipleColorsImage
|
||||
@ -75,10 +76,9 @@ 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'):
|
||||
imageFilePath = getImageFilePath(camera, numberOfTrainingImages + cameraTestingImageIndex)
|
||||
print(f'{imageFilePath=}')
|
||||
print(f'{camera=} {numberOfTrainingImages + cameraTestingImageIndex=}')
|
||||
|
||||
multipleColorsImage = getMultipleColorsImage(imageFilePath)
|
||||
multipleColorsImage = getMultipleColorsImage(camera, numberOfTrainingImages + cameraTestingImageIndex)
|
||||
|
||||
# Should make a function
|
||||
singleColorChannelDenoisedImages = {color: denoise(singleColorChannelImages[color], DENOISER) for color in Color}
|
||||
@ -88,8 +88,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')):
|
||||
imageFilePath = getImageFilePath(camera, cameraTrainingImageIndex)
|
||||
multipleColorsImage = getMultipleColorsImage(imageFilePath)
|
||||
multipleColorsImage = getMultipleColorsImage(camera, cameraTrainingImageIndex)
|
||||
|
||||
if computeExtremes:
|
||||
minColor, maxColor = updateExtremes(multipleColorsImage, minColor, maxColor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user