Metal surface gouge depth detection method and system
Through the digital connection between the intelligent control system and the image acquisition equipment and light source, combined with the light source combination scheme and automatic adjustment of the light source color, the metal surface damage detection is used using edge detection and contour extraction algorithms, which solves the problem of high misjudgment rate in the existing technology and achieves efficient and accurate metal surface damage detection.
Patent Information
- Application Number
- CN202510362734.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In the prior art, defect detection of metal surfaces has a high misjudgment rate, and it is difficult to ensure efficient and accurate detection of metal surface damage defects.
By establishing a digital connection between the intelligent control system and the image acquisition equipment and light sources, preset a variety of light source combination schemes, automatically adjust the light source color, use edge detection and contour extraction algorithms to perform depth detection and area division of metal surface damage, calculate the constraint value of the damage area, and compare it with the preset threshold to determine whether the product is qualified or unqualified.
It realizes efficient and accurate detection of metal surface damage defects, reduces the rate of misjudgment, significantly improves detection efficiency, and can quickly detect defects on a large number of metal surfaces without manual intervention.
Smart Images

Figure CN119887760A_ABST
Abstract
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] In the prior art, surface scratches are a common type of defect during the production, transportation and use of metal products. Scratches not only affect the appearance quality of the product, but may also cause stress concentration, reduce the mechanical properties and service life of the product. At present, the traditional method of detecting the depth of metal surface scratches mainly relies on manual visual inspection and simple measuring tools, which is inefficient, and there is a high misjudgment rate in the defect detection of metal surfaces, making it difficult to ensure the technical problem of efficient and accurate detection of metal surface scratches. Summary of the invention
[0003] The purpose of the present application is to provide a method and system for detecting the depth of scratches on a metal surface, so as to solve the technical problem that the defect detection on the metal surface in the prior art has a high misjudgment rate.
[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: Establish digital connection between intelligent control system, image acquisition equipment and light source; Preset multiple light source combination schemes, match the corresponding light source combination schemes according to the metal type of the product to be detected and the threshold of the target detection accuracy, and build a light source detection scheme library. The multiple light source combination schemes are 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; Arrange and start 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; 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 smallest contrast with the metal surface color, use the adjusted light source color for irradiation, and collect the image of the metal surface to obtain the dents 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 distinguish different dent areas; Calculate the area of the extracted dent contour to obtain the constraint value of each dent area; The constraint value of the dent area is compared with the 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.
[0006] According to a second aspect of the embodiments of the present application, a metal surface scratch depth detection system is provided, the system comprising: 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, and to build a light source detection solution library by matching the corresponding light source combination solutions with 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; 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; A light source color automatic adjustment module, which 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 smallest 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 dents to be detected; A dent area segmentation module, which 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 a contour segmentation technique; 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.
[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages: Establish a digital connection between the intelligent control system and the image acquisition device and the light source; preset a variety of light source combination schemes, match the corresponding light source combination schemes by the metal type of the product to be detected and the threshold of the target detection accuracy, and build a light source detection scheme library. 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 after adjustment, and the image of the metal surface is collected to obtain the dents to be detected; the edge detection algorithm is used to extract the edge contour of the dent, and 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; 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 the preset threshold value, if the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified, 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. The technical problem of high misjudgment rate in defect detection of metal surfaces in the prior art is solved, and efficient and accurate detection of dent defects on metal surfaces is achieved. A large number of metal surfaces are quickly detected for defects through an intelligent control system without manual intervention, which significantly improves the technical effect of detection efficiency.
[0008] 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
[0009] The embodiments of the present invention and the following brief description are illustrated in conjunction with the accompanying drawings, which are described as follows: 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; Figure 2 A schematic diagram of a process for extracting the edge contour and contour point set of a dent and distinguishing different dent areas in a method for detecting the depth of dents on a metal surface provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a metal surface scratch depth detection system provided in an embodiment of the present application.
[0010] Explanation of the accompanying drawings: digital connection establishment module 11, light source detection scheme library construction module 12, detection scheme 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
[0011] 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.
[0012] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0013] 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 explicitly listed, but may include other steps or modules that are not explicitly listed or are inherent to these processes, methods, products or devices.
[0014] Embodiment 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: Establish digital connection between intelligent control system, image acquisition equipment and light source; Specifically, a digital connection is established between the intelligent control system, the image acquisition device, and the light source. The intelligent control system automatically analyzes the image data, generates precise control instructions, realizes the intelligent adjustment of the light source and the automation of the scratch detection, and improves the accuracy and efficiency of the detection.
[0015] Preset multiple light source combination schemes, match the corresponding light source combination schemes according to the metal type of the product to be detected and the threshold of the target detection accuracy, and build a light source detection scheme library. The multiple light source combination schemes are 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; Specifically, first, determine the metal type of the product to be detected and the target detection accuracy threshold. Metal type is classified into different metal types according to the material of the product to be detected, such as iron, aluminum, copper, stainless steel, etc. Each metal will respond differently to the light source due to its different optical properties such as reflectivity and absorptivity; set the detection accuracy threshold based on the actual requirements and quality standards of the product. The threshold is determined based on information such as the location and depth of the scratch. Secondly, design a light source combination scheme. Select multiple types of light sources, lay out the light sources, and consider the arrangement of the light sources, such as direct, oblique, circular, strip, etc., as well as the angle and distance between the light source and the product to be detected. For each metal type and target detection accuracy threshold, design a series of experiments to test different light source combination schemes. Use an image acquisition device to capture images of the product to be detected under different light source combinations. Analyze the images and evaluate the impact of different light source combinations on the detection accuracy. According to the experimental results, select the light source combination and exposure rate parameters that best meet the current detection needs to form the optimal light source combination scheme. Finally, build a light source detection scheme library, and store the optimal light source combination scheme corresponding to each metal type and target detection accuracy threshold in the light source detection scheme library.
[0016] Arrange and start 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; Specifically, first, prepare the corresponding light source equipment, and determine the optimal layout of the light source according to the size, shape and detection requirements of the product to be inspected, so that the light can be evenly and effectively irradiated to 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, according to the detected metal type and the set target detection accuracy threshold, match the corresponding light source detection scheme from the light source detection scheme library. This includes selecting the most appropriate light source type, layout and parameter settings. Finally, execute the matched light source detection scheme.
[0017] 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 smallest contrast with the metal surface color, use the adjusted light source color for irradiation, and collect the image of the metal surface to obtain the dents to be detected; Specifically, first, the detection process is started, the matched light source detection scheme is executed, and the color characteristics of the metal surface are detected. Since low contrast helps to enhance the details and potential scratches on the metal surface, the light source color with the smallest contrast with the metal surface color is found. Finally, the adjusted light source color is used for illumination, and the image acquisition device is used to recapture the image of the metal surface to obtain the scratches to be detected.
[0018] Further, the color characteristics of the metal surface are detected, and the light source color is automatically adjusted. 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 irradiation, and collect an image of the metal surface to obtain the dents to be detected, which also includes: Obtaining color information of the metal surface from the collected image, wherein the color information includes average hue and Saturation ; Get the light source hue from the light source color information and the saturation of the light source ; 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; Illuminate the metal surface with the adjusted light source and recapture the image.
[0019] 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 value. 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 the 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 calculated color with the smallest contrast. After determining the light source with the smallest contrast with the metal surface color, adjust the light source. After adjusting the color of the light source, use the adjusted light source to re-irradiate the metal surface. Ensure that the light source's irradiation angle, distance and other parameters are consistent with the previous acquisition to ensure the comparability of the image. Finally, use the image acquisition device to re-acquire the image of the metal surface.
[0020] Further, using a color matching algorithm to calculate the difference between the color of the metal surface and the color of the candidate light source, and adjusting the color of the light source to the calculated color with the minimum contrast, further comprising: By calculating the color difference To express contrast, the contrast formula between the metal surface color and the light source color is: ; are weight factors for hue, saturation, and brightness. Different weight values are set based on actual experimental experience. Is the average color and light source hue The hue difference of the constraint value is that the maximum hue difference does not exceed 180 degrees; The color difference Substituting into the formula: ; Get the minimum contrast between the metal surface color and the light source color ; A candidate light source color list is defined, and the contrast between each candidate light source color and the metal surface color is calculated to select the light source color corresponding to the minimum contrast value, where the light source color with the minimum contrast value is the light source color with the smallest difference from the metal surface color.
[0021] 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: ; in are weight factors for hue, saturation and brightness, which are determined based on actual experimental experience; 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; The color difference Substitute into the formula , get the minimum contrast between the metal surface color and the light source color ; 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 empirical testing requirements. For each light source color in the candidate light source color list, calculate its contrast with the metal surface color. Calculate the color difference formula for each candidate light source color. After calculating the contrast between all candidate light source colors and the metal surface color After the values are compared, select The light source color with the smallest value. This light source color is the light source color with the smallest difference from the metal surface color.
[0022] 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 distinguish different dent areas; Specifically, edge detection, contour extraction and contour segmentation techniques are combined to process the dented image. First, edge detection algorithms (such as the Sobel algorithm, Prewitt algorithm, Roberts algorithm and Canny algorithm) are used to extract the edge contour of the dent. Then, contour extraction algorithms (such as the findContours function) are used to extract the contour point set of the dent. Finally, contour segmentation techniques (such as the active contour model Snake) are used to distinguish different dented areas.
[0023] Further, such as Figure 2 As shown, an edge detection algorithm is used to extract the edge contour of the dent, a contour extraction algorithm is used to extract the contour point set of the dent, and contour segmentation technology is used to distinguish different dent areas. It also includes: Read the image of the metal surface and perform preprocessing, and extract the edge of the scratch in the image through an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process; Use a contour extraction algorithm to obtain a contour point set of the scratch, and use parameters to limit the extraction of only external contours 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 dent areas.
[0024] Specifically, the collected metal surface image is read and the image is preprocessed and converted into a grayscale image to simplify the subsequent edge detection process. The grayscale image only contains brightness information, which reduces the influence of color on edge detection. Then the grayscale image is smoothed, such as Gaussian blur, to reduce noise interference in the image and improve the accuracy of edge detection. Then, according to the characteristics of the image, a suitable edge detection algorithm, such as Canny, Sobel or Laplacian, is selected, and the edge detection algorithm is applied to the preprocessed grayscale image to obtain a binary image containing the edge of the dent. Then, the contour extraction function (such as findContours in OpenCV) is used to find the contour in the binary image. By setting parameters, only the external contour is extracted to simplify 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 will be used for subsequent contour drawing and segmentation. Then, each extracted contour is drawn on the image using the contour point set, and each extracted contour is further segmented using contour segmentation technology (such as a segmentation algorithm based on graph theory) to completely separate different dent areas.
[0025] Calculate the area of the extracted dent contour to obtain the constraint value of each dent area; 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 to determine the severity of the dent. In the task of detecting dents on metal surfaces, extracting the dent contour and calculating its area is an important step, which can help us understand the severity of the dent and realize quantitative analysis of the dent area.
[0026] Furthermore, the area of the extracted dent contour is calculated to obtain the constraint value of each dent area, which also includes: 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 is the weight coefficient for adjusting the impact of the dent area, k2 is the weight coefficient for adjusting the impact of the dent circumference, k1 and k2 are data obtained through experimental tests, A is the area of the dent, and P is the circumference of the dent contour.
[0027] Specifically, first calculate the number of pixels in the area enclosed by the dent outline through the scanning line algorithm or the seed filling algorithm, and then get the area of each dent area. The perimeter of the dent outline can be calculated by using the distance between two adjacent points formula, and then the perimeter is accumulated. Then substitute the area of the dent area and the perimeter of the dent outline 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 the data obtained by analyzing and testing a large number of samples with dents during the experiment.
[0028] The constraint value of the dent area is compared with the 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.
[0029] Specifically, the calculated constraint value of the dent area is compared with a preset threshold. The preset threshold is derived based on the actual requirements and quality standards of the product. If the constraint value of the dent area is less than or equal to the preset threshold, the product is determined to be qualified. If the constraint value of the dent area is greater than the preset threshold, the product is determined to be unqualified.
[0030] Further, the constraint value of the dent area is compared with a preset threshold value. If the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold value, the product is considered unqualified. The preset threshold value is set according to the actual requirements and quality standards of the product. It also includes: Preset thresholds, which are obtained by analyzing a large amount of sample data according to specific product standards and different application scenarios to adapt to different surface defect sensitivities; Compare the constraint value of each scratch area with the threshold value, and determine whether the product is qualified based on the comparison result.
[0031] Specifically, in order to adapt to the different sensitivities of metal surface defects, a large amount of sample data is collected based on product standards and different application scenarios. In the process of collecting data, products from different production batches and different production process conditions are covered. For each sample, its dents are recorded in detail, including information such as dent area, dent location, depth, etc., and the performance of these samples during actual use is also recorded. By analyzing these data and using statistical methods such as mean, standard deviation, probability distribution, etc., a preset threshold is determined that can ensure product quality while taking into account production efficiency and cost.
[0032] Compare the calculated constraint value with the preset threshold. If the constraint value of 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. For such a product, it is judged to be qualified. On the contrary, if the constraint value of the dent area is greater than the preset threshold, it means that the dent may have an unacceptable impact on the performance, appearance or service life of the product, and it is judged as an unqualified product. For unqualified products, enterprises need to handle them according to their own quality management processes, such as rework, scrapping or special marking to further analyze the cause of the defect.
[0033] In summary, the embodiments of the present application have at least the following technical effects: Establish a digital connection between the intelligent control system and the image acquisition device and the light source; preset a variety of light source combination schemes, match the corresponding light source combination schemes by the metal type of the product to be detected and the threshold of the target detection accuracy, and build a light source detection scheme library. 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 after adjustment, and the image of the metal surface is collected to obtain the dents to be detected; the edge detection algorithm is used to extract the edge contour of the dent, and 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; 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 the preset threshold value, if the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified, 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. The technical problem of high misjudgment rate in defect detection of metal surfaces in the prior art is solved, and efficient and accurate detection of dent defects on metal surfaces is achieved. A large number of metal surfaces are quickly detected for defects through an intelligent control system without manual intervention, which significantly improves the technical effect of detection efficiency.
[0034] There are also existing technologies for detecting the depth of metal surface scratches. The laboratory measurement method uses 3D stereoscopic detection, and mass production uses laser detection or manual visual inspection. Among them, 3D stereoscopic detection is slow; the detection accuracy of laser detection in mass production is > 0.1mm, and it is impossible to detect scratches below 0.05mm; manual visual inspection has a high rate of misjudgment and wrong judgment. This application realizes efficient and accurate detection of metal surface scratch defects, especially solving the technical problem that the depth of scratches within 0.05mm cannot be detected when detecting the depth of scratches on the metal surface in the existing technology.
[0035] Embodiment 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, and the system and method embodiments in the present application are based on the same inventive concept. The system includes: A digital connection establishing module 11, wherein the digital connection establishing module 11 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 12, the light source detection solution library construction module 12 is used to preset a plurality of light source combination solutions, and to construct a light source detection solution library by matching the corresponding light source combination solutions with the metal type of the product to be detected and the threshold value of the target detection accuracy. The plurality of light source combination solutions are the light source combinations and exposure rate parameters that best meet the current detection requirements, and 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 13, which is used to arrange 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; A light source color automatic adjustment module 14, which 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 smallest 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 dents to be detected; 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 a contour segmentation technology; A constraint value obtaining module 16, wherein the 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; 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.
[0036] Furthermore, the light source color automatic adjustment module 14 is used to perform the following method: Obtaining color information of the metal surface from the collected image, wherein the color information includes average hue and Saturation ; Get the light source hue from the light source color information and the saturation of the light source ; 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; Illuminate the metal surface with the adjusted light source and recapture the image.
[0037] Furthermore, the scratch area segmentation module 15 is used to perform the following method: Read the image of the metal surface and perform preprocessing, and extract the edge of the scratch in the image through an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process; Use a contour extraction algorithm to obtain a contour point set of the scratch, and use parameters to limit the extraction of only external contours 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 dent areas.
[0038] Furthermore, the constraint value obtaining module 16 is used to execute the following method: 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 is the weight coefficient for adjusting the impact of the dent area, k2 is the weight coefficient for adjusting the impact of the dent circumference, k1 and k2 are data obtained through experimental tests, A is the area of the dent, and P is the circumference of the dent contour.
[0039] Furthermore, the constraint value and threshold comparison module 17 is used to perform the following method: Preset thresholds, which are obtained by analyzing a large amount of sample data according to specific product standards and different application scenarios to adapt to different surface defect sensitivities; Compare the constraint value of each scratch area with the threshold value, and determine whether the product is qualified based on the comparison result.
[0040] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded 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 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.
[0041] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0042] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.
Claims
1. A method for detecting the depth of scratches on a metal surface, characterized in that: The method comprises: Establish digital connection between intelligent control system, image acquisition equipment and light source; Preset multiple light source combination schemes, match the corresponding light source combination schemes according to the metal type of the product to be detected and the threshold of the target detection accuracy, and build a light source detection scheme library. The multiple light source combination schemes are 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; Arrange and start 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; 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 smallest contrast with the metal surface color, use the adjusted light source color for irradiation, and collect the image of the metal surface to obtain the dents 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 distinguish different dent areas; Calculate the area of the extracted dent contour to obtain the constraint value of each dent area; The constraint value of the dent area is compared with the 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.
2. A method for detecting the depth of scratches on a metal surface as claimed in claim 1, characterized in that: 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 smallest contrast with the metal surface color, use the adjusted light source color for irradiation, and collect the image of the metal surface to obtain the dents to be detected, including: Obtaining color information of the metal surface from the collected image, wherein the color information includes average hue and Saturation ; Get the light source hue from the light source color information and the saturation of the light source ; 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; Illuminate the metal surface with the adjusted light source and recapture the image.
3. A method for detecting the depth of scratches on a metal surface as claimed in claim 2, characterized in that: 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: By calculating the color difference To express contrast, the contrast formula between the metal surface color and the light source color is: ; are weight factors for hue, saturation, and brightness. Different weight values are set based on actual experimental experience. Is the average color and light source hue The hue difference of the constraint value is that the maximum hue difference does not exceed 180 degrees; The color difference Substituting into the formula: ; Get the minimum contrast between the metal surface color and the light source color ; A candidate light source color list is defined, and the contrast between each candidate light source color and the metal surface color is calculated to select the light source color corresponding to the minimum contrast value, where the light source color with the minimum contrast value is the light source color with the smallest difference from the metal surface color.
4. A method for detecting the depth of scratches on a metal surface as claimed in claim 1, characterized in that: 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 distinguish different dent areas, including: Read the image of the metal surface and perform preprocessing, and extract the edge of the scratch in the image through an edge detection algorithm. The preprocessing is grayscale image processing to simplify the edge detection process; Use a contour extraction algorithm to obtain a contour point set of the scratch, and use parameters to limit the extraction of only external contours 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 dent areas.
5. A method for detecting the depth of scratches on a metal surface as claimed in claim 1, characterized in that: The area of the extracted dent contour is calculated 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 is the weight coefficient for adjusting the impact of the dent area, k2 is the weight coefficient for adjusting the impact of the dent circumference, k1 and k2 are data obtained through experimental tests, A is the area of the dent, and P is the circumference of the dent contour.
6. 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 dent area is compared with a preset threshold value. If the constraint value of the dent area is less than or equal to the preset threshold value, the product is considered qualified. If the constraint value of the dent area is greater than the preset threshold value, the product is considered unqualified. The preset threshold value 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 according to specific product standards and different application scenarios to adapt to different surface defect sensitivities; Compare the constraint value of each scratch area with the threshold value, and determine whether the product is qualified based on the comparison result.
7. A metal surface scratch depth detection system, characterized in that: The system is used to implement a metal surface scratch depth detection method according to any one of claims 1 to 6, 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, and to build a light source detection solution library by matching the corresponding light source combination solutions with 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; 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; A light source color automatic adjustment module, which 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 smallest 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 dents to be detected; A dent area segmentation module, which 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 a contour segmentation technique; 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
Automobile seat surface defect detection system based on machine vision as well as detection method
CN105806849A
Matching-based visual outline defect inspection system and method for specially-shaped stamping parts
CN106018422A
Visual inspection system for appearance defects of pressure sensor
CN119198754A
Method and apparatus for inspecting surface of metal strip panel
JP2000241360A
AU2020100891A4