Bearing defect detection method and system based on computer vision

Through computer vision technology, gradient calculation and double -threshold detection, combined with the shape and texture characteristics, generate bearing defect index, solve the problem of noise and misjudgment in existing technologies, and achieve high accuracy and reliability of bearing defect detection.

CN118799706BActive Publication Date: 2025-01-21CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411286882.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-01-21
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

The prior art has noise, uneven light and background interference in bearing defect detection affect the contour clarity and refinement accuracy, and a single threshold detection method may lead to misjudgment.

Method used

Using computer vision -based methods, through gradient calculation and non -large value to inhibit edge pixels, set up double -threshold detection and differentiated weak edge pixel points to form continuous edge curves and divide defective areas, combined with shape characteristics, texture characteristics and grayness The variance generates bearing defect index.

Benefits of technology

Effectively detect the edge of the bearing surface, accurately divide the defective areas, reduce the effects of noise and uneven light, improve the accuracy and reliability of detection, and avoid misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799706B_ABST
    Figure CN118799706B_ABST
Patent Text Reader

Abstract

The present invention provides a bearing defect detection method and system based on computer vision, which relates to the technical field of bearing defect detection. The present invention acquires a bearing surface image, performs grayscale and denoising processing, obtains a recognition image, applies a gradient operator to calculate the grayscale gradient in the horizontal and vertical directions, and performs non-maximum suppression to obtain edge pixel points; calculates edge strength, establishes dual threshold detection, combines strong edges with weak edges to form a continuous edge curve, and divides it into defective areas and non-defective areas; acquires the length of the defective edge curve, calculates the edge curvature, evaluates the shape feature coefficient, and generates the texture feature coefficient using a local binary mode; calculates the grayscale variance of the defective area, and comprehensively generates a bearing defect index; compares the bearing defect index with a threshold value to determine whether the bearing has defects. The present invention generates a bearing defect index through image processing and feature analysis, and compares it with a threshold value, thereby realizing accurate detection of bearing defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of bearing defect detection, and in particular to a bearing defect detection method and system based on computer vision. Background Art

[0002] With the development of industrialization, bearings, as an indispensable component in mechanical equipment, play a key role in supporting and transmitting power in various mechanical equipment, and can reduce friction between mechanical parts, which can greatly improve the reliability and stability of equipment. As a key mechanical transmission component, the outer ring side and the inner ring side of the bearing play a major transmission role. However, during the operation of the machinery, the rolling elements and raceways of the bearings are constantly rubbing against each other during long-term use, resulting in material fatigue damage. When fatigue gradually accumulates to a certain extent, it may cause microscopic deformation or unevenness of the inner and outer sides of the bearings. Therefore, the side health of the bearing is directly related to the safety, reliability and economy of the equipment. Therefore, regular inspection and maintenance of bearings and timely handling of bearing defects are essential to ensure long-term stable operation of equipment and improve production efficiency.

[0003] In the prior art, publication number CN115147407A discloses a bearing quality detection method based on computer vision, which uses image refinement operation to obtain single-pixel contour lines, divides each single-pixel contour line equally, and obtains the minimum circumscribed rectangle as the ring line segment detection area; calculates the linearity of the ring line segment detection area, and judges the damage of the bearing ring by comparing the linearity with a set threshold and comparing the direction angle mean of the contour line with a set threshold.

[0004] Insufficient existing technology:

[0005] When collecting images for refinement, the noise, uneven lighting and background interference in the image may affect the clarity of the contour and the accuracy of refinement, resulting in incomplete contours or redundant details, and selecting the minimum enclosing rectangle as the ring detection. When the contour shape is complex or has overlapping parts, it is necessary to ensure that the selected enclosing rectangle can accurately surround the ring and not misjudge the non-ring area.

[0006] When setting the thresholds for linearity and angular orientation, it is necessary to fully consider the characteristic differences of different parts of the bearing and possible noise and interference factors. Bearings of different types and specifications may have different geometric shapes and surface features. The straightness of the line segments and the smoothness of the edges must be considered, which is crucial for the accuracy of judging damage. The single threshold detection method may result in misjudgment, resulting in the inability to complete the quality inspection of the bearing.

[0007] Therefore, it is necessary to provide a bearing defect detection method and system based on computer vision to solve the above problems.

[0008] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0009] The purpose of the present invention is to provide a bearing defect detection method and system based on computer vision to solve the problems raised in the above background technology.

[0010] To achieve the above object, the present invention provides the following technical solutions:

[0011] A bearing defect detection method based on computer vision, the specific steps include:

[0012] Step 1: Collect the surface image of the side of the bearing to be evaluated, grayscale the collected surface image and perform denoising to obtain the first recognition image of the inner surface of the bearing, apply the gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal and vertical directions of the first recognition image, perform non-maximum suppression in the two types of gradient directions, and obtain edge pixel points;

[0013] Step 2: Calculate the edge strength of each edge pixel, and set up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combine adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, and segment the first recognition image into defect areas and non-defect areas;

[0014] Step 3: Collect the length of the edge curve of the defect area and calculate the edge curvature corresponding to each edge pixel point. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the shape of the defect area is characterized by the smoothness. The gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel through the local binary pattern to generate a coding number, and the coding number is converted into a texture feature coefficient after the base conversion.

[0015] Step 4: Traverse the grayscale values ​​of all pixels inside the defect area, calculate the grayscale variance of the pixels inside the defect area, and synthesize the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance to generate the bearing defect index;

[0016] Step 5: Compare the generated bearing defect index with the bearing defect threshold. If the bearing defect index is less than the threshold, it indicates that the bearing has no defects. Otherwise, the bearing has defects.

[0017] The length of the edge curve of the defect area is collected and the edge curvature corresponding to each edge pixel is calculated. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the defect area shape characterized by smoothness is specifically based on the following logic:

[0018]

[0019] in, Indicates that the curve length is calculated using a discrete set of points, N represents the total number of discrete points on the edge curve, min{θ[(x t-1 ,y t-1 ), (x t ,y t ), (x t+1 ,y t+1 )]} represents the minimum angle between three adjacent points, x t Represents the horizontal coordinate of the tth point on the edge curve, y t Represents the ordinate of the tth point on the edge curve, (x t-1 ,y t-1 )、(x t+1 ,y t+1 ) represents the coordinates of two adjacent points, represents the edge curvature of the t-th edge pixel, δ represents the shape feature coefficient characterized by smoothness, t is a positive integer, t = 1, 2, 3..., N, N represents the total number of pixels on the edge curve;

[0020] The coding number is generated through the local binary pattern, and the coding number is converted into a texture feature coefficient. The method is based on:

[0021] The neighborhood is defined as the area formed by the cycloid with the central pixel as the center and the neighborhood radius as the cycloid. Eight neighborhood pixels are selected to compare with the gray value of the central pixel. If the neighborhood pixel value is greater than or equal to the gray value of the central pixel, the binary bit at the corresponding position is set to 1, otherwise it is set to 0. The obtained binary string is combined into a binary number in a clockwise direction. After decimal conversion, the texture feature coefficient of the defect area is characterized. The logic is as follows:

[0022]

[0023] Among them, C l represents the gray value of the lth neighborhood pixel, l ranges from 1 to 8, C z Represents the gray value of the center pixel, M bf Represents the texture feature coefficient, M bf (l) represents the judgment value of the grayscale size of the lth neighborhood pixel. bf When (l) = 1, it means that the gray value of the lth neighborhood pixel is greater than the gray value of the central pixel; when Mbf When (l) = 0, it means that the gray value of the lth pixel in the neighborhood is less than the gray value of the central pixel;

[0024] The grayscale variance of the pixels inside the defective area is calculated, and the bearing defect index is generated by using the grayscale variance, shape feature coefficient and texture feature coefficient. The logic is as follows:

[0025]

[0026] Among them, S represents the mean value of the pixel grayscale points in the defect area, V represents the variance of the pixel grayscale in the defect area, and G h Indicates the grayscale value of the hth pixel in the defect area, B ear Indicates the bearing defect index, H represents the total number of pixels in the defect area, h is a positive integer, h = 1, 2, 3..., H, M bf ′ represents the texture coefficient eigenvalue obtained after the binary number is converted to decimal.

[0027] Furthermore, in step 1, a first recognition image of the inner surface of the bearing is obtained according to the method:

[0028] In the bearing surface image, the image area with sparse pixel distribution is smoothed by applying a Gaussian kernel on the image. The radius of the Gaussian kernel is larger than the radius of the pixel in the surface image. When using Gaussian blur, the smoothness of the plane image is retained while removing noise. In the image area with dense pixel distribution, the edge-preserving filter is used to process the image area with dense pixel distribution, remove noise and adjust the smoothness. The density of the image area is judged based on the difference between the grayscale values ​​of the pixels in the horizontal and vertical directions. The formula is:

[0029] Δg(p, q)=|g(p+1, q)-g(p, q)|+|g(p, q+1)-g(p, q)|

[0030]

[0031] Among them, Δg(p, q) represents the grayscale gradient of the image at the pixel point (p, q), g(p+1, q) represents the grayscale value of the pixel point in the p+1th row and qth column in the image, that is, the grayscale value in the horizontal direction; g(p, q+1) represents the grayscale value of the pixel point in the pth row and q+1th column in the image, that is, the grayscale value in the vertical direction, Q g Represents the grayscale threshold.

[0032] Furthermore, in step 2, the edge strength of each edge pixel is calculated according to the following method:

[0033] The Sobel operator is applied to each pixel of the image, where the center of the operator is aligned with the current pixel, and then the corresponding elements are multiplied to obtain the new pixel gray value. The horizontal or vertical direction of each pixel is determined by calculating the edge direction, and the gray values ​​of adjacent pixels in the corresponding direction are compared. If the pixel is not the local maximum in this direction, its gray value is set to 0 to suppress non-edges. The logic is:

[0034]

[0035] Among them, G x Represents the grayscale amplitude of the pixel in the horizontal direction after the operator convolution, G y Represents the grayscale amplitude of the pixel in the vertical direction after operator convolution, a 11 ……a ij is the gray value of the pixel in the horizontal direction, b 11 ……b mn is the gray value of the pixel in the vertical direction, G (x,y) Indicates the edge strength of the pixel, Q θ Indicates the edge direction of the pixel, i, j, m, and n are all positive integers.

[0036] Furthermore, in step 2, the image is segmented into defect areas and non-defect areas according to the following method:

[0037] A dual-threshold detection is established, that is, two gradient thresholds are established to distinguish strong edge pixels from weak edge pixels. The high gradient component threshold is used to mark strong edge pixels, and pixels exceeding this threshold are marked as strong edge pixels; the low gradient component threshold is used to mark weak edge pixels, and pixels below this threshold are marked as weak edge pixels; pixels between the two are marked as non-edge pixels. Starting from the strong edge pixels, the edge tracking technology is used to combine the adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, which is used as a dividing line to distinguish the defect area from the non-defect area, and the detected defect area is classified and identified. The logic is as follows:

[0038]

[0039] Among them, T max 、T min Respectively represent the high gradient component threshold and the low gradient component threshold, G q , G f , G r They represent strong edge pixels, non-edge pixels, and weak edge pixels respectively.

[0040] Further, in step 5, the generated bearing defect index is compared with a threshold value, according to the method:

[0041] The bearing defect threshold is established by analyzing the historical data of normal bearings and bearings known to have defects. If the defect index is less than the threshold, the bearing is considered to have no defects. If the defect index is greater than or equal to the threshold, it indicates that the bearing has defects and needs further inspection or replacement.

[0042] The present invention further provides a bearing defect detection system based on computer vision, wherein the detection system is used to perform the above-mentioned bearing defect detection method, comprising:

[0043] A bearing image acquisition module, wherein the bearing image acquisition module is used to acquire a surface image of the side surface of the bearing to be evaluated, grayscale the acquired surface image and perform denoising to obtain a first identification image of the inner surface of the bearing, apply a gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal direction and the vertical direction of the first identification image, perform non-maximum suppression in two types of gradient directions, and obtain edge pixel points;

[0044] An edge detection module, wherein the edge detection module calculates the edge strength of each edge pixel point, and sets up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combines adjacent strong edge pixels with weak edge pixels connected to them to form a continuous edge curve, and divides the first recognition image into defective areas and non-defective areas;

[0045] An image feature extraction module, wherein the image feature extraction module collects the length of the edge curve of the defect area and calculates the edge curvature corresponding to each edge pixel point, evaluates the smoothness by calculating the average value of the curvature, and characterizes the shape feature coefficient of the shape of the defect area by the smoothness. By using a local binary pattern, the gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel to generate a coding number, and the coding number is converted into a texture feature coefficient after base conversion;

[0046] A bearing defect assessment module, which is used to traverse the grayscale values ​​of all pixels in the defect area, calculate the grayscale variance of the pixels in the defect area, and comprehensively generate a bearing defect index by combining the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance;

[0047] The bearing defect determination module is used to compare the generated bearing defect index with the bearing defect threshold. If the bearing defect index is less than the threshold, it indicates that the bearing has no defects, otherwise, the bearing has defects.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] The present invention can effectively detect the edge of the bearing surface and segment the image into defective areas and non-defective areas by calculating the gradient and suppressing non-maximum values ​​in two types of gradient directions, combined with dual threshold detection and edge connection. This precise edge detection helps to accurately locate defects in a complex bearing surface environment and avoids the misjudgment problem that may occur in a single threshold method.

[0050] The present invention can also comprehensively generate a bearing defect index by calculating edge curvature, aspect ratio, texture feature coefficient and pixel grayscale variance. These features not only take into account the diversity of bearing shapes and surface features, but also take into account the grayscale changes and texture information of the image, thereby improving the comprehensive evaluation capability of bearing defects. This comprehensive feature analysis method can effectively reduce the impact of noise and uneven illumination on the detection results, and improve the accuracy and reliability of quality detection.

[0051] The present invention can better process complex bearing surface images, accurately detect defects, and provide detailed evaluation indicators, which is helpful for quality control and fault diagnosis in the manufacturing industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic diagram of the overall method flow of the present invention.

[0053] Figure 2 It is a schematic diagram of the system module flow of the present invention. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0055] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0056] Example:

[0057] See also Figure 1, a bearing defect detection method based on computer vision, the specific steps include:

[0058] Step 1: Collect the surface image of the side of the bearing to be evaluated, grayscale the collected surface image and perform denoising to obtain the first recognition image of the inner surface of the bearing, apply the gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal and vertical directions of the first recognition image, perform non-maximum suppression in the two types of gradient directions, and obtain edge pixel points;

[0059] Step 2: Calculate the edge strength of each edge pixel, and set up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combine adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, and segment the first recognition image into defect areas and non-defect areas;

[0060] Step 3: Collect the length of the edge curve of the defect area and calculate the edge curvature corresponding to each edge pixel point. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the shape of the defect area is characterized by the smoothness. The gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel through the local binary pattern to generate a coding number, and the coding number is converted into a texture feature coefficient after the base conversion.

[0061] Step 4: Traverse the grayscale values ​​of all pixels inside the defect area, calculate the grayscale variance of the pixels inside the defect area, and synthesize the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance to generate the bearing defect index;

[0062] Step 5: Compare the generated bearing defect index with the bearing defect threshold. If the bearing defect index is less than the threshold, it indicates that the bearing has no defects. Otherwise, the bearing has defects.

[0063] The length of the edge curve of the defect area is collected and the edge curvature corresponding to each edge pixel is calculated. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the defect area shape characterized by smoothness is specifically based on the following logic:

[0064]

[0065] in, Indicates that the curve length is calculated using a discrete set of points, N represents the total number of discrete points on the edge curve, min{θ[(x t-1 ,y t-1 ), (x t ,y t ), (x t+1 ,y t+1 )]} represents the minimum angle between three adjacent points, x tRepresents the horizontal coordinate of the tth point on the edge curve, y t Represents the ordinate of the tth point on the edge curve, (x t-1 ,y t-1 )、(x t+1 ,y t+1 ) represents the coordinates of two adjacent points, represents the edge curvature of the t-th edge pixel, δ represents the shape feature coefficient characterized by smoothness, t is a positive integer, t = 1, 2, 3..., N, N represents the total number of pixels on the edge curve;

[0066] The coding number is generated through the local binary pattern, and the coding number is converted into a texture feature coefficient. The method is based on:

[0067] The neighborhood is defined as the area formed by the cycloid with the central pixel as the center and the neighborhood radius as the cycloid. Eight neighborhood pixels are selected to compare with the gray value of the central pixel. If the neighborhood pixel value is greater than or equal to the gray value of the central pixel, the binary bit at the corresponding position is set to 1, otherwise it is set to 0. The obtained binary string is combined into a binary number in a clockwise direction. After decimal conversion, the texture feature coefficient of the defect area is characterized. The logic is as follows:

[0068]

[0069] Among them, C l represents the gray value of the lth neighborhood pixel, l ranges from 1 to 8, C z Represents the gray value of the center pixel, M bf Represents the texture feature coefficient, M bf (l) represents the judgment value of the grayscale size of the lth neighborhood pixel. bf When (l) = 1, it means that the gray value of the lth neighborhood pixel is greater than the gray value of the central pixel; when M bf When (l) = 0, it means that the gray value of the lth pixel in the neighborhood is less than the gray value of the central pixel;

[0070] The grayscale variance of the pixels inside the defective area is calculated, and the bearing defect index is generated by using the grayscale variance, shape feature coefficient and texture feature coefficient. The logic is as follows:

[0071]

[0072] Among them, S represents the mean value of the pixel grayscale points in the defect area, V represents the variance of the pixel grayscale in the defect area, and G h Indicates the grayscale value of the hth pixel in the defect area, B ear Indicates the bearing defect index, H represents the total number of pixels in the defect area, h is a positive integer, h = 1, 2, 3..., H, Mbf ′ represents the texture coefficient eigenvalue obtained after the binary number is converted to decimal.

[0073] It should be noted that the side surface of the bearing usually refers to the end surface of the outer ring of the bearing and the end surface of the inner ring of the bearing. If the side surface of the bearing is not flat, the alignment of the inner ring, outer ring and axial component cannot be ensured during installation, which may cause uneven force on the bearing, resulting in skewness and tilt. The uneven side surface of the bearing may cause uneven preload or clearance during installation, affecting the running accuracy of the bearing and causing early wear or jamming. Therefore, the flatness of the side surface of the bearing is very important. Maintaining the flatness of the bearing mounting surface and contact surface can not only extend the service life of the bearing, but also ensure the stability and safety of the equipment.

[0074] Therefore, it is necessary to obtain a first recognition image of the inner surface of the bearing, and the method is as follows:

[0075] In the bearing surface image, the image area with sparse pixel distribution is smoothed by applying a Gaussian kernel on the image. The radius of the Gaussian kernel is larger than the radius of the pixel in the surface image. When using Gaussian blur, the smoothness of the plane image is retained while removing noise. In the image area with dense pixel distribution, the edge-preserving filter is used to process the image area with dense pixel distribution, remove noise and adjust the smoothness. The density of the image area is judged based on the difference between the grayscale values ​​of the pixels in the horizontal and vertical directions. The formula is:

[0076] Δg(p, q)=|g(p+1, q)-g(p, q)|+|g(p, q+1)-g(p, q)|

[0077]

[0078] Among them, Δg(p, q) represents the grayscale gradient of the image at the pixel point (p, q), g(p+1, q) represents the grayscale value of the pixel point in the p+1th row and qth column in the image, that is, the grayscale value in the horizontal direction; g(p, q+1) represents the grayscale value of the pixel point in the pth row and q+1th column in the image, that is, the grayscale value in the vertical direction, Q g Represents the grayscale threshold; in the above formula, |g(p+1, q)-g(p, q)| and |g(p, q+1)-g(p, q)| respectively represent the absolute value of the grayscale difference between two adjacent pixels in the vertical and horizontal directions. The larger the difference, the greater the pixel change in that direction, and the more obvious the details of the image in that direction.

[0079] It should be noted that if you want to intuitively and clearly detect the area where the grayscale changes most dramatically in the bearing image, you need to use a suitable gradient operator to calculate two types of directional gradients. This precise gradient calculation helps to accurately locate the edge lines of the bearing surface, thereby improving the accuracy of subsequent defect detection and segmentation. Non-maximum suppression is a commonly used technique for refining the detected edge lines. It ensures that only true edge pixels are retained and removes redundant responses in the gradient image. This prevents the edges from being over-enhanced or breaks on the detected edges, thereby ensuring the accuracy and continuity of the edge detection results.

[0080] Therefore, it is necessary to calculate the edge strength of each edge pixel, and the method is based on:

[0081] The Sobel operator is applied to each pixel of the image, where the center of the operator is aligned with the current pixel, and then the corresponding elements are multiplied to obtain the new pixel gray value. The horizontal or vertical direction of each pixel is determined by calculating the edge direction, and the gray values ​​of adjacent pixels in the corresponding direction are compared. If the pixel is not the local maximum in this direction, its gray value is set to 0 to suppress non-edges. The logic is:

[0082]

[0083] Among them, G x Represents the grayscale amplitude of the pixel in the horizontal direction after the operator convolution, G y Represents the grayscale amplitude of the pixel in the vertical direction after operator convolution, a 11 ……a ij is the gray value of the pixel in the horizontal direction, b 11 ……b mn is the gray value of the pixel in the vertical direction, G (x,y) Indicates the edge strength of the pixel, Q θ Indicates the edge direction of the pixel, i, j, m, and n are all positive integers;

[0084] It should be noted that dual threshold detection converts the gradient image into two categories: strong edge pixels and weak edge pixels, which is a key step in edge connection. Strong edge pixels usually represent higher grayscale changes, while weak edge pixels represent lower grayscale changes but may be part of the real edge. In this way, it is possible to better distinguish between actual defects and noise or subtle changes on the bearing surface.

[0085] Therefore, it is necessary to segment the image into defect areas and non-defect areas, based on the following method:

[0086] A dual-threshold detection is established, that is, two gradient thresholds are established to distinguish strong edge pixels from weak edge pixels. The high gradient component threshold is used to mark strong edge pixels, and pixels exceeding this threshold are marked as strong edge pixels; the low gradient component threshold is used to mark weak edge pixels, and pixels below this threshold are marked as weak edge pixels; pixels between the two are marked as non-edge pixels. Starting from the strong edge pixels, the edge tracking technology is used to combine the adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, which is used as a dividing line to distinguish the defect area from the non-defect area, and the detected defect area is classified and identified. The logic is as follows:

[0087]

[0088] Among them, T max 、T min Respectively represent the high gradient component threshold and the low gradient component threshold, G q , G f , G r They represent strong edge pixels, non-edge pixels, and weak edge pixels respectively.

[0089] It should be noted that by comparing the bearing defect index with the set threshold, the equipment status can be better monitored, the maintenance strategy can be optimized, downtime and maintenance costs can be reduced, and the safety and reliability of the equipment can be improved, making the equipment operation more predictable and reducing the potential risks caused by bearing failures.

[0090] Therefore, the generated bearing defect index needs to be compared with a threshold value, based on the following method:

[0091] The bearing defect threshold is established by analyzing the historical data of normal bearings and bearings known to have defects. If the defect index is less than the threshold, the bearing is considered to have no defects. If the defect index is greater than or equal to the threshold, it indicates that the bearing has defects and needs further inspection or replacement.

[0092] See also Figure 2 The present invention also provides a bearing defect detection system based on computer vision, the detection system is used to perform the above-mentioned bearing defect detection method, including:

[0093] A bearing image acquisition module, wherein the bearing image acquisition module is used to acquire a surface image of the side surface of the bearing to be evaluated, grayscale the acquired surface image and perform denoising to obtain a first identification image of the inner surface of the bearing, apply a gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal direction and the vertical direction of the first identification image, perform non-maximum suppression in two types of gradient directions, and obtain edge pixel points;

[0094] An edge detection module, wherein the edge detection module calculates the edge strength of each edge pixel point, and sets up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combines adjacent strong edge pixels with weak edge pixels connected to them to form a continuous edge curve, and divides the first recognition image into defective areas and non-defective areas;

[0095] An image feature extraction module, wherein the image feature extraction module collects the length of the edge curve of the defect area and calculates the edge curvature corresponding to each edge pixel point, evaluates the smoothness by calculating the average value of the curvature, and characterizes the shape feature coefficient of the shape of the defect area by the smoothness. By using a local binary pattern, the gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel to generate a coding number, and the coding number is converted into a texture feature coefficient after base conversion;

[0096] A bearing defect assessment module, which is used to traverse the grayscale values ​​of all pixels in the defect area, calculate the grayscale variance of the pixels in the defect area, and comprehensively generate a bearing defect index by combining the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance;

[0097] The bearing defect determination module is used to compare the generated bearing defect index with the bearing defect threshold. If the bearing defect index is less than the threshold, it indicates that the bearing has no defects, otherwise, the bearing has defects.

[0098] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0099] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0101] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A bearing defect detection method based on computer vision, characterized in that: The specific steps include: Step 1: Collect the surface image of the side of the bearing to be evaluated, grayscale the collected surface image and perform denoising to obtain the first recognition image of the inner surface of the bearing, apply the gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal and vertical directions of the first recognition image, perform non-maximum suppression in the two types of gradient directions, and obtain edge pixel points; Step 2: Calculate the edge strength of each edge pixel, and set up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combine adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, and segment the first recognition image into defect areas and non-defect areas; Step 3: Collect the length of the edge curve of the defect area and calculate the edge curvature corresponding to each edge pixel point. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the shape of the defect area is characterized by the smoothness. The gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel through the local binary pattern to generate a coding number, and the coding number is converted into a texture feature coefficient after the base conversion. Step 4: Traverse the grayscale values ​​of all pixels inside the defect area, calculate the grayscale variance of the pixels inside the defect area, and synthesize the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance to generate the bearing defect index; Step 5: Compare the generated bearing defect index with the bearing defect threshold. If the bearing defect index is less than the threshold, it indicates that the bearing has no defects. Otherwise, the bearing has defects. The length of the edge curve of the defect area is collected and the edge curvature corresponding to each edge pixel is calculated. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the defect area shape characterized by smoothness is specifically based on the following logic: in, Indicates that the curve length is calculated using a discrete set of points, N represents the total number of discrete points on the edge curve, min{θ[(x t-1 ,y t-1 ), (x t ,y t ), (x t+1 ,y t+1 )]} represents the minimum angle between three adjacent points, x t Represents the horizontal coordinate of the tth point on the edge curve, y t Represents the ordinate (x t-1 ,y t-1 )、(x t+1 ,y t+1 ) represents the coordinates of two adjacent points, represents the edge curvature of the t-th edge pixel, δ represents the shape feature coefficient characterized by smoothness, t is a positive integer, t = 1, 2, 3..., N, N represents the total number of pixels on the edge curve; The coding number is generated through the local binary pattern, and the coding number is converted into a texture feature coefficient. The method is based on: The neighborhood is defined in the cycloid formation area with the central pixel as the center and the neighborhood radius as the cycloid. Eight neighborhood pixels are selected to compare with the grayscale value of the central pixel. If the neighborhood pixel value is greater than or equal to the grayscale value of the central pixel, the binary bit at the corresponding position is set to 1, otherwise it is set to 0. The obtained binary string is combined clockwise into a binary number. After decimal conversion, the texture feature coefficient of the defect area is represented. The logic is as follows: Among them, C l represents the gray value of the lth neighborhood pixel, l ranges from 1 to 8, C z Represents the gray value of the center pixel, M bf Represents the texture feature coefficient, M bf (l) represents the judgment value of the grayscale size of the lth neighborhood pixel. bf When (l) = 1, it means that the gray value of the lth neighborhood pixel is greater than the gray value of the central pixel; when M bf When (l) = 0, it means that the gray value of the lth pixel in the neighborhood is less than the gray value of the central pixel; The grayscale variance of the pixels inside the defective area is calculated, and the bearing defect index is generated by using the grayscale variance, shape feature coefficient and texture feature coefficient. The logic is as follows: Among them, S represents the mean value of the pixel grayscale points in the defect area, V represents the variance of the pixel grayscale in the defect area, and G h Indicates the grayscale value of the hth pixel in the defect area, B ear Indicates the bearing defect index, H represents the total number of pixels in the defect area, h is a positive integer, h = 1, 2, 3..., H, M bf ′ represents the texture feature coefficient value obtained after the binary number is converted into decimal.

2. A bearing defect detection method based on computer vision according to claim 1, characterized in that: The first recognition image of the inner surface of the bearing is obtained according to the method: In the bearing surface image, the image area with sparse pixel distribution is smoothed by applying a Gaussian kernel on the image. The radius of the Gaussian kernel is larger than the radius of the pixel in the surface image. When using Gaussian blur, the smoothness of the plane image is retained while removing noise. In the image area with dense pixel distribution, the edge-preserving filter is used to process the image area with dense pixel distribution, remove noise and adjust the smoothness. The density of the image area is judged based on the difference between the grayscale values ​​of the pixels in the horizontal and vertical directions. The formula is: Δg(p, q)=|g(p+1, q)-g(p, q)|+|g(p, q+1)-g(p, q)| Where Δg(p, q) represents the grayscale gradient of the image at the pixel point (p, q), g(p+1, q) represents the grayscale value of the pixel point in the p+1th row and qth column of the image; g(p, q+1) represents the grayscale value of the pixel point in the pth row and q+1th column of the image, Q g Represents the grayscale threshold.

3. The method for bearing defect detection based on computer vision according to claim 1, characterized in that: The edge strength of each edge pixel is calculated based on the following method: The Sobel operator is applied to each pixel of the image, where the center of the operator is aligned with the current pixel, and then the corresponding elements are multiplied to obtain the new pixel gray value. The horizontal or vertical direction of each pixel is determined, and the gray values ​​of adjacent pixels in the corresponding direction are compared. If the pixel is not the local maximum in this direction, its gray value is set to 0 to suppress non-edges. The logic is: Among them, G x Represents the grayscale amplitude of the pixel in the horizontal direction after the operator convolution, G y Represents the grayscale amplitude of the pixel in the vertical direction after operator convolution, a 11 ……a ij is the gray value of the pixel in the horizontal direction, b 11 ……b mn is the gray value of the pixel in the vertical direction, G (x,y) Indicates the edge strength of the pixel, Q θ Indicates the edge direction of the pixel, i, j, m, and n are all positive integers.

4. A bearing defect detection method based on computer vision according to claim 3, characterized in that: The image is segmented into defective and non-defective areas based on the following method: A dual-threshold detection is established, that is, two gradient thresholds are established to distinguish strong edge pixels from weak edge pixels. The high gradient component threshold is used to mark strong edge pixels, and pixels exceeding this threshold are marked as strong edge pixels; the low gradient component threshold is used to mark weak edge pixels, and pixels below this threshold are marked as weak edge pixels; pixels between the two are marked as non-edge pixels. Starting from the strong edge pixels, the edge tracking technology is used to combine the adjacent strong edge pixels with the weak edge pixels connected to them to form a continuous edge curve, which is used as a dividing line to distinguish the defect area from the non-defect area, and the detected defect area is classified and identified. The logic is as follows: Among them, T max , T min Respectively represent the high gradient component threshold and the low gradient component threshold, G q , G f , G r They represent strong edge pixels, non-edge pixels, and weak edge pixels respectively.

5. The method for bearing defect detection based on computer vision according to claim 1, characterized in that: The resulting bearing defect index is compared to a threshold value based on the following method: The bearing defect threshold is established by analyzing the historical data of normal bearings and bearings known to have defects. If the defect index is less than the threshold, the bearing is considered to have no defects. If the defect index is greater than or equal to the threshold, it indicates that the bearing has defects and needs further inspection or replacement.

6. A bearing defect detection system based on computer vision, the detection system being used to execute the bearing defect detection method according to any one of claims 1 to 5, comprising: A bearing image acquisition module, wherein the bearing image acquisition module is used to acquire a surface image of the side surface of the bearing to be evaluated, grayscale the acquired surface image and perform denoising to obtain a first identification image of the inner surface of the bearing, apply a gradient operator to calculate the gradient component amplitude of the grayscale value in the horizontal direction and the vertical direction of the first identification image, perform non-maximum suppression in two types of gradient directions, and obtain edge pixel points; An edge detection module, wherein the edge detection module calculates the edge strength of each edge pixel point, and sets up a double threshold detection to differentiate strong edge pixels and weak edge pixels, combines adjacent strong edge pixels with weak edge pixels connected to them to form a continuous edge curve, and divides the first recognition image into defective areas and non-defective areas; An image feature extraction module, wherein the image feature extraction module collects the length of the edge curve of the defect area and calculates the edge curvature corresponding to each edge pixel point, evaluates the smoothness by calculating the average value of the curvature, and characterizes the shape feature coefficient of the shape of the defect area by the smoothness. By using a local binary pattern, the gray value of the central pixel in the defect area is compared with the gray value of each neighboring pixel to generate a coding number, and the coding number is converted into a texture feature coefficient after base conversion; A bearing defect assessment module, which is used to traverse the grayscale values ​​of all pixels in the defect area, calculate the grayscale variance of the pixels in the defect area, and comprehensively generate a bearing defect index by combining the obtained shape feature coefficient, texture feature coefficient and pixel grayscale variance; A bearing defect determination module, wherein the bearing defect determination module is used to compare the generated bearing defect index with a bearing defect threshold value. If the bearing defect index is less than the threshold value, it indicates that the bearing has no defect; otherwise, the bearing has a defect; The length of the edge curve of the defect area is collected and the edge curvature corresponding to each edge pixel is calculated. The smoothness is evaluated by calculating the average value of the curvature. The shape characteristic coefficient of the defect area shape characterized by smoothness is specifically based on the following logic: in, Indicates that the curve length is calculated using a discrete set of points, N represents the total number of discrete points on the edge curve, min{θ[(x t-1 ,y t-1 ), (x t ,y t ), (x t+1 ,y t+1 )]} represents the minimum angle between three adjacent points, x t Represents the horizontal coordinate of the tth point on the edge curve, y t Represents the ordinate (x t-1 ,y t-1 )、(x t+1 ,y t+1 ) represents the coordinates of two adjacent points, represents the edge curvature of the t-th edge pixel, δ represents the shape feature coefficient characterized by smoothness, t is a positive integer, t = 1, 2, 3..., N, N represents the total number of pixels on the edge curve; The coding number is generated through the local binary pattern, and the coding number is converted into a texture feature coefficient. The method is based on: The neighborhood is defined as the area formed by the cycloid with the central pixel as the center and the neighborhood radius as the cycloid. Eight neighborhood pixels are selected to compare with the gray value of the central pixel. If the neighborhood pixel value is greater than or equal to the gray value of the central pixel, the binary bit at the corresponding position is set to 1, otherwise it is set to 0. The obtained binary string is combined into a binary number in a clockwise direction. After decimal conversion, the texture feature coefficient of the defect area is characterized. The logic is as follows: Among them, C l represents the gray value of the lth neighborhood pixel, l ranges from 1 to 8, C z Represents the gray value of the center pixel, M bf Represents the texture feature coefficient, M bf (l) represents the judgment value of the grayscale size of the lth neighborhood pixel. bf When (l) = 1, it means that the gray value of the lth neighborhood pixel is greater than the gray value of the central pixel; when M bf When (l) = 0, it means that the gray value of the lth pixel in the neighborhood is less than the gray value of the central pixel; The grayscale variance of the pixels inside the defective area is calculated, and the bearing defect index is generated by using the grayscale variance, shape feature coefficient and texture feature coefficient. The logic is as follows: Among them, S represents the mean value of the pixel grayscale points in the defect area, V represents the variance of the pixel grayscale in the defect area, and G h Indicates the grayscale value of the hth pixel in the defect area, B ear Indicates the bearing defect index, H represents the total number of pixels in the defect area, h is a positive integer, h = 1, 2, 3..., H, M bf ′ represents the texture feature coefficient value obtained after the binary number is converted into decimal.

Citation Information

Patent Citations

  • Bearing quality detection method based on computer vision

    CN115147407A

  • Machine vision detection device and method for steel rail surface discrete defects

    CN107618533A

  • Food packaging defect sample generation method based on custom algorithm

    CN114820556A