Bearing roller defect detection system and method based on image processing
Patent Information
- Application Number
- CN202611126082.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-20
AI Technical Summary
该类方案未能有效识别滚子的几何结构,无法将端面与弧面区域自动分离,导致端面压痕和弧面划伤的响应特征相互干扰,降低了缺陷类型判别的准确性
利用表面图像灰度梯度方向在极坐标下的方向角分布序列检测角点突变位置,以突变位置对应的极径值作为分割半径截取滚子端面区域和滚子弧面区域。这一方式借助滚子圆形端面与柱面弧面在极坐标中梯度方向变化的差异,自动定位端面与弧面的几何边界,无需预先设定固定位置或模板,对滚子图像中的平移、旋转具有不变性。角点突变标记的环形分割带还允许在分割边界两侧引入像素容差,克服轮廓模糊产生的分割偏差,从而在源头上为端面压痕特征和弧面划伤特征的独立提取提供准确的空间分离,避免了因区域混合而造成的特征失真。
Smart Images

Figure REF-OBJ-1785222531622-000006 
Figure REF-OBJ-1785222531622-000059 
Figure REF-OBJ-1785222531622-000088
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a bearing roller defect detection system and method based on image processing. Background Technology
[0002] Bearing rollers are the core components of rolling bearings, and their surface quality directly affects the bearing's operational accuracy and service life. During the production process, indentations and pits are easily formed on the roller end faces, and axial scratches are easily formed on the curved surfaces. These two types of defects often coexist in a single surface image and have similar shapes, posing challenges to automated inspection. Existing bearing roller defect detection methods mostly rely on manual visual inspection or threshold segmentation methods based on conventional image processing. Conventional image processing methods typically perform global feature extraction on the entire image and use edge detection, texture analysis, and other means to directly determine whether anomalies exist. This type of approach fails to effectively identify the roller's geometry and cannot automatically separate the end face and curved surface regions, leading to mutual interference between the response features of end face indentations and curved surface scratches, reducing the accuracy of defect type identification. Some technologies achieve end face and curved surface segmentation by using preset template matching or fixed-position bounding boxes, but rollers undergo attitude deflection and radial offset during imaging, making it difficult for preset templates to adapt to positional changes, resulting in region segmentation errors and insufficient reliability of subsequent feature extraction. In the defect classification stage, existing methods often rely solely on isolated features of a single region or simple shape descriptors. When indentations and scratches overlap in grayscale and shape, they fail to effectively distinguish defect categories, leading to frequent misclassifications. Therefore, a detection method is needed that can adaptively separate the roller end face and curved surface regions in an image and fuse features from multiple regions to achieve accurate defect classification. Summary of the Invention
[0003] This paper presents a bearing roller defect detection system and method based on image processing. By using polar coordinate mapping in the gray-scale gradient direction and corner abrupt change localization, the system adaptively segments the roller end face region and the arc surface region to eliminate the interference of region aliasing on feature extraction. The system uses the numerical interval overlap relationship between the end face indentation feature value and the arc surface scratch feature value to determine the suspected defect region. Combined with the morphological direction decomposition in the local contrast expansion direction, the system can accurately identify indentation, scratch and mixed morphological defects, thereby improving the automation level and discrimination accuracy of bearing roller defect detection.
[0004] To achieve the above objectives, the present invention provides the following technical solution: Summary of the Invention This invention provides a bearing roller defect detection method based on image processing, comprising: acquiring a surface image of the bearing roller; mapping the gray-level gradient direction of the surface image into an angular distribution sequence in polar coordinates to convert two-dimensional directional information into an ordered sequence, thereby enhancing the sensitivity to changes in the roller profile; based on the abrupt change positions of corner points in the angular distribution sequence, cropping the roller end face region and the roller arc surface region from the surface image to achieve automatic separation of the end face and the arc surface; extracting the closed edge loop of the roller end face region, obtaining the circumferential gray-level projection curve of the closed edge loop, and determining the end face indentation feature value based on the peak-valley fluctuation amplitude of the circumferential gray-level projection curve to stably characterize the undulation of the indentation; extracting the axial gray-level stripes of the roller arc surface region, and statistically analyzing the spacing variation of the axial gray-level stripes. Based on the rate of change of spacing and the rate of change of width, the characteristic value of arc surface scratch is determined, thereby effectively reflecting the texture distortion caused by scratches; according to the overlapping relationship of the numerical intervals of the end face indentation characteristic value and the arc surface scratch characteristic value, the suspected defect area is divided from the surface image, and the potential location of the defect is accurately locked by the common constraint of the two defect features; the local contrast expansion direction of the suspected defect area is obtained, and the morphological direction decomposition of the suspected defect area is performed according to the local contrast expansion direction to obtain the gray-level accumulation on each directional component, so as to highlight the extension characteristics of the defect; according to the ratio relationship of the gray-level accumulation on each directional component, the defect category identifier of the suspected defect area is determined, and the defect category identifier is output to realize the automated and fine classification of surface defects of bearing rollers.
[0005] As a preferred embodiment of the present invention, the process of mapping the gray-level gradient direction of the surface image into an angular distribution sequence in polar coordinates includes: establishing a polar coordinate system with the center point of the surface image as the pole, calculating the gray-level gradient direction angle of each pixel in the surface image; mapping the gray-level gradient direction angle to the polar angle interval of the polar coordinate system, arranging the mapped direction angles of each pixel in ascending order of polar radius, to obtain the angular distribution sequence. By calculating the difference between two adjacent mapped direction angles in the angular distribution sequence, the sequence positions where the difference is greater than a preset jump threshold are marked as corner abrupt change positions; using the polar radius corresponding to the corner abrupt change position as the segmentation radius, the region in the surface image with a polar radius smaller than the segmentation radius is cut off as the roller end face region, and the region with a polar radius larger than the segmentation radius is cut off as the roller arc surface region. This scheme can reliably distinguish the boundary between the roller end face and the arc surface, with high region separation accuracy. Furthermore, the segmentation radius is centered on the polar radius value corresponding to the corner abrupt change position, and is extended to both sides by a preset pixel tolerance range to form an annular segmentation band. The inner boundary of the annular segmentation band is used to cut off the roller end face area, and the outer boundary is used to cut off the roller arc surface area, so as to avoid segmentation deviation caused by edge transition.
[0006] When determining the feature value of the end face indentation, edge detection is performed on the roller end face region to extract the gradient closed boundary as the closed edge loop; along the circumferential direction of the closed edge loop, the gray values of each pixel on the closed edge loop are accumulated to obtain the circumferential gray-scale projection curve; local maxima and local minima are extracted from the circumferential gray-scale projection curve, and the difference between the local maxima and the adjacent local minima is calculated as the peak-valley fluctuation amplitude. The average of all peak-valley fluctuation amplitudes is used as the feature value of the end face indentation. The obtained feature value has a stable quantification ability for the depth and distribution of indentation defects.
[0007] When determining the feature value of arc surface scratches, the arc surface region of the roller is segmented by grayscale binarization along the axial direction. Continuous dark stripes with grayscale values lower than the global grayscale mean are extracted as the axial grayscale stripes. The distance between the center lines of two adjacent axial grayscale stripes is measured as the stripe spacing, and the pixel width between the two edges of a single axial grayscale stripe is measured as the stripe width. The ratio of the variance to the mean of all adjacent stripe spacings is calculated as the spacing change rate, and the ratio of the variance to the mean of all stripe widths is calculated as the width change rate. The weighted sum of the spacing change rate and the width change rate is used as the feature value of the arc surface scratch, which can highly sensitively reflect the damage to texture consistency caused by arc surface scratches.
[0008] When dividing the suspected defect area, the first numerical interval corresponding to the end face indentation feature value and the second numerical interval corresponding to the arc surface scratch feature value are obtained, and the intersection interval of the first numerical interval and the second numerical interval is calculated. If the intersection interval is not empty, the pixels in the surface image whose end face indentation feature value falls into the intersection interval and the pixels whose arc surface scratch feature value falls into the intersection interval are merged into a candidate pixel set. The smallest bounding rectangle of the candidate pixel set is defined as the suspected defect area. The detection completeness and positioning accuracy of the defect area are improved by feature overlap constraint.
[0009] During the morphological decomposition process, the contrast value of each pixel within the suspected defect region is calculated. Pixels with contrast values higher than the region's average contrast value are selected as high-contrast points. The principal inertial axis direction of all high-contrast points is calculated as the local contrast expansion direction. Using the local contrast expansion direction as the reference direction, the suspected defect region is projected onto the orthogonal decomposition direction of the reference direction and the decomposition direction at a 45-degree angle to the reference direction, respectively, to obtain a first projection sequence and a second projection sequence. The grayscale values of the first projection sequence and the second projection sequence are accumulated to obtain the grayscale accumulation in the reference direction and the grayscale accumulation in the 45-degree decomposition direction, respectively. Through local decomposition, the energy distribution of defects in different directions can be highlighted.
[0010] When determining the defect category identifier, the ratio of the accumulated grayscale value in the reference direction to the accumulated grayscale value in the 45-degree decomposition direction is calculated. When the ratio is greater than a first classification threshold, the defect category identifier is determined to be an axial scratch; when the ratio is less than a second classification threshold, the defect category identifier is determined to be an indentation / dentation; when the ratio is between the second classification threshold and the first classification threshold, the defect category identifier is determined to be a mixed-morphology category. This allows for the automatic differentiation of axial scratches, indentations / dents, and mixed-morphology defects, improving the accuracy and practicality of classification.
[0011] This invention also provides a bearing roller defect detection system based on image processing, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned image processing-based bearing roller defect detection method. This system utilizes machine vision and image processing techniques to automatically detect and classify defects such as end face indentations and arc surface scratches on bearing rollers online, offering advantages such as high detection efficiency, good consistency, and precise classification.
[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: The method detects abrupt corner changes by utilizing the angular distribution sequence of the grayscale gradient direction in polar coordinates of the surface image. The polar radius corresponding to the abrupt change location is used as the segmentation radius to truncate the roller end face and the roller arc surface region. This approach automatically locates the geometric boundaries of the end face and arc surface by leveraging the difference in gradient direction changes between the circular end face and the cylindrical arc surface in polar coordinates, without requiring pre-set fixed positions or templates, and is invariant to translations and rotations in the roller image. The annular segmentation band marked by corner abrupt changes also allows for the introduction of pixel tolerance on both sides of the segmentation boundary, overcoming segmentation deviations caused by contour blurring. This provides accurate spatial separation for the independent extraction of end face indentation features and arc surface scratch features at the source, avoiding feature distortion caused by region mixing.
[0013] Using the overlap between the numerical ranges of end-face indentation feature values and arc-surface scratch feature values as a screening criterion, candidate pixel sets exhibiting both indentation and scratch responses are extracted from the surface image to define suspected defect areas. Based on this, the principal inertial axis of high-contrast points within the suspected defect area is calculated as the local contrast expansion direction. Morphological decomposition is then performed in orthogonal and 45-degree directions using this direction as a reference, obtaining the grayscale accumulation in different directional components. The ratio between directional components directly corresponds to the morphological orientation characteristics of the defect: axial scratches have concentrated energy along the reference direction, resulting in a higher ratio; indentations have weak directionality, resulting in a lower ratio; ratios in between indicate mixed morphologies. This method, which first locates defects by the overlap of end-face and arc-surface features and then classifies them based on contrast direction decomposition, effectively integrates feature information from different regions. It can robustly distinguish between indentation and scratch defects without relying on classifier training, reducing the probability of misreporting indentations as scratches or missing mixed morphologies. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0015] Figure 1 This is a flowchart of a bearing roller defect detection method based on image processing; Figure 2 This is a flowchart for calculating the characteristic values of roller arc surface scratches; Figure 3 This is a schematic diagram of the axial grayscale stripes and global grayscale mean in the roller arc surface area; Figure 4 It is the cumulative grayscale curve of the local contrast expansion direction of the suspected defect area and the determination of the defect category. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] See Figure 1This invention provides a bearing roller defect detection method based on image processing, comprising: acquiring a surface image of the bearing roller; mapping the gray-level gradient direction of the surface image into an angular distribution sequence in polar coordinates; extracting the roller end face region and roller arc surface region from the surface image based on the abrupt change positions of the corner points in the angular distribution sequence; extracting the closed edge loop of the roller end face region, obtaining the circumferential gray-level projection curve of the closed edge loop, and determining the end face indentation feature value based on the peak-valley fluctuation amplitude of the circumferential gray-level projection curve; extracting the axial gray-level stripes of the roller arc surface region, statistically analyzing the spacing change rate and width change rate of the axial gray-level stripes, and determining the arc surface scratch feature value based on the spacing change rate and width change rate; dividing the suspected defect region from the surface image based on the overlapping relationship of the numerical intervals of the end face indentation feature value and the arc surface scratch feature value; acquiring the local contrast expansion direction of the suspected defect region, performing morphological direction decomposition on the suspected defect region based on the local contrast expansion direction, and obtaining the gray-level accumulation amount on each directional component; determining the defect category identifier of the suspected defect region based on the ratio relationship of the gray-level accumulation amount on each directional component, and outputting the defect category identifier.
[0018] Example 1:
[0019] In practical implementation, a polar coordinate system is established with the center point of the surface image as the pole. The center point of the surface image is determined by calculating the geometric center of the surface image, specifically by taking the pixel position corresponding to half the number of pixels in the width direction and half the number of pixels in the height direction of the surface image as the pole. The gray-level gradient direction angle of each pixel in the surface image is calculated. Optionally, the Sobel operator is used to calculate the gray-level gradient of each pixel along the horizontal direction. and grayscale gradient along the vertical direction ,in Represents the row and column coordinates of a pixel in the surface image. Gray-level gradient direction angle. Calculate using the following formula:
[0020] in, Represents pixels The horizontal gray-level gradient at that location Represents pixels The vertical grayscale gradient at that location. Represents the arctangent function. The range of values is ,according to and The positive and negative combination relationship will Mapped to The grayscale gradient direction angle of each pixel is obtained from the interval.
[0021] Map the grayscale gradient direction angle to the polar angle interval of the polar coordinate system. The polar angle interval of the polar coordinate system is set to... For each pixel, the Euclidean distance from that pixel to the pole is calculated as the polar radius. Calculate the azimuth angle of the pixel relative to the pole as the polar angle. The grayscale gradient direction angle is used as the mapping direction angle and assigned to the corresponding pixel, establishing a correspondence between the epipolar radius and the mapping direction angle. Following the increasing order of epipolar radius, the mapping direction angles of all pixels are arranged into a one-dimensional sequence, resulting in the direction angle distribution sequence, denoted as [equation missing]. ,in For sequence indexing, numbering starts from 1. Indicates the first in the sequence One mapping direction angle.
[0022] Calculate the difference between two adjacent mapped direction angles in the direction angle distribution sequence. For the sequence index... and Calculate the difference Each calculated difference is compared with a preset jump threshold. The preset jump threshold is set as the arithmetic mean of all differences plus twice the standard deviation. Sequence positions with differences greater than the preset jump threshold are marked as corner mutation positions. The corner mutation position is represented by the sequence index corresponding to the previous mapping direction angle, and the extreme radius value of the pixel corresponding to that index is recorded as the corner mutation extreme radius value.
[0023] Centered on the corner abrupt change extreme diameter value, a first width of a preset pixel tolerance range is expanded in the direction of decreasing radius, and a second width of the preset pixel tolerance range is expanded in the direction of increasing radius, forming an annular segmentation band. The preset pixel tolerance range is 3 pixels. The extreme diameter value corresponding to the inner boundary of the annular segmentation band is the corner abrupt change extreme diameter value minus the first width, and the extreme diameter value corresponding to the outer boundary of the annular segmentation band is the corner abrupt change extreme diameter value plus the second width. The roller end face region is intercepted by the inner boundary of the annular segmentation band, that is, the region formed by all pixels in the surface image whose extreme diameter is smaller than the extreme diameter value corresponding to the inner boundary is taken as the roller end face region. The roller arc surface region is intercepted by the outer boundary of the annular segmentation band, that is, the region formed by all pixels in the surface image whose extreme diameter is larger than the extreme diameter value corresponding to the outer boundary is taken as the roller arc surface region.
[0024] Example 2:
[0025] In the specific implementation, edge detection is performed on the roller end face region. Optionally, the Canney edge detection operator is used. Gaussian smoothing filtering is applied to the roller end face region, and the gradient magnitude and gradient direction of each pixel in the filtered roller end face region are calculated. Non-maximum suppression is applied to the gradient magnitude, retaining local maxima points in the gradient direction. High and low thresholds are set. The high threshold is the gradient magnitude corresponding to the cumulative percentile of the gradient magnitude histogram in the roller end face region reaching 90%, and the low threshold is half of the high threshold. Starting from the pixels with gradient magnitudes higher than the high threshold, pixels with gradient magnitudes higher than the low threshold and connected to the already tracked pixels are traced to form edge segments. Edge segments with endpoint spacing less than 5 pixels and absolute gradient direction difference less than 30 degrees are connected to extract closed gradient closure boundaries as closed edge loops. If multiple gradient closure boundaries exist, the gradient closure boundary that forms the largest area and is approximately circular is selected as the closed edge loop.
[0026] Along the circumferential direction of the closed edge ring, obtain the position coordinates of each pixel on the closed edge ring. Taking the geometric center point of the closed edge ring as the reference point, calculate the polar angle of each pixel on the closed edge ring relative to the reference point, and sort the pixels in ascending order of polar angle to obtain the circumferential pixel sequence. The circumferential direction is defined as traversing one revolution of the closed edge ring along the direction of increasing polar angle. Extract the original grayscale values of each pixel in the circumferential pixel sequence sequentially to form a one-dimensional grayscale sequence. Perform a moving average smoothing process on the one-dimensional grayscale sequence, with the sliding window width set to 5 pixels to eliminate high-frequency noise in the grayscale values. The smoothed one-dimensional grayscale sequence is the circumferential grayscale projection curve, denoted as [missing information - likely a typo]. ,in For sampling indices along the circumferential direction, , This represents the total number of pixels in the circumferential pixel sequence. Indicates the first The smoothed grayscale value corresponding to each sampling point.
[0027] From the circumferential grayscale projection curve Local maxima and local minima are extracted. In specific implementation, the sampling index is traversed. From 2 to ,like and Then the sampling index will be The corresponding location is marked as a local maximum point, and the local maximum is recorded. ;like and Then the sampling index will be The corresponding location is marked as a local minimum point, and the local minimum value is recorded. All extracted local maxima are arranged in cyclic order as follows: ,in , Indicates the first A local maximum, This represents the total number of local maxima. All extracted local minima are arranged in cyclic order as follows: ,in , Indicates the first A local minimum, This represents the total number of local minima.
[0028] Optionally, peak-valley pairs are constructed based on the alternating occurrence of local maxima and local minima in the circumferential pixel sequence. Starting from the circumferential origin, using the first encountered local extremum type as a reference, if a local maxima is encountered first, then each adjacent local maxima and local minima are paired into a peak-valley pair in an alternating order of local maxima-local minima-local maxima; if a local minima is encountered first, then each adjacent local minima is paired into a local maxima in an alternating order of local minima-local maxima-local minima. The difference between the local maxima and the adjacent local minima is then taken as the peak-valley fluctuation amplitude. The absolute value of the difference between the local maxima and local minima in all formed peak-valley pairs is taken as the peak-valley fluctuation amplitude, resulting in a set of peak-valley fluctuation amplitudes. , , This represents the total number of peak-valley pairs. The average amplitude of all peak-valley fluctuations is calculated and used as the characteristic value of the end-face indentation. The calculation formula is:
[0029] in, Indicates the characteristic value of the end face indentation. This represents the total number of peak-valley pairs. Indicates the first The peak-valley fluctuation amplitude corresponding to a peak-valley pair is the absolute value of the difference between the local maximum and local minimum values in that peak-valley pair.
[0030] Example 3:
[0031] In specific implementation, please refer to Figure 2The roller arc surface region is segmented along the axial direction using grayscale binarization. The axial direction is defined as the major axis of the roller arc surface region, determined by calculating the minimum bounding rectangle of the region and extracting the direction vector of the major side. The grayscale values of all pixels within the roller arc surface region are calculated, and the arithmetic mean of these values is taken as the global grayscale mean. The grayscale value of each pixel within the roller arc surface region is compared with the global grayscale mean. If a pixel's grayscale value is lower than the global grayscale mean, it is marked as a dark pixel; otherwise, it is marked as a bright pixel, resulting in the binarized segmentation result.
[0032] In the binarized segmentation results, continuous dark stripes with gray values lower than the global gray mean are extracted as axial gray stripes. Optionally, a connected component analysis method is used to extract axial gray stripes, identifying regions marked as dark pixels in the binarized segmentation results and continuously or approximately continuously distributed along the axial direction as dark stripe connected regions. Morphological skeleton extraction is performed on each extracted dark stripe connected region to obtain its centerline. The axial projection length of the centerline of the dark stripe connected region is used as the criterion for determining the length of the axial gray stripes. Dark stripe connected regions whose axial projection length of the centerline is less than 5% of the total axial length of the roller arc surface region are removed, and the remaining dark stripe connected regions are retained as axial gray stripes.
[0033] The distance between the centerlines of two adjacent axial grayscale fringes is measured as the fringe spacing. For all axial grayscale fringes, they are arranged sequentially according to the position of their centerlines in the axial direction. The average spacing between the centerlines of two adjacent axial grayscale fringes in the direction perpendicular to the axial direction is calculated, and this average spacing is taken as the fringe spacing between two adjacent axial grayscale fringes. Let the ... The fringe spacing of adjacent axial grayscale fringes is denoted as , ,in Let be the total number of axial grayscale fringes. The pixel width between the two edges of a single axial grayscale fringe is measured as the fringe width. For each axial grayscale fringe, the pixel distance between the two edges perpendicular to the center line is measured at equally spaced sampling points along the center line direction. The arithmetic mean of these pixel distances is taken as the fringe width of a single axial grayscale fringe. Let the ... The width of an axial grayscale stripe is denoted as , .
[0034] The ratio of the variance to the mean of the spacing between all adjacent fringes is calculated as the rate of change of spacing. The mean of the fringe spacing is also calculated. Calculate the variance of the fringe spacing. Spacing change rate ,in Indicates the first The fringe spacing of adjacent axial grayscale fringes, Indicates the number of adjacent stripe spacings. This represents the mean of the stripe spacing. This represents the standard deviation of the stripe spacing.
[0035] The ratio of the variance to the mean of all stripe widths is calculated as the rate of change of width. The mean of the stripe widths is also calculated. Calculate the variance of the stripe width. Width change rate ,in Indicates the first The stripe width of the axial grayscale stripes. This indicates the total number of axial grayscale stripes. This represents the average stripe width. The standard deviation of the stripe width.
[0036] The weighted sum of the spacing change rate and the width change rate is used as the characteristic value of the arc surface scratch. The calculation formula is:
[0037] in, Indicates the characteristic value of arc surface scratches. This represents the weighting coefficient for the rate of change of spacing, with a value ranging from 0.4 to 0.6. The specific value is determined based on the importance of the spacing dispersion of adjacent axial grayscale stripes in characterizing scratch defects. This represents the weighting coefficient for the width change rate, with a value ranging from 0.4 to 0.6, and satisfying the following conditions: . Indicates the rate of change of spacing. This indicates the rate of width change. When the unevenness of the axial grayscale stripe spacing contributes significantly to the detection of scratch defects, it will... Set to 0.6, Set to 0.4; when the variation in stripe width contributes significantly to the detection of scratch defects, set... Set to 0.4, Set it to 0.6.
[0038] See Figure 3In the graph, the horizontal axis represents the axial position of the roller's curved surface area, in pixels; the vertical axis represents the grayscale value at the corresponding position, ranging from 0 to 200. The blue solid curve is the grayscale value curve obtained by sampling along the axial direction, exhibiting obvious periodic fluctuations, with grayscale values varying between approximately 60 and 200. Peak areas with higher grayscale values correspond to bright pixels, while valley areas with lower grayscale values correspond to dark pixels. Light red blocks mark the distribution range of axial grayscale stripes; these areas correspond to the troughs of the grayscale curve, displayed as continuous dark stripes with grayscale values lower than the global grayscale mean. The black dashed line represents the global grayscale mean of the roller's curved surface area, approximately 140, which serves as a threshold to divide the grayscale curve into dark and bright pixels.
[0039] It can be observed that the blue grayscale curve exhibits several distinct grayscale decrease intervals along the axial direction. These intervals correspond to axial grayscale stripe regions, with relatively uniform stripe spacing, stable stripe width, and clear dark stripe outlines. The grayscale value fluctuates little within the stripe intervals, indicating that the grayscale distribution within the stripes is uniform and continuous, consistent with the steps in Example 3 for extracting axial grayscale stripes through binarization and connected component analysis. The light red stripe intervals highly overlap with the intervals where the grayscale value curve is lower than the global grayscale mean, verifying the effectiveness of threshold segmentation.
[0040] Example 4:
[0041] In specific implementation, a first numerical interval corresponding to the end face indentation characteristic value and a second numerical interval corresponding to the arc surface scratch characteristic value are obtained. Using the end face indentation characteristic value as the center value, a first lower bound is defined by expanding the end face indentation characteristic value by 5% in the direction of decreasing value, and a first upper bound is defined by expanding the end face indentation characteristic value by 5% in the direction of increasing value. The closed interval formed by the first lower bound and the first upper bound is defined as the first numerical interval. Similarly, using the arc surface scratch characteristic value as the center value, a second lower bound is defined by expanding the arc surface scratch characteristic value by 5% in the direction of decreasing value, and a second upper bound is defined by expanding the arc surface scratch characteristic value by 5% in the direction of increasing value. The closed interval formed by the second lower bound and the second upper bound is defined as the second numerical interval.
[0042] Calculate the intersection interval of the first and second numerical intervals. Let the first numerical interval be... ,in Indicates the first lower bound value. Let represent the first upper bound value. Let the second value interval be . ,in Indicates the second lower bound value. This represents the second upper bound value. The lower bound of the intersection interval is taken as... and The larger of the values, the upper bound of the intersection interval is taken as and The smaller of the two values. If the larger value is less than or equal to the smaller value, the intersection interval is not empty, and the intersection interval is denoted as . ,in This indicates the lower bound of the intersection interval. This represents the upper bound of the intersection interval. If the larger value is greater than the smaller value, the intersection interval is empty.
[0043] When the intersection interval is not empty, the pixels in the surface image whose end-face indentation feature values fall into the intersection interval are merged with the pixels whose arc surface scratch feature values fall into the intersection interval to form a candidate pixel set. The end-face indentation feature values falling into the intersection interval means that the end-face indentation feature values satisfy... The condition that the feature values of the arc surface scratch fall into the intersection interval means that the feature values of the arc surface scratch satisfy the following conditions: The conditions are as follows: In the surface image, all pixels whose end-face indentation feature values are calculated and whose end-face indentation feature values satisfy the condition of falling into the intersection interval are added to the candidate pixel set; all pixels whose arc surface scratch feature values are calculated and whose arc surface scratch feature values satisfy the condition of falling into the intersection interval are added to the candidate pixel set. During the merging process, if the same pixel satisfies both conditions, it is retained only once in the candidate pixel set.
[0044] Within the candidate pixel set, calculate the minimum bounding rectangle of all pixels within the set. The calculation method is as follows: extract the row and column coordinates of all pixels in the candidate pixel set, determine the minimum row coordinate, maximum row coordinate, minimum column coordinate, and maximum column coordinate, respectively. Using the minimum row and minimum column coordinates as one vertex of the rectangle, and the maximum row and maximum column coordinates as the opposite diagonal vertices, construct a minimum bounding rectangle aligned with the image coordinate axes. Define the suspected defect region within this constructed minimum bounding rectangle. In the surface image, pixels on the boundary of the suspected defect region and pixels inside the boundary are uniformly labeled as pixels within the suspected defect region.
[0045] Example 5:
[0046] In the specific implementation, the contrast value of each pixel within the suspected defect area is calculated. For each pixel within the suspected defect area, a local neighborhood window of size 3 pixels × 3 pixels is taken centered on it, and the standard deviation of the grayscale values within the local neighborhood window is calculated as the contrast value of the central pixel. All pixels within the suspected defect area are traversed to obtain the contrast value corresponding to each pixel. The arithmetic mean of the contrast values of all pixels within the suspected defect area is calculated as the region's average contrast value. The contrast value of each pixel is compared with the region's average contrast value, and pixels with contrast values higher than the region's average contrast value are selected as high-contrast points. All high-contrast points constitute a set of high-contrast points.
[0047] Calculate the principal inertial axis direction of all high-contrast points as the local contrast expansion direction. Obtain the row and column coordinates of each high-contrast point in the high-contrast point set in the surface image. Let the high-contrast point set contain... The first high contrast point, The row coordinates of the high contrast points are Column coordinates are , Calculate the mean row coordinates of the set of high-contrast points. mean of column coordinates Construct the covariance matrix of the set of high-contrast points. The elements of the covariance matrix include the variance of the row coordinates. Column coordinate variance and row and column coordinate covariance Calculate the eigenvalues and eigenvectors of the covariance matrix. The direction of the eigenvector corresponding to the largest eigenvalue is the principal inertial axis direction for all high-contrast points. Determine the principal inertial axis direction as the local contrast expansion direction, denoted as vector. .
[0048] Using the local contrast expansion direction as the reference direction, the suspected defect area is projected onto the orthogonal decomposition direction of the reference direction and the decomposition direction at a 45-degree angle to the reference direction, respectively. The orthogonal decomposition direction of the reference direction refers to the direction in the same direction as the local contrast expansion direction, i.e., along the vector... The orthogonal decomposition direction projection axis is established along the direction of the reference direction. The coordinates of each pixel within the suspected defect area are projected onto this axis, resulting in a sequence of orthogonal decomposition direction projection values. The decomposition direction at a 45-degree angle to the reference direction is defined by the straight line determined by the unit vector corresponding to this direction. The coordinates of each pixel within the suspected defect area are projected onto this axis, resulting in a sequence of 45-degree decomposition direction projection values. The orthogonal decomposition direction projection value sequence is sorted in ascending order of projection value to obtain the first projection sequence; the 45-degree decomposition direction projection value sequence is also sorted in ascending order of projection value to obtain the second projection sequence.
[0049] The grayscale values of the first projection sequence and the second projection sequence are accumulated separately. For each projection value position in the first projection sequence, the grayscale value of the original pixel corresponding to that projection value position is obtained. The grayscale values corresponding to all projection value positions in the first projection sequence are summed to obtain the grayscale accumulation amount in the reference direction. For each projection value position in the second projection sequence, the grayscale value of the original pixel corresponding to that projection value position is obtained. The grayscale values corresponding to all projection value positions in the second projection sequence are summed to obtain the cumulative grayscale value along the 45-degree decomposition direction. Grayscale accumulation This reflects the total energy of the grayscale distribution in the suspected defect area along the local contrast expansion direction, and the grayscale accumulation. It reflects the total energy of grayscale distribution in the suspected defect area at a 45-degree angle to the local contrast expansion direction.
[0050] Calculate the cumulative gray level in the reference direction. Gray accumulation at a 45-degree decomposition direction The ratio of , is denoted as the ratio. The calculation formula is:
[0051] in, This represents the ratio of cumulative grayscale values used for defect category determination. This represents the cumulative grayscale value along the reference direction, i.e., the sum of the grayscale values corresponding to the first projection sequence. This represents the cumulative amount of grayscale along the 45-degree decomposition direction, which is the sum of the grayscale values corresponding to the second projection sequence.
[0052] ratio The results are compared with a first classification threshold and a second classification threshold. The first classification threshold is set to 2.5. This value is based on the fact that when the morphology of the suspected defect area exhibits obvious axial extension characteristics, the gray-level accumulation along the local contrast expansion direction is significantly higher than the gray-level accumulation along the 45-degree decomposition direction, and the ratio usually exceeds 2.5. The second classification threshold is set to 0.6. This value is based on the fact that when the morphology of the suspected defect area exhibits approximately isotropic pit characteristics, the gray-level accumulation along the local contrast expansion direction is relatively close to the gray-level accumulation along the 45-degree decomposition direction, and the ratio usually is lower than 0.6.
[0053] When the ratio When the ratio exceeds the first classification threshold of 2.5, the defect category is classified as axial scratch. When the ratio is less than the second classification threshold of 0.6, the defect category is identified as indentation / pitting. The value falls between the second classification threshold of 0.6 and the first classification threshold of 2.5, which satisfies the condition. When the defect category is determined to be a mixed morphology category, the defect category identifier is output as a string after the determination is completed. The output defect category identifier includes "axial scratch category", "indentation pit category" or "mixed morphology category".
[0054] A bearing roller defect detection system based on image processing includes a memory, a processor, and a computer program stored in the memory and running on the processor. The memory stores surface image data, intermediate calculation results, and computer program instructions. The processor executes the computer program, implementing all the steps described above: acquiring the angular distribution sequence, extracting the roller end face and roller arc surface regions, calculating end face indentation feature values, calculating arc surface scratch feature values, dividing suspected defect areas, acquiring the local contrast expansion direction and decomposing it to obtain grayscale accumulation, determining the defect category identifier, and outputting the results. During execution, the processor reads surface image data from the memory, stores the calculated angular distribution sequence, corner abrupt change positions, closed edge loops, circumferential grayscale projection curves, axial grayscale stripes, end face indentation feature values, arc surface scratch feature values, suspected defect areas, local contrast expansion direction, grayscale accumulation, and defect category identifier in the memory, and finally sends the defect category identifier to the output interface.
[0055] See Figure 4 In the figure, the horizontal axis represents the sorting index of the pixel within the suspected defect area in the projection value sequence, and the vertical axis represents the grayscale value of the corresponding pixel. The blue solid line in the figure represents the projection value sequence along the orthogonal decomposition direction, and the orange dashed line represents the projection value sequence along the decomposition direction at a 45-degree angle to the local contrast expansion direction. The blue solid line clearly shows a peak increase and decrease trend in the index range of approximately 150 to 350, with the grayscale value rising from approximately 100 to a peak of over 170 before falling back, indicating a significant clustering characteristic of grayscale distribution in this direction. The orange dashed line, on the other hand, shows relatively fluctuating low-amplitude fluctuations in the corresponding range, with a relatively uniform overall distribution of grayscale values and low amplitude. The overall curve trend and key grayscale accumulation values accurately reflect the local grayscale distribution characteristics of the defect area, supporting the defect category determination method based on the grayscale accumulation ratio.
[0056] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A bearing roller defect detection method based on image processing, characterized in that, include: Obtain a surface image of the bearing roller, and map the grayscale gradient direction of the surface image into an angular distribution sequence in polar coordinates; Based on the abrupt change positions of the corner points in the directional angle distribution sequence, the roller end face region and the roller arc surface region in the surface image are extracted; Extract the closed edge loop of the roller end face region, obtain the circumferential grayscale projection curve of the closed edge loop, and determine the end face indentation characteristic value based on the peak and valley fluctuation amplitude of the circumferential grayscale projection curve. Extract the axial grayscale stripes of the roller arc surface region, calculate the spacing change rate and width change rate of the axial grayscale stripes, and determine the arc surface scratch feature value based on the spacing change rate and the width change rate. Based on the overlapping relationship between the numerical ranges of the end face indentation feature value and the arc surface scratch feature value, suspected defect areas are delineated from the surface image; Obtain the local contrast expansion direction of the suspected defect area, and perform morphological orientation decomposition on the suspected defect area based on the local contrast expansion direction to obtain the gray-level accumulation of each directional component. Based on the ratio of grayscale accumulation in each directional component, the defect category identifier of the suspected defect area is determined and the defect category identifier is output.
2. The bearing roller defect detection method based on image processing according to claim 1, characterized in that, The gray-level gradient direction of the surface image is mapped into an angular distribution sequence in polar coordinates, specifically including: A polar coordinate system is established with the center point of the surface image as the pole, and the gray-level gradient direction angle of each pixel in the surface image is calculated. The grayscale gradient direction angle is mapped to the polar angle range of the polar coordinate system, and the mapped direction angles of each pixel are arranged in ascending order of polar radius to obtain the direction angle distribution sequence.
3. The bearing roller defect detection method based on image processing according to claim 2, characterized in that, Based on the abrupt change positions of corner points in the directional angle distribution sequence, the roller end face region and roller arc surface region in the surface image are extracted, specifically including: Calculate the difference between two adjacent mapped direction angles in the direction angle distribution sequence, and mark the sequence positions where the difference is greater than a preset jump threshold as the corner abrupt change positions; Using the extreme diameter value corresponding to the corner abrupt change position as the segmentation radius, the region in the surface image with an extreme diameter smaller than the segmentation radius is cut out as the roller end face region, and the region with an extreme diameter larger than the segmentation radius is cut out as the roller arc surface region.
4. The bearing roller defect detection method based on image processing according to claim 1, characterized in that, Extract the closed edge loop of the roller end face region, obtain the circumferential grayscale projection curve of the closed edge loop, and determine the end face indentation feature value based on the peak and valley fluctuation amplitude of the circumferential grayscale projection curve, specifically including: Edge detection is performed on the roller end face region, and the gradient closed boundary is extracted as the closed edge loop; Along the circumferential direction of the closed edge ring, the grayscale values of each pixel on the closed edge ring are accumulated to obtain the circumferential projection value, thus obtaining the circumferential grayscale projection curve; Local maxima and local minima are extracted from the circumferential grayscale projection curve. The difference between the local maxima and the adjacent local minima is calculated as the peak-valley fluctuation amplitude. The average of all peak-valley fluctuation amplitudes is used as the end face indentation feature value.
5. The bearing roller defect detection method based on image processing according to claim 1, characterized in that, Extract the axial grayscale fringes of the roller arc surface region, statistically analyze the spacing change rate and width change rate of the axial grayscale fringes, and determine the arc surface scratch feature value based on the spacing change rate and the width change rate, specifically including: The roller arc surface region is segmented by grayscale binarization along the axial direction, and continuous dark stripes with grayscale values lower than the global grayscale mean are extracted as the axial grayscale stripes. The distance between the center lines of two adjacent axial grayscale stripes is measured as the stripe spacing, and the pixel width between the two edges of a single axial grayscale stripe is measured as the stripe width. The ratio of the variance to the mean of all adjacent stripe spacings is calculated as the spacing change rate, and the ratio of the variance to the mean of all stripe widths is calculated as the width change rate. The weighted sum of the spacing change rate and the width change rate is used as the arc surface scratch feature value.
6. The bearing roller defect detection method based on image processing according to claim 1, characterized in that, Based on the overlap between the numerical ranges of the end face indentation feature values and the arc surface scratch feature values, suspected defect areas are delineated from the surface image, specifically including: Obtain the first numerical interval corresponding to the end face indentation feature value and the second numerical interval corresponding to the arc surface scratch feature value, and calculate the intersection interval between the first numerical interval and the second numerical interval; If the intersection interval is not empty, the pixels in the surface image whose end face indentation feature value falls into the intersection interval and the pixels whose arc surface scratch feature value falls into the intersection interval are merged into a candidate pixel set, and the smallest bounding rectangle of the candidate pixel set is defined as the suspected defect area.
7. The bearing roller defect detection method based on image processing according to claim 1, characterized in that, Obtain the local contrast expansion direction of the suspected defect region, and perform morphological orientation decomposition on the suspected defect region based on the local contrast expansion direction to obtain the gray-level accumulation in each directional component, specifically including: Calculate the contrast value of each pixel in the suspected defect area, select the pixel with a contrast value higher than the average contrast value of the area as the high contrast point, and calculate the principal inertial axis direction of all high contrast points as the local contrast expansion direction. Using the local contrast expansion direction as the reference direction, the suspected defect area is projected onto the orthogonal decomposition direction of the reference direction and the decomposition direction at a 45-degree angle to the reference direction, respectively, to obtain a first projection sequence and a second projection sequence; The grayscale values of the first projection sequence and the second projection sequence are accumulated respectively to obtain the grayscale accumulation in the reference direction and the grayscale accumulation in the 45-degree decomposition direction.
8. The bearing roller defect detection method based on image processing according to claim 7, characterized in that, Based on the ratio of grayscale accumulation in each directional component, the defect category identifier of the suspected defect area is determined, specifically including: Calculate the ratio of the accumulated gray level in the reference direction to the accumulated gray level in the 45-degree decomposition direction; When the ratio is greater than the first classification threshold, the defect category is identified as an axial scratch category; When the ratio is less than the second classification threshold, the defect category is identified as an indentation pit. When the ratio is between the second classification threshold and the first classification threshold, the defect category is identified as a mixed morphology category.
9. The bearing roller defect detection method based on image processing according to claim 3, characterized in that, The segmentation radius is centered on the extreme radius value corresponding to the corner abrupt change position, and is extended to both sides by a preset pixel tolerance range to form an annular segmentation band. The inner boundary of the annular segmentation band is used to cut off the roller end face area, and the outer boundary is used to cut off the roller arc surface area.
10. A bearing roller defect detection system based on image processing, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the image processing-based bearing roller defect detection method as described in any one of claims 1 to 9.