摘 要
产品质量是企业永恒的主题,是企业得以生存发展最重要的条件。活塞环是一种嵌入活塞槽沟内部与气缸壁贴合上下运动的金属环。活塞环的生产加工流程繁琐,活塞环在生产与流转过程中可能产生多种外观表面缺陷,这些缺陷将不同程度影响发动机的工作效率。针对金属环成形尺寸误差和外形缺陷,使用人工抽检效率低,不能对全部工件进行检测,存在大量未检出残次品的问题。产品的数字化自动检测有益于提高企业效益、提升市场竞争力。本文研究了一种基于 OpenCV的金属成形工件尺寸与外形缺陷检测的方案,旨在基于活塞环表面缺陷检测需求,通过数据采集与分析,软件开发与算法编程,实现了活塞环几种典型缺陷的检测。因此活塞环表面缺陷的自动化检测具有总要的研究意义与实际开发价值。
关键词:活塞环,缺陷,OpenCV,算法编程,缺陷检测
ABSTRACT
Product quality is the eternal theme of an enterprise and the most important condition for its survival and development. Piston ring is a kind of metal ring which is embedded in the groove of piston and fits up and down with the cylinder wall. The production and processing of piston rings are cumbersome. During the production and circulation of piston rings, many kinds of surface defects may occur, which will affect the working efficiency of engines to varying degrees. Aiming at the dimension error and shape defect of metal ring forming, manual sampling inspection is inefficient, and can not detect all the workpieces. There are many problems of undetected defective products. Digital automatic detection of products is beneficial to improve the efficiency of enterprises and market competitiveness. Therefore, the automatic detection of piston ring surface defects has important research significance and practical development value. This paper studies a method of metal forming workpiece size and shape defect detection based on OpenCV, aiming at realizing several typical defect detection of piston rings through data acquisition and analysis, software development and arithmetic programming based on the requirement of surface defect detection of piston rings. Through learning to improve understanding and analysis of problems, experimental design, image processing programming skills, engineering design practice ability.
key words: piston ring, defect, OpenCV, algorithmic programming, defect detection
目 录
1 绪论 1
1.1 课题研究背景和意义 1
1.2国内外研究现状和发展 2
1.3研究内容 2
2 活塞环生产过程介绍与缺陷分析 4
2.1活塞环工作原理 4
2.2活塞环的的加工特点 5
2.3活塞环工艺过程介绍 6
2.4活塞环缺陷形成原因 6
3 机器视觉系统的工作原理与组成 8
3.1机器视觉工作原理 8
3.2机器视觉系统组成 8
4 图像处理介绍与缺陷分析 10
4.1对活塞环缺陷特征的简单分析 10
4.2图像二值化 10
4.3图像处理常用方法 11
4.4图像预处理 12
4.4.1图像灰度化 12
4.4.2平滑处理 12
4.4.3图像增强-直方图均衡化(equalizeHist) 14
4.4.4形态学滤波(morphologyEx) 15
4.5图片的裁剪(Rect) 16
4.6图片的混合(addWeighted) 16
4.7缺陷面积的计算(contourArea) 17
4.8图像的遍历算法 17
5 功能模块程序设计与开发 18
5.1图像预处理 18
5.2各功能的实现方法 18
5.2.1轮廓的提取 18
5.2.2图像的裁剪 20
5.2.3掉角的检测及面积测量 21
5.2.4压伤的检测 27
5.3操作界面程序设计 29
5.3.1按钮的实现 30
5.3.2图像的加载 30
6 可行性分析 32
6.1各因素对系统的影响 32
6.1.1社会因素的考虑 32
6.1.2健康因素的考虑 32
6.1.3安全因素的考虑 33
6.1.4文化因素的考虑 33
6.1.5环境因素的考虑 33
6.2复杂环境的预测 33
6.2.1光源 33
6.2.2工业相机的成像方式 34
6.2.3环境条件 35
6.3系统经济性分析 35
6.3.1生产成本 35
6.3.2产生社会价值 36
7 结论 37
参考文献 38
致 谢 39