Add and use getImagePrnuEstimatedNpArray
This commit is contained in:
parent
878cff9aa2
commit
d8c7b8b0ef
@ -67,6 +67,12 @@ def getMultipleColorsImage(singleColorChannelImages):
|
||||
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
|
||||
return multipleColorsImage
|
||||
|
||||
def getImagePrnuEstimateNpArray(singleColorChannelImages, multipleColorsImage):
|
||||
singleColorChannelDenoisedImages = {color: denoise(singleColorChannelImages[color], DENOISER) for color in Color}
|
||||
multipleColorsDenoisedImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelDenoisedImages)
|
||||
imagePrnuEstimateNpArray = multipleColorsImage - multipleColorsDenoisedImage
|
||||
return imagePrnuEstimateNpArray
|
||||
|
||||
from utils import silentTqdm
|
||||
#tqdm = silentTqdm
|
||||
|
||||
@ -84,10 +90,7 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
singleColorChannelImages = getSingleColorChannelImages(camera, numberOfTrainingImages + cameraTestingImageIndex)
|
||||
multipleColorsImage = getMultipleColorsImage(singleColorChannelImages)
|
||||
|
||||
# Should make a function
|
||||
singleColorChannelDenoisedImages = {color: denoise(singleColorChannelImages[color], DENOISER) for color in Color}
|
||||
multipleColorsDenoisedImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelDenoisedImages)
|
||||
imagePrnuEstimateNpArray = multipleColorsImage - multipleColorsDenoisedImage
|
||||
imagePrnuEstimateNpArray = getImagePrnuEstimatedNpArray(singleColorChannelImages, multipleColorsImage)
|
||||
|
||||
cameraTestingImagesNoise[camera] = cameraTestingImagesNoise.get(camera, []) + [imagePrnuEstimateNpArray]
|
||||
for cameraTrainingImageIndex in tqdm(range(minimumNumberOfImagesCameras if computeExtremes else numberOfTrainingImages), 'Camera training image index'):
|
||||
@ -99,10 +102,8 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
minColor, maxColor = updateExtremes(multipleColorsImage, minColor, maxColor)
|
||||
continue
|
||||
|
||||
singleColorChannelDenoisedImages = {color: denoise(singleColorChannelImages[color], DENOISER) for color in Color}
|
||||
multipleColorsDenoisedImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelDenoisedImages)
|
||||
imagePrnuEstimateNpArray = getImagePrnuEstimatedNpArray(singleColorChannelImages, multipleColorsImage)
|
||||
|
||||
imagePrnuEstimateNpArray = multipleColorsImage - multipleColorsDenoisedImage
|
||||
cameraIterativeMean = camerasIterativeMean[camera]
|
||||
cameraIterativeMean.add(imagePrnuEstimateNpArray)
|
||||
if cameraIndex == numberOfCameras - 1:
|
||||
|
Loading…
x
Reference in New Issue
Block a user