Engine crankshaft bearing bush surface defect detection method
By clustering and contrast adjustment of the crankshaft shaft surface image, combined with the detection method of defect evaluation coefficient, the problem of reflective areas covering the faulty area is solved, and the accuracy and robustness of the detection are improved.
Patent Information
- Application Number
- CN202510345226.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-03-24
AI Technical Summary
The reflective area on the crankshaft shaft surface masks the faulty area, resulting in detection errors and reducing detection accuracy.
By collecting grayscale images of crankshaft shafts, marking and training using crankshaft segmentation networks, clustering and identifying reflective areas, and contrast adjustments are performed, and defect evaluation coefficients are calculated to detect surface defects.
Effectively process the reflective area, improve image quality, and perform fine detection with defect evaluation coefficients, which improves the accuracy and robustness of the surface defect detection of crankshaft shells.
Smart Images

Figure CN119863462A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and more specifically, to a method for detecting surface defects of an engine crankshaft bearing. Background Art
[0002] The engine crankshaft bearing is one of the key components of the engine. As the lubricating contact surface between the crankshaft and the engine body, it bears the huge load when the engine is running, ensures the smooth rotation of the crankshaft, and reduces friction and wear. The crankshaft bearing must not only withstand the rotational force from the crankshaft rotation, but also withstand the impact and load of various dynamic forces in the engine. Therefore, their design and material selection are particularly important. The crankshaft bearing is usually made of high-strength, wear-resistant metal materials and fits closely with other parts of the engine such as the engine body. High-quality bearings can effectively reduce the energy consumption of the engine, improve fuel efficiency, and thus improve the overall performance of the engine. The surface quality of the bearing directly affects the reliability and life of the engine. Defects on the surface of the bearing, such as scratches, indentations, corrosion, etc., directly affect the noise level and vibration characteristics of the engine, and may even lead to poor lubrication, causing problems such as engine overheating, burning of bearings, and even crankshaft fracture, reducing driving comfort, thereby affecting the normal operation of the engine, and even causing major safety accidents.
[0003] When capturing images of the crankshaft bearing surface and inspecting the crankshaft bearing defects in the image, multiple reflective bands, that is, reflective areas, will be generated on the crankshaft bearing surface due to the illumination of lighting and natural light. As a result, when inspecting the integrity of the bearing, the reflective areas may cover up some bearing fault areas, resulting in errors in the integrity detection of the crankshaft bearing and reducing the detection accuracy of the crankshaft bearing surface defects. Summary of the invention
[0004] The present invention provides a method for detecting surface defects of an engine crankshaft bearing, aiming to solve the problem in the related art that a reflective area will be generated on the surface of the crankshaft bearing, resulting in that when detecting the integrity of the bearing, the reflective area may cover up some bearing failure areas, causing errors in the integrity detection of the crankshaft bearing and reducing the detection accuracy of the crankshaft bearing surface defects.
[0005] The present invention provides a method for detecting surface defects of an engine crankshaft bearing, comprising: collecting a grayscale image of the crankshaft bearing surface, and marking and training the crankshaft bearing surface area through a crankshaft bearing segmentation network to obtain a bearing surface image; clustering the pixel points in the bearing surface image, identifying and separating the reflective area, adjusting the contrast of the reflective area in the bearing surface image, and using the adjusted bearing surface image as a target image, wherein the adjustment method is as follows: ;in, Pixels in the reflective area The pixel value after contrast adjustment, Pixels in the reflective area The pixel value of Pixels in the reflective area Pixels in the neighborhood of The pixel value of is the pixel value sequence of the reflective area, is the median function, is the rounding function, Pixels in the reflective area The number of neighboring pixel values, is an average function; the defect evaluation coefficient of the target image is calculated, and the bearing surface defects are detected based on the size of the defect evaluation coefficient, wherein the defect evaluation coefficient reflects the continuity of the two edges in the middle of the target image. The image quality is improved through effective reflective area processing and adaptive contrast adjustment, and at the same time, the defect evaluation coefficient (reflecting edge continuity and parallelism) is combined to perform refined defect detection, which can ultimately improve the accuracy and robustness of bearing surface defect detection.
[0006] Furthermore, the bearing surface defects are detected based on the size of the defect evaluation coefficient, including: if the defect evaluation coefficient is greater than the defect evaluation threshold, an alarm is issued and the corresponding crankshaft bearing is marked as a poor quality product.
[0007] Furthermore, the defect evaluation coefficient of the target image is calculated using the following formula: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, is the number of pixels on any straight line in the vertical direction of the target image. This method uses the ratio of the edge length of the image to the total number of vertical pixels. This method simply and intuitively reflects the continuity of the edge and can obtain the evaluation result without complex image processing algorithms.
[0008] Furthermore, the defect evaluation coefficient is also related to the degree of parallelism between the two middle edges of the target image. The calculation formula of the defect evaluation coefficient is: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the longest edge in the target image. The minimum distance from a pixel to the second longest edge, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, is the number of pixels on any straight line in the vertical direction of the target image, is the standard deviation, is the hyperbolic tangent function. In some defects, edge parallelism may be more important than simple continuity. By introducing the consideration of parallelism, it is possible to identify those defects that may be continuous in form but have low parallelism, thus improving the detection accuracy.
[0009] Furthermore, the minimum distance from the i-th pixel on the longest edge to the second longest edge in the target image is calculated. , ; In the formula, is the Euclidean distance, is the longest edge in the target image. pixels, is the set of pixels on the longest edge in the target image, is the set of pixels on the second longest edge in the target image.
[0010] Furthermore, the pixel points in the bearing surface image are clustered, including: converting the grayscale image into HSV color space to obtain a color vector composed of hue, brightness, and saturation values in the HSV color space; clustering the bearing surface image using a K-means clustering algorithm to obtain Clusters.
[0011] Furthermore, the objective function of the clustering algorithm satisfies the following polynomial: ; In the formula, is the objective function value of clustering, For the The color vector of the cluster center, For the The first The color vector of the point, For the The coordinates of the cluster centers, For the The first The coordinates of the points, is the Euclidean distance, For the Clusters, is the number of clusters. This objective function not only focuses on the color similarity between points in the cluster, but also considers their spatial distribution. Through weighted cosine similarity and Euclidean distance, this method can optimize color information and spatial information at the same time. The comprehensive use of color and spatial information can effectively avoid clustering errors that are biased towards a certain feature.
[0012] Further, we get clusters, including: in response to the response function of the clustering algorithm reaching a maximum value, the optimal value is obtained as The value of the response function is calculated as: ; In the formula, is the response function value, is the edge segmentation coefficient of the nth cluster.
[0013] Furthermore, the calculation formula of the edge segmentation coefficient of the cluster is: ; In the formula, For the The edge partition coefficient of clusters, is the color vector of the qth pixel on the edge of the nth cluster, is the color vector of the pixel points of non-same clusters adjacent to the qth pixel point on the edge of the nth cluster, and Q is the number of pixels on the edge of the nth cluster. This method can be used to further optimize the clustering algorithm by quantizing the edge segmentation coefficient, especially to improve the clarity and segmentation of the cluster edge, reduce mis-clustering or aliasing, and thus improve the accuracy and stability of clustering.
[0014] Furthermore, the empirical value of the defect evaluation threshold is 0.6.
[0015] Beneficial Effects (i) By adjusting the contrast of different reflective areas separately, it is possible to better distinguish the pixels on the two edges of the middle of the bearing that may be worn in different reflective areas, thereby improving the accuracy of subsequent detection.
[0016] (ii) By using the target image obtained after contrast adjustment, two edges can be detected more accurately in the target image. And according to the parallelism and continuity of the two edges, it can be accurately calculated whether the edge has defects, thereby improving the accuracy of crankshaft bearing defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a schematic top view schematically showing a crankshaft bearing according to an embodiment of the present invention; Figure 2 is a flow chart schematically illustrating defect detection according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown, S101: collecting a grayscale image of the crankshaft bearing surface.
[0019] In one embodiment, when collecting the grayscale image of the crankshaft bearing surface, it is first necessary to select a suitable industrial camera or high-resolution camera equipment, and ensure that the light source is evenly distributed to avoid excessive or weak light affecting the image quality. Before shooting, the bearing surface can also be cleaned to eliminate any stains or impurities that may affect the image quality, so that the subtle texture and defects on the crankshaft bearing surface can be clearly captured. During the shooting process, the appropriate angle and distance should also be selected to ensure that the bearing surface can be fully displayed and the reflective area is reduced as much as possible. After the image acquisition is completed, the image of the crankshaft bearing surface is grayed by image processing software to obtain a grayscale image of the crankshaft bearing surface, which helps to highlight surface features such as texture changes, wear areas or potential defects. Finally, the collected grayscale image can be further processed, including denoising, contrast enhancement, etc., for subsequent analysis and detection.
[0020] It should be noted that during the shooting process, when the camera is directly above the crankshaft bearing, due to the shaking of the camera or the crankshaft bearing, the two edge lines in the middle of the crankshaft bearing in the image of the crankshaft bearing surface will appear one long and one short. And because the crankshaft bearing surface is a smooth curved surface, as the crankshaft bearing moves, multiple reflective positions will inevitably appear, affecting the subsequent defect detection of the crankshaft bearing surface, where the defect detection of the crankshaft bearing surface refers to the detection of the integrity of the two edges in the middle of the crankshaft bearing (such as Figure 1 Middle edge a, edge b).
[0021] S102: extracting the reflective area from the grayscale image.
[0022] It should be noted that in order to extract the reflective area from the grayscale image, the background of the grayscale image needs to be segmented. Specifically, the grayscale image is input into the crankshaft bearing segmentation network to obtain the bearing surface image. The reason is that the background area usually contains elements that are irrelevant to the crankshaft bearing surface (such as background environment, irrelevant objects, etc.), and the pixel values of these areas will interfere with the clustering algorithm. Segmenting the background area can remove these irrelevant information and ensure that clustering is only performed on the reflective area of the bearing surface, thereby improving the accuracy of clustering.
[0023] In one embodiment, the training process of the crankshaft bearing segmentation network is as follows: extract the bearing surface image from the grayscale image, collect multiple grayscale images of the crankshaft bearing surface, and mark the pixel points of the surface area of the bearing as 1, and the background pixel points as 0, and put the marked bearing surface image into the semantic segmentation network for training, and in response to the loss function being less than a preset value or reaching a preset number of training times, obtain the crankshaft bearing segmentation network. Then, the grayscale image collected in real time is put into the crankshaft bearing segmentation network to obtain a 0-1 distribution map of the bearing area, and the 0-1 distribution map is multiplied by the grayscale image to obtain the bearing surface image.
[0024] In one embodiment, the specific process of extracting the reflective area from the grayscale image is as follows: the grayscale image is converted into the HSV color space to obtain a color vector composed of hue, lightness, and saturation values in the HSV color space; the pixel points in the bearing surface image are clustered using the K-means clustering algorithm to obtain Clusters are formed, and the connected domain composed of each cluster corresponds to a reflective area. So far, the reflective area can be extracted.
[0025] It should be noted that the commonly used K-means clustering requires the user to specify the number of clusters in advance, but in many applications, the number of clusters is unknown or difficult to determine. Without the appropriate number of clusters, the clustering effect may be very poor. For example, if the number of clusters is set too large or too small, the clustering effect will be inaccurate, resulting in unusable final results. K-means clustering only relies on a single feature of the data point (such as spatial position or color), so it may be less effective in complex data or image processing tasks. Therefore, in another embodiment of the present method, the clustering algorithm is optimized to improve the accuracy of the extraction of reflective areas.
[0026] In another embodiment, the bearing surface image is clustered using a K-means clustering algorithm to obtain Clusters, where the objective function of the clustering algorithm satisfies the following polynomial: ; In the formula, is the objective function value of clustering, For the The color vector of the cluster center, For the The first The color vector of the point, For the The coordinates of the cluster centers, For the The first The coordinates of the points, is the Euclidean distance, For the Clusters, is the number of clusters. When the minimum value is reached, we get clusters. Each cluster contains several pixels. This method expands the traditional K-means objective function by adding a combination of color similarity-based metrics (through cosine similarity) and spatial position-based metrics (through Euclidean distance), which can more finely control the clustering process, especially when processing reflective areas in images, and can better capture surface textures and defects.
[0027] In one embodiment, The initial value is 1. As the initial value increases, the number of clusters also increases. Each time the value changes, clustering is completed until the response function reaches the maximum value, and the optimal The calculation formula of the response function value is: ; In the formula, is the response function value, is the edge segmentation coefficient of the nth cluster.
[0028] In one embodiment, the calculation formula of the edge segmentation coefficient of the cluster is: ; In the formula, For the The edge partition coefficient of clusters, is the color vector of the qth pixel on the edge of the nth cluster, is the color vector of the pixel of the non-same cluster adjacent to the qth pixel on the edge of the nth cluster, and Q is the number of pixels on the edge of the nth cluster. So far, we can get There are clusters, and each connected domain composed of clusters corresponds to a reflective area.
[0029] By using the above method, the clarity of the cluster boundary is measured by calculating the color similarity between edge pixels and adjacent clusters, so that the clustering algorithm can adjust the cluster boundary more finely, so that the segmented clusters are not only similar in color, but also more coherent in space, avoiding blurred boundaries. And by continuously adjusting 𝑘 and using the response function to select the optimal 𝑘, this makes the clustering process more dynamic and adaptable, and improves the clustering accuracy of the reflective area.
[0030] S103: performing contrast adjustment on the reflective area in the bearing surface image to obtain a target image.
[0031] In one embodiment, if canny edge detection is performed directly on the reflective area, it may not be possible to identify the complete edge in the area with higher reflective intensity (the reflective area belongs to the two middle edges of the bearing) due to the setting of the edge size threshold. Therefore, in the subsequent detection of surface defects of the crankshaft bearing, some edges cannot be identified in the high-brightness reflective area and the low-darkness reflective area, resulting in errors in the detection of surface defects of the crankshaft bearing. Therefore, by adjusting the contrast of different reflective areas separately, it is possible to better distinguish different reflective areas that may be pixels on the wear position of the two middle edges of the bearing, which facilitates subsequent edge detection and improves the accuracy of detection.
[0032] In one embodiment, the contrast of the reflective area in the bearing surface image is adjusted, and the adjusted bearing surface image is used as the target image. The adjustment method is as follows: ;in, Pixels in the reflective area The pixel value after contrast adjustment, Pixels in the reflective area The pixel value of Pixels in the reflective area Pixels in the neighborhood of The pixel value of is the pixel value sequence of the reflective area, is the median function, is the rounding function, Pixels in the reflective area The number of neighboring pixel values, is the mean value function.
[0033] in, The contrast increase adjustment coefficient is used to increase the pixel value of the pixel point that is greater than the median pixel value in the reflective area. The larger the value, the greater the pixel value of the a-th pixel point in the reflective area is from the median pixel value in the reflective area. To reduce the contrast adjustment coefficient, the pixel values of pixels that are smaller than the median pixel value in the reflective area are reduced. The smaller the value, the greater the distance between the pixel value of the ath pixel in the reflective area and the median pixel value in the reflective area. The contrast of the reflective area is improved by increasing and decreasing the pixel points on both sides of the median pixel value in the reflective area. is the neighborhood fluctuation degree value of the a-th pixel in the reflective area. The smaller the value is, the more similar the pixel value of the a-th pixel in the reflective area is to the similarity value of the surrounding neighborhood, indicating that the possibility that the pixel is an edge pixel is lower.
[0034] S104: Calculate the defect evaluation coefficient of the target image.
[0035] Specifically, the defect evaluation coefficient of the target image is calculated, and the defect evaluation coefficient reflects the continuity of the two middle edges of the target image. If the continuity of the edge is lower, it means that there is a disconnection and discontinuity on the edge, which means that there is a defect on the surface of the crankshaft bearing.
[0036] In one embodiment, the defect evaluation coefficient of the target image is calculated using the following formula: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, It is the number of pixels on any vertical line in the target image. The larger the value is, the closer the number of pixels on the longest edge is to the number of pixels on any straight line in the vertical direction of the target image, indicating that the continuity of the longest edge is higher, and the defect evaluation coefficient of the target image is larger. Thus, the edge with the lowest degree of continuity is selected from the two edges as the defect evaluation coefficient of the target image.
[0037] In another embodiment, the defect evaluation coefficient of the target image not only reflects the continuity of the two edges in the middle of the target image, but is also related to the parallelism of the two edges in the middle of the target image. In this embodiment, the calculation formula of the defect evaluation coefficient of the target image is: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the longest edge in the target image. The minimum distance from a pixel to the second longest edge, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, is the number of pixels on any straight line in the vertical direction of the target image, is the standard deviation, is the hyperbolic tangent function.
[0038] In one embodiment, the minimum distance from the i-th pixel on the longest edge to the second longest edge in the target image is calculated. , ; In the formula, is the Euclidean distance, is the longest edge in the target image. pixels, is the set of pixels on the longest edge in the target image, is the set of pixels on the second longest edge in the target image.
[0039] in, It is to determine the shortest distance from each pixel on the longest edge of the target image to the second longest edge, so as to facilitate the subsequent calculation of the standard deviation to express the degree of parallelism between the longest edge and the second longest edge. The larger the value of is, the larger the defect evaluation coefficient of the target image is. It is used to determine whether the longest edge and the second longest edge in the target image are fully extended to both ends of the vertical direction of the image. The smaller the value, the more discontinuous the longest edge or the second longest edge in the target image is and the lower the degree of continuity is, which may be caused by defects on the crankshaft bearing surface.
[0040] S105: Inspect the crankshaft bearing based on the defect evaluation coefficient of the target image.
[0041] Specifically, if the defect evaluation coefficient is greater than the defect evaluation threshold, it means that there is a defect on the surface of the crankshaft bearing, then an alarm is issued and the corresponding crankshaft bearing is marked as a low-quality product. If the defect evaluation coefficient is less than or equal to the defect evaluation threshold, the corresponding crankshaft bearing is marked as a high-quality product. The empirical value of the defect evaluation threshold is 0.6. In other embodiments, the empirical value of the defect evaluation threshold can be 0.67 or 0.7, etc., which can be set according to specific implementation conditions.
[0042] Through the target image obtained after contrast adjustment, the two edges can be detected more accurately in the target image. And according to the parallelism and continuity of the two edges, it can be accurately calculated whether the edge has defects, thereby improving the accuracy of crankshaft bearing defect detection.
Claims
1. A method for detecting surface defects of an engine crankshaft bearing, characterized in that: include: Collect the grayscale image of the crankshaft bearing surface, and mark and train the crankshaft bearing surface area through the crankshaft bearing segmentation network to obtain the bearing surface image; Cluster the pixels in the bearing surface image, identify and separate the reflective area, adjust the contrast of the reflective area in the bearing surface image, and use the adjusted bearing surface image as the target image. The adjustment method is as follows: ; in, Pixels in the reflective area The pixel value after contrast adjustment, Pixels in the reflective area The pixel value of Pixels in the reflective area Pixels in the neighborhood of The pixel value of is the pixel value sequence of the reflective area, is the median function, is the rounding function, Pixels in the reflective area The number of neighboring pixel values, is the mean value function; The defect evaluation coefficient of the target image is calculated, and the bearing surface defects are detected based on the size of the defect evaluation coefficient, wherein the defect evaluation coefficient reflects the continuity of the two middle edges of the target image.
2. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: The bearing surface defects are detected based on the size of the defect evaluation coefficient, including: If the defect evaluation coefficient is greater than the defect evaluation threshold, an alarm is issued and the corresponding crankshaft bearing is marked as a poor quality product.
3. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: Calculate the defect evaluation coefficient of the target image, the calculation formula is: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, It is the number of pixels on any vertical line in the target image.
4. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: The defect evaluation coefficient is also related to the parallelism of the two middle edges of the target image. The calculation formula of the defect evaluation coefficient is: ; In the formula, is the defect evaluation coefficient of the crankshaft bearing, is the longest edge in the target image. The minimum distance from a pixel to the second longest edge, is the number of pixels on the longest edge in the target image, is the number of pixels on the second longest edge in the target image, is the number of pixels on any straight line in the vertical direction of the target image, is the standard deviation, is the hyperbolic tangent function.
5. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: Calculate the minimum distance from the i-th pixel on the longest edge to the second longest edge in the target image , the calculation formula is: ; In the formula, is the Euclidean distance, is the longest edge in the target image. pixels, is the set of pixels on the longest edge in the target image, is the set of pixels on the second longest edge in the target image.
6. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: Clustering the pixel points in the bearing surface image includes: The grayscale image is converted into an HSV color space to obtain a color vector composed of hue, lightness, and saturation values in the HSV color space; The K-means clustering algorithm is used to cluster the bearing surface image to obtain Clusters.
7. The engine crankshaft bearing surface defect detection method according to claim 6, characterized in that: The objective function of the clustering algorithm satisfies the following polynomial: ; In the formula, is the objective function value of clustering, For the The color vector of the cluster center, For the The first The color vector of the point, For the The coordinates of the cluster centers, For the The first The coordinates of the points, is the Euclidean distance, For the Clusters, is the number of clusters.
8. The engine crankshaft bearing surface defect detection method according to claim 1, characterized in that: get Clusters include: In response to the clustering algorithm's response function reaching its maximum value, the optimal value is obtained as The value of the response function is calculated as: ; In the formula, is the response function value, is the edge segmentation coefficient of the nth cluster.
9. The engine crankshaft bearing surface defect detection method according to claim 8, characterized in that: The calculation formula of the edge segmentation coefficient of the cluster is: ; In the formula, For the The edge partition coefficient of clusters, is the color vector of the qth pixel on the edge of the nth cluster, is the color vector of the pixel point of a non-clustered cluster adjacent to the qth pixel point on the edge of the nth cluster, and Q is the number of pixels on the edge of the nth cluster.
10. The engine crankshaft bearing surface defect detection method according to claim 2, characterized in that: The empirical value of the defect evaluation threshold is 0.6.
Citation Information
Patent Citations
Visual detection method for abnormal placement direction and sequence of crankshaft bearing bush cover group
CN111583254A
Wear detection device for a bearing bush
CN111624122A
Bearing bush wear condition detection method and related equipment
CN114636632A
Packaging tin appearance defect detection method
CN119228800A
Bearing bush gap film thickness measuring device based on machine vision and working method
CN119268569A