Wiener Filter for image deblur

前端 未结 3 969
自闭症患者
自闭症患者 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: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.

提交回复
热议问题