浙江大学生物系统工程-生物生产机器人-实验报告2_第1页
浙江大学生物系统工程-生物生产机器人-实验报告2_第2页
浙江大学生物系统工程-生物生产机器人-实验报告2_第3页
浙江大学生物系统工程-生物生产机器人-实验报告2_第4页
浙江大学生物系统工程-生物生产机器人-实验报告2_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论