h0=figure('toolbar','none',...
'position',[50 90 920 600],...
'name','图象处理');
%=================================
%frame1
f=uicontrol('parent',h0,...
'style','frame',...
'position',[5 60 90 440]);
%frame2
top=0.47;
left=0.58;
right=0.90;
bottom=0.12;
labelHt=0.04;
spacing=0.005;
% First, the MiniCommand Window frame
frmBorder=0.02;
frmPos=[left-frmBorder bottom-frmBorder ...
(right-left)+2*frmBorder (top-bottom)+2*frmBorder];
uicontrol( ...
'Style','frame', ...
'Units','normalized', ...
'Position',frmPos, ...
'BackgroundColor',[0.50 0.50 0.50]);
% Then the text label
labelPos=[left top-labelHt (right-left) labelHt+0.01];
uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 1], ...
'String','MiniCommand Window');
%==================================
%标定
e1=uicontrol('parent',h0,...
'style','edit',...
'string','输入实长',...
'fontsize',10,...
'HorizontalAlignment','right', ...
'BackgroundColor',[0.5 0.5 0.5], ...
'ForegroundColor',[1 1 0], ...
'position',[20 270 60 20],...
'HorizontalAlignment','right',...
'callback',['mtr=get(e1,''string'');,', 'TR=str2num(mtr);']); %TR-实际长度
t1=uicontrol('parent',h0,...
'style','text',...
'string','标 定',...
'fontsize',10,...
'position',[20 300 60 20],...
'horizontalalignment','center');
%=================================
%title
subplot(2,2,2)
text(0.2,0.5,'显示局部图片','fontsize',20,'color','blue')
subplot(2,2,3)
text(0.2,0.5,'显示边缘位置','fontsize',20,'color','blue')
subplot(2,2,1)
text(0.2,0.5,'显示原始图片','fontsize',20,'color','blue')
colorbar
%===============================
%选项栏
l1=uicontrol('parent',h0,...
'style','listbox',...
'position',[10 335 80 125],...
'string','自动|标定|读图|验证取点|提取边缘|验证直线|验证半径|验证角度|刷新',...
'value',1,...
'max',0.5,...
'min',0);
f2=uicontrol('parent',h0,...
'style','text',...
'string','选择类型',...
'fontsize',10,...
'position',[10 460 80 20]);
%================================
h4=uicontrol(gcf,'style','text',...
'string','结果显示区',...
'fontsize',20,...
'HorizontalAlignment','left', ...
'BackgroundColor',[1 1 1], ...
'ForegroundColor',[0 0 1], ...
'position',[530 80 300 80]);
%=================================
%开始,关闭
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[15 220 70 25],...
'string','运行',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'set(h4,''string'',''数据处理中,请等待。。。'',''fontsize'',20),',...
'a=get(l1,''value'');,',...
'if a==1,',...
'main_auto,',...
'set(h4,''string'',''计算完毕,请察看计算结果。'',''fontsize'',20),',...
'end,',...
'if a==2,',...
'save TR TR,',...
'set(h4,''string'',''标定已完成,请继续。'',''fontsize'',20),',...
'end,',...
'if a==3,',...
'main_show,',...
'set(h4,''string'',''数据已读入,请察看图片。'',''fontsize'',20),',...
'end,',...
'if a==4,',...
'main_point,',...
'set(h4,''string'',''计算完毕,请察看边缘亚像素点数据。'',''fontsize'',20),',...
'end,',...
'if a==5,',...
'main_edge,',...
'set(h4,''string'',''处理完毕,请察看边缘。'',''fontsize'',20),',...
'end,',...
'if a==6,',...
'main_line,',...
'set(h4,''string'',''处理完毕,请察看边缘。'',''fontsize'',20),',...
'end,',...
'if a==7,',...
'main_r,',...
'set(h4,''string'',''计算完毕,请察看圆弧及半径。'',''fontsize'',20),',...
'end,',...
'if a==8,',...
'main_angle,',...
'set(h4,''string'',''计算完毕,请察看角度。'',''fontsize'',20),',...
'end,',...
'if a==9,',...
'close,','main_gui2,'...
'set(h4,''string'',''刷新完毕,请继续。'',''fontsize'',20),',...
'end,',...
'end']);
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[15 170 70 25],...
'string','关闭',...
'callback','close');
%==============================
%grid on/off
r1=uicontrol('style','radio',...
'string','grid on',...
'value',0,...
'position',[10 100 60 20],...
'callback',[...
'grid on,',...
'set(r1,''value'',1);,',...
'set(r2,''value'',0)']);
r2=uicontrol('style','radio',...
'string','grid off',...
'position',[10 80 60 20],...
'value',1,...
'callback',[...
'grid off,',...
'set(r2,''value'',1);,',...
'set(r1,''value'',0)']);
%==================================
%显示结果
h11=uicontrol(...
gcf,'style','pushbutton',...
'position',[530 240 100 30],...
'string','顶点xT',...
'callback',[...
'load edgeinfo,'...
'set(h4,''string'',xT,''fontsize'',20),',...
]);
h12=uicontrol(gcf,'style','pushbutton',...
'position',[630 240 100 30],...
'string','顶点yT',...
'callback',[...
'load edgeinfo,'...
'set(h4,''string'',yT,''fontsize'',20),',...
]);
h13=uicontrol(gcf,'style','pushbutton',...
'position',[730 240 100 30],...
'string','底yD',...
'callback',[...
'load edgeinfo,'...
'set(h4,''string'',yD,''fontsize'',20),',...
]);
h14=uicontrol(gcf,'style','pushbutton',...
'position',[530 210 100 30],...
'string','R(半径)',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(r),''mm''],''fontsize'',20),',...
]);
h15=uicontrol(gcf,'style','pushbutton',...
'position',[630 210 100 30],...
'string','D(直径)',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(d),''mm''],''fontsize'',20),',...
]);
h16=uicontrol(gcf,'style','pushbutton',...
'position',[730 210 100 30],...
'string','L(长度)',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(L),''mm''],''fontsize'',20),',...
]);
h17=uicontrol(gcf,'style','pushbutton',...
'position',[530 180 100 30],...
'string','H(宽度)',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(b),''mm''],''fontsize'',20),',...
]);
h18=uicontrol(gcf,'style','pushbutton',...
'position',[630 180 100 30],...
'string','角α',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(fix(a)),''°'',num2str(fix((a-fix(a))*60)),''′''],''fontsize'',20),',...
]);
h19=uicontrol(gcf,'style','pushbutton',...
'position',[730 180 100 30],...
'string','角β',...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 0], ...
'callback',[...
'load shuju,'...
'set(h4,''string'',[num2str(fix(b)),''°'',num2str(fix((b-fix(b))*60)),''′''],''fontsize'',20),',...
]);
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
vision-measurement-of-turning-tool.rar (53个子文件)
车刀视觉测量
shuju.mat 512B
edgepoint_3.m 1KB
shujuinfo.mat 512B
picinfo.mat 3.52MB
getpic.m 265B
xspt.m 338B
old4.jpg 391KB
main_gui2.asv 7KB
edgeinfo_2.mat 4.69MB
main_line.m 376B
main_angle.m 561B
_desktop.ini 9B
point3sinA.m 317B
yspt.m 516B
Untitled3.m 383B
circle.m 372B
xxx.mat 208B
xspt_fit.m 451B
pointinfo.mat 288B
graf2d1.m 2KB
nihe.m 533B
L.mat 184B
cut.m 124B
shuju.m 161B
main_point.m 972B
xspt_bak.m 337B
angle1.m 913B
求圆心坐标.m 715B
old3.jpg 516KB
fitb.m 552B
edgepoint.m 2KB
edgeinfo2.mat 4.69MB
edgeinfo.mat 2.34MB
main_gui2.m 8KB
main_auto.m 3KB
bw2.mat 1.17MB
graf2d1.asv 2KB
A2.mat 1.17MB
CCC.mat 96KB
old5.JPG 507KB
untitled.m 2KB
12.jpg 507KB
main_show.m 144B
main_r.m 357B
edgepoint_2.m 1KB
Untitled2.m 1KB
Untitled1.m 2KB
bw.mat 2.34MB
run.m 8KB
main_edge.m 746B
nihe2.m 642B
TR.mat 192B
window2.m 147B
共 53 条
- 1
资源评论
- qq_453754142023-11-29果断支持这个资源,资源解决了当前遇到的问题,给了新的灵感,感谢分享~
JonSco
- 粉丝: 66
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功