?? shili73.m
字號:
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','實例73');
h1=axes('parent',h0,...
'position',[0.25 0.45 0.5 0.5],...
'visible','off');
I=imread('eight.tif');
imshow(I)
u1=uimenu('parent',h0,...
'tag','u1',...
'label','添加噪聲',...
'backgroundcolor',[0.75 0.75 0.75]);
u11=uimenu('parent',u1,...
'tag','u11',...
'label','SALT&PEPPER噪聲',...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'set(u11,''checked'',''on'');,',...
'set(u12,''checked'',''off'');,',...
'cla,',...
'I=imnoise(I,''salt & pepper'',0.02);,',...
'imshow(I)']);
u12=uimenu('parent',u1,...
'tag','u12',...
'label','GAUSSIAN噪聲',...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'set(u12,''checked'',''on'');,',...
'set(u11,''checked'',''off'');,',...
'cla,',...
'I=imnoise(I,''gaussian'',0,0.005);,',...
'imshow(I)']);
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','均平過濾',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 100 50 20],...
'callback',[...
'cla,',...
'J=filter2(fspecial(''average'',3),I)/255;,',...
'imshow(J)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','中值過濾',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 100 50 20],...
'callback',[...
'cla,',...
'J=medfilt2(I,[3 3]);,',...
'imshow(J)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','自適應過濾',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 100 50 20],...
'callback',[...
'cla,',...
'J=wiener2(I,[5 5]);,',...
'imshow(J)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'string','關閉',...
'fontsize',15,...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[90 50 70 30],...
'callback','close');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -