A method and system for detecting the cleanliness of a to-be-painted automobile part

By combining filtering, distance transformation, and watershed algorithms, the accuracy and robustness issues of contaminant adhesion detection in complex images are solved, achieving more accurate contaminant segmentation and cleanliness detection.

CN121259002BActive Publication Date: 2026-02-24CHANGSHU ZHONGTE AUTOMOTIVE TRIM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511832585.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-02-24
Estimated Expiration
2045-12-08

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient accuracy and robustness in handling image noise, complex textures, contaminant reflections, and tightly adhered contaminants.

Method used

Noise is removed by filtering, shape potential field map is generated by distance transformation, local maximum points are identified and saliency height is calculated, gradient potential field map is constructed, and weighted fusion is performed by combining shape potential field map and watershed algorithm is used for regional flooding to identify pollutant areas.

Benefits of technology

It effectively suppressed over-segmentation and under-segmentation, improved the accuracy of pollutant quantity and size measurement, and enhanced the robustness and reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259002B_ABST
    Figure CN121259002B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent detection, in particular to a kind of to be sprayed paint automobile parts cleanliness detection method and system.The method includes: obtaining the gray image of to be sprayed paint automobile parts;The local maximum point of significant height is calculated to obtain the marker point by carrying out distance transformation to the gray image after pre-processing;Gradient potential field diagram is generated based on gradient amplitude and gradient confidence;Shape potential field diagram is generated based on distance transformation image;With the marker point as starting point, regional flooding is carried out on the fusion potential field diagram obtained by weighting gradient potential field diagram and shape potential field diagram, and the final segmentation boundary is formed;Finally, based on segmentation boundary, the contaminated area is identified and calculated to determine cleanliness.The present application effectively avoids under-segmentation caused by contamination adhesion, significantly improves the accuracy of contamination segmentation and the robustness of detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent inspection technology. More specifically, this invention relates to a method and system for inspecting the cleanliness of automotive parts to be painted. Background Technology

[0002] In modern automotive manufacturing, the painting quality of the vehicle body and its components directly impacts the overall appearance, durability, and value of the vehicle. Before painting, the cleanliness of the component surfaces is a prerequisite for ensuring good paint adhesion, smoothness, and corrosion resistance. After a series of processes such as stamping, welding, and machining, various minute contaminants, such as metal shavings, abrasives, dust, and fibers, remain on the component surfaces. If these contaminants are not thoroughly removed before painting, it can lead to defects such as particles, pinholes, and blistering on the paint surface, and even cause premature paint peeling and corrosion, seriously affecting product quality and brand reputation.

[0003] To quantify and control cleanliness, the industry commonly uses image processing algorithms to automatically identify, segment, and measure particles in images to assess cleanliness levels. However, existing technologies face significant challenges in particle segmentation. In real-world conditions, contaminant particles are often not isolated; large numbers of particles tend to cluster together, forming agglomerates or overlaps. Traditional segmentation algorithms typically fail when dealing with such complex, agglomerated particle clusters. These algorithms struggle to distinguish between subtle internal boundaries and noise, often misidentifying the entire agglomerated particle cluster as a single, irregular, large particle, leading to severe undersegmentation. This undersegmentation directly results in a significant underestimation of particle quantity and a significant overestimation of particle size, ultimately causing a large discrepancy between the cleanliness test results and the actual situation, rendering the results meaningless for guiding production. Summary of the Invention

[0004] The purpose of this invention is to propose a method and system for detecting the cleanliness of automotive parts to be painted, in order to solve the problems of insufficient accuracy and robustness of existing technologies when dealing with complex situations such as image noise, complex textures, contaminant reflection, and tightly adhered contaminants.

[0005] This invention provides a method for detecting the cleanliness of automotive parts to be painted. The method includes: acquiring a grayscale image of the automotive parts to be painted and removing noise using a filtering method to obtain a preprocessed image; performing a distance transformation on the preprocessed image to obtain a distance-transformed image, the distance-transformed image including the distance values ​​of each pixel; performing a reversal operation on the distance-transformed image to generate a shape potential field map; identifying local maxima points in the distance-transformed image, calculating the saliency height of each local maxima point, and comparing it with a preset height threshold to obtain a marker point; calculating the gradient magnitude and gradient confidence of each pixel in the preprocessed image, and combining the gradient magnitude and gradient confidence to generate a gradient potential field map; performing a weighted fusion of the gradient potential field map and the shape potential field map to obtain a fused potential field map; starting from the marker point, performing regional flooding on the fused potential field map based on a watershed algorithm until the watershed boundaries of different regions meet, forming a final segmentation boundary; identifying contaminant regions based on the final segmentation boundary, and determining the cleanliness of the automotive parts to be painted based on the contaminant regions.

[0006] This invention eliminates spurious markers caused by noise or minute surface textures of components at the algorithm's source by calculating and filtering the saliency height of local maxima, fundamentally suppressing oversegmentation. Secondly, this invention innovatively constructs a fused potential field map, on which the true but weak adhesion boundaries between pollutants are relatively enhanced. Finally, regional flooding based on geodesic distance is performed on this gradient potential field map, allowing the flooding process to easily overcome low-confidence artifact regions while encountering significant obstacles when encountering high-confidence true boundaries, thus effectively solving the undersegmentation problem.

[0007] Optionally, the step of obtaining the distance-transformed image includes: performing binarization processing on the preprocessed image to obtain a binary image; calculating the minimum distance from each foreground pixel to the background pixel in the binary image, and assigning the minimum distance to the corresponding pixel to generate the distance-transformed image.

[0008] Optionally, the calculation step of the local maximum point includes: traversing each pixel in the distance-transformed image; determining whether the distance value of the current pixel is greater than the distance values ​​of all pixels in its preset neighborhood; if the determination is yes, then identifying the current pixel as a local maximum point.

[0009] Optionally, the calculation steps of the saliency height include: for any local maximum point in the distance-transformed image, finding all other local maximum points whose distance values ​​are greater than the local maximum point; determining a target point among the other local maximum points that has the smallest geometric distance to the local maximum point; determining the saddle point with the lowest distance value on the shortest connection path between the target point and the local maximum point; and calculating the difference between the distance value of the local maximum point and the distance value of the saddle point to obtain the saliency height.

[0010] By introducing saliency height to filter local maxima in the distance transformation graph, false peaks caused by image noise or surface textures of contaminants can be effectively filtered out from the source of the algorithm, thereby greatly suppressing the oversegmentation problem common in traditional watershed algorithms.

[0011] Optionally, the step of obtaining the marker point includes: comparing the salience height of each local maximum point with a preset height threshold; if the salience height of any local maximum point is greater than the preset height threshold, then the local maximum point is determined as a marker point.

[0012] Optionally, the step of obtaining the fused potential field map includes: determining the maximum value of the distance value in the distance-transformed image, and subtracting the maximum value from the distance value of each pixel in the distance-transformed image to obtain the inverted shape potential field map; calculating the gradient magnitude and gradient confidence of each pixel in the preprocessed image; performing a weighted multiplication of the gradient magnitude and gradient confidence of each pixel to obtain the gradient potential field map; and performing a weighted summation of the gradient potential field map and the shape potential field map to generate the fused potential field map.

[0013] Gradient potential field mapping can significantly enhance the relative strength of weak boundaries between adherent particles and suppress artifacts and noise within particles. This method fundamentally solves the undersegmentation problem caused by the inability to identify weak boundaries in traditional methods, and significantly improves the accuracy of pollutant particle segmentation.

[0014] Optionally, the calculation steps of the watershed algorithm include: defining the marked point as a seed point; then, using the seed point as the source, performing a regional flooding process on the fused potential field map; this process follows the principle of shortest geodesic distance, that is, flooding preferentially spreads to adjacent pixels with lower gradient potential field values; when flooding regions originating from different seed points meet, a segmentation boundary is formed on the path with the highest gradient potential field value; this process continues until all pixels are classified into the corresponding flooding regions, ultimately forming a complete segmentation boundary.

[0015] By employing a geodesic distance-based regional flooding strategy on the fused potential field map, the flooding area was effectively prevented from overflowing the weak boundaries between cohesive particles, solving the undersegmentation problem and ensuring that the final segmentation contour highly matches the actual visual edges of the pollutant particles, thus improving the accuracy of the measurement.

[0016] Optionally, the gradient magnitude calculation step includes: performing a convolution operation on the preprocessed image to obtain gradient components in the horizontal and vertical directions; and determining the gradient magnitude of each pixel by calculating the square root of the sum of the squares of the gradient components in the horizontal and vertical directions.

[0017] Optionally, the gradient confidence calculation steps include: defining a neighborhood window for each pixel; calculating multiple gradient feature indicators within the neighborhood window, the gradient feature indicators including: gradient direction consistency, local contrast, and neighborhood smoothness; and normalizing and then adding the multiple gradient feature indicators to form a gradient confidence.

[0018] By constructing gradient confidence to evaluate the reliability of each pixel gradient value, the influence of false edges caused by complex industrial scene factors such as strong reflection of metal particles and uneven lighting can be intelligently reduced, making the segmentation process more robust to harsh image conditions.

[0019] Optionally, a cleanliness detection system for automotive parts to be painted includes: a processor; the processor is used to run a computer program; and a memory in which the computer program is stored.

[0020] The beneficial effects of this invention are as follows: This invention aims to solve the technical challenge of accurately segmenting densely clustered contaminants in industrial testing. By creatively fusing three different dimensions of features—gradient magnitude reflecting pixel-level edge intensity, gradient confidence level assessing edge reliability, and saliency height characterizing the importance of contaminant regions—in the gradient potential field map construction stage, this scheme reshapes the image terrain used for segmentation. This method not only effectively suppresses noise and texture artifacts within significant particles but also greatly enhances the relative prominence of weak boundaries between clustered particles, thereby effectively overcoming the undersegmentation problem commonly found in traditional methods. It significantly improves the accuracy of contaminant quantity statistics and size measurement, making the overall cleanliness detection results more robust and reliable. Attached Figure Description

[0021] Figure 1 This is a flowchart of a method for detecting the cleanliness of automotive parts to be painted according to an embodiment of the present invention.

[0022] Figure 2This is an original grayscale image of an automotive component according to an embodiment of the present invention, which is a system for detecting the cleanliness of automotive components to be painted.

[0023] Figure 3 This is a distance transformation diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention.

[0024] Figure 4 This is a shape potential field diagram of a system for detecting the cleanliness of automotive parts to be painted, according to an embodiment of the present invention.

[0025] Figure 5 This is a local maximum value diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention.

[0026] Figure 6 This is a gradient potential field diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention.

[0027] Figure 7 This is a regional flooding process diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention.

[0028] Figure 8 This is a pollutant result diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention.

[0029] Figure 9 This is a structural block diagram of a system for detecting the cleanliness of automotive parts to be painted, according to an embodiment of the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Figure 1 The diagram shown is a flowchart of a method for detecting the cleanliness of automotive parts to be painted according to an embodiment of the present invention.

[0031] S1: Obtain grayscale images of the car parts to be painted, and use filtering methods to remove noise to obtain preprocessed images.

[0032] Digital images of painted automotive parts are obtained using an image acquisition device. If the acquired image is color, it is first converted to grayscale. Since noise may be introduced during image acquisition and transmission, noise suppression is required for the grayscale image. In one specific implementation, the filtering method is a bilateral filtering method, which can effectively smooth the image, remove noise, and retain the edge details of contaminants relatively well. Figure 2 The image shown is an original grayscale image of an automotive component to be painted, according to an embodiment of the present invention, of a system for detecting the cleanliness of automotive components to be painted.

[0033] S2: Perform a distance transformation on the preprocessed image to obtain a distance-transformed image, and perform a reversal operation on the distance-transformed image to generate a shape potential field map.

[0034] First, the preprocessed image needs to be binarized to distinguish between foreground and background pixels. In one specific implementation, the binarization process uses Otsu's method to automatically determine a global threshold and generate a binary image. Then, a distance transform is performed on the binary image. In a preferred embodiment, the distance transform uses Euclidean distance transform, calculating the minimum distance from each foreground pixel to a background pixel in the binary image, and assigning this minimum distance to the corresponding pixel. The distance values ​​of all pixels constitute the distance-transformed image.

[0035] like Figure 3 The diagram shown is a distance transformation diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention. Figure 3 The calculation logic is as follows: First, the preprocessed grayscale image is binarized. In this embodiment, the large law method is used to divide the image into foreground (pollutant) and background. For each foreground pixel in the binary image, its Euclidean distance to the nearest background pixel is calculated. The larger the distance value, the farther the pixel is from the background, i.e., it is located in the central region of the pollutant. The illustration shows that the brighter the area, the larger the distance value. This step highlights the central position of the particles, providing a basis for subsequent separation of adhering particles.

[0036] Subsequently, the maximum value of the distance value in the distance-transformed image is determined, and the maximum value is subtracted from the distance value of each pixel in the distance-transformed image to obtain the inverted shape potential field map.

[0037] like Figure 4 The figure shown is a shape potential field diagram of a system for detecting the cleanliness of automotive parts to be painted according to an embodiment of the present invention. Figure 4 The calculation logic is as follows: invert the distance transformation map. Shape potential field = max(distance transformation value) - current pixel distance transformation value. In the shape potential field, the value is lowest at the particle center (low potential energy), and higher at the edges. Illustration meaning: This map forms the terrain basis of the watershed algorithm, causing water flow to naturally converge towards the particle center.

[0038] S3: Identify the local maximum points in the distance-transformed image, calculate the salience height of each local maximum point, and compare it with a preset height threshold to obtain a marker point.

[0039] First, iterate through each pixel in the distance-transformed image and determine whether its distance value is greater than the distance values ​​of all pixels in its eight neighborhoods. If so, identify it as a local maximum point.

[0040] However, not all local maxima correspond to a true contaminant center; some are false markers generated by noise or minute textures. This invention introduces saliency height as a screening criterion. For any local maxima P in the distance-transformed image, its saliency height is calculated as follows: Find all other local maxima points with distance values ​​greater than P; among these, determine a target point Q with the smallest geometric distance to P; connect P and Q; in the shortest connection path, determine the saddle point S with the lowest distance value; calculate the difference between the distance value of P and the distance value of the saddle point S to obtain the saliency height.

[0041] Finally, the salience height of each local maximum point is compared with a preset height threshold; if the salience height of any local maximum point is greater than the preset height threshold, then the local maximum point is determined as a marker point. Through this step, a large number of local maximums that are not significant on the terrain and are caused by noise or minor textures can be filtered out, resulting in an initial set of marker points that are reasonably numerous and accurately located.

[0042] like Figure 5 The image shown is a partial maximum value diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention. Figure 5 The calculation logic is as follows: Local maxima are found on the distance transform map. Maximum filtering is performed using an 8x8 neighborhood window. The saliency height of each local maxima is calculated. Only points with a saliency height greater than a preset threshold of 2 are retained as markers. This step effectively removes spurious peaks caused by noise or minute textures. Illustration: The background is the original image, and the superimposed colored dots are the filtered markers. Each marker represents the location of an independent contaminant.

[0043] S4: Calculate the gradient magnitude and gradient confidence of each pixel in the preprocessed image, and combine the gradient magnitude and the gradient confidence to generate a gradient potential field map.

[0044] First, a convolution operation is performed on the preprocessed image to obtain gradient components in the horizontal and vertical directions. Based on these gradient components, the gradient magnitude of each pixel is determined by calculating the square root of their sum. In one specific implementation, the convolution operation is implemented using the Sobel operator.

[0045] Secondly, to evaluate the reliability of gradient magnitude, this invention introduces the concept of gradient confidence. For each pixel, a neighborhood window is defined (in this embodiment, it is set to a size of 5x5), and multiple gradient feature indices are calculated within this window, preferably including:

[0046] (1) Gradient direction consistency: First, normalize the horizontal and vertical gradient components of each pixel in the neighborhood window by dividing them by their gradient magnitudes. Then, sum all the normalized horizontal and vertical components. The final resultant vector magnitude is the consistency index. The larger the value, the more consistent the gradient direction and the higher the confidence level.

[0047] (2) Local contrast: It is obtained by calculating the difference between the maximum and minimum gray values ​​within the neighborhood window. The larger the difference, the clearer the edge and the higher the confidence level.

[0048] (3) Neighborhood smoothness: This is obtained by calculating the variance of gray values ​​within the neighborhood window. The smaller the variance, the flatter the region. If a gradient exists at this point, it is more likely to be a real edge rather than a texture, and the confidence level is higher.

[0049] Then, the calculated gradient feature indices are normalized and summed to form a gradient confidence score.

[0050] Finally, the gradient magnitude of each pixel is multiplied by the gradient confidence level to obtain the gradient potential field map.

[0051] like Figure 6 The figure shown is a gradient potential field diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention. Figure 6 The computational logic is as follows: The Sobel operator (kernel size = 3x3) is used to calculate the gradients of the image in the horizontal and vertical directions, obtaining the gradient magnitude. Gradient confidence: Combining gradient direction consistency, local contrast, and neighborhood smoothness, the gradient confidence is calculated to evaluate the reliability of edges. Gradient potential field = gradient magnitude × gradient confidence field. Illustration meaning: The clearer and more reliable the edges in an image, the higher the potential field value. This diagram is used in the watershed algorithm to provide resistance, preventing flooding from crossing the true particle boundaries.

[0052] S5: Starting from the marked point, perform regional flooding in the watershed algorithm on the fused potential field map obtained by weighting the gradient potential field map and the shape potential field map to form the final segmentation boundary.

[0053] Specifically, it is implemented as an improved watershed algorithm under dual constraints. The execution process of this algorithm is as follows:

[0054] First, the marked point is defined as a seed point; then, starting from the seed point, regional flooding is performed on the fused potential field map; the flooding process follows the principle of shortest geodesic distance, that is, the flooding preferentially spreads to adjacent pixels with lower values ​​in the fused potential field map.

[0055] When flood regions originating from different seed points meet, a dividing boundary is formed on the path with the highest value in the fused potential field graph. This process continues until all pixels are classified into their respective flood regions. Finally, when flood regions from different seed points meet, their watershed boundaries will inevitably form on the paths with the highest cumulative cost, thus forming the final dividing boundary.

[0056] like Figure 7 The diagram shown is a regional flooding process diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention. Figure 7 The calculation logic is: Fusion potential field = α × Shape potential field + (1-α) × Gradient potential field. The preset fusion weight coefficient α = 0.5. It combines shape constraints and edge constraints. The watershed algorithm uses the marked points as the source and floods the fusion potential field. The illustration shows the integrated potential field terrain used for the final segmentation. Low-lying areas correspond to pollutant centers, and towering ridges correspond to pollutant boundaries or background.

[0057] S6: Identify independent contaminant areas based on the final segmentation boundary, and determine the cleanliness of the automotive parts to be painted based on the contaminant areas.

[0058] After obtaining the final segmentation boundaries in step S5, the preprocessed image is precisely divided into multiple closed regions. Using a connected component algorithm, each closed region is identified as an independent contaminant region. Then, the geometric parameters of each contaminant region are calculated, including at least one of the following: the number of contaminant regions, the total area, and the maximum area. Finally, based on the statistical results of the geometric parameters, a comparison is made with a preset cleanliness standard to output the cleanliness level of the automotive parts to be painted.

[0059] like Figure 8 The image shown is a pollutant result diagram of a cleanliness detection system for automotive parts to be painted according to an embodiment of the present invention. Figure 8 The calculation logic is as follows: the flood process continues until the watersheds at different marker points meet, forming a dividing boundary (watershed). The resulting different colored regions represent the segmented independent pollutant particles. Illustration: The colored regions overlaying the original image demonstrate the final segmentation effect. Even pollutants that are stuck together can be accurately segmented into two independent individuals, showcasing the beneficial effects of this invention.

[0060] According to a second aspect of the present invention, the present invention also provides a system for detecting the cleanliness of automotive parts to be painted. Figure 9 This is a structural block diagram of a system for detecting the cleanliness of automotive parts to be painted, according to an embodiment of the present invention. Figure 9As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a method for detecting the cleanliness of automotive parts to be painted according to the first aspect of the present invention. The system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface; their configuration and functions are known in the art and will not be described further here.

[0061] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be within the scope of protection of the present invention.

Claims

1. A method for detecting the cleanliness of automotive parts to be painted, characterized in that, The detection method includes: A grayscale image of the car parts to be painted is acquired, and noise is removed by filtering to obtain a preprocessed image; a distance transformation is performed on the preprocessed image to obtain a distance transformed image, which includes the distance values ​​of each pixel; the distance transformed image is inverted to generate a shape potential field map. Identify local maxima in the distance-transformed image, calculate the saliency height of each local maxima, and compare it with a preset height threshold to obtain a marker point; The steps for calculating saliency height include: for any local maximum point in the distance-transformed image, finding all other local maximum points whose distance values ​​are greater than the local maximum point; determining a target point among the other local maximum points that has the smallest geometric distance to the local maximum point; determining the saddle point with the lowest distance value on the shortest connection path between the target point and the local maximum point; and calculating the difference between the distance value of the local maximum point and the distance value of the saddle point to obtain the saliency height. Calculate the gradient magnitude and gradient confidence of each pixel in the preprocessed image, and combine the gradient magnitude and gradient confidence to generate a gradient potential field map; The steps for calculating gradient confidence include: defining a neighborhood window for each pixel; calculating multiple gradient feature indices within the neighborhood window, including gradient direction consistency, local contrast, and neighborhood smoothness; and normalizing and then adding the multiple gradient feature indices to form a gradient confidence. The gradient potential field map and the shape potential field map are weighted and fused to obtain a fused potential field map. Starting from the marked point, regional flooding is performed on the fused potential field map based on the watershed algorithm until the watershed boundaries of different regions meet to form the final segmentation boundary. Based on the final segmentation boundary, contaminant areas are identified, and the cleanliness of the automotive parts to be painted is determined according to the contaminant areas.

2. The method for detecting the cleanliness of automotive parts to be painted according to claim 1, characterized in that, The steps for obtaining the distance-transformed image include: The preprocessed image is binarized to obtain a binary image; Calculate the minimum distance from each foreground pixel to the background pixel in the binary image, and assign the minimum distance to the corresponding pixel to generate a distance-transformed image.

3. The method for detecting the cleanliness of automotive parts to be painted according to claim 1, characterized in that, The steps for calculating the local maximum point include: Iterate through every pixel in the distance-transformed image; Determine whether the distance value of the current pixel is greater than the distance values ​​of all pixels in its preset neighborhood; if the determination is yes, then identify the current pixel as a local maximum point.

4. The method for detecting the cleanliness of automotive parts to be painted according to claim 1, characterized in that, The steps for obtaining the marker points include: The salience height of each local maximum point is compared with a preset height threshold; If the salience height of any local maximum point is greater than the preset height threshold, then the local maximum point is determined as a marker point.

5. The method for detecting the cleanliness of automotive parts to be painted according to claim 1, characterized in that, The steps for obtaining the fused potential field diagram include: The maximum value of the distance value in the distance transformation image is determined, and the maximum value is subtracted from the distance value of each pixel in the distance transformation image to obtain the inverted shape potential field map; Calculate the gradient magnitude and gradient confidence of each pixel in the preprocessed image; multiply the gradient magnitude and gradient confidence of each pixel by weight to obtain the gradient potential field map; The gradient potential field map and the shape potential field map are weighted and summed to generate a fused potential field map.

6. The method for detecting the cleanliness of automotive parts to be painted according to claim 1, characterized in that, The calculation steps of the watershed algorithm include: The marked points are defined as seed points. Then, starting from the seed points, regional flooding is performed on the fused potential field map. The flooding process follows the principle of shortest geodesic distance, that is, the flooding preferentially spreads to adjacent pixels with lower values ​​in the fused potential field map. When flooding regions originating from different seed points meet, a dividing boundary is formed on the path with the highest value in the fused potential field map. This process continues until all pixels are classified into the corresponding flooding regions, and finally a complete dividing boundary is formed.

7. The method for detecting the cleanliness of automotive parts to be painted according to claim 5, characterized in that, The steps for calculating the gradient magnitude include: The preprocessed image is convolved to obtain gradient components in the horizontal and vertical directions; based on the gradient components in the horizontal and vertical directions, the gradient magnitude of each pixel is determined by calculating the square root of the sum of their squares.

8. A system for detecting the cleanliness of automotive parts to be painted, characterized in that, include: processor; A memory, wherein a computer program is stored; When the processor is configured to execute the computer program, it implements a method for detecting the cleanliness of automotive parts to be painted as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Insulator image segmentation method based on distance transform and marker watershed algorithm

    CN108986104A

  • Abnormity monitoring and sudden stop system for numerical control machine tool

    CN116758099A