硕 士 学 位 论 文
MASTER DISSERTATION
基于机器视觉的移动工件
抓取和装配的研究
The Research of the Grasp and Assemblage
of Moving Workpiece
Based on Machine Vision
作 者 夏文杰
校内导师 陆 艺 副教授
校外导师 杨维和 高工
专业领域 仪器仪表工程
中国计量学院
二〇一六年三月
˝
•
‰
˚
中图分类号 TP242.6 学校代码 10356
UDC 621
密级 公开
硕 士 学 位 论 文
MASTER DISSERTATION
基于机器视觉的移动工件
抓取和装配的研究
The Research of the Grasp and Assemblage
of Moving Workpiece
Based on Machine Vision
作 者 夏文杰 专业领域 仪器仪表工程
校内导师 陆 艺 副教授 校外导师 杨维和 高工
申请学位 工学硕士 论文类型 应用研究
二〇一六年三月
˝
•
‰
˚
The Research of the Grasp and Assemblage
of Moving Workpiece
Based on Machine Vision
By
WenJie XIA
A Dissertation Submitted to
China Jiliang University
In partial fulfillment of the requirement
For the degree of
Master of Engineering
China Jiliang University
March, 2016
˝
•
‰
˚
独创性声明
本人声明所呈交的学位论文是本人在导师指导下进行的研究工作和取得的
研究成果,除了文中特别加以标注和致谢之处外,论文中不包含其他人已经发
表或撰写过的研究成果,也不包含为获得 中国计量学院 或其他教育机构的
学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡献均
已在论文中作了明确的说明并表示了谢意。
学位论文作者签名: 签字日期: 年 月 日
学位论文版权使用授权书
本学位论文作者完全了解 中国计量学院 有关保留、使用学位论文的
规定。特授权 中国计量学院 可以将学位论文的全部或部分内容编入有关数
据库进行检索,并采用影印、缩印或扫描等复制手段保存、汇编以供查阅和借
阅。同意学校向国家有关部门或机构送交论文的复印件和磁盘。(保密的学位论
文在解密后适用本授权说明)
学位论文作者签名: 导师签名:
签字日期: 年 月 日 签字日期: 年 月 日
˝
•
‰
˚
致 谢
光阴如水、日月如梭,转眼三年的研究生生活马上邻近尾声了,回首这三
年的点点滴滴,往事不禁历历在目,在我毕业论文即将完成之际,我要向这一
路走来关心、帮助和支持过我的老师、同学和家人们表示由衷的感谢,你们的
支持才是我不断前行的力量!
首先,我要特别感谢陆艺老师在研究生期间对我学习、生活上的帮助,在
这三年的学习时间里我充分的感受到了陆老师的渊博学识,严谨的治学,敏锐
的学术思维以及兢兢业业的工作作风,对我产生了深刻影响。感谢他从论文的
选题开始一直到最终完成对我的细心指导,感谢他给予了我宝贵的实践机会和
课题研究的指引,感谢他在生活上对我的关系和帮助。在此,我祝福您在以后
的岁月中能获得更多的研究成果,愿您桃李满天下!
其次,我衷要感谢导师组的王学影老师、郭斌老师、范伟军老师在学习和
生活上对我的帮助。感谢校外导师杨维和高工的悉心指导和帮助。感谢陪伴我
走过研究生岁月的实验室师兄弟们,感谢师兄毛民、张浩、徐陈杰、薛剑对我
研究课题的支持和帮助,感谢张俊鑫、刘慧平、徐博文、王欢、王华、张培培、
于丽梅在读研期间对我的关心和支持。
最后,感谢我的父母、家人们,是你们在精神和物质上对我的支持和鼓励,
才能使我能够顺利的毕业,你们的关心和鼓励是我奋发向上的动力,让我有勇
气继续努力和前进。祝愿你们能身体健康、生活美满。
衷心感谢各位评审专家在百忙之中抽出时间对本文的细心审阅,送上我最
真挚的祝福:平安幸福,工作顺利!
夏文杰
2015 年 10 月
˝
•
‰
˚
基于机器视觉的移动工件抓取和装配的研究
摘要:随着计算机技术、数字图像处理的迅速发展,机器视觉技术广泛应用于
汽车及汽车零部件制造业、机械加工行业等诸多领域中。目前传统的工业机器
人必须通过逐点示教才能完成生产线上的物料搬运、装配,但是工业现场工件
往往任意摆放,致使工业机器人无法完成操作任务。针对上述问题,本文引入
机器视觉技术,对工业生产线上的工件自动装配问题进行了研究,主要研究工
作如下:
(1)为了解决工业生产线上产品自动装配的问题,根据技术指标,完成了
方案的总体设计,同时介绍了整个机器视觉系统的工作原理;
(2)确定单目视觉标定方案,并且通过 OpenCV 完成摄像机的内外参数
标定,通过标定结果矫正图像畸变。为了进一步得到图像像素尺寸和实际物理
尺寸之间的精确关系,在像素级角点基础上进行内插实现亚像素级角点检测;
(3)对工件图像进行定位处理,提出了一种基于曲线拟合的质心定位与偏
转角度定位算法。由于本测试系统为动态抓取,工件运动模糊的现象比较严重,
针对这一情况,引入维纳滤波器对图像进行复原,为了解决复原图像中的振铃
现象,引入 Limetal 提出的最优窗法,该处理结果使复原图像边缘清晰可见同
时避免了振铃效应;
(4)在 Visual Studio2008 搭载 OpenCV2.4.4 软件环境下,将测试系统分为
参数设置模块、图像采集与处理模块、运动控制模块、通信模块 4 个部分,并
对每个功能模块进行阐述;同时由于测试软件是多任务的,采用多线程控制技
术来实现;
(5)抓取装配实验中,为了探究光照强度、电机运行速度对装配结果的影
响,分别作了实验并记录数据,根据实验数据,对每个因素都进行分析处理,
保证最后的装配结果稳定可靠。
关键词:机器视觉;数字图像处理;摄像机标定
分类号:TP242.6; UDC 621
I
˝
•
‰
˚
The Research of the Grasp and Assemblage of Moving
Workpiece Based on Machine Vision
Abstract: With the rapid development of computer technology and digital image
processing, machine vision has been widely applied in the field of Automobile and
automobile parts manufacturing, machinery processing industry. Recently the
traditional industrial robots must go through with point by point teaching mode to
complete handling, assembling and transfering material and up-down material in
production line between the workpiece for each station. However the industrial field
environment is complex, and the workpiece position is put randomly, so that the
industrial robots can't do operation task smoothly. According to the above problems,
machine vision technology is introduced in this paper, and the mobile workpiece
grabbing and assembling technology is studied based on machine vision. The main
research work is as follows:
(1)In order to solve the industrial products covering up and down automatic
assembly in the production line, we complete the overall design scheme according to
the technical index of the machine vision system, and the working principle of the
machine vision system is introduced.
(2)The monocular vision calibration methods is determined, and calibration
of camera’s interior and exterior parameters is completed through the OpenCV, and
image distortion is corrected by the calibration results. At the same time in order to
get the relationship between the image pixel size and the actual physical size,
subpixel level corner detection by interpolating diagonal point value on the basis of
the Harris corner detector is completed.
(3)Fixing the workpiece image processing, a algorithm based on rectangle
fitting about centroid localization and the deflection angle is proposed. Because of
the testing system for dynamic grabbing, workpiece movement fuzzy phenomenon
is more serious with the improvement of motor speed. To remedy the situation, the
wiener filter for image restoration is introduced. In order to solve the ringing in the
restored image, we introduce the optimal window method put forward by Limetal,
II
˝
•
‰
˚
so that the processing result reinstated image edge is visible and avoid the ringing
effect at the same time.
(4)In Visual Studio 2008 with OpenCV2.4.4 software environment, the test
system can be divided into four parts with modular design thinking, such as
parameter setting module, image acquisition and processing module, motor control
module, and communication module, each of which are expounded. Because the test
software is more tasks, multi-threaded control technology is used to realize it at the
same time.
(5)In grabbing assembly experiment, to explore the following factors, such as
light intensity, motor speed, which have a influence on the result of the assembly,
experiments and record data are made respectively. According to the experimental
data, every factor is analyzed and processed to ensure that the results of the final
assembly are stable and reliable.
Keywords:machine vision; image processing; camera calibration
Classification:TP242.6; UDC 621
III
˝
•
‰
˚