Wiener Filter for image deblur

前端 未结 3 970
自闭症患者
自闭症患者 2021-01-01 00:24

I am trying to implement the Wiener Filter to perform deconvolution on blurred image. My implementation is like this

import numpy as np
from numpy.fft import         


        
相关标签:
3条回答
  • 2021-01-01 00:31

    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

    0 讨论(0)
  • 2021-01-01 00:37

    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.

    0 讨论(0)
  • 2021-01-01 00:44

    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)
    
    0 讨论(0)
提交回复
热议问题