Method and system for detecting inner and outer diameter defects of bearing based on industrial vision

By collecting images on the outer diameter surface of the bearing and determining the identification confidence using the direction consistency of the incised ellipse and defect candidates, the authenticity problem of defect recognition under smooth and reflective surface of the bearing is solved, and more accurate defect recognition is achieved.

CN120013865AInactive Publication Date: 2025-05-16SHENZHEN POLYTECHNIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411963085.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the outer diameter surface of the bearing is smooth and reflective, it is difficult for the prior art to accurately identify the real defect area, resulting in a decrease in the authenticity of defect recognition.

Method used

The surface image of the outer diameter of the bearing is collected by an industrial camera, the defect detection frame is extracted, and the defect identification point is determined based on the incision ellipse, the defect candidate part is constructed, and the identification confidence is determined through the direction consistency between the defect candidate part and the incision ellipse, and the effective defect detection frame is selected, and finally the defect edge point fits to obtain scratch defects.

Benefits of technology

Under the condition that the outer diameter surface of the bearing is smooth and reflective, the real defect area can be accurately identified, the authenticity of the defects on the outer diameter surface of the bearing can be improved, and misjudgment of spots or shadows can be avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013865A_ABST
    Figure CN120013865A_ABST
Patent Text Reader

Abstract

The invention provides a bearing inner and outer diameter defect detection method and system based on industrial vision, and the method comprises the steps: collecting an outer diameter surface image of a bearing, and extracting all defect detection frames in the outer diameter surface image of the bearing; for each defect detection frame, determining a plurality of defect identification points of the defect detection frame based on an inscribed ellipse in the defect detection frame, and constructing a defect candidate part corresponding to the defect detection frame according to all the defect identification points; determining the identification confidence coefficient of the defect detection frame during defect identification through the direction consistency between the defect candidate part and the inscribed ellipse, and screening out an effective defect detection frame based on the identification confidence coefficient of each defect detection frame; and extracting all defect edge points in the effective defect detection frame, and fitting all the defect edge points to obtain the scratch defect corresponding to the effective defect detection frame. According to the scheme, the scratch defect is obtained based on defect edge point fitting, and a real defect area can be identified under the condition that the outer diameter surface of the bearing is smooth and is influenced by light reflection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of defect detection, and more specifically, to a method and system for detecting inner and outer diameter defects of bearings based on industrial vision. Background Art

[0002] With the advancement of high-quality industrial development, defect detection has become an important guarantee for product quality. Defect detection is a technology that uses image processing and machine vision methods to automatically identify product surface defects. It is widely used in industrial automation. Traditional manual defect detection is susceptible to subjective influences and has low efficiency. Automated detection can quickly and accurately identify tiny defects, such as cracks, scratches, holes and other defect types. With the improvement of computing power and the optimization of algorithms, defect detection has gradually been applied to electronic products, metal processing, bearing manufacturing and other fields, and has become an important technology to ensure product quality and manufacturing efficiency.

[0003] In the existing defect detection field, defect detection mainly identifies product surface anomalies through image acquisition and analysis. First, the detection system obtains the image of the target object through a camera or sensor and performs preprocessing. Then, the image segmentation, edge detection and other algorithms are used to preliminarily extract possible defect areas. Next, the target detection algorithm is used to identify and classify defects. However, in the defect detection on the outer diameter surface of the bearing, the metal surface of the outer diameter of the bearing is often smooth and reflective, resulting in strong light spots or shadows in the collected image. These shadows will form dark areas similar to actual defects (i.e., small in size and randomly distributed), resulting in the inability to distinguish between shadows and real defect areas, thereby reducing the authenticity of the identification of defects on the outer diameter surface of the bearing. Therefore, how to identify the real defect area under the influence of the smooth and reflective surface of the bearing outer diameter, and then improve the authenticity of the identification of defects on the outer diameter surface of the bearing has become a difficult problem faced by the industry. Summary of the invention

[0004] The present application provides a method and system for detecting inner and outer diameter defects of bearings based on industrial vision, which can identify the real defect area when the outer diameter surface of the bearing is smooth and affected by reflection, thereby improving the authenticity of identifying outer diameter surface defects of the bearing.

[0005] In a first aspect, the present application provides a method for detecting inner and outer diameter defects of bearings based on industrial vision, comprising the following steps: Collect the outer diameter surface image of the bearing by using an industrial camera, and extract all defect detection frames in the outer diameter surface image of the bearing; For each defect detection frame, multiple defect identification points of the defect detection frame are determined based on the inscribed ellipse in the defect detection frame, and defect candidate parts corresponding to the defect detection frame are constructed according to all the defect identification points; Determine the identification confidence of the defect detection frame when performing defect identification through the directional consistency between the defect candidate portion and the inscribed ellipse, and then obtain the identification confidence of each defect detection frame when performing defect identification, and select the effective defect detection frame from all the defect detection frames based on the identification confidence of each defect detection frame; All defect edge points in the effective defect detection frame are extracted, and the scratch defect corresponding to the effective defect detection frame is obtained by fitting all the defect edge points.

[0006] In some embodiments, determining multiple defect identification points of the defect detection frame based on the inscribed ellipse in the defect detection frame specifically includes: The line connecting the center points of the two shortest opposite sides of the defect detection frame is used as the short axis of the inscribed ellipse, the line connecting the center points of the two longest opposite sides of the defect detection frame is used as the long axis of the inscribed ellipse, and the center point of the defect detection frame is used as the point of the inscribed circle, thereby obtaining the inscribed ellipse in the defect detection frame; Extract all edge pixel points on the edge line of the inscribed ellipse; Selecting an edge pixel point as a selected edge pixel point, and extracting all adjacent pixels of the selected edge pixel point from the defect detection frame; Performing local correlation analysis on the selected edge pixel points based on the pixel values ​​corresponding to each adjacent pixel point, thereby obtaining the local pixel correlation degree of the selected edge pixel point; Continue to determine the local pixel correlations of the remaining edge pixels, extract all local pixel correlations greater than the local pixel correlation threshold, and use the edge pixel points corresponding to the extracted local pixel correlations as defect identification points, thereby obtaining multiple defect identification points of the defect detection frame.

[0007] In some embodiments, performing local correlation analysis on selected edge pixels based on pixel values ​​corresponding to each adjacent pixel to obtain the local pixel correlation of the selected edge pixels specifically includes: Get the total number of all adjacent pixels; Compare the pixel values ​​corresponding to each adjacent pixel point with the pixel values ​​corresponding to the selected edge pixel point, and extract the total number of pixel values ​​corresponding to the adjacent pixel points that are smaller than the pixel values ​​corresponding to the selected edge pixel point; The ratio of the total number of pixels extracted is calculated to the total number of all adjacent pixels, and the result of the ratio calculation is used as the local pixel association degree of the selected edge pixel.

[0008] In some embodiments, constructing defect candidate parts corresponding to the defect detection frame according to all defect identification points specifically includes: Select a defect identification point as the selected defect identification point, draw a straight line through the selected defect identification point perpendicular to the nearest edge of the defect detection frame, obtain a straight line segment corresponding to the selected defect identification point, and use the length of the straight line segment as the approach amount when the selected defect identification point approaches the target defect; Continue to determine the approximation amount when the remaining defect identification points approach the target defect, and then obtain the approximation amount when each defect identification point approaches the target defect; The defect candidate part corresponding to the defect detection frame is constructed based on the approximation corresponding to each defect identification point.

[0009] In some embodiments, constructing a defect candidate portion corresponding to a defect detection frame based on the approximation corresponding to each defect identification point specifically includes: Compare the approximation amount corresponding to each defect identification point with the preset approximation amount to screen out all the defect approximation key points; All defect approximation key points are connected end to end in a predetermined order to construct defect candidate parts corresponding to the defect detection box.

[0010] In some embodiments, determining the identification confidence of the defect detection frame for defect identification by using the directional consistency between the defect candidate portion and the inscribed ellipse specifically includes: Determining the main axis direction of the defect candidate portion; Taking the major axis direction of the inscribed ellipse as a reference direction; The identification confidence of the defect detection frame when performing defect identification is determined by the main axis direction and the reference direction.

[0011] In some embodiments, extracting all defect edge points in the valid defect detection frame specifically includes: Converting the image within the target defect frame into a binary image; Performing defect feature analysis on each pixel in the binary image to obtain a defect correlation degree corresponding to each pixel; For each pixel point, the corresponding defect correlation degree is compared with the defect correlation degree threshold, all defect correlation degrees greater than the defect correlation degree threshold are extracted, and the pixel points corresponding to the extracted defect correlation degrees are used as the defect edge points in the effective defect detection frame.

[0012] In a second aspect, the present application provides a bearing inner and outer diameter defect detection system based on industrial vision, comprising: An acquisition module is used to acquire an image of the outer diameter surface of the bearing through an industrial camera, and extract all defect detection frames in the image of the outer diameter surface of the bearing; A processing module, for determining, for each defect detection frame, a plurality of defect identification points of the defect detection frame based on an inscribed ellipse in the defect detection frame, and constructing a defect candidate portion corresponding to the defect detection frame according to all the defect identification points; The processing module is further used to determine the identification confidence of the defect detection frame when performing defect identification through the directional consistency between the defect candidate portion and the inscribed ellipse, thereby obtaining the identification confidence of each defect detection frame when performing defect identification, and screen out a valid defect detection frame from all defect detection frames based on the identification confidence of each defect detection frame; The execution module is used to extract all defect edge points in the effective defect detection frame, and obtain the scratch defect corresponding to the effective defect detection frame by fitting all the defect edge points.

[0013] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores codes, and the processor is configured to obtain the codes and execute the above-mentioned method for detecting inner and outer diameter defects of bearings based on industrial vision.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for detecting inner and outer diameter defects of bearings based on industrial vision.

[0015] The technical solution provided by the embodiments disclosed in this application has the following beneficial effects: In the bearing inner and outer diameter defect detection method and system based on industrial vision provided by the present application, first, the bearing outer diameter surface image is collected by an industrial camera, and all defect detection frames in the bearing outer diameter surface image are extracted; secondly, for each defect detection frame, multiple defect identification points of the defect detection frame are determined based on the inscribed ellipse in the defect detection frame, and a defect candidate part corresponding to the defect detection frame is constructed according to all the defect identification points; then, the identification confidence of the defect detection frame when performing defect identification is determined by the directional consistency between the defect candidate part and the inscribed ellipse, and then the identification confidence of each defect detection frame when performing defect identification is obtained, and based on the identification confidence of each defect detection frame, effective defect detection frames are screened out from all defect detection frames; finally, all defect edge points in the effective defect detection frame are extracted, and the scratch defect corresponding to the effective defect detection frame is obtained by fitting all the defect edge points.

[0016] It can be seen that the present application can identify the real defect area when the outer diameter surface of the bearing is smooth and affected by reflection, thereby improving the authenticity of the identification of defects on the outer diameter surface of the bearing; first, all defect detection frames in the bearing outer diameter surface image are extracted, and then the approximate defect position of the bearing outer diameter surface is roughly determined; secondly, based on the inscribed ellipse in the defect detection frame, multiple defect identification points of the defect detection frame are determined to further identify whether the current defect detection frame has a misdetection, and according to the defect approximation corresponding to each defect identification point, the defect candidate part corresponding to the defect detection frame is constructed, so as to further judge the detection effectiveness of the current defect detection frame; further, the defect detection frame is extracted through the directional consistency between the defect candidate part and the inscribed ellipse. The reliability degree of defect identification, and based on the reliability degree of defect identification, an effective defect detection frame is screened out, thereby avoiding the influence of light spots or shadows caused by the smooth and reflective metal surface of the bearing, thereby improving the authenticity of defect detection on the outer diameter surface of the bearing; then, all defect edge points in the effective defect detection frame are extracted to provide comprehensive information about the position, size and shape of the defect, avoiding the problem of missed detection caused by the small size of the defect and the random distribution; finally, the scratch defect corresponding to the effective defect detection frame is obtained by fitting all the defect edge points; in summary, the technical solution provided by the present application can identify the real defect area under the influence of the smooth and reflective outer diameter surface of the bearing, thereby improving the authenticity of the identification of defects on the outer diameter surface of the bearing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is an exemplary flow chart of a method for detecting inner and outer diameter defects of bearings based on industrial vision according to some embodiments of the present application; Figure 2 is an exemplary flow chart of determining a defect candidate part according to some embodiments of the present application; Figure 3 is an exemplary flow chart of determining identification confidence according to some embodiments of the present application; Figure 4 It is a structural schematic diagram of a bearing inner and outer diameter defect detection system based on industrial vision according to some embodiments of the present application; Figure 5 It is a structural schematic diagram of a computer device for implementing a method for detecting inner and outer diameter defects of bearings based on industrial vision according to some embodiments of the present application. DETAILED DESCRIPTION

[0018] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0019] refer to Figure 1, which is an exemplary flow chart of a bearing inner and outer diameter defect detection method based on industrial vision according to some embodiments of the present application. The bearing inner and outer diameter defect detection method 100 based on industrial vision mainly includes the following steps: In step 101, an image of the outer diameter surface of a bearing is collected by an industrial camera, and all defect detection frames in the image of the outer diameter surface of the bearing are extracted.

[0020] In specific implementation, the image of the outer diameter surface of the bearing is collected through an industrial camera. The industrial camera is an image acquisition device specially designed for industrial automation and detection. Its core function is to use optical means to convert the image of the product, workpiece or scene into an analyzable digital signal, thereby helping to achieve quality inspection, dimension measurement, position recognition and other tasks.

[0021] In the specific implementation, all defect detection boxes in the bearing outer diameter surface image can be extracted through a preset deep learning target detection model. The preset deep learning target detection model adopts YOLO in the convolutional neural network, which will not be repeated here. In addition, a manual labeling method can also be used to extract all defect detection boxes in the bearing outer diameter surface image, which is not limited here.

[0022] The defect detection box in this application represents a window in the image that marks the target object area with a rectangular box, that is, the rectangular box used to roughly mark the defects on the outer diameter surface of the bearing in this application. By extracting the defect detection box, the defect area and position of the outer diameter surface of the bearing can be roughly identified.

[0023] In step 102, for each defect detection frame, multiple defect identification points of the defect detection frame are determined based on the inscribed ellipse in the defect detection frame, and a defect candidate portion corresponding to the defect detection frame is constructed according to all the defect identification points.

[0024] In some embodiments, the following steps may be specifically used to determine multiple defect identification points of the defect detection frame based on the inscribed ellipse in the defect detection frame, namely: The line connecting the center points of the two shortest opposite sides of the defect detection frame is used as the short axis of the inscribed ellipse, the line connecting the center points of the two longest opposite sides of the defect detection frame is used as the long axis of the inscribed ellipse, and the center point of the defect detection frame is used as the point of the inscribed circle, thereby obtaining the inscribed ellipse in the defect detection frame; Extract all edge pixel points on the edge line of the inscribed ellipse; Selecting an edge pixel point as a selected edge pixel point, and extracting all adjacent pixels of the selected edge pixel point from the defect detection frame; Performing local correlation analysis on the selected edge pixel points based on the pixel values ​​corresponding to each adjacent pixel point, thereby obtaining the local pixel correlation degree of the selected edge pixel point; Continue to determine the local pixel correlations of the remaining edge pixels, extract all local pixel correlations greater than the local pixel correlation threshold, and use the edge pixel points corresponding to the extracted local pixel correlations as defect identification points, thereby obtaining multiple defect identification points of the defect detection frame.

[0025] It should be noted that, in this embodiment, the local pixel correlation threshold represents a pre-set standard local pixel correlation, which is used to identify defect identification points and can be specifically set according to actual needs.

[0026] In a specific implementation, all adjacent pixel points of the selected edge pixel point are extracted from the defect detection frame, that is, the pixel points of the selected edge pixel point in the eight-neighborhood direction in the defect detection frame are taken as adjacent pixel points, and then all adjacent pixel points of the selected edge pixel point are obtained. In addition, in other embodiments, other methods can be used to extract all adjacent pixel points of the selected edge pixel point, which is not limited here. In this embodiment, the adjacent pixel points represent the pixel points adjacent to the selected edge pixel point.

[0027] In some embodiments, the following steps may be used to perform local correlation analysis on selected edge pixels based on the pixel values ​​corresponding to each adjacent pixel to obtain the local pixel correlation of the selected edge pixels, namely: Get the total number of all adjacent pixels; Compare the pixel values ​​corresponding to each adjacent pixel point with the pixel values ​​corresponding to the selected edge pixel point, and extract the total number of pixel values ​​corresponding to the adjacent pixel points that are smaller than the pixel values ​​corresponding to the selected edge pixel point; The ratio of the total number of pixels extracted is calculated to the total number of all adjacent pixels, and the result of the ratio calculation is used as the local pixel association degree of the selected edge pixel.

[0028] It should be noted that the local correlation analysis in this embodiment represents a process of comparing the pixel deviations of selected edge pixels and adjacent edge pixels, and taking the ratio of the total number of pixel values ​​corresponding to adjacent pixels that are smaller than the pixel values ​​corresponding to the selected edge pixels to the total number of all adjacent pixels as the local pixel correlation of the selected edge pixels. In defect detection on the outer diameter surface of bearings, especially scratch defect detection, the pixel value at the defect point will be significantly higher than the background pixel value. Therefore, whether the pixel point is a potential defect point can be determined by calculating the total number of pixel values ​​of the pixel point that are greater than the pixel values ​​of the adjacent pixels.

[0029] It should also be noted that, in this embodiment, the local pixel association degree represents the degree of association between the selected edge pixel point and the adjacent pixel point, that is, the larger the local pixel association degree, the greater the degree of association between the selected edge pixel point and the adjacent pixel point, and the smaller the local pixel association degree, the smaller the degree of association between the selected edge pixel point and the adjacent pixel point.

[0030] In addition, it should be noted that the defect identification points in the present application represent key points used to identify the locations of potential defects. By determining the defect identification points, the state changes of the defects can be accurately recorded and tracked to ensure that each defect is properly handled and not omitted or ignored, so as to further identify whether the current defect detection frame has a false detection situation.

[0031] In some embodiments, reference Figure 2 As shown, this figure is an exemplary flow chart for determining defect candidate parts according to some embodiments of the present application. In this embodiment, constructing defect candidate parts corresponding to defect detection boxes according to all defect identification points can be implemented by the following steps: First, in step 1021, a defect identification point is selected as the selected defect identification point, and a straight line is drawn through the selected defect identification point perpendicular to the nearest edge of the defect detection frame to obtain a straight line segment corresponding to the selected defect identification point, and the length of the straight line segment is used as the approximation amount when the selected defect identification point approaches the target defect; Then, in step 1022, the approximation amount of the remaining defect identification points when approaching the target defect is continued to be determined, and then the approximation amount of each defect identification point when approaching the target defect is obtained; Finally, in step 1023, the defect candidate portion corresponding to the defect detection frame is constructed based on the approximation corresponding to each defect identification point.

[0032] In specific implementation, the approach amount of the remaining defect identification points when approaching the target defect is further determined by the determination method of "drawing a straight line through the selected defect identification point perpendicular to the nearest edge of the defect detection frame to obtain a straight line segment corresponding to the selected defect identification point, and taking the length of the straight line segment as the approach amount of the selected defect identification point when approaching the target defect".

[0033] It should be noted that the approximation amount in the present application represents the degree to which the pixel points in the defect detection frame are close to the defective pixel points, that is, the larger the approximation amount, the greater the degree to which the pixel points in the defect detection frame are close to the defective pixel points, and vice versa. By determining the approximation amount, the actual defects on the outer diameter surface of the bearing can be further approached, thereby obtaining more accurate and effective defect identification results.

[0034] In some embodiments, the defect candidate portion corresponding to the defect detection frame is constructed based on the approximation corresponding to each defect identification point, and the following steps can be used, namely: Compare the approximation amount corresponding to each defect identification point with the preset approximation amount to screen out all the defect approximation key points; All defect approximation key points are connected end to end in a predetermined order to construct defect candidate parts corresponding to the defect detection box.

[0035] Specifically, in reality, the approximation value corresponding to each defect identification point is compared with the approximation value threshold, and all defect approximation key points are screened out, that is, all approximations greater than the approximation value threshold are extracted, and the defect identification points corresponding to each extracted approximation value are used as defect approximation key points, where the defect approximation key point in this embodiment represents the point closest to the outer diameter surface of the bearing in space.

[0036] In the specific implementation, all the defect approximation key points are connected end to end in a predetermined order to construct the defect candidate part corresponding to the defect detection frame, that is: all the defect approximation key points are connected end to end in a predetermined order in a clockwise direction to construct the defect candidate part corresponding to the defect detection frame, which will not be repeated here.

[0037] It should be noted that the defect candidate portion in the present application represents the area obtained after approximating the defect area. By determining the defect candidate portion, the severity of the bearing outer diameter surface defects and the effectiveness of the defect detection frame in detecting defects can be effectively identified.

[0038] In step 103, the identification confidence of the defect detection frame when performing defect identification is determined by the directional consistency between the defect candidate part and the inscribed ellipse, and then the identification confidence of each defect detection frame when performing defect identification is obtained, and based on the identification confidence of each defect detection frame, a valid defect detection frame is screened out from all the defect detection frames.

[0039] It should be noted that the directional consistency between the defect candidate portion and the inscribed ellipse in the present application is measured by the angle between the two.

[0040] In some embodiments, reference Figure 3 As shown in FIG. 1 , this figure is an exemplary flow chart of determining identification confidence according to some embodiments of the present application. In this embodiment, the identification confidence of the defect detection frame for defect identification is determined by the directional consistency between the defect candidate portion and the inscribed ellipse, which can be implemented by the following steps: First, in step 1031, the main axis direction of the defect candidate portion is determined; Then, in step 1032, the major axis direction of the inscribed ellipse is used as a reference direction; Finally, in step 1033, the identification confidence of the defect detection frame when performing defect identification is determined by the main axis direction and the reference direction.

[0041] In the specific implementation, first, principal component analysis (PCA) is used to calculate the main axis direction of the defect candidate part, and then the major axis direction of the inscribed ellipse is used as a reference direction. Further, the angle between the main axis direction and the reference direction is calculated, and then the angle is input as an input parameter into a preset confidence function. Finally, the confidence function outputs the identification confidence of the defect detection frame when the defect is identified, wherein the confidence function adopts a cosine function. In addition, other confidence functions may also be used in other embodiments, which are not limited here.

[0042] It should be noted that, in this embodiment, the main axis direction represents the main extension direction of the defect candidate part. By determining the main axis direction, the geometric shape and expansion trend of the defect area can be effectively identified; in this embodiment, the reference direction represents the direction used as a reference in the inscribed ellipse. In this application, the identification confidence represents the reliability of the defect detection frame when identifying defects, that is, the matching accuracy between the area marked as defects in the defect detection frame and the actual defects. The identification confidence is evaluated by quantifying the consistency between the main axis direction of the defect block and the direction of the inscribed ellipse. The higher the identification confidence, the more the defect area marked by the defect detection frame conforms to the actual defect distribution characteristics, and the higher the accuracy. The lower the identification confidence, the less the defect area marked by the defect detection frame conforms to the actual defect distribution characteristics, and the lower the accuracy.

[0043] In specific implementation, the identification confidence of each defect detection frame when identifying defects is determined by the method of "determining the identification confidence of the defect detection frame when identifying defects through the directional consistency between the defect candidate part and the inscribed ellipse", which will not be repeated here.

[0044] In some embodiments, the following steps may be used to select valid defect detection frames from all defect detection frames based on the identification confidence of each defect detection frame, namely: Get the identification confidence of each defect detection box Each identification confidence is compared with the identification confidence threshold, all identification confidences greater than the identification confidence threshold are extracted, and the defect detection boxes corresponding to each extracted identification confidence are used as valid defect detection boxes.

[0045] It should be noted that in this embodiment, the identification confidence threshold represents a pre-set confidence standard value for screening defect detection frames. This threshold can effectively identify defect detection frames with high confidence to improve the effectiveness and authenticity of defect detection on the outer diameter surface of the bearing. The identification confidence threshold can be set according to actual needs and is not limited here.

[0046] It should also be noted that the effective defect detection frame in the present application refers to a defect detection frame that can accurately locate the defect area and meet the confidence requirements during the defect detection process on the outer diameter surface of the bearing. Such a defect detection frame can clearly mark the position, size and shape characteristics of the defect and meet the detection accuracy requirements of the application scenario. Therefore, by determining the effective defect detection frame, the boundary of the defect area can be effectively identified, reducing redundancy or missed detection outside the frame.

[0047] In step 104, all defect edge points in the effective defect detection frame are extracted, and the scratch defect corresponding to the effective defect detection frame is obtained by fitting all the defect edge points.

[0048] In some embodiments, all defect edge points in the effective defect detection frame may be extracted by the following steps, namely: Converting the image within the target defect frame into a binary image; Performing defect feature analysis on each pixel in the binary image to obtain a defect correlation degree corresponding to each pixel; For each pixel point, the corresponding defect correlation degree is compared with the defect correlation degree threshold, all defect correlation degrees greater than the defect correlation degree threshold are extracted, and the pixel points corresponding to the extracted defect correlation degrees are used as the defect edge points in the effective defect detection frame.

[0049] In specific implementation, the image in the target defect frame can be converted into a binary image through the image processing tool OpenCV, which will not be described in detail here. In this embodiment, the binary image refers to an image in which pixel values ​​are assigned to 0 or 1.

[0050] In some embodiments, defect feature analysis is performed on each pixel in the binary image to obtain the defect correlation degree corresponding to each pixel, that is: Setting a local search domain of the binary image; Select a pixel point in the binary image as a selected pixel point, and extract all neighboring pixel points of the selected pixel point according to the local search domain; Compare the grayscale value of the selected pixel with the grayscale values ​​of each adjacent pixel, extract the frequency of occurrence of the grayscale value of the selected pixel being greater than the grayscale value of the adjacent pixel, and use the frequency of occurrence as the defect correlation degree corresponding to the selected pixel; Continue to determine the defect correlation degrees corresponding to the remaining pixels in the binary image, and then obtain the defect correlation degrees corresponding to each pixel.

[0051] In a specific implementation, a local search domain of the binary image is set, and the local search domain is set to an 8-neighborhood. In addition, in other embodiments, it can also be set to other neighborhoods, such as a 4-neighborhood. There is no limitation here. The local search domain represents a box for searching for local information of pixel points.

[0052] In a specific implementation, all neighboring pixels of the selected pixel are extracted according to the local search domain, that is, taking the selected pixel as the center and the local search domain as the range, all other pixels except the selected pixel are extracted as neighboring pixels.

[0053] It should be noted that, in this embodiment, the defect correlation degree represents the degree to which the current pixel is judged as a defective pixel, that is, the larger the defect correlation degree, the greater the degree to which the current pixel is judged as a defective pixel, and the smaller the defect correlation degree, the smaller the degree to which the current pixel is judged as a defective pixel.

[0054] It should also be noted that the defect edge point in the present application represents a pixel point that is identified as having a defect. By determining the defect edge point, the scratch defect on the outer diameter surface of the current bearing can be effectively identified.

[0055] In some embodiments, the following steps may be used to obtain the scratch defect corresponding to the effective defect detection frame obtained by fitting all defect edge points, namely: Perform adjacency classification on all defect edge points to obtain an adjacent defect edge point set and a non-adjacent defect edge point set; All adjacent defect edge points in the adjacent defect edge point set are connected end to end to obtain the scratch defect corresponding to the effective defect detection frame, and for each non-adjacent defect edge point in the non-adjacent defect edge point set, each non-adjacent defect edge point is used as an independent scratch point.

[0056] In specific implementation, through the above-mentioned determination method of "obtaining the scratch defects corresponding to the effective defect detection frame by fitting all defect edge points", the scratch defects corresponding to all effective defect detection frames can be determined, and then all scratch defects on the outer diameter surface of the bearing can be obtained.

[0057] In addition, in another aspect of the present application, in some embodiments, the present application provides a bearing inner and outer diameter defect detection system based on industrial vision, referring to Figure 4 , which is a structural schematic diagram of a bearing inner and outer diameter defect detection system based on industrial vision according to some embodiments of the present application. The bearing inner and outer diameter defect detection system based on industrial vision 200 includes: an acquisition module 201, a processing module 202 and an execution module 203, which are described as follows: Acquisition module 201, in this application, acquisition module 201 is mainly used to acquire the outer diameter surface image of the bearing through an industrial camera, and extract all defect detection frames in the outer diameter surface image of the bearing; Processing module 202, in the present application, the processing module 202 is mainly used to determine, for each defect detection frame, multiple defect identification points of the defect detection frame based on the inscribed ellipse in the defect detection frame, and construct a defect candidate portion corresponding to the defect detection frame according to all the defect identification points; The processing module 202 is further configured to determine the identification confidence of the defect detection frame when performing defect identification through the directional consistency between the defect candidate portion and the inscribed ellipse, thereby obtaining the identification confidence of each defect detection frame when performing defect identification, and screen out a valid defect detection frame from all defect detection frames based on the identification confidence of each defect detection frame; The execution module 203 in the present application is mainly used to extract all defect edge points in the effective defect detection frame, and obtain the scratch defect corresponding to the effective defect detection frame by fitting all defect edge points.

[0058] In addition, the present application also provides a computer device, which includes a memory and a processor, the memory stores a code, and the processor is configured to obtain the code and execute the above-mentioned bearing inner and outer diameter defect detection method based on industrial vision.

[0059] In some embodiments, reference Figure 5 , which is a schematic diagram of the structure of a computer device for implementing a bearing inner and outer diameter defect detection method based on industrial vision according to some embodiments of the present application. The bearing inner and outer diameter defect detection method based on industrial vision in the above embodiment can be performed by Figure 5 The computer device 300 shown in the figure is implemented, and the computer device 300 includes at least one processor 301, a communication bus 302, a memory 303 and at least one communication interface 304.

[0060] Processor 301 can be a general-purpose central processing unit (CPU), or an application-specific integrated circuit (ASIC) or one or more for controlling the execution of the bearing inner and outer diameter defect detection method based on industrial vision in the present application.

[0061] The communication bus 302 may be used to transmit information between the above-mentioned components.

[0062] The memory 303 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

[0063] The memory 303 is used to store the program code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the program code stored in the memory 303. The program code may include one or more software modules. The determination of the bearing inner and outer diameter defect detection method based on industrial vision in the above embodiment can be implemented by the processor 301 and one or more software modules in the program code in the memory 303.

[0064] The communication interface 304 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0065] In a specific implementation, as an embodiment, a computer device may include multiple processors, each of which may be a single-CPU processor or a multi-CPU processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0066] The above-mentioned computer device may be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the computer device may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of computer device.

[0067] In addition, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned bearing inner and outer diameter defect detection method based on industrial vision.

[0068] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0069] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for detecting inner and outer diameter defects of bearings based on industrial vision, characterized in that: The steps include: Collect the outer diameter surface image of the bearing by using an industrial camera, and extract all defect detection frames in the outer diameter surface image of the bearing; For each defect detection frame, multiple defect identification points of the defect detection frame are determined based on the inscribed ellipse in the defect detection frame, and defect candidate parts corresponding to the defect detection frame are constructed according to all the defect identification points; Determine the identification confidence of the defect detection frame when performing defect identification through the directional consistency between the defect candidate portion and the inscribed ellipse, and then obtain the identification confidence of each defect detection frame when performing defect identification, and select the effective defect detection frame from all the defect detection frames based on the identification confidence of each defect detection frame; All defect edge points in the effective defect detection frame are extracted, and the scratch defect corresponding to the effective defect detection frame is obtained by fitting all the defect edge points.

2. The method according to claim 1, characterized in that Determining multiple defect identification points of the defect detection frame based on the inscribed ellipse in the defect detection frame specifically includes: The line connecting the center points of the two shortest opposite sides of the defect detection frame is used as the short axis of the inscribed ellipse, the line connecting the center points of the two longest opposite sides of the defect detection frame is used as the long axis of the inscribed ellipse, and the center point of the defect detection frame is used as the point of the inscribed circle, thereby obtaining the inscribed ellipse in the defect detection frame; Extract all edge pixel points on the edge line of the inscribed ellipse; Selecting an edge pixel point as a selected edge pixel point, and extracting all adjacent pixels of the selected edge pixel point from the defect detection frame; Performing local correlation analysis on the selected edge pixel points based on the pixel values ​​corresponding to each adjacent pixel point, thereby obtaining the local pixel correlation degree of the selected edge pixel point; Continue to determine the local pixel correlations of the remaining edge pixels, extract all local pixel correlations greater than the local pixel correlation threshold, and use the edge pixel points corresponding to the extracted local pixel correlations as defect identification points, thereby obtaining multiple defect identification points of the defect detection frame.

3. The method according to claim 2, characterized in that Based on the pixel values ​​corresponding to each adjacent pixel point, the local correlation analysis of the selected edge pixel point is performed, and then the local pixel correlation degree of the selected edge pixel point is obtained, which specifically includes: Get the total number of all adjacent pixels; Compare the pixel values ​​corresponding to each adjacent pixel point with the pixel values ​​corresponding to the selected edge pixel point, and extract the total number of pixel values ​​corresponding to the adjacent pixel points that are smaller than the pixel values ​​corresponding to the selected edge pixel point; The ratio of the total number of pixels extracted is calculated to the total number of all adjacent pixels, and the result of the ratio calculation is used as the local pixel association degree of the selected edge pixel.

4. The method according to claim 1, characterized in that The defect candidate parts corresponding to the defect detection frame constructed according to all defect identification points specifically include: Select a defect identification point as the selected defect identification point, draw a straight line through the selected defect identification point perpendicular to the nearest edge of the defect detection frame, obtain a straight line segment corresponding to the selected defect identification point, and use the length of the straight line segment as the approach amount when the selected defect identification point approaches the target defect; Continue to determine the approximation amount when the remaining defect identification points approach the target defect, and then obtain the approximation amount when each defect identification point approaches the target defect; The defect candidate part corresponding to the defect detection frame is constructed based on the approximation corresponding to each defect identification point.

5. The method according to claim 4, characterized in that The defect candidate parts corresponding to the defect detection frame constructed based on the approximation corresponding to each defect identification point specifically include: Compare the approximation amount corresponding to each defect identification point with the preset approximation amount to screen out all the defect approximation key points; All defect approximation key points are connected end to end in a predetermined order to construct defect candidate parts corresponding to the defect detection box.

6. The method according to claim 1, characterized in that Determining the identification confidence of the defect detection frame for defect identification by using the directional consistency between the defect candidate portion and the inscribed ellipse specifically includes: Determining the main axis direction of the defect candidate portion; Taking the major axis direction of the inscribed ellipse as a reference direction; The identification confidence of the defect detection frame when performing defect identification is determined by the main axis direction and the reference direction.

7. The method according to claim 1, characterized in that Extracting all defect edge points in the effective defect detection frame specifically includes: Converting the image within the target defect frame into a binary image; Performing defect feature analysis on each pixel in the binary image to obtain a defect correlation degree corresponding to each pixel; For each pixel point, the corresponding defect correlation degree is compared with the defect correlation degree threshold, all defect correlation degrees greater than the defect correlation degree threshold are extracted, and the pixel points corresponding to the extracted defect correlation degrees are used as the defect edge points in the effective defect detection frame.

8. A bearing inner and outer diameter defect detection system based on industrial vision, characterized in that: include: An acquisition module is used to acquire an image of the outer diameter surface of the bearing through an industrial camera, and extract all defect detection frames in the image of the outer diameter surface of the bearing; A processing module, for determining, for each defect detection frame, a plurality of defect identification points of the defect detection frame based on an inscribed ellipse in the defect detection frame, and constructing a defect candidate portion corresponding to the defect detection frame according to all the defect identification points; The processing module is further used to determine the identification confidence of the defect detection frame when performing defect identification through the directional consistency between the defect candidate portion and the inscribed ellipse, thereby obtaining the identification confidence of each defect detection frame when performing defect identification, and screen out a valid defect detection frame from all defect detection frames based on the identification confidence of each defect detection frame; The execution module is used to extract all defect edge points in the effective defect detection frame, and obtain the scratch defect corresponding to the effective defect detection frame by fitting all the defect edge points.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores codes, and the processor is configured to obtain the codes and execute the method for detecting inner and outer diameter defects of bearings based on industrial vision as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting inner and outer diameter defects of bearings based on industrial vision as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • A method for on-line detection of outer diameter defects of a hub bearing

    CN122841250A