å¾å读åï¼
global I
% dialog for opening files
[imagefile , pathname]= uigetfile('*.tif');
if imagefile ~= 0
filename=[pathname imagefile];
[X,map]=imread(filename);
I=X;
show_Callback(hObject, eventdata, handles)
set(handles.save,'enable','on')
end;
å¾åä¿åï¼
global I
[imagefile , pathname, filterindex]= uiputfile({'*.tif','tif';'*.*','All Files'},'Image Save As');
if (imagefile ~= 0 & filterindex==1)
filename=[pathname imagefile '.tif'];
imwrite(I,filename);
else (imagefile ~= 0)
filename=[pathname imagefile];
imwrite(I,filename);
end;
é¢åå¢å¼ºï¼
global I
J=imnoise(I,'salt & pepper',0.02);
%gei tuxiang tianjia yanjiao zaosheng
subplot(121),imshow(J)
title('han you zaosheng de yuan tuxiang')
J=double(J);
f=fft2(J);
g=fftshift(f);
[M,N]=size(f);
n=3;d0=20;
n1=floor(M/2);n2=floor(N/2);
for i=1:M
for j=1:N
d=sqrt((i-n1)^2+(j-n2)^2);
h=1/(1+0.414*(d/d0)^(2*n));
g(i,j)=h*g(i,j);
end
end
g=ifftshift(g);
g=uint8(real(ifft2(g)));
subplot(122),imshow(g)
title('san jie Butterworth lvbo tuxiang')
FFTåæ¢ï¼
% 读å
¥åå§å¾å
subplot(1,2,1);
imshow(I)
title('yuan tu');
% æ±ç¦»æ£å
ç«å¶é¢è°±
J=fftshift(fft2(I));
subplot(1,2,2);
imshow(log(abs(J)),[8,10])
title('fft');
温馨提示:答案为网友推荐,仅供参考