I = imread('F:3.tif');
figure(1);imshow(I,[]);
title('原图像');
a=double(I);
b1=fft2(a);
b=fftshift(b1);
figure;imshow(abs(b)/100000);
[m,n]=size(b);
l=zeros(m,n);
n1=floor(m/2)+1;
n2=floor(n/2)+1;
r2=(n1-90)^2;
for i=1:m;
for j=1:n
if (((i-n1)^2+(j-n2)^2)==r2)
l(i,j)=0;
else
l(i,j)=1;
end
end
end
q1=b.*l;
q2=ifftshift(q1);
q=ifft2(q2);
imshow(q/256);
figure;h=medfilt2(q,[7 7],'symmetric');
h=uint8(h);
imshow(h);
h1=fspecial('gaussian',11,10);
c=deconvwnr(h,h1,0.017);
figure;imshow(c);
自己解决了
I = imread('F:3.tif');
figure(1);imshow(I,[]);
title('原图像');
a=double(I);
b1=fft2(a);
b=fftshift(b1);
figure;imshow(abs(b)/100000);
[m,n]=size(b);
l=zeros(m,n);
n1=floor(m/2)+1;
n2=floor(n/2)+1;
r2=(n1-90)^2;
for i=1:m;
for j=1:n
if (((i-n1)^2+(j-n2)^2)==r2)
l(i,j)=0;
else
l(i,j)=1;
end
end
end
q1=b.*l;
q2=ifftshift(q1);
q=ifft2(q2);
imshow(q/256);
figure;h=medfilt2(q,[7 7],'symmetric');
h=uint8(h);
imshow(h);
h1=fspecial('gaussian',11,10);
c=deconvwnr(h,h1,0.017);
figure;imshow(c);
自己解决了
举报