下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、沖尢必象实验报告专业:_生物系统工程姓名:一蒋昊铮学号: 3120100277日期: 20150325地点:农生环d座实验步骤存储minboundrect源代码,调用minbounckect,通过mer方法获取水果横径;通过excel处理数据,进行回归分析,获得图片与参数。课程名称:生物生产机器人指导老师:_崔迪一成绩: 实验名称:水果品质检测与分级的方法实验类型:实验室操作结合上机同组学生姓名:_吴文华方小敏邓敏娜赵懿潼李艺健蔡杭杭一、实验目的二、实验步骤三、源程序四、思考题实验目的1.常握用mer方法检测水果横径的方法;2.掌握机器视觉系统的标定方法。水果编号真实值/mmmer方法检测值回
2、归模型检测结果/mm1 jr 74.12503. 3574.626805271.76490. 7373.0076593 n69. 32465.469. 75782474. 12503. 2974.619107573. 18482.76y = 0. 1283x + 10.04771.985108672.56481. 1371.775979776. 42516. 1576.2690458 j71.02473. 1970.7572779 n72.86490. 6973.002527107& 12526. 2477.5635922.7978777675747372717069684604704
3、80490500510520530实验名称:水果品质检测与分级的方法姓名:蒋吴铮学号:3120100277真实值与mer方法检测值回归模型y = o.1283x +10.047 弘.a附旳三、 源程序minboundrect 源代码:function rectx,recty,area,perimeter = minboundrect(x,y,metric) if (nargin<3) | isempty(metric)metric = 'a:elseif ischar(metric)error 'metric must be a character flag if it
4、is supplied.'else% check for 'a' or 'p*metric = lower(meiric(:)j;ind = slrmatch(metric, ,areal/perimeter,);if isempty(ind)error 'metric does not match either mareah or nperimeter,n endmetric = metric(l);endx=x(:);y=y(0;n = length(x);if n =length(y)error x and y must be the same s
5、izes'endif n>3edges = convhull(x,y); % tp1 will silence the warnings% exclude those points inside the hull as not relevant % also sorts the points into their convex hull as a% closed polygonx = x(edges);y = y(edges);nedges = length(x) 1;elseif n>l% n must be 2 or 3nedges = n;x(end+l) = x(l
6、);y(end+l) = y(l);elsenedges = n;endswitch nedgescase 0rectx =;recty =;area =;perimeter =;returncase 1rectx = repmat(x,l,5);recty = repmat(yj,5);area = 0;perimeter = 0;returncase 2rectx = x( 1 2 2 1 1);recty = y(l 22 1 1);area = 0;perimeter = 2*sqrt(diff(x).a2 + diff(y).a2);returnendrmat = (theta) c
7、os(theta) sin(theta);-sin(theta) cos(theta); ind = l:(length(x)-l);edgeangles = atan2(y(ind+l) y(ind),x(ind+l) x(ind); edgeangles = unique(mod(edgeangles,pi/2);nang = length(edgeangles);area = inf;perimeter = inf;met = inf;xy = x,y;for i = l:nangrot = rmat(-edgeangles(i);xyr = xy*rot;xymin = min(xyr
8、j j); xymax = max(xyr, j);a_i = prod(xymax - xymin); p_i = 2*sum(xymax-xymin);if metric=-a,m二 a_i;elsem i = p i;end讦mvmet% keep this onemet = m_i;area = a_i;perimeter = p_i;rect = xymin;xymax( 1 ),xymin(2) ;xymax;xymin(l),xymax(2) ;xymin;rect = rect*rot"rectx = rect(: j);recty = rect(:,2);end e
9、ndend调用minboundrect源程序:»i=imread(f2.l.bmp');i=imread(,l.bmp);订=rgb2gray(i);%订灰度图像i2=im2bw(i 1);» dg=edge(i2);bw=im2bw(i2);r c=find(bw=0);rectx,recty,area,perimeter = minboundrect(c,r/ar); figureimshow(bw);line(rectx(:),recty(:)/color7rr);width=sqrt(rectx(2)-rectx( 1) a2+(recty (2)-recty( 1 )a2) length=sqrt(rectx( 1 )-rectx(4)a2+(recty(1) -recty(4)a2)edge('llbmpj;dg = cdgc('l.l.bmp'
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 第20课 三国两晋南北朝时期的科技与文化(教案)-2024-2025学年七年级历史上册素养提升教案(统编版2024)
- 人教版物理 选修1-1 4.4 信息化社会 教案
- 19《大象的耳朵》教学设计(公开课教案)
- 水能溶解多少物质(教案)-2024-2025学年教科版(2017)科学三年级上册
- 篮球行进间胸前双手传接球技术 教学设计-2023-2024学年高一上学期体育与健康人教版必修第一册
- 西师大版音乐五年级下册1一杯美酒(教案)
- 人音版八年级音乐上册(简谱)第四单元《☆我的祖国》教学设计
- 2020-2021学年新教材高中历史第10单元改革开放与社会主义现代化建设教案
- 滚翻:连续两次前滚翻(教案) 体育二年级下册
- 高中美术《传统艺术的根脉- 青铜器》教案
- 寻乌县城垃圾转运设施项目可行性研究报告
- 五年级数学(小数乘除法)计算题专项练习及答案
- 办公区域维修方案
- 2024-2025年秋季第一学期学校主题班会安排表+小学2024-2025第一学期主题班会课安排表
- 电工外包协议书模板范本
- 举办铁人项比赛行业五年发展洞察报告
- 加速康复外科ERAS围术期运动康复训练 2
- 2025届新高考语文冲刺热点复习:词语的意义与用法
- 第七单元、数学广角-植树问题 (课件) -2024-2025学年五年级上册数学人教版
- 长效(锌溴)无衰减液流储能电站项目建议书
- 2024-2030年中国木寡糖(XOS)行业市场发展趋势与前景展望战略分析报告
评论
0/150
提交评论