山东大学学士论文1摘要随着工业的发展,产品的质量越来越受到人们的关注。因此企业必须提高对产品质量的检测。而标签检测就是其中一个重要方面。传统的标签检测大都是由人工进行,只能满足小批量生产,效率低下,检测精度低下,因此给企业造成很多损失。现在标签检测系统是基于机器视觉技术、自动化技术、图像处理技术而设计的稳定性好、效率高的检测系统。本文介绍了机器视觉技术的现状及发展,以及在许多领域中的应用,简单说明了机器视觉技术的体系结构。根据课题要求,提出了标签在线检测系统的总体设计方案。利用CCD摄像机及图像采集卡采集图像信息,采集到的信息传送到计算机,由MATLAB图像处理软件进行预处理及图像分析,并将检测结果输出,由PLC控制硬件设备的动作。本文也简要叙述了图像采集单元各部分的选取及方案设计。本文主要侧重研究检测系统的图像处理单元。图像处理单元采取MATLAB实现图像处理算法,分析研究了图像处理的流程,研究每步算法的原理,对比优缺点,选择最优的方法进行处理,以得到高质量的二值图像。最后选择合适的图像分析方案,以实现课题的目标。关键词:标签图像处理MATLAB检测山东大学学士论文2ABSTRACTAsthedevelopmentoftheindustry,thequalityoftheproductisconcernedmoreandmorebypeople.Hencethecompanymustimprovethetestofproducts’quality.Thelabeltestisoneimportantaspectofit.Thetraditionalwaysoflabeldetectionaremostlydonebypeople,itcanonlymeetthesmallpatchproduction,itsefficientanddetectionaccuracyareverylow.Soitcauseslotsofdamagetotheenterprise.Nowthelabeltestingsystemisbasedonthemachinevisiontechnology,automatictechnologyandimageprocessingtechnology,ithasgoodstabilityandhighefficient.Thisarticledescribesthecurrentsituationanddevelopmentofmachinevisiontechnology,anditsapplicationsinmanyareas.Itillustratesthearchitectureofmachinevisiontechnologybriefly.Accordingtherequestsofsubject,weproposetheoveralldesignplanofthelabeltestingsystem.UseCCDcamerasandimageacquisitioncardcollectimage,then,sendtheimageinformationtocomputer,finally,processandanalyzetheimagethroughtheMATLAB,andoutputthetestresult.PLCcontroltheactionofhardware.Thisarticlealsointroduceshowtoselecttheeverysectionoftheimageacquisitionunitandthedesignofthelightsystem.Thisarticlemainlyintroducestheimageprocessunitofthissystem.TheunitadoptsMATLABtoachievetheimageprocessingalgorithms,toanalyzetheprocessoftheimageprocessingandtoresearchtheprincipleofeverystep.Then,wecomparetotheadvantageanddisadvantageofeachalgorithms,choosethebestmethodtoimprovethequalityoftheimage.Finally,choosetheappropriateimageanalysissolutiontoachievethesubjectobjectives.Keywords:labelimageprocessingMATLABdetection山东大学学士论文3目录第一章绪论.......................................................................................................11.1课题背景............................................................................................11.2机器视觉技术......................................................................................11.2.1机器视觉技术的现状及发展.....................................................11.2.2机器视觉技术的应用.................................................................21.2.3机器视觉系统的体系结构.........................................................21.3标签检测系统的现状与发展................................................................31.4研究意义与目标....................................................................................41.4.1研究意义.....................................................................................41.4.2研究目标.....................................................................................5第二章标签在线检测系统总体设计...............................................................62.1标签在线检测系统的组成部分............................................................62.2标签在线检测系统的工作过程............................................................72.3本课题要注意的几个问题................................................................72.3.1图像采集.....................................................................................72.3.2图像处理.....................................................................................72.3.3图像分析.....................................................................................8第三章图像采集单元的设计...........................................................................93.1图像采集单元的组成..........................................................................93.1.1CCD摄像机的选取与分析........................................................93.1.2照明方案的设计.......................................................................113.1.3图像采集卡的选择....................................................................12第四章图像处理单元的设计.........................................................................144.1数字图像处理概述...............................................................................144.2图像的预处理.......................................................................................144.2.1图像的灰度修正.......................................................................154.2.2图像的平滑处理.......................................................................154.3图像的二值化.......................................................................................16山东大学学士论文44.4图像的识别...........................................................................................164.4.1图像面积的计算.......................................................................174.4.2图像重心的计算.......................................................................174.5图像处理的软件实现...........................................................................174.5.1图像处理及识别算法的设计...................................................174.5.2文件夹的添加。.......................................................................184.5.3标签检测系统的程序流程框图...............................