Move getImageNpArray to utils.py

This commit is contained in:
Benjamin Loison
2024-05-03 02:32:05 +02:00
parent 790c0d6da4
commit 4bea5e3a97
2 changed files with 17 additions and 17 deletions

View File

@@ -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