| The plastic tube has become one of the main packing varieties of cosmetics,medicine and food in daily life because of its convenient use,affordable price,safe and reliable health and other characteristics,the detection of the printing defects on the surface of the plastic pipe is an important link before it leaves the factory,but because of the small area of the printing defects such as missed printing,indentation,scratch and so on,it is mixed with the printing pattern,traditional artificial detection methods are easy to produce visual fatigue,and it is difficult to ensure the detection efficiency and accuracy.Based on machine vision technology and depth learning method,a printing defect detection system for plastic pipe is developed,which is oriented to the printing defects of plastic pipe in the fields of daily chemical,medicine,food and so on,it can improve the detection efficiency,reduce the waste output,reduce the labor cost,improve the competitiveness of enterprises,and can be extended to metal pipe and other printing defects detection applications,with good market prospects.Therefore,the research goal of this paper is to design a machine vision-based plastic pipe printing defect detection system.The main research contents of the paper are as follows:Firstly,the characteristics of three kinds of defects such as missed print,indentation and scratch are analyzed,and the types of defects are judged by color,shape and area,the industrial linear array camera is chosen as the vision imaging device,and the machine imaging model is built by studying the working principle of the linear array camera.Secondly,according to the characteristics of small target detection,in order to increase the proportion of small target and extract more edge detection information,it is necessary to transform the original image data samples,in this paper,image segmentation is used to solve the problem that the ratio of the object to the image is small and can not be used to detect the object directly.In addition,in the process of visual imaging due to uneven lighting,the speed of measured components caused by such factors as image quality problems,Open CV image processing library is used to enhance the image from four aspects of brightness,contrast,chroma and sharpness,so as to better use in the training of detection algorithm.Then,based on the Py Charm integrated development environment and using Python as the explanatory language,CBAM attention mechanism is added to YOLOv4-tiny target detection algorithm to improve the representation ability of CNN and effectively reduce the interference of invalid targets.Using the above methods and detection algorithm,the small target defect detection on the surface of plastic pipe is realized in multi-thread programming environment,and the validity of the detection algorithm is verified by various evaluation indexes.Finally,the design of the system software function modules,including the camera settings and acquisition display module,defect detection and display module and the system as a whole performance test.The experimental results show that the average detection accuracy m AP is 98.20% and the detection speed is 25.27 Fps,which can meet the detection requirements. |