基于C++MFC的活塞环外观表面缺陷机器视觉检测系统 毕业论文+任务书+开题报告+项目源码及exe执行文件
摘 要产品质量是企业永恒的主题,是企业得以生存发展最重要的条件。活塞环是一种嵌入活塞槽沟内部与气缸壁贴合上下运动的金属环。活塞环的生产加工流程繁琐,活塞环在生产与流转过程中可能产生多种外观表面缺陷,这些缺陷将不同程度影响发动机的工作效率。针对金属环成形尺寸误差和外形缺陷,使用人工抽检效率低,不能对全部工件进行检测,存在大量未检出残次品的问题。产品的数字化自动检测有益于提高企业效益、提升市场竞争力。本文研究了一种基于 OpenCV的金属成形工件尺寸与外形缺陷检测的方案,旨在基于活塞环表面缺陷检测需求,通过数据采集与分析,软件开发与算法编程,实现了活塞环几种典型缺陷的检测。因此活塞环表面缺陷的自动化检测具有总要的研究意义与实际开发价值。关键词:活塞环,缺陷,OpenCV,算法编程,缺陷检测ABSTRACTProduct 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 绪论 11.1 课题研究背景和意义 11.2国内外研究现状和发展 21.3研究内容 22 活塞环生产过程介绍与缺陷分析 42.1活塞环工作原理 42.2活塞环的的加工特点 52.3活塞环工艺过程介绍 62.4活塞环缺陷形成原因 63 机器视觉系统的工作原理与组成 83.1机器视觉工作原理 83.2机器视觉系统组成 84 图像处理介绍与缺陷分析 104.1对活塞环缺陷特征的简单分析 104.2图像二值化 104.3图像处理常用方法 114.4图像预处理 124.4.1图像灰度化 124.4.2平滑处理 124.4.3图像增强-直方图均衡化(equalizeHist) 144.4.4形态学滤波(morphologyEx) 154.5图片的裁剪(Rect) 164.6图片的混合(addWeighted) 164.7缺陷面积的计算(contourArea) 174.8图像的遍历算法 175 功能模块程序设计与开发 185.1图像预处理 185.2各功能的实现方法 185.2.1轮廓的提取 185.2.2图像的裁剪 205.2.3掉角的检测及面积测量 215.2.4压伤的检测 275.3操作界面程序设计 295.3.1按钮的实现 305.3.2图像的加载 306 可行性分析 326.1各因素对系统的影响 326.1.1社会因素的考虑 326.1.2健康因素的考虑 326.1.3安全因素的考虑 336.1.4文化因素的考虑 336.1.5环境因素的考虑 336.2复杂环境的预测 336.2.1光源 336.2.2工业相机的成像方式 346.2.3环境条件 356.3系统经济性分析 356.3.1生产成本 356.3.2产生社会价值 367 结论 37参考文献 38致 谢 39