📄 复件 jiemian.m
字号:
h0=figure('toolbar','none',...
'position',[10 10 700 700],...
'name','边界提取及分析');
h1=axes('parent',h0,...
'position',[0.1 0.2 0.8 0.8],...
'visible','off');
a=imread('kk.jpg');
imshow(a),
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','灰度图',...
'position',[20 120 50 30],...
'callback',[...
'cla,',...
'a=imread(''kk.jpg'');,',...
'ff=rgb2gray(a);,',...
'imshow(ff)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','图像增强',...
'position',[20 250 50 30],...
'callback',[...
'cla,',...
'a=imread(''kk.jpg'');,',...
'ff=rgb2gray(a);,',...
'h=histeq(ff,64);,',...
'imshow(h)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','中值滤波',...
'position',[20 380 50 30],...
'callback',[...
'cla,',...
'a=imread(''kk.jpg'');,',...
'ff=rgb2gray(a);,',...
'h=histeq(ff,64);,',...
'c=medfilt2(h,[7,7]);,',...
'imshow(c)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','canny边界',...
'position',[20 510 50 30],...
'callback',[...
'cla,',...
'a=imread(''kk.jpg'');,',...
'ff=rgb2gray(a);,',...
'h=histeq(ff,64);,',...
'c=medfilt2(h,[7,7]);,',...
'd=edge(c,''canny'',0.12);,',...
'e=bwareaopen(d,150);,',...
's=ones(3,3);,',...
'image2=dilate(e,s,2);,',...
'image3=erode(image2,s,2);,',...
'ee=bwareaopen(image3,100);,',...
'imshow(image2)']);
b5=uicontrol('parent',h0,...
'units','points',...
'tag','b5',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','轴线标定',...
'position',[850 120 50 30],...
'callback',[...
'cla,',...
'a=imread(''kk.jpg'');,',...
'ff=rgb2gray(a);,',...
'h=histeq(ff,64);,',...
'c=medfilt2(h,[7,7]);,',...
'd=edge(c,''canny'',0.12);,',...
'e=bwareaopen(d,150);,',...
's=ones(3,3);,',...
'image2=dilate(e,s,2);,',...
'imshow(image2);,',...
'hold on;,',...
'[xi,yi,BW1,idx,x,y]=bwselect(image2,4);,',...
'aa=(x(1)+x(2))/2;,',...
'aa1=(x(3)+x(4))/2;,',...
'bb=(y(1)+y(2))/2;,',...
'bb1=(y(3)+y(4))/2;,',...
'plot(aa,bb,''*'',''color'',''r'');,',...
'plot(aa1,bb1,''*'',''color'',''g'');,',...
'line([aa,aa1],[bb,bb1]);,']);
b9=uicontrol('parent',h0,...
'units','points',...
'tag','b9',...
'style','pushbutton',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','关闭',...
'position',[400 50 150 50],...
'callback','close');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -