inverse filtering and weiner filtering matlab code

26 次查看(过去 30 天)
here i am trying to implement inverse filtering and weiner filtering
in this figure both of gaussian noise and motion blure were added after that both of uinverse filtering and weiner filtering were applied
note : the value of mean and vaiance are 0 and 650 respectively but when i enter the 650 to the variance it doesnt give me any result so i changed it to 0.01
this is where i came so far still not working anyone can help
thanks,,
I = im2double(imread('Fig0526(a)(original_DIP).tif'));
imshow(I);
title('Original Image (courtesy of MIT)');
LEN = 90;
THETA = 45;
PSF = fspecial('motion', LEN, THETA);
blurred = imfilter(I, PSF, 'conv', 'circular');
figure, imshow(blurred)
noise_mean = 0;
noise_var =0.01 ;
blurred_noisy = imnoise(blurred, 'gaussian', noise_mean, noise_var);
figure, imshow(blurred_noisy)
title('Simulate Blur and Noise')
estimated_nsr = noise_var / var(I(:));
wnr3 = deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr3)
title('Restoration of Blurred, Noisy Image Using Estimated NSR');

回答(1 个)

yanqi liu
yanqi liu 2021-12-4
yes,sir,may be change some parameter,because motion too big to hard restore,such as
clc; clear all; close all;
I = im2double(imread('cameraman.tif'));
imshow(I);
title('Original Image');
LEN = 20;
THETA = 45;
PSF = fspecial('motion', LEN, THETA);
blurred = imfilter(I, PSF, 'conv', 'circular');
figure, imshow(blurred)
noise_mean = 0;
noise_var = 0.001;
blurred_noisy = imnoise(blurred, 'gaussian', noise_mean, noise_var);
figure, imshow(blurred_noisy)
title('Simulate Blur and Noise')
estimated_nsr = noise_var / var(I(:));
wnr3 = deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr3)
title('Restoration of Blurred, Noisy Image Using Estimated NSR');

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by