Add and use rescaleRawImageForDenoiser and updateExtremes (#59)
This commit is contained in:
@@ -124,3 +124,16 @@ def mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages
|
||||
def saveNpArray(fileName, npArray):
|
||||
with open(f'{fileName}.npy', 'wb') as f:
|
||||
np.save(f, npArray)
|
||||
|
||||
def rescaleRawImageForDenoiser(imageNpArray, minColor, maxColor):
|
||||
imageNpArray = (imageNpArray - minColor) / (maxColor - minColor)
|
||||
return imageNpArray
|
||||
|
||||
def updateExtremes(imageNpArray, minColor, maxColor):
|
||||
colorRawImageVisibleMin = imageNpArray.min()
|
||||
colorRawImageVisibleMax = imageNpArray.max()
|
||||
if minColor is None or colorRawImageVisibleMin < minColor:
|
||||
minColor = colorRawImageVisibleMin
|
||||
if maxColor is None or colorRawImageVisibleMax > maxColor:
|
||||
maxColor = colorRawImageVisibleMax
|
||||
return minColor, maxColor
|
||||
|
||||
Reference in New Issue
Block a user