Move getImageNpArray to utils.py
This commit is contained in:
@@ -142,3 +142,17 @@ def getColorMeans(imagesFileNames, colors = Color):
|
||||
colorIterativeMean.add(imageNpArray)
|
||||
colorMeans[color] = colorIterativeMean.mean
|
||||
return colorMeans
|
||||
|
||||
def getImageNpArray(imageFilePath, computeExtremes, color):
|
||||
global minColor, maxColor
|
||||
imageNpArray = getColorChannel(imageFilePath, color)
|
||||
|
||||
if computeExtremes:
|
||||
minColor, maxColor = updateExtremes(imageNpArray, minColor, maxColor)
|
||||
return
|
||||
|
||||
if isARawImage(imageFilePath) and denoiser != 'mean':
|
||||
imageNpArray = rescaleRawImageForDenoiser(imageNpArray, minColor, maxColor)
|
||||
# Pay attention to range of values expected by the denoiser.
|
||||
# Indeed if provide the thousands valued raw image, then the denoiser only returns values between 0 and 1 and making the difference between both look pointless.
|
||||
return imageNpArray
|
||||
|
||||
Reference in New Issue
Block a user