| Bearings are widely used core basic components in the field of mechanical equipment,and their quality has a significant impact on the performance and lifespan of mechanical equipment.However,various defects may occur during the manufacturing process of bearings,and their quality needs to be tested.At present,the detection of characteristic dimensions and surface defects of bearings is mainly completed by manual sampling,which has disadvantages such as low efficiency,incomplete detection,and susceptibility to subjective factors.Machine vision based detection technology has the advantages of high efficiency,non-contact,and intelligence,and has been widely applied in the field of industrial manufacturing.This article focuses on the issue of bearing size measurement and surface defect detection,and studies a vision based detection method to explore the process of achieving high-precision measurement of bearing feature size and efficient recognition of surface defects.The main research content is as follows:Firstly,a visual inspection system was established.Based on the analysis of the characteristics of the tested bearing parts,a visual measurement system device was designed and built to meet the requirements of size measurement and defect detection.Secondly,a method for detecting the size of the bearing outer ring was studied.Aiming at the problem of low corner detection accuracy in commonly used checkerboard calibration methods,a new corner detection method based on local area linear fitting intersection is proposed to improve camera calibration accuracy;And the coordinate transformation method based on homography matrix is adopted to overcome the problems of poor reliability and low accuracy of commonly used proportional coefficient methods;In addition,by improving the subpixel edge detection method based on local area effect,the accuracy of size detection has been further improved.Then,a vision based algorithm for detecting the roundness error of the inner and outer rings of bearings was designed.Based on the contour data obtained by visual devices and the roundness error judgment model,a nonlinear objective function is constructed.On this basis,an improved bee colony algorithm is used to solve the nonlinear objective function,achieve roundness error detection,and improve the accuracy and efficiency of roundness error calculation.Finally,the process of identifying bearing surface defects based on conventional classification methods and deep learning methods was explored.We constructed a surface defect dataset and trained traditional machine learning and deep learning defect detection models,respectively.Construct feature vectors for defect images using image texture and grayscale statistical features,and use SVM classifiers to classify defect types;Use YOLOv5 deep learning model to detect surface defects.The experimental results show that the re projection error of the corner detection algorithm proposed in this paper is 0.028 pixels,which is better than 0.117 pixels of Open CV and 0.203 pixels of MATLAB toolbox,and has higher detection accuracy;Measure the diameter size of existing bearings with a detection accuracy of within 0.5 pixel;For the calculation of roundness error in contour data,the improved artificial bee colony algorithm has a higher solving accuracy than the least squares method.By adding grayscale statistics to form feature vectors,surface defect classification and detection can be effectively achieved.The accuracy of defect classification is 96.11%,and the m AP for defect detection using YOLO is 0.837. |