| At present,in the process of modern cigarette production,the speed of cigarette packaging machine has reached 600-1000 packs / min.at this speed,the former medium speed machine visual inspection system can not meet the quality control of cigarette package appearance.In the production process,there will be blisters,wrinkles and other transparent film folding defects,end face damage defects,which will cause equipment shutdown,conveyor jam.At the same time,zb48 packaging unit,as a domestic high-speed packaging unit,has not designed a visual inspection system for the appearance defect of small package end face,and only relying on proximity switch and other devices can not meet the requirements of cigarette package appearance inspection.In order to solve this problem,wedecided to upgrade the zb48 packaging machine quality inspection system and establish a system which can quickly complete the online inspection of cigarette package appearance quality.The first step is to build a hardware platform.The hardware platform uses Basler Racer Series industrial CCD camera for image acquisition,optical fiber position sensor for positioning monitoring,high-speed AVR microcontroller as control unit,and industrial computer with solid-state hard disk for image processing;the second step is to design image recognition algorithm.This paper analyzes and summarizes the common defects of cigarette package to be solved in this project: defect of change of mark characteristics,defects of material,flatness of packaging material and integrity of packaging material.According to the types of defects,the detection algorithm is designed according to the classification,and the algorithm is verified by combining the hard collected images.1.Using edge detection algorithm to identify the cigarette package trademark.Gaussian filter is used to smooth and denoise the image,and then Laplace operator is used to extract the feature edge,and the threshold value is selected in a reasonable range to calculate the similarity value with the template to judge whether the cigarette package appearance is defective;2.The angle and position of the straight line are detected by Hough transform.The edge is extracted by Laplace Gaussian operator,and the Hough transform threshold and value range are established to judge whether the end face folding angle of transparent paper is standard or not;3.The integrity of cigarette packaging material is detected by gray histogram normalization calculation.By comparing the gray distribution of the detection image and the template image,the similarity of the two images is obtained.4.Using gray threshold method to detect the smoothness of transparent paper wrapped in cigarette package.By selecting the appropriate gray threshold,the defects are distinguished from the background,and the uneven hot sealing defects are identified.Finally,the experimental results show that: 1.The detection accuracy of the improved edge template recognition algorithm is increased by 90%;2.The detection accuracy of the improved Hough transform is improved.3.The new gray detection algorithm improves the detection accuracy and adaptability.4.After debugging,the gray threshold and white dot number threshold can accurately identify the uneven defects. |