Wiener filtering on RGB image

1.4k Views Asked by At

I am trying to implement the wiener filter on the CIFAR10 dataset which consists of RGB images.

But this filter can only be used for Gray-scaled images.

I tried to implement it on each R/G/B channel and then combine them, but the resulting RGB image was not even close to the initial image.

Any ideas?

(I am using scipy.signal.signaltools.wiener)

Thanks in advance

1

There are 1 best solutions below

0
Arjaan Auinger On

Ok, how about skimage (scikit-image)? Have a look here: https://scikit-image.org/docs/dev/api/skimage.restoration.html#skimage.restoration.wiener

The example given on an rgb image is the following:

from skimage import color, data, restoration
img = color.rgb2gray(data.astronaut())
from scipy.signal import convolve2d
psf = np.ones((5, 5)) / 25
img = convolve2d(img, psf, 'same')
img += 0.1 * img.std() * np.random.standard_normal(img.shape)
deconvolved_img = restoration.wiener(img, psf, 1100)