A quality inspection method for metal composite materials based on image processing

By using edge detection and cluster analysis, the error problem in the quality inspection of metal composite materials is solved, and the accurate identification and evaluation of surface defects in metal composite materials are achieved.

CN118781112BActive Publication Date: 2024-11-15宝鸡世邦钛制品有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411261334.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-11-15
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

In existing technologies, the quality inspection results of metal composite materials are inaccurate, especially because it is difficult to distinguish between the natural texture and surface defects of the metal itself, resulting in large errors in the inspection results.

Method used

By performing edge detection on metal composite materials, edge connected regions are obtained. The angle between any two pixels and the horizontal direction is calculated. The regularity of the edge connected regions is calculated based on the variance of the angle. Edge connected regions with similar regularities are merged and clustered. The degree of anomaly of the clusters is calculated. Finally, the defect region is determined based on the degree of defect.

Benefits of technology

It improves the accuracy of quality inspection of metal composite materials, reduces false and missed detections caused by metal texture, and provides a more accurate quality assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781112B_ABST
    Figure CN118781112B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a metal composite material quality detection method based on image processing. The method comprises the steps of: obtaining an edge connected domain of a metal composite material; for any edge connected domain, calculating the angle between any two pixel points and the horizontal direction, calculating the regularity of the edge connected domain according to the variance of the angle, calculating the regularity of the edge connected domain and its #imgabs0# nearest neighbor edge connected domains for selective merging; clustering the merged edge connected domains, and for any cluster cluster, calculating the abnormality of the cluster cluster; calculating the defect degree of any merged edge connected domain, judging whether each merged edge connected domain is a defective edge connected domain according to the defect degree, and completing the quality detection of the metal composite material. The present invention provides more accurate quality detection results for metal composite materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a metal composite material quality detection method based on image processing. Background Art

[0002] With the development of modern manufacturing technology, metal composite materials have been widely used in petroleum, chemical, shipbuilding, machinery manufacturing and other industrial fields because they have greatly improved the thermal expansion and strength of single metal materials. However, due to the complex manufacturing process and high cost of metal composite materials, it is necessary to conduct quality inspection on metal composite materials. During the manufacturing process, scratches and dents may appear on the surface of metal composite materials. These surface defects will reduce the appearance quality of the material and also affect the wear resistance and durability of the material.

[0003] The traditional quality inspection method of metal composite materials mainly relies on manual subjective observation. This method is simple to operate, but requires a lot of manpower. Therefore, it is necessary to use image processing technology to inspect the quality of metal composite materials to replace manual work and avoid consuming a lot of manpower and material resources.

[0004] For example, the Chinese patent application document with publication number CN112837285A discloses a method and device for edge detection of plate surface images, which points out that in the process of plate surface edge detection, due to the influence of factors such as lighting and conveyor belt boundaries, the edge of the plate surface in the collected image has a small gradient and is difficult to identify. The existing edge detection method cannot accurately detect the edge of the plate surface in the plate surface image, so it is necessary to analyze the gradient change in the image to prevent missed detection and false detection when detecting plate surface defects. On the surface of metal composite materials, there will be a large number of natural textures existing in the metal itself. When edge detection is performed on it, these texture parts will also be detected, which will affect the quality detection results of the metal composite materials and lead to inaccurate quality detection results. Summary of the invention

[0005] The purpose of the present invention is to provide a metal composite material quality detection method based on image processing to solve the technical problem of inaccurate quality detection results of metal composite materials.

[0006] In order to solve the above technical problems, the present invention provides a metal composite material quality detection method based on image processing, which adopts the following technical solutions:

[0007] Perform edge detection on metal composite materials to obtain all edge connected domains;

[0008] For any edge connected domain, the angle between any two pixels and the horizontal direction is calculated, and the regularity of the edge connected domain is calculated based on the variance of the angle, wherein the regularity is negatively correlated with the variance of the angle; the regularity is calculated based on the variance of the angle. The absolute value of the regularity difference of the nearest neighbor edge connected domains is calculated, and the edge connected domains whose absolute value of the regularity difference is less than or equal to the preset threshold are merged;

[0009] Clustering the merged edge connected domains, for any cluster, calculating the abnormality of the cluster according to the mean of the regularity of all merged edge connected domains in the cluster and the standard deviation of the regularity of all merged edge connected domains in the cluster, wherein the abnormality is positively correlated with the mean and negatively correlated with the standard deviation;

[0010] For any merged edge connected domain, the ratio of the abnormality degree of the cluster where the merged edge connected domain is located to the regularity of the merged edge connected domain is used as the defect degree of the merged edge connected domain. According to the size of the defect degree, it is judged whether each merged edge connected domain is a defective edge connected domain, thereby completing the quality inspection of the metal composite material.

[0011] By analyzing the regularity of any merged edge connected domain and the abnormality of the clustering cluster of the merged edge connected domain after clustering, the defect degree of the merged edge connected domain is calculated, and the spatial distribution of the merged edge connected domain in the entire image is fully considered, so that the quality inspection results of metal composite materials are more accurate.

[0012] Preferably, the method for obtaining the edge connected domain comprises the steps of:

[0013] Image Utilization of Metal Composite Materials The operator performs edge detection to obtain a binary image, and all connected domains in the binary image are recorded as edge connected domains.

[0014] Preferably, the method for obtaining the nearest neighbor edge connected domain includes:

[0015] For any edge connected domain, the mean of the horizontal coordinates of all the pixels in the edge connected domain is used as the horizontal coordinate of the center point of the edge connected domain, and the mean of the vertical coordinates of all the pixels in the edge connected domain is used as the vertical coordinate of the center point of the edge connected domain; the Euclidean distance between the center points of the edge connected domain and other edge connected domains is obtained, and the Euclidean distance of the center point closest to the edge connected domain is obtained. An edge connected domain is recorded as the nearest neighbor edge connected domain of the edge connected domain.

[0016] By analyzing any edge connected domain The nearest neighbor edge connected domain can fully consider the local regularity of the edge connected domain, which is convenient for merging edge connected domains with similar regularity into the same edge connected domain in the future to reduce the amount of calculation.

[0017] Preferably, the angle satisfies the expression:

[0018] ;

[0019] In the formula, represents the first pixels and The angle between pixels; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Represents the inverse tangent function.

[0020] Preferably, the regularity satisfies the expression:

[0021] ;

[0022] In the formula, Indicates The regularity of the edge connected domains; Indicates The total number of pixels in the edge connected domain; Represents the pixel number in the edge connected domain, where ; Represents the first pixels and The angle between each pixel and the horizontal direction; Indicates The average of the angles between the pixel and all other pixels and the horizontal direction; Expressed as a natural constant The exponential function of base .

[0023] By analyzing the difference in angles between any two pixels in the edge connected domain and the horizontal direction, the regularity of the edge connected domain is calculated, and the spatial distribution of the pixels in the edge connected domain is taken into consideration, so that the calculation result of the regularity of the edge connected domain is more accurate.

[0024] Preferably, the abnormality degree satisfies the expression:

[0025] ;

[0026] In the formula, Indicates The abnormality of each cluster; Indicates The total number of edge connected domains after merging in the clusters; Represents the total number of edge connected domains after merging that participate in clustering; Indicates The average value of the absolute value of the difference between the regularity of all merged edge connected domains in a cluster and the cluster center of the cluster; Indicates The number of edge connected domains after merging in the clusters; Indicates The first The absolute value of the difference between the regularity of the edge connected domain after merging and the cluster center of the cluster; Expressed as a natural constant The exponential function with base ; Represents the absolute value symbol.

[0027] The abnormality degree of the cluster is calculated by calculating the regularity differences of all merged edge connected domains in the cluster. It is believed that the smaller the regularity difference, the lower the abnormality degree of the cluster, so that the calculation result of the abnormality degree of the cluster is more accurate.

[0028] Preferably, the average difference comprises:

[0029] For any cluster, the absolute value of the difference between the regularity of all merged edge connected domains in the cluster and the cluster center of the cluster is obtained, and the mean of all the absolute values ​​is taken as the average difference between the regularity of all merged edge connected domains in the cluster and the cluster center of the cluster.

[0030] By calculating the average difference between the regularity of all merged edge connected domains in any cluster and the cluster center of the cluster, the average level of the difference between all merged edge connected domains in the cluster and the cluster center of the cluster can be obtained, preventing the influence of noise data points, thereby making the calculation result of the abnormality degree of the cluster more accurate.

[0031] Preferably, judging whether each merged edge connected domain is a defect connected domain according to the degree of defect comprises the steps of:

[0032] For any merged edge connected domain, if the defect degree of the merged edge connected domain is greater than or equal to a preset defect threshold, the connected domain is recorded as a defective connected domain.

[0033] The present invention has the following technical effects:

[0034] The present invention performs edge detection on the metal composite material to obtain the edge connected domain, and calculates the regularity of any edge connected domain according to the distribution of pixel points in the edge connected domain. By considering the distribution of pixel points in the edge connected domain, the calculation result of the regularity of the edge connected domain is made more accurate.

[0035] Furthermore, the present invention clusters all merged edge connected domains according to the regularity of the merged edge connected domains, and calculates the abnormality degree of all clustering clusters according to the clustering results, and calculates the defect degree of all merged edge connected domains in combination with the regularity of the merged edge connected domains and the abnormality degree of the clustering clusters to which they are located, thereby making the calculation results of the defect degree of the merged edge connected domains more accurate, and further making the quality inspection results of the metal composite materials more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0037] Figure 1 This is a method flow chart of a metal composite material quality detection method based on image processing in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0039] The embodiment of the present invention discloses a metal composite material quality detection method based on image processing, referring to Figure 1 , comprising steps S1 to S5:

[0040] S1: collecting metal composite material images, and preprocessing the metal composite material images to obtain edge connected domains;

[0041] Use a camera to take images of metal composite materials, and grayscale the images of metal composite materials. The operator performs edge detection, obtains a binary image after edge detection, and records each connected domain in the binary image as an edge connected domain.

[0042] It should be noted that Edge detection algorithm is a widely used image processing technology for identifying the edges of images. The algorithm first smoothes the image through a Gaussian filter to reduce the influence of noise; then calculates the gradient amplitude and direction of the image to determine the potential edge position; then, it uses non-maximum suppression to refine the edge, and suppresses the pixels of non-local maxima to obtain finer edge lines; finally, through the double threshold processing method, the edge pixels are divided into strong edges and weak edges. Weak edges will only be retained when they are connected to strong edges. Therefore, Edge detection algorithms can effectively detect and accurately locate edges in images.

[0043] At this point, edge detection is performed on the metal composite material to obtain all edge connected domains.

[0044] S2: For any edge connected domain, the regularity of the edge connected domain is calculated according to the distribution of pixels in the edge connected domain;

[0045] It should be noted that the edge detection results include the texture of the metal itself and the scratches and concave areas on the metal surface, which cannot be effectively distinguished based on the edge detection results alone. The texture of the metal itself is formed by the way the atoms of the metal are arranged during the solidification process. It is a natural phenomenon formed during the solidification process of the metal, while the scratches on the metal surface are usually caused by external forces, such as friction, wear and mechanical damage during the metal manufacturing process. Therefore, the regularity of the texture of the metal itself is stronger. Therefore, the present invention calculates the regularity of the edge connected domain by the distribution of pixels in the edge connected domain.

[0046] It should be further explained that, since the natural texture of the metal surface often has a certain directionality, the angle between any two pixels in the edge connected domain and the horizontal direction can be calculated, which facilitates the subsequent calculation of the regularity of the edge connected domain based on the angle between the pixel points and the horizontal direction.

[0047] In one embodiment, for any two pixels in any edge connected domain, the angle between them and the horizontal direction is calculated as follows:

[0048] ;

[0049] In the formula, represents the first pixels and The angle between each pixel and the horizontal direction; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Represents the inverse tangent function.

[0050] It should be noted that the natural texture of the metal surface usually shows high regularity and consistency in a specific direction due to its formation, while scratches or damage may show a more chaotic directional distribution. Therefore, the regularity of the edge connected domain can be calculated by calculating the distribution of these angles.

[0051] In one embodiment, the regularity calculation formula of the edge connected domain is as follows:

[0052] ;

[0053] In the formula, Indicates The regularity of the edge connected domains; Indicates The total number of pixels in the edge connected domain; Represents the pixel number in the edge connected domain, where ; Represents the first pixels and The angle between each pixel and the horizontal direction; Indicates The average of the angles between the pixel and all other pixels and the horizontal direction; Expressed as a natural constant The exponential function of base .

[0054] in, Indicates The smaller the variance of the angle between a pixel and all other pixels and the horizontal direction, the smaller the value is. The more consistent the angles between a pixel and all other pixels and the horizontal direction are, that is, the more regular the angles between the pixel and all other pixels and the horizontal direction are; It represents the average level of all variances. The smaller its value is, the stronger the regularity of the edge connected domain is.

[0055] At this point, the regularity calculation of any edge connected domain is completed.

[0056] S3: For any edge connected domain, according to the edge connected domain and its Selectively merge the regularity of the nearest neighbor edge connected domains;

[0057] It should be noted that the natural texture of the metal surface usually has a strong regularity, and this regularity is often manifested as a clear repetitive pattern in a certain direction; unlike the natural texture, scratches, dents and other defects on the metal surface usually break the regularity of the texture, causing the edge connectivity domains of these areas to show lower regularity, and scratches or damage have random or chaotic distribution characteristics, which is quite different from the regularity of natural texture.

[0058] It should be further explained that edge connected domains with similar regularity may belong to the same texture feature region. Therefore, by evaluating the regularity difference between each edge connected domain and its adjacent edge connected domains, edge connected domains with smaller regularity differences can be merged into the same region.

[0059] In one embodiment, for any edge connected domain, the mean of the horizontal coordinates of all the pixels in the edge connected domain is used as the horizontal coordinate of the center point of the edge connected domain, and the mean of the vertical coordinates of all the pixels in the edge connected domain is used as the vertical coordinate of the center point of the edge connected domain; the Euclidean distance between the center points of the edge connected domain and other edge connected domains is obtained, and the Euclidean distance closest to the center point of the edge connected domain is obtained. The edge connected domain is recorded as the nearest neighbor edge connected domain of the edge connected domain. is the preset number of nearest neighbor edge connected domains, which is not specifically limited in the present invention and can be adjusted by implementers according to actual implementation conditions. For example, .

[0060] Calculate the absolute value of the regularity difference between the edge connected domain and any of its nearest neighbor edge connected domains. If the absolute value of the regularity difference between the two is less than or equal to the preset regularity threshold , then these two edge connected domains are merged into one edge connected domain. It is a preset regularity threshold, which is not specifically limited in the present invention and can be adjusted by the implementer according to the actual situation. For example, .

[0061] At this point, the edge connected domain and its Selective merging of connected regions with nearest neighbor edges.

[0062] S4: Cluster the merged edge connected domains and calculate the abnormality degree of any cluster;

[0063] It should be noted that the above operation merges edge connected domains with similar regularity in a local range into the same edge connected domain, that is, merges edge connected domains with similar features into the same edge connected domain. In the entire image, the texture of the metal itself tends to be consistent. Therefore, the present invention clusters the regularity of all merged edge connected domains and calculates the abnormality of each cluster cluster according to the clustering results.

[0064] In one embodiment, for any merged edge connected domain, the mean of the edge connected domain before the merge is used as the regularity of the merged edge connected domain; according to the regularity of all merged edge connected domains, all merged edge connected domains are clustered using an iterative self-organizing clustering algorithm to obtain a clustering result.

[0065] For any cluster, the abnormality calculation formula of the cluster is as follows:

[0066] ;

[0067] In the formula, Indicates The abnormality of each cluster; Indicates The total number of edge connected domains after merging in the clusters; Represents the total number of edge connected domains after merging that participate in clustering; Indicates The average value of the absolute value of the difference between the regularity of all merged edge connected domains in a cluster and the cluster center of the cluster; Indicates The number of edge connected domains after merging in the clusters; Indicates The first The absolute value of the difference between the regularity of the merged edge connected domain and the cluster center of the cluster; Expressed as a natural constant The exponential function with base ; Represents the absolute value symbol.

[0068] in, It indicates the average level of the difference between the regularity of all merged edge connected domains in the cluster and the cluster center. The smaller its value is, the closer the regularity of the merged edge connected domains in the cluster is, that is, the lower the abnormality of the cluster is. Indicates the stability of the difference between the regularity of all merged edge connected domains in the cluster and the cluster center. The smaller its value is, the more stable the difference between the regularity of all merged edge connected domains in the cluster and the cluster center is. It indicates the proportion of the merged edge connected domains in the cluster. The larger the value, the more the number of merged edge connected domains in the cluster, that is, the lower the abnormality of the cluster.

[0069] At this point, the calculation of the abnormality degree of any cluster is completed.

[0070] S5: Calculate the defect degree of any merged edge connected domain to detect the quality of the metal composite material;

[0071] It should be noted that, for the natural texture part of the metal, the abnormality of the cluster where it is located is lower, and because its distribution is more regular, its regularity is higher, while for the defective part, the abnormality of the cluster where the defective part is located is higher, and because its distribution is irregular, its regularity is lower, so the present invention calculates the defect degree of any merged edge connected domain based on the abnormality of the cluster where the merged edge connected domain is located and the regularity of the merged edge connected domain.

[0072] In one embodiment, for any merged edge connected domain, the ratio of the abnormality degree of the cluster where the merged edge connected domain belongs to to the regularity of the merged edge connected domain is used as the defect degree of the merged edge connected domain.

[0073] If the defect level is greater than or equal to the preset defect threshold , then the edge connected domain is marked as a defective area, and all edge connected domains are judged to be defective connected domains, so as to complete the quality inspection of the metal composite material, where The present invention does not specifically limit the preset defect threshold, and the implementer may adjust it according to the specific implementation situation, for example .

[0074] Through the above steps, the quality inspection of metals and materials is completed.

[0075] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A metal composite material quality detection method based on image processing, characterized in that: Includes steps: Perform edge detection on metal composite materials to obtain all edge connected domains; For any edge connected domain, the angle between any two pixels and the horizontal direction is calculated, and the regularity of the edge connected domain is calculated based on the variance of the angle, wherein the regularity is negatively correlated with the variance of the angle; the regularity is calculated based on the variance of the angle. The absolute value of the regularity difference of the nearest neighbor edge connected domains is calculated, and the edge connected domains whose absolute value of the regularity difference is less than or equal to the preset threshold are merged; Clustering the merged edge connected domains, for any cluster, calculating the abnormality of the cluster according to the mean of the regularity of all merged edge connected domains in the cluster and the standard deviation of the regularity of all merged edge connected domains in the cluster, wherein the abnormality is positively correlated with the mean and negatively correlated with the standard deviation; For any merged edge connected domain, the ratio of the abnormality degree of the cluster where the merged edge connected domain is located to the regularity of the merged edge connected domain is used as the defect degree of the merged edge connected domain. According to the size of the defect degree, it is judged whether each merged edge connected domain is a defective edge connected domain, thereby completing the quality inspection of the metal composite material.

2. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: The method for obtaining the edge connected domain comprises the steps of: Image Utilization of Metal Composite Materials The operator performs edge detection to obtain a binary image, and all connected domains in the binary image are recorded as edge connected domains.

3. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: The method for obtaining the nearest neighbor edge connected domain includes: For any edge connected domain, the mean of the horizontal coordinates of all the pixels in the edge connected domain is used as the horizontal coordinate of the center point of the edge connected domain, and the mean of the vertical coordinates of all the pixels in the edge connected domain is used as the vertical coordinate of the center point of the edge connected domain; the Euclidean distance between the center points of the edge connected domain and other edge connected domains is obtained, and the Euclidean distance of the center point closest to the edge connected domain is obtained. An edge connected domain is recorded as the nearest neighbor edge connected domain of the edge connected domain.

4. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: The angle satisfies the expression: ; In the formula, represents the first pixels and The angle between pixels; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Indicates The horizontal coordinate of the pixel point; Indicates The vertical coordinate of the pixel; Represents the inverse tangent function.

5. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: The regularity satisfies the expression: ; In the formula, Indicates The regularity of the edge connected domains; Indicates The total number of pixels in the edge connected domain; Represents the pixel number in the edge connected domain, where ; Represents the first pixels and The angle between each pixel and the horizontal direction; Indicates The average of the angles between the pixel and all other pixels and the horizontal direction; Expressed as a natural constant The exponential function of base .

6. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: The abnormality degree satisfies the expression: ; In the formula, Indicates The abnormality of each cluster; Indicates The total number of edge connected domains after merging in the clusters; Represents the total number of edge connected domains after merging that participate in clustering; Indicates The average difference between the regularity of all merged edge connectivity domains in a cluster and the cluster center of the cluster; Indicates The number of edge connected regions after merging in the clusters; Indicates The first The absolute value of the difference between the regularity of the merged edge connected domain and the cluster center of the cluster; Expressed as a natural constant The exponential function with base ; Represents the absolute value symbol.

7. The metal composite material quality detection method based on image processing according to claim 6 is characterized in that: The average differences include: For any cluster, the absolute value of the difference between the regularity of all merged edge connected domains in the cluster and the cluster center of the cluster is obtained, and the mean of all absolute values ​​is taken as the average difference between the regularity of all merged edge connected domains in the cluster and the cluster center of the cluster.

8. The metal composite material quality detection method based on image processing according to claim 1 is characterized in that: Judging whether each merged edge connected domain is a defect connected domain according to the degree of defect, including the steps of: For any merged edge connected domain, if the defect degree of the merged edge connected domain is greater than or equal to a preset defect threshold, the edge connected domain is recorded as a defective connected domain.