A metal surface scratch depth detection method and system

By combining an intelligent control system with image acquisition equipment, automatically adjusting the light source color and using edge detection algorithms and contour segmentation technology, the problems of low efficiency and high misjudgment rate in metal surface scratch depth detection are solved, and efficient and accurate detection of scratch depth within 0.05mm is achieved.

CN119887760BActive Publication Date: 2025-09-23DALIAN MINGDE PRECISION MASCH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510362734.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-09-23
Estimated Expiration
2045-03-26

AI Technical Summary

Technical Problem

The existing technology has low efficiency and high misjudgment rate in detecting the depth of metal surface scratches, making it difficult to accurately detect the depth of scratches within 0.05 mm.

Method used

Establish digital connections between the intelligent control system, image acquisition equipment, and light sources, preset light source combination plans, automatically adjust light source colors, combine edge detection and contour segmentation algorithms, calculate the scratch area to determine whether the product is qualified or unqualified.

Benefits of technology

It achieves efficient and accurate detection of metal surface scratches and defects, significantly improves detection efficiency, reduces misjudgment rate, and can detect scratch depths within 0.05mm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887760B_ABST
    Figure CN119887760B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image detection related technical fields, specifically including a method and system for detecting the depth of metal surface scratches, including: arranging and starting a light source, and automatically adjusting the color of the light source according to the color characteristics of the metal surface; extracting the edge contour of the scratch, and using a contour extraction algorithm to extract the contour point set of the scratch, and distinguishing different scratch areas; calculating the area of ​​the extracted scratch contour to obtain a constraint value for each scratch area; comparing the constraint value of the scratch area with a preset threshold, and if the constraint value of the scratch area is greater than the preset threshold, the product is considered unqualified. This solves the technical problem of a high misjudgment rate in metal surface defect detection in the prior art, achieves efficient and accurate detection of metal surface scratch defects, and rapidly performs defect detection on a large number of metal surfaces through an intelligent control system without manual intervention, significantly improving the technical effect of detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to image detection, and in particular to a method and system for detecting the depth of scratches on a metal surface. Background Art

[0002] Surface scratches are a common defect in the production, transportation, and use of metal products. These scratches not only affect the product's appearance but can also lead to stress concentration, reducing its mechanical properties and service life. Currently, traditional methods for detecting the depth of metal surface scratches rely primarily on manual visual inspection and simple gaging. This is inefficient and has a high rate of false positives, making it difficult to ensure efficient and accurate detection of surface scratches. Summary of the Invention

[0003] The purpose of this application is to provide a method and system for detecting the depth of scratches on metal surfaces, so as to solve the technical problem of a high misjudgment rate in the prior art of metal surface defect detection.

[0004] In view of the above technical problems, the present application provides a method and system for detecting the depth of scratches on a metal surface.

[0005] In a first aspect of an embodiment of the present application, a method for detecting the depth of scratches on a metal surface is provided, the method comprising:

[0006] Establish digital connections between intelligent control systems, image acquisition equipment, and light sources;

[0007] Preset multiple light source combination schemes. Build a light source detection scheme library by matching the light source combination schemes corresponding to the metal type of the product to be detected and the target detection accuracy threshold. The multiple light source combination schemes are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection scheme library contains a collection of light source combinations that match different metal types and detection accuracy standards;

[0008] Deploy and activate the light source, match the light source detection plan according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection plan;

[0009] Detecting the color characteristics of the metal surface and automatically adjusting the light source color. The automatic adjustment of the light source color is to find the light source color with the smallest contrast with the metal surface color, use the adjusted light source color for illumination, and collect an image of the metal surface to obtain the scratches to be detected;

[0010] Use edge detection algorithm to extract edge contour of the dent, use contour extraction algorithm to extract contour point set of the dent, and use contour segmentation technology to separate different dent areas;

[0011] Calculate the area of ​​the extracted scratch contour to obtain the constraint value of each scratch area;

[0012] The constraint value of the dent area is compared with a preset threshold. If the constraint value of the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

[0013] A second aspect of the embodiments of the present application further provides a metal surface scratch depth detection system, the system comprising:

[0014] A digital connection establishment module, which is used to establish a digital connection between the intelligent control system and the image acquisition device and the light source;

[0015] A light source detection solution library construction module, which is used to preset multiple light source combination solutions. The light source detection solution library is constructed by matching the corresponding light source combination solutions based on the metal type of the product to be detected and the target detection accuracy threshold. The multiple light source combination solutions are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection solution library contains a collection of light source combinations that match different metal types and detection accuracy standards;

[0016] A detection scheme execution module, which is used to deploy and start the light source, match the light source detection scheme according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection scheme;

[0017] A light source color automatic adjustment module is used to detect the color characteristics of the metal surface and automatically adjust the light source color. The automatic adjustment of the light source color is to find the light source color with the minimum contrast with the metal surface color, use the adjusted light source color for irradiation, and collect an image of the metal surface to obtain the scratches to be detected;

[0018] A dent area segmentation module is used to extract the edge contour of the dent using an edge detection algorithm, extract the contour point set of the dent using a contour extraction algorithm, and distinguish different dent areas using contour segmentation technology;

[0019] A constraint value obtaining module, which is used to calculate the area of ​​the extracted dent contour to obtain a constraint value for each dent area;

[0020] The constraint value and threshold comparison module is used to compare the constraint value of the dent area with a preset threshold. If the constraint value of the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

[0021] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0022] Establish a digital connection between the intelligent control system and the image acquisition device and the light source; preset multiple light source combination schemes, and build a light source detection scheme library by matching the metal type of the product to be detected with the threshold value of the target detection accuracy. The multiple light source combination schemes are the light source combinations and exposure rate parameters that best meet the current detection needs. The light source detection scheme library contains a collection of light source combinations that match different metal types and detection accuracy standards; deploy and start the light source, match the light source detection scheme according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection scheme; detect the color characteristics of the metal surface and automatically adjust the light source color. The automatic adjustment of the light source color is to find the light source combination that matches the metal type and the detection accuracy threshold of the product to be detected. The light source color with the smallest color contrast on the metal surface is used for irradiation, and an image of the metal surface is collected to obtain the dents to be detected; the edge contour of the dent is extracted using an edge detection algorithm, the contour point set of the dent is extracted using a contour extraction algorithm, and different dent areas are distinguished by contour segmentation technology; the area of ​​the extracted dent contour is calculated to obtain the constraint value of each dent area; the constraint value of the dent area is compared with a preset threshold value, and if the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified, and if the constraint value of the dent area is greater than the preset threshold value, the product is considered unqualified, and the preset threshold value is set according to the actual requirements and quality standards of the product. This solves the technical problem of a high misjudgment rate in defect detection on metal surfaces in the prior art, achieves efficient and accurate detection of dent defects on metal surfaces, and rapidly detects defects on a large number of metal surfaces through an intelligent control system without manual intervention, significantly improving the technical effect of detection efficiency.

[0023] The above description is only an overview of the technical solution of the present application. In order to more clearly illustrate the technical means of the present application and to implement it in accordance with the contents of the specification, and to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The embodiments of the present invention and the following brief description are illustrated in conjunction with the accompanying drawings, which are described as follows:

[0025] Figure 1 A schematic diagram of a process for detecting the depth of scratches on a metal surface provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a process for extracting the edge contour and contour point set of a scratch, and distinguishing different scratch areas, in a method for detecting scratch depth on a metal surface provided in an embodiment of the present application;

[0027] Figure 3 A schematic structural diagram of a metal surface scratch depth detection system provided in an embodiment of the present application.

[0028] Explanation of the accompanying symbols: digital connection establishment module 11, light source detection plan library construction module 12, detection plan execution module 13, light source color automatic adjustment module 14, scratch area segmentation module 15, constraint value acquisition module 16, constraint value and threshold comparison module 17. DETAILED DESCRIPTION

[0029] The present application solves the technical problem of a high misjudgment rate in metal surface defect detection in the prior art by providing a method and system for detecting the depth of metal surface scratches.

[0030] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0031] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products or devices.

[0032] Example 1, as Figure 1 As shown, the present application provides a method for detecting the depth of scratches on a metal surface, wherein the method comprises:

[0033] Establish digital connections between intelligent control systems, image acquisition equipment, and light sources;

[0034] Specifically, a digital connection is established between the intelligent control system, image acquisition equipment, and light source. The intelligent control system automatically analyzes image data and generates precise control instructions, enabling intelligent adjustment of the light source and automation of flaw detection, thereby improving detection accuracy and efficiency.

[0035] Preset multiple light source combination schemes. Build a light source detection scheme library by matching the light source combination schemes corresponding to the metal type of the product to be detected and the target detection accuracy threshold. The multiple light source combination schemes are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection scheme library contains a collection of light source combinations that match different metal types and detection accuracy standards;

[0036] Specifically, first, determine the metal type of the product to be inspected and the target detection accuracy threshold. Metal types are categorized based on the material of the product to be inspected, such as iron, aluminum, copper, and stainless steel. Each metal responds differently to light sources due to its varying optical properties, such as reflectivity and absorptivity. A detection accuracy threshold is set based on the product's actual requirements and quality standards. This threshold is determined based on information such as the location and depth of the dent. Second, design a light source combination. Select various light source types and create a layout, taking into account the light source placement (e.g., direct, oblique, circular, or strip), as well as the angle and distance between the light source and the product to be inspected. For each metal type and target detection accuracy threshold, design a series of experiments to test different light source combinations. Use an image acquisition device to capture images of the product to be inspected under different light source combinations. Analyze the images to assess the impact of different light source combinations on detection accuracy. Based on the experimental results, select the light source combination and exposure parameters that best meet the current detection requirements to determine the optimal light source combination. Finally, construct a light source detection solution library, storing the optimal light source combination for each metal type and target detection accuracy threshold.

[0037] Deploy and activate the light source, match the light source detection plan according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection plan;

[0038] Specifically, first, prepare the corresponding light source equipment, and determine the optimal layout of the light source based on the size, shape and detection requirements of the product to be inspected, so that the light can be evenly and effectively irradiated on the surface of the product to be inspected. Install the light source equipment on the inspection station according to the predetermined layout, connect the power supply and controller, and start the light source. At this time, the light source should emit stable and uniform light to illuminate the surface of the product to be inspected. Next, based on the detected metal type and the set target detection accuracy threshold, match the corresponding light source detection plan from the light source detection plan library. This includes selecting the most appropriate light source type, layout and parameter settings. Finally, execute the matched light source detection plan.

[0039] Detecting the color characteristics of the metal surface and automatically adjusting the light source color. The automatic adjustment of the light source color is to find the light source color with the smallest contrast with the metal surface color, use the adjusted light source color for illumination, and collect an image of the metal surface to obtain the scratches to be detected;

[0040] Specifically, the inspection process is initiated, executing the matched light source detection scheme to detect the color characteristics of the metal surface. Because low contrast helps enhance surface detail and potential scratches, a light source color with minimal contrast is sought. Finally, the adjusted light source color is used for illumination, and an image acquisition device is used to recapture an image of the metal surface to obtain the scratches to be detected.

[0041] Furthermore, the color characteristics of the metal surface are detected, and the color of the light source is automatically adjusted. The automatic adjustment of the light source color is to find the light source color with the smallest contrast with the color of the metal surface, use the adjusted light source color for irradiation, and collect an image of the metal surface to obtain the scratches to be detected, which also includes:

[0042] Obtain the color information of the metal surface from the collected image, the color information including the average hue and saturation ;

[0043] Get the light source hue from the light source color information and the saturation of the light source ;

[0044] Use a color matching algorithm to calculate the difference between the metal surface color and the candidate light source color, and adjust the light source color to the calculated color with the minimum contrast;

[0045] Illuminate the metal surface with the adjusted light source and recapture the image.

[0046] Specifically, the HSV (hue, saturation, brightness) color space is used to analyze color features. The color information of the metal surface is obtained from the collected image, including the average hue of the color. and saturation Calculate the average hue of the metal surface area in HSV color space ( ) and saturation ( ). When calculating the average hue, traverse each pixel in the metal surface area, obtain its hue value, and then calculate the average. The saturation is calculated as above, by summing and averaging the saturation values ​​of the pixels in the metal surface area. Next, obtain the light source hue from the light source color information. and the saturation of the light source . Then, use a color matching algorithm to calculate the difference between the color of the metal surface and the color of the candidate light source, and adjust the color of the light source to the color with the minimum calculated contrast. After determining the light source with the minimum contrast with the metal surface color, adjust the light source. After adjusting the light source color, use the adjusted light source to re-illuminate the metal surface. Ensure that the light source's illumination angle, distance and other parameters are consistent with the previous acquisition to ensure image comparability. Finally, use the image acquisition device to recapture the image of the metal surface.

[0047] Furthermore, a color matching algorithm is used to calculate the difference between the color of the metal surface and the color of the candidate light source, and the color of the light source is adjusted to the calculated color with the minimum contrast, which also includes:

[0048] By calculating the color difference To express contrast, the formula for measuring the contrast between the metal surface color and the light source color is:

[0049] ;

[0050] are weight factors for hue, saturation, and brightness. Different weight values ​​are set based on actual experimental experience. Is the average tone and light source hue The hue difference is constrained to be no more than 180 degrees.

[0051] The color difference Substituting into the formula:

[0052] ;

[0053] Get the minimum contrast between the metal surface color and the light source color ;

[0054] A list of candidate light source colors is defined. By calculating the contrast between each candidate light source color and the metal surface color, the light source color corresponding to the minimum contrast value is selected. The light source color with the minimum contrast value is the light source color with the smallest difference from the metal surface color.

[0055] Specifically, when calculating the difference between the metal surface color and the candidate light source color, the color difference is calculated by To express contrast. The calculation formula takes into account the three factors of hue, saturation and brightness. The formula is:

[0056] ;

[0057] in are weight factors for hue, saturation, and brightness, which are determined based on actual experimental experience; It is the hue difference between the average hue and the light source hue, and the maximum hue difference is constrained not to exceed 180 degrees;

[0058] The color difference Substitute into the formula , get the minimum contrast between the metal surface color and the light source color ;

[0059] Define a candidate light source color list that contains all possible light source color options for illuminating metal surfaces. These candidate light source colors are selected based on multiple factors such as light source equipment, metal type, and experience of detection requirements. For each light source color in the candidate light source color list, calculate its contrast with the metal surface color. Calculate the corresponding color of each candidate light source color according to the color difference formula. After calculating the contrast between all candidate light source colors and metal surface colors After comparing the values, select The light source color with the smallest value. This light source color is the light source color that has the smallest difference from the metal surface color.

[0060] Use edge detection algorithm to extract edge contour of the dent, use contour extraction algorithm to extract contour point set of the dent, and use contour segmentation technology to separate different dent areas;

[0061] Specifically, edge detection, contour extraction, and contour segmentation techniques are combined to process the dented image. First, edge detection algorithms (such as the Sobel, Prewitt, Roberts, and Canny algorithms) are used to extract the edge contours of the dent. Then, contour extraction algorithms (such as the findContours function) are used to extract the contour points of the dent. Finally, contour segmentation techniques (such as the active contour model Snake) are used to separate the different dented areas.

[0062] Further, such as Figure 2 As shown, the edge detection algorithm is used to extract the edge contour of the dent, the contour extraction algorithm is used to extract the contour point set of the dent, and the contour segmentation technology is used to distinguish different dent areas. It also includes:

[0063] Read the image of the metal surface and perform preprocessing to extract the edge of the scratch in the image using an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process.

[0064] A contour extraction algorithm is used to obtain a contour point set of the scratch, and a parameter is used to limit the extraction of only the external contour to simplify the contour point set, wherein each extracted contour is regarded as a point set;

[0065] Draw each extracted contour on the image;

[0066] Each extracted contour is segmented using contour segmentation technology to distinguish different bruise areas.

[0067] Specifically, the captured metal surface image is read and preprocessed into a grayscale image to simplify the subsequent edge detection process. Grayscale images contain only brightness information, reducing the influence of color on edge detection. The grayscale image is then smoothed, such as with a Gaussian blur, to reduce noise and improve edge detection accuracy. An appropriate edge detection algorithm, such as Canny, Sobel, or Laplacian, is selected based on the image's characteristics and applied to the preprocessed grayscale image to obtain a binary image containing the edges of the dents. Contour extraction functions (such as findContours in OpenCV) are then used to locate contours within the binary image. Parameters are set to only extract the outer contours, simplifying the contour point set. Each found contour is represented as a point set containing the coordinates of all points on the contour. These contour point sets are used for subsequent contour drawing and segmentation. Each extracted contour is then drawn on the image using the contour point set. Contour segmentation techniques (such as graph-theory-based segmentation algorithms) are then used to segment each extracted contour, completely separating the different dent areas.

[0068] Calculate the area of ​​the extracted scratch contour to obtain the constraint value of each scratch area;

[0069] Specifically, the area of ​​the extracted dent contour is calculated, and then the area value is substituted into the constraint value calculation formula to calculate the constraint value of each dent area, which is used to determine the severity of the dent. When dealing with metal surface dent detection tasks, extracting the dent contour and calculating its area is a critical step. It can help us understand the severity of the dent and achieve quantitative analysis of the dent area.

[0070] Furthermore, the area of ​​the extracted dent contour is calculated to obtain the constraint value of each dent area, which also includes:

[0071] The area of ​​each scratched area is obtained by calculating the number of pixels in the area enclosed by the scratch outline;

[0072] The constraint value is obtained by the constraint value calculation formula, and the constraint value calculation formula is:

[0073] C=k1*A+k2*P ;

[0074] Among them, k1 is the weight coefficient for adjusting the influence of the dent area, k2 is the weight coefficient for adjusting the influence of the dent perimeter, k1 and k2 are data obtained through experimental testing, A is the area of ​​the dent area, and P is the perimeter of the dent outline.

[0075] Specifically, the number of pixels in the area enclosed by the dent outline is first calculated using the scan line algorithm or the seed filling algorithm, and then the area of ​​each dent area is obtained. The perimeter of the dent outline can be calculated by using the distance between two adjacent points formula, and then the perimeter is accumulated. The area of ​​the dent area and the perimeter of the dent outline are then substituted into the constraint value calculation formula C=k1*A+k2*P to calculate the constraint value. Among them, k1 is the weight coefficient for adjusting the influence of the dent area, k2 is the weight coefficient for adjusting the influence of the perimeter of the dent, A is the area of ​​the dent area, and P is the perimeter of the dent outline. The weight coefficients k1 and k2 are data obtained by analyzing and testing a large number of samples with dents during the experiment.

[0076] The constraint value of the dent area is compared with a preset threshold. If the constraint value of the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

[0077] Specifically, the calculated constraint value for the dent area is compared with a preset threshold. This threshold is determined based on the actual product requirements and quality standards. If the constraint value for the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value for the dent area is greater than the preset threshold, the product is considered unqualified.

[0078] Furthermore, the constraint value of the scratch area is compared with a preset threshold. If the constraint value of the scratch area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the scratch area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

[0079] Preset thresholds, which are obtained by analyzing a large amount of sample data based on specific product standards and different application scenarios to adapt to different surface defect sensitivities;

[0080] Compare the constraint value of each scratch area with the threshold value, and judge whether the product is qualified based on the comparison result.

[0081] Specifically, to adapt to different sensitivities to metal surface defects, a large amount of sample data is collected based on product standards and different application scenarios. During the data collection process, products from different production batches and under different production process conditions are covered. For each sample, its scratch condition is recorded in detail, including information such as the scratch area, location, and depth, and the performance of these samples during actual use is also recorded. By analyzing these data and applying statistical methods such as mean, standard deviation, and probability distribution, a preset threshold is determined that can ensure product quality while taking into account production efficiency and cost.

[0082] The calculated constraint value is compared with the preset threshold. If the constraint value for the dent area is less than or equal to the preset threshold, it means that the impact of the dent on the product is within an acceptable range. The product is deemed qualified. Conversely, if the constraint value for the dent area is greater than the preset threshold, it indicates that the dent may have an unacceptable impact on the product's performance, appearance, or service life, resulting in the product being deemed unqualified. For unqualified products, the company needs to handle them according to their quality management processes, such as rework, scrapping, or special marking to further analyze the cause of the defect.

[0083] In summary, the embodiments of the present application have at least the following technical effects:

[0084] Establish a digital connection between the intelligent control system and the image acquisition device and the light source; preset multiple light source combination schemes, and build a light source detection scheme library by matching the metal type of the product to be detected with the threshold value of the target detection accuracy. The multiple light source combination schemes are the light source combinations and exposure rate parameters that best meet the current detection needs. The light source detection scheme library contains a collection of light source combinations that match different metal types and detection accuracy standards; deploy and start the light source, match the light source detection scheme according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection scheme; detect the color characteristics of the metal surface and automatically adjust the light source color. The automatic adjustment of the light source color is to find the light source combination that matches the metal type and the detection accuracy threshold of the product to be detected. The light source color with the smallest color contrast on the metal surface is used for irradiation, and an image of the metal surface is collected to obtain the dents to be detected; the edge contour of the dent is extracted using an edge detection algorithm, the contour point set of the dent is extracted using a contour extraction algorithm, and different dent areas are distinguished by contour segmentation technology; the area of ​​the extracted dent contour is calculated to obtain the constraint value of each dent area; the constraint value of the dent area is compared with a preset threshold value, and if the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified, and if the constraint value of the dent area is greater than the preset threshold value, the product is considered unqualified, and the preset threshold value is set according to the actual requirements and quality standards of the product. This solves the technical problem of a high misjudgment rate in defect detection on metal surfaces in the prior art, achieves efficient and accurate detection of dent defects on metal surfaces, and rapidly detects defects on a large number of metal surfaces through an intelligent control system without manual intervention, significantly improving the technical effect of detection efficiency.

[0085] Existing technologies also target the depth detection of metal surface scratches. Laboratory measurements use 3D stereoscopic testing, while mass production uses laser testing or manual visual inspection. 3D stereoscopic testing is inefficient; mass production laser testing has an accuracy of >0.1mm, making it incapable of detecting scratches less than 0.05mm; and manual visual inspection has a high rate of misjudgments and errors. This application achieves efficient and accurate detection of metal surface scratches, particularly resolving the technical issue in existing technologies where scratch depth detection on metal surfaces cannot be performed for scratches less than 0.05mm.

[0086] Example 2, based on the same inventive concept as the method for detecting the depth of scratches on a metal surface in the above embodiment, Figure 2 As shown, the present application provides a metal surface scratch depth detection system. The system and method embodiments of the present application are based on the same inventive concept. The system includes:

[0087] A digital connection establishing module 11, which is used to establish a digital connection between the intelligent control system and the image acquisition device and the light source;

[0088] A light source detection solution library construction module 12 is used to preset multiple light source combination solutions. The light source detection solution library is constructed by matching the light source combination solutions corresponding to the metal type of the product to be detected and the threshold of the target detection accuracy. The multiple light source combination solutions are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection solution library contains a collection of light source combinations that match different metal types and detection accuracy standards;

[0089] A detection scheme execution module 13 is used to deploy and start the light source, match the light source detection scheme according to the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection scheme;

[0090] A light source color automatic adjustment module 14 is used to detect the color characteristics of the metal surface and automatically adjust the light source color. The automatic adjustment of the light source color is to find the light source color with the minimum contrast with the metal surface color, use the adjusted light source color for illumination, and collect an image of the metal surface to obtain the scratches to be detected;

[0091] The dent area segmentation module 15 is used to extract the edge contour of the dent using an edge detection algorithm, extract the contour point set of the dent using a contour extraction algorithm, and distinguish different dent areas using contour segmentation technology;

[0092] A constraint value obtaining module 16 is used to calculate the area of ​​the extracted dent contour to obtain a constraint value for each dent area;

[0093] The constraint value and threshold comparison module 17 is used to compare the constraint value of the dent area with a preset threshold. If the constraint value of the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

[0094] Furthermore, the light source color automatic adjustment module 14 is configured to perform the following method:

[0095] Obtain the color information of the metal surface from the collected image, the color information including the average hue and saturation ;

[0096] Get the light source hue from the light source color information and the saturation of the light source ;

[0097] Use a color matching algorithm to calculate the difference between the metal surface color and the candidate light source color, and adjust the light source color to the calculated color with the minimum contrast;

[0098] Illuminate the metal surface with the adjusted light source and recapture the image.

[0099] Furthermore, the scratch area segmentation module 15 is configured to perform the following method:

[0100] Read the image of the metal surface and perform preprocessing to extract the edge of the scratch in the image using an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process.

[0101] A contour extraction algorithm is used to obtain a contour point set of the scratch, and a parameter is used to limit the extraction of only the external contour to simplify the contour point set, wherein each extracted contour is regarded as a point set;

[0102] Draw each extracted contour on the image;

[0103] Each extracted contour is segmented using contour segmentation technology to distinguish different bruise areas.

[0104] Furthermore, the constraint value obtaining module 16 is used to execute the following method:

[0105] The area of ​​each scratched area is obtained by calculating the number of pixels in the area enclosed by the scratch outline;

[0106] The constraint value is obtained by the constraint value calculation formula, and the constraint value calculation formula is:

[0107] C=k1*A+k2*P ;

[0108] Among them, k1 is the weight coefficient for adjusting the influence of the dent area, k2 is the weight coefficient for adjusting the influence of the dent perimeter, k1 and k2 are data obtained through experimental testing, A is the area of ​​the dent area, and P is the perimeter of the dent outline.

[0109] Furthermore, the constraint value and threshold comparison module 17 is used to perform the following method:

[0110] Preset thresholds, which are obtained by analyzing a large amount of sample data based on specific product standards and different application scenarios to adapt to different surface defect sensitivities;

[0111] Compare the constraint value of each scratch area with the threshold value, and judge whether the product is qualified based on the comparison result.

[0112] It should be noted that the above-mentioned order of the embodiments of the present application is for descriptive purposes only and does not represent the superiority or inferiority of the embodiments. The above description is of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0113] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

[0114] This specification and drawings are merely illustrative of the present application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Obviously, those skilled in the art may make various modifications and variations to this application without departing from the scope of this application. Thus, this application is intended to include such modifications and variations as fall within the scope of this application and its equivalents.

Claims

1. A method for detecting the depth of scratches on a metal surface, characterized in that: The method comprises: Establish digital connections between intelligent control systems, image acquisition equipment, and light sources; Preset multiple light source combination schemes. Build a light source detection scheme library by matching the light source combination schemes corresponding to the metal type of the product to be detected and the target detection accuracy threshold. The multiple light source combination schemes are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection scheme library contains a collection of light source combinations that match different metal types and detection accuracy standards; Deploy and activate the light source, match the light source detection plan with the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection plan; Detecting the color characteristics of the metal surface and automatically adjusting the color of the light source, wherein the automatic adjustment of the light source color is to find the light source color with the smallest contrast with the metal surface color, using the adjusted light source color for illumination, and collecting an image of the metal surface to obtain the scratches to be detected; Use edge detection algorithm to extract edge contour of the dent, use contour extraction algorithm to extract contour point set of the dent, and use contour segmentation technology to separate different dent areas; Calculate the area of ​​the extracted scratch contour to obtain the constraint value of each scratch area; The constraint value of the scratch area is compared with a preset threshold. If the constraint value of the scratch area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the scratch area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product. The method includes detecting the color characteristics of the metal surface and automatically adjusting the color of the light source, wherein the method automatically adjusts the color of the light source to find the light source color with the smallest contrast with the color of the metal surface, uses the adjusted light source color for irradiation, and collects an image of the metal surface to obtain the scratches to be detected, including: The color information of the metal surface is obtained from the collected image, and the color information includes the average hue H m and saturation S m ; From the light source color information, get the light source hue H l and the saturation S of the light source l ; Use a color matching algorithm to calculate the difference between the metal surface color and the candidate light source color, and adjust the light source color to the calculated color with the minimum contrast; Illuminate the metal surface with the adjusted light source and recapture the image; Use a color matching algorithm to calculate the difference between the metal surface color and the candidate light source color, and adjust the light source color to the calculated color with the minimum contrast, including: The hue difference H m -H l Substituting into the formula: ΔH=min(|H m -H l |,360-|H m -H l |) Get the minimum contrast value ΔH between the metal surface color and the light source color; A list of candidate light source colors is defined. By calculating the contrast between each candidate light source color and the metal surface color, the light source color corresponding to the minimum contrast value is selected. The light source color with the minimum contrast value is the light source color with the smallest difference from the metal surface color.

2. A method for detecting the depth of scratches on a metal surface according to claim 1, characterized in that: Use edge detection algorithms to extract the edge contours of the dents, use contour extraction algorithms to extract the contour point set of the defect, and use contour segmentation technology to separate different dent areas, including: Read the image of the metal surface and perform preprocessing to extract the edge of the scratch in the image using an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process. A contour extraction algorithm is used to obtain a contour point set of the scratch, and a parameter is used to limit the extraction of only the external contour to simplify the contour point set, wherein each extracted contour is regarded as a point set; Draw each extracted contour on the image; Each extracted contour is segmented using contour segmentation technology to distinguish different bruise areas.

3. A method for detecting the depth of scratches on a metal surface as claimed in claim 1, characterized in that: Calculate the area of ​​the extracted dent contour to obtain the constraint value of each dent area, including: The area of ​​each scratched area is obtained by calculating the number of pixels in the area enclosed by the scratch outline; The constraint value is obtained by the constraint value calculation formula, and the constraint value calculation formula is: C=k1*A+k2*P Among them, k1 and k2 are weight coefficients for adjusting the impact of the dent area and perimeter respectively. These weight coefficients are obtained through experimental testing data. A is the area of ​​the dent area, and P is the perimeter of the dent outline.

4. A method for detecting the depth of scratches on a metal surface as claimed in claim 1, characterized in that: The constraint value of the scratch area is compared with a preset threshold. If the constraint value of the scratch area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the scratch area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product, including: Preset thresholds, which are obtained by analyzing a large amount of sample data based on specific product standards and different application scenarios to adapt to different surface defect sensitivities; The constraint value of each scratch area is compared with the threshold value, and the product is judged to be qualified based on the comparison result.

5. A metal surface scratch depth detection system, characterized in that: The system is used to implement the method for detecting the depth of scratches on a metal surface according to any one of claims 1 to 4, and the system comprises: A digital connection establishment module, which is used to establish a digital connection between the intelligent control system and the image acquisition device and the light source; A light source detection solution library construction module, which is used to preset multiple light source combination solutions. The light source detection solution library is constructed by matching the corresponding light source combination solutions based on the metal type of the product to be detected and the target detection accuracy threshold. The multiple light source combination solutions are the light source combinations and exposure rate parameters that best meet the current detection requirements. The light source detection solution library contains a collection of light source combinations that match different metal types and detection accuracy standards; A detection scheme execution module, which is used to deploy and start the light source, match the light source detection scheme based on the detected metal type and the detection accuracy threshold of the product to be detected, and execute the light source detection scheme; A light source color automatic adjustment module is used to detect the color characteristics of the metal surface and automatically adjust the color of the light source. The automatic adjustment of the light source color is to find the light source color with the minimum contrast with the metal surface color, use the adjusted light source color for illumination, and collect an image of the metal surface to obtain the scratches to be detected; A dent area segmentation module is used to extract the edge contour of the dent using an edge detection algorithm, extract the contour point set of the dent using a contour extraction algorithm, and distinguish different dent areas using contour segmentation technology; A constraint value obtaining module, which is used to calculate the area of ​​the extracted dent contour to obtain a constraint value for each dent area; The constraint value and threshold comparison module is used to compare the constraint value of the dent area with a preset threshold. If the constraint value of the dent area is less than or equal to the preset threshold, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold, the product is considered unqualified. The preset threshold is set according to the actual requirements and quality standards of the product.

Citation Information

Patent Citations

  • A defect detection device and method for a non-standard high reflective curved surface workpiece

    AU2020100891A4

  • Automobile seat surface defect detection system based on machine vision as well as detection method

    CN105806849A