Question
Matlab Coding: 4. Blur saturn.tif image by 7x7 averaging filter and add Gauassian noise with 0.06 variance a- Use the inverse filter to filter the
Matlab Coding:
4. Blur saturn.tif image by 7x7 averaging filter and add Gauassian noise with 0.06 variance
a- Use the inverse filter to filter the blurred-noisy image. Compute the root mean square error between the original image, blurred-noisy image and the filtered image. Matlab code for inverse filtering is given below
b- Repeat the same process using Wiener filter (Type help wiener2 in Matlab to get information on how to use wiener filter).
Explaination:
Basically use the image provided above to add blur by 7x7 average filter and noise to the image.
a) use inverse filter to this newly filtered image and compute root square error
b) then use Weiner filter to the newly filtered image (image with average filter and noise)
Image Link: https://goo.gl/qk6r5U
Code for inverse filtering:
Code for inverse filtering:
N=256;
n=.2;
f=imread('lena.tif',N,N);
figure(1)
imagesc(f)
colormap(gray)
b=ones(5,5)/5^2;
F=fft2(f);
B=fft2(b,N,N);
G=F.*B; %convolving Fwith B produces blurry image
g=ifft2(G)+10*randn(N,N);% add noise to the blurry image.
G=fft2(g);
figure(2)
imagesc(abs(ifft2(G)))
colormap(gray)
BF=find(abs(B)
B(BF)=n;
H=ones(N,N)./B;
I=G.*H;%deconvolution is called inverse filtering (dividing by B)
im=abs(ifft2(I));
figure(3)
imagesc(im)
colormap(gray)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started