Add show_mean_noise.py
This commit is contained in:
parent
b354f59ac5
commit
606821d45e
7
datasets/raise/show_mean_noise.py
Normal file
7
datasets/raise/show_mean_noise.py
Normal file
@ -0,0 +1,7 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
npArray = np.load('mean.npy')
|
||||
npArrayMin = npArray.min()
|
||||
print(f'{npArrayMin=}')
|
||||
plt.imsave('np_array.png', npArray - npArrayMin)
|
@ -3,6 +3,7 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from tqdm import tqdm
|
||||
from skimage.restoration import denoise_tv_chambolle
|
||||
from skimage import img_as_float
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, '../../algorithms/image_utils/')
|
||||
@ -28,8 +29,8 @@ for subgroupIndex in range(NUMBER_OF_SUBGROUPS):
|
||||
imagesPrnuEstimateNpArray = []
|
||||
for imageFileName in tqdm(imagesFileNames[numberOfImagesPerSubgroup * subgroupIndex : numberOfImagesPerSubgroup * (subgroupIndex + 1)]):
|
||||
imagePath = f'{IMAGES_FOLDER}/{imageFileName}'
|
||||
imagePil = Image.open(imagePath).convert('F')
|
||||
imageNpArray = np.array(imagePil)
|
||||
imagePil = Image.open(imagePath)
|
||||
imageNpArray = img_as_float(np.array(imagePil))
|
||||
imagePrnuEstimateNpArray = imageNpArray - denoise_tv_chambolle(imageNpArray, weight=0.2, channel_axis=-1)
|
||||
imagesPrnuEstimateNpArray += [imagePrnuEstimateNpArray]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user