| In today’s society,people are becoming more and more sensitive to the quality of product packaging.As an important component of lotion product containers,during product injection molding production and handling emulsion pump covers may produce surface stains,lack of glue,scratches,burrs,friction lines,etc.Therefore,the detection of product surface defects has been paid more and more attention by manufacturers.In this paper,according to the characteristics and inspection requirements of different surfaces of the emulsion pump cover,a visual inspection experimental platform is built,a machine vision software algorithm is designed,and three inspection stations are set up to detect the bottom,side and top surfaces of the pump cover respectively.The main contents of the work of this paper are as follows:1.Set up an experimental platform for detecting defects of the emulsion pump cover,and select the industrial camera,lens and light source models according to factors such as the appearance,size,color,field of view,and detection accuracy of the pump cover.2.Analyze the image characteristics of the bottom surface of the pump cover,and use image processing technology to detect defects in the image.Preprocess the image first,then use edge extraction,morphology and flood filling methods to locate the image,and analyze the four types of defect grayscale,shape and position features of the bottom surface of the pump cover,including burrs,scratches,lack of glue,and stains,respectively.Use different image processing methods to detect various types of defects.For the false defects caused by the mold imprint on the bottom surface of the pump cover,the contours of the detected stain defects are extracted first,and then the contours are fitted with a straight line based on the least square method,and the distance from the centroid of the pump cover to the fitted straight line is compared to determine the location of the false defects.Eliminate the false stains corresponding to the straight line with the smallest distance.3.Analyze the image characteristics of different angles of the side,make a data set through image processing technology,and use the CNN model for classification training.Analyze the characteristics of side images and gray histograms taken by 4 uniformly and symmetrically distributed cameras,and first use image processing technology to crop,locate,segment and zoom the images to create a standard data set.Analyze the characteristics of the Mobilenet_V2 convolutional neural network,customize the structure and parameters of the CNN network model based on Mobilenet_V2 according to factors such as image size and the number of categories,train and test the standard data set,set the early_stopping parameter until the training is completed,and combine it with LBP+SVM,Comparing the two machine learning methods of the VGG16 model based on transfer learning,it is finally proved that the custom CNN model based on Mobilenet_V2 has a better discrimination effect.4.Analyze the image characteristics of the top surface of the pump cover,analyze the defect type and its existence area according to the shape of the pump cover,analyze the gray histogram,and use the image processing method to locate the corresponding area and detect the stain.5.Select a certain number of qualified pump covers and unqualified pump covers with defects such as stains,lack of glue,scratches,burrs and friction lines and deformation,and conduct defect detection experiments on each surface of the pump cover,and analyze the test results.The experimental results show that the detection accuracy of this paper is above 95%,and the detection time is about 63.36 ms,which meets the requirements of manufacturers. |