Compare commits

...

2 Commits

2 changed files with 37 additions and 2 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python
from PIL import Image
from utils import Color, mergeSingleColorChannelImagesAccordingToBayerFilter
import matplotlib.pyplot as plt
import numpy as np
@ -15,4 +14,4 @@ def getImageByColor(color):
singleColorChannelImages = {color: getImageByColor(color) for color in Color}
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
plt.imsave(PREFIX + 'multiple_colors.png', multipleColorsImage)
plt.imsave(PREFIX + 'multiple_colors.png', multipleColorsImage)

View File

@ -0,0 +1,36 @@
#!/usr/bin/env python
from utils import Denoiser, Color, mergeSingleColorChannelImagesAccordingToBayerFilter
import matplotlib.pyplot as plt
import numpy as np
PREFIX = 'means/mean_rafael_230424_'
def getImageByColor(color):
filePath = PREFIX + f'{color}.npy'
image = np.load(filePath)
return image
multipleColorsImageDenoisers = {}
DENOISERS = [
Denoiser.BILATERAL,
Denoiser.WAVELET,
Denoiser.MEAN,
]
for denoiser in DENOISERS:
singleColorChannelImages = {color: getImageByColor(color) for color in Color}
multipleColorsImage = mergeSingleColorChannelImagesAccordingToBayerFilter(singleColorChannelImages)
multipleColorsImageDenoisers[denoiser] = multipleColorsImage
def getExtreme(extreme):
vExtreme = extreme(list(multipleColorsImageDenoisers.values()))
#print(vExtreme)
return vExtreme
vMin, vMax = [getExtreme(extreme) for extreme in [np.min, np.max]]
for denoiser in DENOISERS:
multipleColorsImage = multipleColorsImageDenoisers[denoiser]
plt.imsave(PREFIX + f'{denoiser}_multiple_colors.png', multipleColorsImage)