Compare commits

..

No commits in common. "8523c025173ae336c27f4f38dcefbefca8e4bc52" and "0bd9e57942d87255200a11935b5019723b2d3afa" have entirely different histories.

2 changed files with 2 additions and 37 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
from PIL import Image
from utils import Color, mergeSingleColorChannelImagesAccordingToBayerFilter
import matplotlib.pyplot as plt
import numpy as np
@ -14,4 +15,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

@ -1,36 +0,0 @@
#!/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)