| With the rapid development of electric vehicles,the performance and endurance of power batteries need to be improved.The detection of surface defects of power battery is a key step in the manufacturing process of power battery,which is to detect whether there is any defect on the cover of power battery box.At present,manual detection is mainly used in industry,Artificial detection is not stable and reliable in terms of detection efficiency and detection accuracy.Machine vision is mainly a detection method that uses machine instead of human eye to locate,detect,measure and identify objects.Machine vision defect detection uses machine instead of human eye to detect defects of water line products and ensure the quality of assembly line products Based on the characteristics of battery defects and the difficulties of manual detection,combined with the advantages of machine vision detection,a defect detection system of power battery cover is designed and developed.The object of this paper is the defect detection of power battery cover in front of laser weldment.The main purpose is to identify whether the power battery cover is closed correctly through the defect characteristics.The main work of this paper is as follows:(1)according to the characteristics of the defects of power battery,it is found that the traditional light source can not produce good results through experiments.In this paper,two lines of structured light are used to show the characteristics of the defects,which can get high contrast image effect,reducing the difficulty of the following image processing algorithm.(2)The common algorithms in image processing,including image denoising,image enhancement,image segmentation and image morphology processing,are studied.Image enhancement and image denoising are important means to improve image quality,and are the key step to ensure the defect feature extraction of power battery.In view of the noise existing in the collected image,this paper introduces the commonly used filtering and denoising methods in the spatial domain,including median,mean,Gaussian,bilateral and other spatial filtering algorithms,and makes a comparative analysis of each filtering algorithm,and finally selects bilateral filtering as the final denoising method.The histogram equalization,Laplacian image sharpening,gray-scale transformation and other image enhancement algorithms are analyzed.Finally,linear transformation is selected as the way of image enhancement,and the adaptive threshold,the Dajin threshold segmentation algorithm and the morphological processing algorithm are analyzed.Then,the ROI region of interest is located and extracted by extracting the central point of power battery foreground.(3)After the defect is extracted,the geometric features of the defect are extracted,and the feature data that can best reflect the features of the workpiece is used for training.Through the experimental analysis,it is found that the SVM algorithm in machine learning is the best for the defect classification of power battery.In this paper,four defect feature data are selected for training according to the characteristics of the defect,The final experimental results show that the accuracy is more than 98%.Compared with the traditional algorithm,the recognition rate is improved a lot.The accuracy of the classifier can be further improved by increasing the number of training samples and feature attributes.(4)Based on vs2015,QT,C + + and opencv development environment,a surface defect detection software based on machine vision is designed and developed.The software consists of image data acquisition module,image processing module,defect classification and identification module,result data storage module and signal input and output module.The recognition rate of the system can reach about 98%,which is in line with the actual production requirements,saving the cost for the manufacturers and improving the production efficiency of the power battery. |