Fix #68: Use same color map for different images to more accurately compare them
This commit is contained in:
parent
3e332c19d8
commit
8523c02517
@ -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)
|
Loading…
x
Reference in New Issue
Block a user