Add and use imageDenoisedNpArray to ease using other denoisers

This commit is contained in:
Benjamin Loison 2024-04-06 00:03:50 +02:00
parent b18080e9f5
commit 15c41c0463
No known key found for this signature in database

View File

@ -20,7 +20,8 @@ def treatImage(imageFileName):
imageFilePath = f'{imagesFolderPath}/{imageFileName}'
imagePil = Image.open(imageFilePath)
imageNpArray = img_as_float(np.array(imagePil))
imageNoiseNpArray = imageNpArray - denoise_tv_chambolle(imageNpArray, weight=0.2, channel_axis=-1)
imageDenoisedNpArray = denoise_tv_chambolle(imageNpArray, weight=0.2, channel_axis=-1)
imageNoiseNpArray = imageNpArray - imageDenoisedNpArray
if mean is None:
mean = imageNoiseNpArray
else: