实例72:图像分析(1)
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','实例72');
h1=axes('parent',h0,...
'position',[0.25 0.45 0.5 0.5],...
'visible','off');
I=imread('rice.tif');
imshow(I)
k=0;
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','图像轮廓图',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[20 100 60 20],...
'callback',[...
'cla,',...
'k=1;,',...
'I=imread(''rice.tif'');,',...
'imcontour(I)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','SOBEL边界图',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 100 60 20],...
'callback',[...
'cla,',...
'k=2;,',...
'I=imread(''rice.tif'');,',...
'BW=edge(I,''sobel'');,',...
'imshow(BW)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','CANNY边界图',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[180 100 60 20],...
'callback',[...
'cla,',...
'k=3;,',...
'I=imread(''rice.tif'');,',...
'BW=edge(I,''canny'');,',...
'imshow(BW)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'string','灰度调整',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[20 50 60 20],...
'callback',[...
'cla,',...
'k=4;,',...