基于labview的产品质量检测平台的设计与应用毕业论文
2021-03-17 21:12:32
摘 要
现今许多卷烟企业都提高了对卷烟产品的质量检测要求,但是传统的物理检测方法无法满足检测需求。在本设计中,采用图像处理检测的方法,通过Labview视觉模块设计了卷烟圆周的检测系统,实现对卷烟圆周的快速检测。
该系统由下位机的图像采集和上位机的图像处理以及尺寸测定组成,下位机图像采集是以STM32F4开发板为硬件开发平台,采用CMOS图像传感器OV7725采集卷烟圆周图像,经A/D转化后存入DMCI的DR内存中,而后通过串口传输将图像数据传入上位机。在Labview图像处理程序中,使用VISA串口传输函数从下位机串口读取图像数据,而后使用vision视觉开发包中的图像处理模块编写图像处理以及圆周检测程序,最终得到卷烟的真实值。
该系统采用非接触式测量,避免了卷烟圆周的受力变形,同时充分利用了Labview可视化编程的优势,测量窗口简洁直观,操作简单,检测效率高。而且圆周测量精度也符合卷烟圆周标准的检测要求,有较大的实用价值而且系统功能也有很大的拓展空间。
关键词:卷烟圆周; 图像检测; STM32F4 ; 串口传输
Abstract
Nowadays, many cigarette companies have improved the quality of cigarette products testing requirements, but the traditional physical detection methods can not meet the testing demands. In this design,the system make use of the image processing detection method, and through the Labview visual module designed the cigarette circumference detection system, to achieve rapid detection of cigarette circumference.
The system is composed of the image acquisition of the hardware and the image processing and the size measurement of the software. In the image acquisition of the hardware, the STM32F4 development board is used as the hardware development platform, and the image of the cigarette is collected by the OV7725. After the DMCI into the DR memory, And then through the serial port transmission of image data into the computer. In the Labview image processing program, the VISA serial port transfer function is used to read the image data from the lower computer serial port. Then, the image processing module in the vision visual development package is used to write the image processing and the circumference detection program, finally the real value of the cigarette is obtained.
The system uses non-contact measurement, which can avoid the deformation of the cigarette circumference, and taking full advantage of the advantages of Labview visual programming, measurement window simple and intuitive, simple operation, high detection efficiency. Besides ,the measurement accuracy of the circumference is also in line with the standard requirements of the circumference of cigarettes, The system has great practical value and the system function also has great room for development.
Key words: Cigarette circumference;image detection ;STM32F4; serial port transmission
目录
1.绪论 1
1.1研究背景 1
1.2 卷烟的检测指标 1
1.3我国卷烟物理指标检测的发展 3
2. 卷烟圆周检测方法研究 5
2.1卷烟圆周检测的意义 5
2.2图像处理技术在卷烟圆周检测的应用 5
2.3.卷烟圆周图像处理算法分析 6
2.3.1 引言 6
2.3.2腐蚀与膨胀 6
2.3.3圆周边界线提取 8
2.3.4卷烟圆周的测定 9
2.3.5 圆周周长的测量 10
3.图像采集系统设计 11
3.1系统总体方案的设计 11
3.2 图像传感器 12
3.3 图像采集电路的设计 14
3.3.1 STM32F4 开发平台 15
3.3.2 STM32F4 的 DCMI 接口 15
3.4 图像传输方式的选取 16
4.基于labview的卷烟检测软件编程 17
4.1 Labview图像处理模块介绍 17
4.2 Labview 系统软件设计 18
4.2.1 图像前期处理程序的设计 19
4.2.2图像尺寸的标定 23
4.2.3 图像圆周测量程序的设计 24
5.系统检测精度的检验与准确性分析 26
6. 总结与展望 28
6.1毕设总结 28
6.2展望: 28
7.参考文献 30
致谢 31
1.绪论
1.1研究背景
自烟草诞生以来,人们就对其褒贬不一,可以说,烟草的发展史就是一部略显戏剧性的吸烟与禁烟的斗争史。,相反烟草却在这种持续不断的禁烟运动中越来越强大,在发展中越来越名正言顺,在当今甚至成为国家的支柱产业,是国家经济命脉中不可缺少的源泉。
在科技繁荣的今天,无数的研究,太多的实验都证明了吸烟会对人体造成巨大而且无可挽回的伤害,但吸烟之风还是盛行于大江南北。时至今日,烟早已不仅仅是一根包裹着烟叶的卷纸,他早已深入到了我们的文化中。