?? shili79.m
字號:
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','實例79');
h1=axes('parent',h0,...
'position',[0.25 0.45 0.5 0.5],...
'visible','off');
load imdemos bacteria
imshow(bacteria)
k1=~(bacteria>100);
k2=filter2(fspecial('laplacian'),bacteria);
k3=(k2>-4)&k1;
k4=erode(k1)&(k3==0);
[r,c]=find(k4);
k5=bwselect(k1,c,r);
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','二值分割圖',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 110 50 20],...
'callback',[...
'cla,',...
'imshow(k1)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','濾波結(jié)果圖',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 110 50 20],...
'callback',[...
'cla,',...
'imshow(k2)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','閾值化圖',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 110 50 20],...
'callback',[...
'cla,',...
'imshow(k3)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'string','目標(biāo)的核',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 60 50 20],...
'callback',[...
'cla,',...
'imshow(k4)']);
b5=uicontrol('parent',h0,...
'units','points',...
'tag','b5',...
'style','pushbutton',...
'string','目標(biāo)分割圖',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 60 50 20],...
'callback',[...
'cla,',...
'imshow(k5)']);
b6=uicontrol('parent',h0,...
'units','points',...
'tag','b6',...
'style','pushbutton',...
'string','關(guān)閉',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 60 50 20],...
'callback','close');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -