| Commutator is the key component of the DC motor,its surface quality can directly affect the performance of the motor.Therefore,visual inspection of commutator’s appearance quality before leaving the factory is becoming a trend.Due to the hard and brittle nature of the bakelite material inside the commutator,cracks and damages may appear on the bottom bakelite surface during the machining process.Besides,due to the light reflection characteristics of the bakelite material,defects are often not obvious in the bakelite image,which brings great difficulty to the inspection of the commutator surface.Therefore,based on the actual needs of the commutator automatic production line for inspection,this thesis studied the visual inspection direction of crack and damage defects on the bottom bakelite surface of the commutator,and developed an inspection algorithm.The main research contents are as follows:Firstly,based on the analysis of imaging characteristics of the bakelite surface and defects,combined with the actual needs of the production line,the illumination mode of the bottom bakelite defect detection is designed.In this mode,coaxial light and low-angle ring light are used to illuminate and image the bottom of the commutator,so that not only obvious edge characteristics but also clear texture characteristics can be obtained to provide rich image information for defect detection.Secondly,for the problem that the low contrast of the bottom bakelite image is not conducive to defect detection,a dynamic contrast limited adaptive histogram equalization image enhancement algorithm is proposed.The algorithm can make full use of global and local contrast information of the image,crop the histogram of image block dynamically,as well as retain the gray distribution information in the original histogram to a certain extent,and avoid the serious loss of image details caused by cropping with a fixed threshold.Experiments show that the proposed algorithm can enhance the contrast of the bottom bakelite image and highlight the details of defects.Subsequently,for the problem that bakelite defects are not easy to detect,a new set of deep learning network models for the detection of bakelite crack and damage defect is designed.The model consists of a segmentation network and a classification network.First,the segmentation network is used to segment the bakelite image,and obtain a pixel-level defect probability map;then the classification network is used to analyze defect features of the segmentation network,and output the final defect class.In the segmentation network,the inception module and Dense Block are introduced to improve the network’s ability to adapt to the defect scale and accelerate convergence of the network;focal loss is used as the loss function of the segmented network to avoid the impact of uneven between positive and negative samples on detection.In the classification network,three convolutions with down-sampling and block process are used to improve the network’s ability of recognizing complex defect shapes and avoiding the influence of surface interference on the classifycation results.Finally,several comparative experiments are carried out using the dataset constructed from defect samples of the commutator bottom bakelite surface,which are collected from the production line.Experiment results show that,compared with the classical FCN network and UNet network,the segmentation network in this thesis can extract defect features more accurately and more stably,reaching an average Intersection over Union of 75.4%.The classification network in this thesis can make full use of the defect information obtained by segmentation network,and adapt to the change of defect scale and shape better,achieve a final accuracy of 97.9%.the model can detect fast,it’s also stable and able to meet the needs of automatic detection of the actual production line. |