hi guys greetings
I found a wiener filter function on scipy website, and i want to use it to reduce noises like salt&pepper noise.
the function :
scipy.signal.wiener(im, mysize=None, noise=None)
here is the source on scipy website, where they demonstrate the function by applying it to a random image : [https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.wiener.html][1]
I found other wiener filter functions, but they require me to define/input the blurring kernel, where it will be needed for the process of deconvolution, so why this function that i found on scipy does not require me to define or input the blurring kernel and just ask to input the Im(image) and mysize(the size of the Wiener filter window)
here's an example of a wiener filter function code, where you need to input the blurring kernel:
def wiener_filter(img, kernel, K):
kernel /= np.sum(kernel)
dummy = np.copy(img)
dummy = fft2(dummy)
kernel = fft2(kernel, s = img.shape)
kernel = np.conj(kernel) / (np.abs(kernel) ** 2 + K)
dummy = dummy * kernel
dummy = np.abs(ifft2(dummy))
return dummy