inverse filtering and weiner filtering matlab code

47 views (last 30 days)
aziz alfares
aziz alfares on 3 Dec 2021
Commented: aziz alfares on 4 Dec 2021
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');

Answers (1)

yanqi liu
yanqi liu on 4 Dec 2021
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');
  1 Comment
aziz alfares
aziz alfares on 4 Dec 2021
i didnt work out with me
do you have another suggestions?
thanks,

Sign in to comment.

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by