A wavelet-based de-noising method designed for MethaneSAT xCH4 retrieval (or any other noisy image)
Use the package manager pip to install MSATwtdenoiser.
pip install MSATwtdenoiser
see example.py
in terms of the name of wavelets, please check out https://pywavelets.readthedocs.io/en/latest/ref/wavelets.html
or
from MSATwtdenoiser import MSATdenoise,example
example()
or
from MSATwtdenoiser import MSATdenoise
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import inspect
img = np.array(mpimg.imread('steve.jpg'))
img.astype(float)
img = np.mean(img,axis=2)
img = img+np.random.normal(0,100,[np.shape(img)[0],np.shape(img)[1]])
# denoiser
denoiser = MSATdenoise(img,'db4',5)
denoised_img = denoiser.denoised
#plotting
fig = plt.figure(figsize=(12, 3))
ax = fig.add_subplot(1, 2, 1)
ax.imshow(img, interpolation="nearest", cmap=plt.cm.gray)
ax = fig.add_subplot(1, 2, 2)
ax.imshow(denoised_img, interpolation="nearest", cmap=plt.cm.gray)
fig.tight_layout()
plt.show()