Wiener Filter for image deblur

為{幸葍}努か 提交于 2019-11-30 20:32:41
gsamaras

Use skimage.restoration.wiener, which is usually used like:

>>> 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)

I have also used it in: Deblur an image using scikit-image.

For data comparison, you can find a sample implementation of Wiener filtering and unsupervisived Wiener filtering at

http://scikit-image.org/docs/dev/auto_examples/plot_restoration.html

If you give your original image data, we may be able to help further.

EDIT: Original link seems to be down, try this one: http://scikit-image.org/docs/dev/auto_examples/filters/plot_restoration.html

We could try unsupervised weiner too (deconvolution with a Wiener-Hunt approach, where the hyperparameters are automatically estimated, using a stochastic iterative process (Gibbs sampler), as described here):

deconvolved, _ = restoration.unsupervised_wiener(im, psf)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!