| The commutator is one of the core components in DC motor and plays a key role in it’s operation.At present,the quality control of commutator mainly depends on manual work.However,there are some problems such as high cost,low efficiency and limited testing accuracy in manual quality inspection,which makes automatic testing become the development trend of enterprises.With no contact and fast response,the technology of machine vision has a good application prospect in the field of industrial detection.Based on the vision technology,this thesis discusses and studies the detection method of the defects on the commutator hook,and puts forward the corresponding solution.The main research contents are as follows:Aiming at the problems of complex texture,low contrast defect and uneven light intensity reflection on the curved hook surface,this thesis designes a detection algorithm of imprint defect on the hook surface based on region extraction.The defect enhancement method based on neighborhood background’s gray contrast difference designed in this thesis is used to highlight the characteristics of defects.Then,combined with the local dynamic threshold method of multi-scale neighborhood and the region adaptive expansion method,the defect area of the hook surface is extracted.Finally,morphological operation and connected domain analysis are used to calculate the geometric features of the region,and according to the detection index to judge whether it is imprint defect.The algorithm can extract the defect area completely,and the detection accuracy of the imprint defect on the hook surface reaches96.3%.In this thesis,a defect detection algorithm based on the geometric features of the hook top is designed to solve the problems such as irregular hook top contour,small number of defect samples and no explicit quantitative index of the defect.Then,the curvature feature and straight-line feature of the hook top contour are extracted.Curvature features are represented by the average curvature of the fitting conic in the hook-top contour interval,and linear features are extracted based on convex hull algorithm and cumulative probability Hough transform.Aiming at the problem that the number of defect samples is small,this thesis adopts One-Class SVM to detect the flattening defects based on a large number of qualified samples.The algorithm achieves zero omission and 92.4% accuracy on the test set,and the overall accuracy is 99.8%,and the average time of a single image is about 10.73 ms.According to the characteristics of the black skin of the hook root and the tin drop from the inner surface of the hook under the direct hook condition of the commutator,the segmentation and classification networks are designed respectively in this thesis.The defect boundary is difficult to determine because the black skin of the hook root will be close to the bakelite or adhere to the black skin of the notch.In this thesis,an improved U-Net network is designed to detect the black skin of the hook root.The performance of the model is enhanced by the introduction of residual connection and anti-pooling operation,and the pyramid pooling module is used to connect the encoder and decoder to extract the feature information fully.In the test set,the average crossover ratio of model score in this thesis reaches 84.3%,and finally achives accuracy rate of 95.5%.For the tin dropping defect on the inner surface of the hook,there are many problems,such as big difference in color brightness,fuzzy transition boundary,and difficulty in making regional labels.In this thesis,a classification network is designed to complete the detection of tin dropping defect on the inner surface of the hook.The model introduces an module called Inception based on residual connection in the shallow layer to fully extract feature information.The convolutional layer and global average pooling layer are used to replace the full connection layer in order to reduce parameters and avoid overfitting.A weighted cross entropy loss function is designed according to the proportion of positive and negative samples.The model in this thesis has an overall accuracy of 97.5% on the two test sets,and the average time of a single sample is about 8.57 ms.Experimental results show that the proposed algorithm in this thesis has good detection accuracy and efficiency for hook defects.Also it accords with the test requirement of actual production. |