www.pudn.com > digitalimageprocessprograms.rar > sanshi.m


a=zeros(24,128); 
b=[zeros(80,48),ones(80,32),zeros(80,48)]; 
f=[a;b;a]; 
subplot(2,1,1); 
imshow(f); 
h=abs(fft2(f)); 
subplot(2,1,2); 
imshow(h); 
 
 
figure; 
for i=1:128 
 for j=1:128 
     q(i,j)=(-1)^(i+j).*f(i,j); 
 end 
end 
subplot(2,1,1); 
imshow(q); 
subplot(2,1,2); 
h1=abs(fft2(q)); 
imshow(h1); 
 
 
figure; 
f0=zeros(128,128); 
for x=24:47 
    for y=0:(x-24) 
        f0(x,81-y)=1; 
        f0(x,81+y)=1; 
    end 
end 
 
for x=81:104 
    for y=0:(104-x) 
        f0(x,47-y)=1; 
        f0(x,47+y)=1; 
    end 
end 
 
for x=48:80 
    for y=0:46 
        f0(x,57+y-x+48)=1; 
    end 
end 
 
 
for i=1:128 
 for j=1:128 
     q0(i,j)=(-1)^(i+j).*f0(i,j); 
 end 
end 
subplot(2,1,1); 
imshow(q0); 
 
subplot(2,1,2); 
h01=abs(fft2(q0)); 
imshow(h01);