Add and use getMultipleColorsImage
This commit is contained in:
parent
fcbccb3b5c
commit
d696edeb3f
@ -58,6 +58,11 @@ def getImageFilePath(camera, cameraImageIndex):
|
||||
imageFilePath = f'{IMAGES_CAMERAS_FOLDER[camera]}/{imageFileName}'
|
||||
return imageFilePath
|
||||
|
||||
def getMultipleColorsImage(imageFilePath):
|
||||
singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color)[:minimalColorChannelCameraResolution[0],:minimalColorChannelCameraResolution[1]], minColor, maxColor) for color in Color}
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
return multipleColorsImage
|
||||
|
||||
from utils import silentTqdm
|
||||
#tqdm = silentTqdm
|
||||
|
||||
@ -73,9 +78,9 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
imageFilePath = getImageFilePath(camera, numberOfTrainingImages + cameraTestingImageIndex)
|
||||
print(f'{imageFilePath=}')
|
||||
|
||||
multipleColorsImage = getMultipleColorsImage(imageFilePath)
|
||||
|
||||
# Should make a function
|
||||
singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color)[:minimalColorChannelCameraResolution[0],:minimalColorChannelCameraResolution[1]], minColor, maxColor) for color in Color}
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
singleColorChannelDenoisedImages = {color: denoise(singleColorChannelImages[color], DENOISER) for color in Color}
|
||||
multipleColorsDenoisedImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelDenoisedImages)
|
||||
imagePrnuEstimateNpArray = multipleColorsImage - multipleColorsDenoisedImage
|
||||
@ -84,8 +89,7 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
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)
|
||||
singleColorChannelImages = {color: rescaleIfNeeded(getColorChannel(imageFilePath, color)[:minimalColorChannelCameraResolution[0],:minimalColorChannelCameraResolution[1]], minColor, maxColor) for color in Color}
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
multipleColorsImage = getMultipleColorsImage(imageFilePath)
|
||||
|
||||
if computeExtremes:
|
||||
minColor, maxColor = updateExtremes(multipleColorsImage, minColor, maxColor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user