Add and use getImageNpArray
This commit is contained in:
parent
809aa7fb43
commit
a15b356e16
@ -53,9 +53,8 @@ if type_ is not None:
|
||||
minColor = None
|
||||
maxColor = None
|
||||
|
||||
# `color` is the actual color to estimate PRNU with.
|
||||
def treatImage(imageFileName, computeExtremes = False, color = None):
|
||||
global mean, numberOfImagesInMean, minColor, maxColor
|
||||
def getImageNpArray(imageFileName, computeExtremes, color):
|
||||
global minColor, maxColor
|
||||
if raiseNotFlatFields:
|
||||
imageFileName = imageFileName.replace('.png', '.NEF')
|
||||
imageFilePath = f'{imagesFolderPath}/nef/{imageFileName}'
|
||||
@ -100,7 +99,14 @@ def treatImage(imageFileName, computeExtremes = False, color = None):
|
||||
else:
|
||||
imagePil = Image.open(imageFilePath)
|
||||
imageNpArray = img_as_float(np.array(imagePil))
|
||||
# Could make not `.nef` compatible.
|
||||
return imageNpArray
|
||||
|
||||
# `color` is the actual color to estimate PRNU with.
|
||||
def treatImage(imageFileName, computeExtremes = False, color = None):
|
||||
global mean, numberOfImagesInMean
|
||||
imageNpArray = getImageNpArray(imageFileName, computeExtremes, color)
|
||||
if imageNpArray is None:
|
||||
return
|
||||
match denoiser:
|
||||
case 'wavelet':
|
||||
imageDenoisedNpArray = denoise(imageNpArray, rescale_sigma=True)
|
||||
|
Loading…
Reference in New Issue
Block a user