Question: Matlab Code: Image Link: https://goo.gl/qk6r5U 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
Matlab Code:

Image Link: https://goo.gl/qk6r5U
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)
Edit: 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)
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 in lect9 b- Repeat the same process using Wiener filter (Type help wiener2 in Matlab to get information on how to use wiener filter). 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 in lect9 b- Repeat the same process using Wiener filter (Type help wiener2 in Matlab to get information on how to use wiener filter)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
