Sei sulla pagina 1di 2

The image f(x,y)=4cos(4x)cos(6y) is sampled with x= y=0.5.

The sampled image is reconstructed


with an ideal LPF with cut off frequencies of 1/2x and 1/2y. Find the reconstructed image.

Matlab code:
clc;clear all;close all
%sampled image
[x y]=meshgrid(-10:.5:10,-10:.5:10);
Is=4*cos(4*pi*x).*cos(6*pi*y);
subplot(2,2,1)
imshow(Is)
title('sampled image')
Isf=fft2(Is);
subplot(2,2,2)
imshow(log(abs(Isf)))
title('spectrum of the sampled image')
H=zeros(length(x),length(y));
[p q]=size(meshgrid(-1:.5:1));
for i=1:p
for j=1:q
H(i,j)=1/4;
end
end
Irf=Isf.*H;
subplot(2,2,3)
imshow(log(abs(Irf)))
title('spectrum of the reconstructed image')
Ir=ifft2(Irf);
subplot(2,2,4)
imshow(Ir,[])
title('reconstructed image');

Potrebbero piacerti anche