📄 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 + -