Efficient identification and detection method for printing defects on surface of metal plate
By obtaining the difference representation value and feature analysis of the metal plate surface image, combining the gray level co-occurrence matrix and neighborhood features, clustering of suspected defect pixels and characterization of the abnormality degree are performed, which solves the accuracy problem of metal plate surface printing defect detection and improves the accuracy and reliability of detection.
Patent Information
- Application Number
- CN202510768595.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-10
AI Technical Summary
When inspecting printed defects on metal plates, the highly reflective features and uneven lighting result in low detection accuracy, making it difficult to accurately identify the printed defect areas.
By obtaining the difference representation values between the printed metal plate to be inspected and the standard image, combined with the gray-level co-occurrence matrix features and neighborhood features, clustering and abnormality degree characterization of suspected defective pixels are performed. Clustering is performed using suspected judgment index values and coordinate values, and finally, printing defects are identified based on the abnormality degree representation values.
It improves the detection accuracy of printing defect areas on the surface of printed metal plates, reduces the interference of uneven lighting and high reflection, and ensures the accuracy and reliability of detection.
Smart Images

Figure CN120672699A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a method for efficiently identifying and detecting printed defects on the surface of a metal plate. Background Art
[0002] Since printing defects on the surface of metal plates can affect the appearance quality, service life and functionality of the product, the detection of printing defects on the surface of metal plates has become an important part of quality control in the manufacturing industry. That is to say, in the production process of metal plates, the detection of printing defects on the surface of metal plates is crucial to the appearance quality and subsequent performance of the metal plates.
[0003] Since printed metal plates are generally produced in batches, there is usually a printing template in front of the printed metal plates. When performing printing defect detection on printed metal plates, the grayscale difference between the surface image of the printed metal plate to be detected and the standard image is generally obtained first, and then the defective pixels are identified based on a preset grayscale difference threshold, and the printing defect area on the surface of the printed metal plate to be detected is identified based on the recognition result. The standard image refers to the surface image of the printing template; however, the metal plate itself not only has high reflective characteristics, but also has the phenomenon of uneven lighting collection, that is, the influence of the collection environment will cause uneven brightness when collecting the surface image of the printed metal plate. The influence of the collection environment mainly refers to various environmental factors such as mechanical vibration. The influence of pixels, and the high reflective characteristics of the metal plate itself and the uneven illumination phenomenon of the collected light will directly affect the accuracy of the subsequent recognition and measurement of the printed defective area. That is, the high reflective characteristics of the metal plate itself and the uneven illumination phenomenon caused by various environmental factors in the process of collecting the surface image of the printed metal plate will cause some normal area pixels to be in the uneven illumination area or the reflective interference area, resulting in a large grayscale difference between the standard image, thereby causing some normal area pixels to be judged as defective area pixels, which in turn leads to low accuracy in the detection of the surface printed defective area of the printed metal plate to be detected. Therefore, how to improve the accuracy of the detection of the surface printed defective area of the printed metal plate has become an urgent problem to be solved. Summary of the Invention
[0004] In order to solve the above problems, the present invention provides a method for efficiently identifying and detecting printing defects on the surface of a metal plate. The technical solutions adopted are as follows:
[0005] An embodiment of the present invention provides a method for efficiently identifying and detecting printing defects on a metal plate surface, comprising the following steps:
[0006] Acquire a surface image and a standard image of the printed metal plate to be inspected;
[0007] Obtaining a difference representation value for each pixel to be detected based on a difference between the pixel to be detected and the standard pixel at the same position, wherein the pixel to be detected belongs to the surface image and the standard pixel belongs to the standard image;
[0008] Obtaining a suspected defective pixel based on the difference representation value of the pixel to be detected, the gray level co-occurrence matrix eigenvalue of the pixel to be detected, and the neighboring pixels to be detected of the pixel to be detected; and obtaining a suspected defective pixel based on the suspected determination index value;
[0009] Clustering all suspected defective pixels according to the suspected determination index value and coordinate value of the suspected defective pixel to obtain each cluster, and obtaining the abnormality degree representation value of the suspected defective pixel according to the difference representation value of the suspected defective pixel, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all suspected defective pixels in the cluster to which the suspected defective pixel belongs;
[0010] Printing defects are identified on the surface of the printed metal plate to be inspected according to the abnormality degree characterization value.
[0011] Beneficial effect: The present invention first obtains a surface image and a standard image of a printed metal plate to be inspected; then, based on the difference between the pixel to be inspected and the standard pixel at the same position, obtains a difference representation value of each pixel to be inspected; then, based on the difference representation value of the pixel to be inspected, the eigenvalue of the grayscale co-occurrence matrix of the pixel to be inspected, and the neighboring pixel to be inspected, obtains a suspected judgment index value of the pixel to be inspected, and obtains a suspected defective pixel based on the suspected judgment index value; then, all suspected defective pixels are clustered according to the suspected judgment index value and coordinate value of the suspected defective pixel to obtain various cluster clusters, and based on the difference representation value of the suspected defective pixel, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all suspected defective pixels in the cluster to which the suspected defective pixel belongs, obtains an abnormality degree representation value of the suspected defective pixel; finally, printing defects are identified on the surface of the printed metal plate to be inspected according to the abnormality degree representation value. Moreover, based on the known difference characterization values of the pixels to be detected, the present invention analyzes the characteristics of the interference area and the defective area, that is, by combining the suspected judgment index value of the pixel to be detected, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all the suspected defective pixels in the cluster to which they belong to obtain the abnormality degree characterization value, thereby improving the accuracy of identifying the printed defective area on the surface of the printed metal plate to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 This is a flow chart of a method for efficiently identifying and detecting printing defects on the surface of a metal plate according to the present invention. DETAILED DESCRIPTION
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field fall within the scope of protection of the embodiments of the present invention.
[0015] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0016] This embodiment provides a method for efficiently identifying and detecting printing defects on metal plate surfaces, which is described in detail as follows:
[0017] like Figure 1 As shown, the method for efficiently identifying and detecting printing defects on the metal plate surface includes the following steps:
[0018] Step S001: Acquire a surface image and a standard image of a printed metal plate to be inspected.
[0019] This embodiment mainly improves the accuracy of identifying printed defect areas based on the analysis of the differences between the surface image of the printed metal plate to be inspected and the standard image, and combines the characteristics of the uneven lighting area and the metal reflection interference area. That is, this embodiment mainly combines multiple dimensions to improve the detection accuracy of printed defect areas; in addition, the printed metal plate in this embodiment is mainly used in the fields of electronic products, automotive parts, home appliances, etc.
[0020] In this embodiment, any printed metal plate in any batch of printed metal plate products is first selected as the printed metal plate to be tested, and a surface image of the printed metal plate to be tested is obtained, and the surface image of the printed metal plate to be tested is a grayscale image. The materials, printing conditions, printing requirements, etc. used when printing all metal plates in the same batch are the same, that is, all printed metal plate products in the same batch are printed according to the same printing template; the surface image of the printed metal plate to be tested in this embodiment is collected by a high-definition camera installed on the metal plate transmission belt, that is, the printed metal plate will be transmitted on the metal plate transmission belt, and the parameters of the high-definition camera for image collection need to be set by the implementer according to actual conditions such as the metal plate size and the transmission belt speed.
[0021] Since this embodiment subsequently needs to analyze the differences between the surface image of the printed metal plate to be inspected and the standard image, and then combine other dimensions for analysis, this embodiment needs to obtain the standard image of the printed metal plate to be inspected, and the standard image of the printed metal plate to be inspected in this embodiment is the surface grayscale image of the printing template of the printed metal plate to be inspected; and as another real-time method, the surface grayscale image of a finished printed metal plate with qualified appearance quality or no defects but consistent with the size, material, printing requirements, etc. of the printed metal plate to be inspected can also be selected as the standard image of the printed metal plate to be inspected.
[0022] Therefore, this embodiment can obtain the surface image and standard image of the printed metal plate to be inspected through the above process, and record the pixel points on the surface image of the printed metal plate to be inspected as pixel points to be inspected, and record the pixel points on the standard image as standard pixel points; in addition, the conditions, angles, etc. when the surface image and the standard image are collected are consistent, so the pixel points with the same coordinates on the surface image and the standard image belong to the same position on different printed metal plates.
[0023] Step S002 : obtaining a difference representation value of each pixel to be detected based on the difference between the pixel to be detected and the standard pixel at the same position.
[0024] Due to the high reflective characteristics of the metal plate itself and the uneven illumination caused by various environmental factors such as mechanical vibration in the process of collecting the surface image of the printed metal plate to be detected, some pixels in normal areas may be in the uneven illumination area or the reflective interference area, which leads to a large difference in the grayscale value of the pixel in the normal area on the printed metal plate and the grayscale value of the pixel at the same position on the standard image. This phenomenon will cause the pixel in the normal area to be identified as a defective pixel when the defective pixel is identified based on the preset grayscale difference threshold, resulting in a low accuracy of the surface printing defect detection of the printed metal plate to be detected. In order to improve the detection accuracy, this embodiment will subsequently analyze the grayscale difference threshold of the printed metal plate to be detected. On the basis of the difference between the surface image and the standard image, the characteristic difference between the defect area and the interference area is analyzed to eliminate the influence of the interference area on the detection, thereby improving the accuracy of defect detection. The interference area refers to the area in uneven brightness or the metal reflection interference area; Therefore, it can be seen that this embodiment needs to first analyze the difference between the surface image of the printed metal plate to be detected and the standard image. That is to say, this embodiment needs to first obtain the difference representation value of each pixel to be detected based on the difference between the pixel to be detected and the standard pixel at the same position. The difference representation value is an important parameter for subsequently obtaining the suspected defect pixel and the abnormality degree representation value. Then the specific acquisition process of the difference representation value of the pixel to be detected is:
[0025] First, with each pixel to be detected on the surface image as the center, a window with a length and width of the preset first length is established, and it is recorded as the first local window corresponding to the pixel to be detected. With each standard pixel on the standard image as the center, a window with a length and width of the preset first length is established, and it is recorded as the first local window corresponding to the standard pixel. In specific applications, the implementer needs to set the preset first length according to actual conditions, but it is required not to be too large and to be an odd number. For example, in this embodiment, the preset first length can be set to 5 or 7. If the preset first length is 5, then the size of the first local window is 5×5, that is, the maximum number of pixels that can be accommodated in the first local window is 25.
[0026] After obtaining the first local window, the specific process of obtaining the difference representation value of any pixel point A to be detected on the surface image is described as an example, that is, the specific process of obtaining the difference representation value of the pixel point A to be detected is: first, on the standard image, obtain the standard pixel point with the same coordinates as the pixel point A to be detected, and record it as the standard pixel point at the same position as the pixel point A to be detected; then, in the first local window of the pixel point A to be detected, obtain all the grayscale value types that appear, and record the set constructed by all the grayscale value types that appear in the first local window of the pixel point A to be detected as the grayscale value type set corresponding to the pixel point A to be detected; then, obtain the grayscale value type set corresponding to the pixel point A to be detected. The frequency of each grayscale value type appearing in the first local window of the pixel A to be detected, and the ratio of the frequency of each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected in the first local window of the pixel A to be detected to the total number of pixels to be detected in the first local window of the pixel A to be detected is recorded as the probability of the corresponding grayscale value type appearing in the first local window of the pixel A to be detected, and the frequency of each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected in the first local window of the standard pixel at the same position as the pixel A to be detected is obtained, and the frequency of each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected in the first local window of the standard pixel at the same position as the pixel A to be detected is recorded as the probability of the corresponding grayscale value type appearing in the first local window of the pixel A to be detected The ratio of the frequency of the standard pixel point at the same position appearing in the first local window of the pixel point A to be detected to the total number of standard pixels in the first local window of the standard pixel point at the same position of the pixel point A to be detected is recorded as the probability of the corresponding gray value type appearing in the first local window of the standard pixel point at the same position of the pixel point A to be detected, that is, the probability of the ath gray value type in the gray value type set corresponding to the pixel point A to be detected appearing in the first local window of the pixel point A to be detected is the ratio of the frequency of the ath gray value type appearing in the first local window of the pixel point A to be detected to the total number of pixels to be detected in the first local window of the pixel point A to be detected, and the ath gray value type in the gray value type set corresponding to the pixel point A to be detected appears in the first local window of the pixel point A to be detected. The probability of the pixel A to be detected appearing in the first local window of the standard pixel at the same position as the pixel A to be detected is the ratio of the frequency of the ath grayscale value type appearing in the first local window of the standard pixel at the same position as the pixel A to be detected to the total number of standard pixels in the first local window of the standard pixel at the same position as the pixel A to be detected; then, based on the grayscale difference between the pixel A to be detected and the standard pixel at the same position as the pixel A to be detected and the probability of each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected appearing in the first local window of the pixel A to be detected and the first local window of the standard pixel at the same position as the pixel A to be detected, the difference characterization value of the pixel A to be detected is obtained.
[0027] And according to the grayscale difference between the pixel A to be detected and the standard pixel at the same position as the pixel A to be detected, and the probability of each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected appearing in the first local window of the pixel A to be detected and the first local window of the standard pixel at the same position as the pixel A to be detected, the specific process of obtaining the difference representation value of the pixel A to be detected is:
[0028] Calculate the absolute value of the grayscale value difference between the pixel A to be detected and the standard pixel at the same position as the pixel A to be detected, and record it as the grayscale feature difference of the pixel A to be detected, obtain the probability difference corresponding to each grayscale value type in the grayscale value type set corresponding to the pixel A to be detected, and record the average of the probability difference values corresponding to all grayscale value types in the grayscale value type set corresponding to the pixel A to be detected as the probability feature difference of the pixel A to be detected, calculate the product of the grayscale feature difference of the pixel A to be detected and the probability feature difference of the pixel A to be detected, and record it as the difference representation value of the pixel A to be detected, and the probability difference corresponding to the bth grayscale value type in the grayscale value type set corresponding to the pixel A to be detected is the absolute value of the difference between the probability of the bth grayscale value type appearing in the first local window of the pixel A to be detected and the probability of the bth grayscale value type appearing in the first local window of the standard pixel at the same position as the pixel A to be detected.
[0029] In addition, the calculation expression of the difference representation value of the pixel point A to be detected is:
[0030]
[0031] Among them, D A is the difference representation value of the pixel A to be detected, H A is the gray value of the pixel A to be detected, H' A is the grayscale value of the standard pixel at the same position as the pixel A to be detected, B is the total number of grayscale value types in the grayscale value type set corresponding to the pixel A to be detected, P A is the probability that the bth grayscale value type in the grayscale value type set corresponding to the pixel point A to be detected appears in the first local window of the pixel point A to be detected, P' A is the probability that the bth grayscale value type in the grayscale value type set corresponding to the pixel to be detected A appears in the first local window of the standard pixel at the same position as the pixel to be detected A. A -H' A |with The larger the value, the greater the difference between the pixel to be detected A and the standard pixel at the same position of the pixel to be detected A. On the contrary, when |H A -H' A |with The smaller the value is, the smaller the difference between the pixel point A to be detected and the standard pixel point at the same position as the pixel point A to be detected is.
[0032] Therefore, this embodiment can obtain the difference characterization value of each pixel to be detected through the above process, and due to the existence of interference factors such as uneven lighting and reflection, there may be pixels in the normal area among the pixels to be detected with larger difference characterization values. Therefore, this embodiment needs to further analyze the characteristics of the defect area and the interference area in combination. The interference area is mainly caused by uneven lighting and metal reflection, so the essence of the interference area refers to the area affected by factors such as uneven lighting and metal reflection, or the interference area can also be called the uneven lighting area and the metal reflection interference area.
[0033] Step S003, obtaining the suspected judgment index value of the pixel to be detected based on the difference characterization value of the pixel to be detected, the gray level co-occurrence matrix eigenvalue of the pixel to be detected, and the neighboring pixels to be detected of the pixel to be detected, and obtaining the suspected defective pixel based on the suspected judgment index value.
[0034] Since the defective pixels cannot be accurately screened out based only on the size of the difference characterization value of the pixel to be detected, this embodiment will next analyze the suspected judgment index value of the pixel to be detected. The suspected judgment index value in this embodiment only analyzes the characteristics between uneven illumination and defective areas. Therefore, this embodiment can only perform an initial screening of normal pixels and defective pixels based on the suspected judgment index value. In order to further ensure the accuracy of identifying defective pixels, it will be further screened in combination with the metal reflection interference area. Based on the above analysis, it can be seen that this embodiment will first obtain the suspected judgment index value. It is known that the suspected judgment index value is related to the difference characterization value and the characteristics of the uneven illumination area and the real defect area. Therefore, when obtaining the suspected judgment index value, this embodiment needs to analyze the characteristics of the uneven illumination area and the real defect area on the basis of the known difference characterization value. The characteristics of the uneven illumination area and the real defect area are: the pixels to be detected in the uneven illumination area are affected by the uneven illumination during image acquisition, so that some pixels to be detected are different from the standard pixels, but the overall texture is not destroyed, while the local area of the real defect area is not completely normal. The local texture features will change, and the uneven brightness area is manifested as a brightness change of the entire image or most areas of the image. Therefore, the local features of the pixels in the uneven brightness area at different window scales are not much different, and the real defects are generally local defects, so the local features of the defective pixels at different window scales are quite different. Then, this embodiment will combine the above description to obtain the suspected judgment index value of the pixel to be detected. Because the surface of the printed metal plate itself usually has a pattern, its local features will also change. In order to avoid the influence of the pattern on the surface of the printed metal plate itself on the accurate identification of subsequent defective pixels during subsequent analysis, this embodiment will replace the grayscale values involved with grayscale feature differences when analyzing the local feature differences at different window scales, thereby avoiding the influence of the pattern on the surface of the printed metal plate itself on the accurate identification of subsequent defective pixels. The grayscale feature difference value of any pixel to be detected is the absolute value of the grayscale value difference between the detection pixel and the standard pixel at the same position of the pixel to be detected. Then, the specific process of obtaining the suspected judgment index value of any pixel A to be detected on the surface image in this embodiment is as follows:
[0035] First, with the pixel point A to be detected as the center, a window with a length and width of a preset second length is established, and it is recorded as the second local window of the pixel point A to be detected. Then, a window constructed by the grayscale feature difference values of all the pixels to be detected in the second local window of the pixel point A to be detected is obtained, and it is recorded as the second feature window of the pixel point A to be detected. A window constructed by the grayscale feature difference values of all the pixels to be detected in the first local window of the pixel point A to be detected is obtained, and it is recorded as the first feature window of the pixel point A to be detected, and the cth grayscale feature difference value in the first feature window of the pixel point A to be detected is the grayscale feature difference value of the cth pixel to be detected in the first local window of the pixel point A to be detected. The grayscale feature difference value of the fth grayscale feature difference value in the second feature window of the pixel point A to be detected is the grayscale feature difference value of the fth pixel point to be detected in the second local window of the pixel point A to be detected; then, according to the grayscale value of the pixel point to be detected in the first local window of the pixel point A to be detected, the grayscale co-occurrence matrix of the pixel point A to be detected is obtained, that is, in the process of obtaining the grayscale co-occurrence matrix of the pixel point A to be detected, the pixel pairs are composed of grayscale values; then, the inverse difference eigenvalue of the grayscale co-occurrence matrix of the pixel point A to be detected is obtained, and the inverse difference eigenvalue can reflect the local texture uniformity, and under the window of the known pixel point A to be detected, the grayscale co-occurrence matrix of the pixel point A to be detected is constructed. The process of measuring the grayscale co-occurrence matrix of pixel point A and calculating the inverse difference eigenvalue of the grayscale co-occurrence matrix is well known; then the inverse function is used to map the inverse difference eigenvalue of the grayscale co-occurrence matrix of the pixel point A to be detected, and the mapping result is recorded as the local texture representation value of the pixel point A to be detected, and then the absolute value of the difference between the mean of all grayscale feature difference values in the first feature window of the pixel point A to be detected and the mean of all grayscale feature difference values in the second local window of the pixel point A to be detected is obtained, and recorded as the window mean difference of the pixel point A to be detected, and the local texture representation value of the pixel point A to be detected and the window mean difference of the pixel point A to be detected are continued to be obtained. Measure the defect characterization value of pixel point A. The defect characterization value is the key to subsequently obtaining the suspected judgment index value. The defect characterization value is mainly determined by analyzing the characteristics of the uneven illumination area and the real defect area. The defect characterization value of the pixel point A to be detected is the product of the local texture characterization value of the pixel point A to be detected and the window mean difference of the pixel point A to be detected; and in specific applications, the implementer needs to set the preset second length according to the preset first length and actual conditions, but the preset second length is required to be not equal to the preset first length. For example, in this embodiment, the preset second length can be set to 9 or 15. If it is 9, then the size of the second local window is 9×9.
[0036] In addition, the specific calculation expression for obtaining the defect characterization value of the pixel A to be detected is: Among them, W A is the inverse difference eigenvalue of the gray level co-occurrence matrix of the pixel A to be detected, is the result of mapping the inverse difference eigenvalue of the gray level co-occurrence matrix of the pixel A to be detected using the inverse function, and is also the local texture representation value of the pixel A to be detected, θ1 A is the mean of all grayscale feature differences in the first feature window of the pixel A to be detected, θ2 A is the mean of all grayscale feature differences in the second feature window of the pixel A to be detected, |θ1 A -θ2 A | is the window mean difference of the pixel A to be detected; and W A The smaller it is, the more uneven the local texture of the pixel A to be detected is. A -θ2 A The larger the | is, the greater the difference in local features of the pixel A to be detected at different window scales. Since the local features of the defective pixels in the defective area are relatively different from those in the uneven illumination area at different window scales, the local texture features of the defective pixels in the defective area will change, that is, the local texture of the defective pixels in the defective area is relatively uneven. Therefore, it can be seen that when W A The smaller and |θ1 A -θ2 A When | is larger, it indicates that the possibility that the pixel A to be detected belongs to the defect area is greater or the probability of being a defective pixel is greater. Conversely, it indicates that the possibility that the pixel A to be detected belongs to the defect area is smaller.
[0037] After obtaining the defect characterization value, the defect characterization value of the pixel A to be detected is obtained by multiplying the difference degree characterization value of the pixel A to be detected, and then performing normalization processing to obtain the result, which is recorded as the suspected judgment index value of the pixel A to be detected. The normalization function Norm() is used for normalization processing here, and the suspected judgment index value ranges from 0 to 1; and the size of the suspected judgment index value can reflect the possibility that the pixel A to be detected is a defective pixel. The suspected judgment index value is the basis for the initial screening, and the smaller the suspected judgment index value is, the higher the probability of the pixel A to be detected is. The greater the probability that the detected pixel A is a normal pixel, the greater the suspected judgment index value, the lower the probability that the detected pixel A is a normal pixel. Therefore, after obtaining the suspected judgment index value of the detected pixel A, this embodiment determines whether the detected pixel A is a suspected defective pixel based on the suspected judgment index value of the detected pixel A. The specific process is: determine whether the suspected judgment index value of the detected pixel A is greater than the preset suspected judgment threshold. If so, the detected pixel A is recorded as a suspected defective pixel; otherwise, the detected pixel A is recorded as a normal pixel. In addition, in specific applications, the implementer needs to set a preset suspected judgment threshold based on the value range of the suspected judgment index value, experimental statistics, and actual conditions. For example, in this embodiment, the suspected judgment index value can be set to 0.7.
[0038] Therefore, this embodiment obtains the suspected defective pixel points on the surface image through the above process.
[0039] Step S004: cluster all suspected defective pixels according to the suspected judgment index value and coordinate value of the suspected defective pixel to obtain each cluster, and obtain the abnormality degree characterization value of the suspected defective pixel according to the difference characterization value of the suspected defective pixel, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all suspected defective pixels in the cluster to which it belongs.
[0040] Since the above screening of suspected defective pixels only analyzes the characteristics between uneven illumination and defective areas, this embodiment can only perform initial screening based on the suspected judgment index value, that is, normal pixels caused by metal reflection may also exist in the suspected defective pixels, so this embodiment needs to combine the characteristics of the real defective area and the metal reflection interference area to obtain the defect confidence of the suspected defective pixel, and the characteristics of the real defective area and the metal reflection interference area are: the real defective area is characterized by low regional grayscale uniformity and low overall brightness uniformity, no significant highlight features, and high local complexity. Although the metal reflection interference area will change the local texture, the grayscale in the area is uniform, and the overall brightness of the metal reflection interference area is high, showing a local highlight feature, and the regional complexity is low. In addition, the real defective area is characterized by low regional grayscale uniformity and low overall brightness uniformity, no significant highlight features, and high local complexity. The real defect area and the metal reflection interference area will destroy the local texture of the image; therefore, based on the above analysis, it can be seen that this embodiment will then obtain the defect confidence of each suspected defective pixel by analyzing the grayscale distribution uniformity, brightness, and complexity in the area to which the suspected defective pixel belongs. The defect confidence can not only further reflect the possibility that the suspected defective pixel is a real defective pixel, but also is an important parameter for subsequently obtaining the abnormality degree representation value of the suspected defective pixel. That is, in this embodiment, before obtaining the abnormality degree representation value of the suspected defective pixel, it is necessary to first obtain the defect confidence of the suspected defective pixel, and before obtaining the defect confidence of the suspected defective pixel, it is necessary to first cluster the suspected defective pixels. Then, all suspected defective pixels on the surface image are clustered to obtain the specific process of each cluster cluster as follows:
[0041] First, the vector composed of the suspected judgment index value, horizontal coordinate value, and vertical coordinate value of each suspected defective pixel point is recorded as the feature vector of the corresponding suspected defective pixel point, and the first parameter in the feature vector of any suspected defective pixel point is the suspected judgment index value of the suspected defective pixel point, the second parameter is the horizontal coordinate value of the suspected defective pixel point, and the third parameter is the vertical coordinate value of the suspected defective pixel point. Then, based on the known feature vector of the suspected defective pixel point, the mean shift clustering algorithm is used to cluster all suspected defective pixels on the surface image to obtain various cluster clusters, and the distance between any two suspected defective pixels involved in clustering all suspected defective pixels on the surface image using the mean shift clustering algorithm is the Euclidean distance between the feature vectors of the two suspected defective pixels; in addition, the specific process of clustering using the mean shift clustering algorithm is a well-known technology, so it will not be described in detail.
[0042] After obtaining the clusters, the specific process of obtaining the defect confidence of any suspected defective pixel S is described as an example based on the cluster to which the suspected defective pixel belongs. That is, the specific process of obtaining the defect confidence of the suspected defective pixel S is as follows:
[0043] First, the cluster to which the suspected defective pixel S belongs is obtained, and recorded as the cluster to be analyzed; then, the gradient direction of each suspected defective pixel in the cluster to be analyzed is obtained, and the information entropy of the gradient direction of all suspected defective pixels in the cluster to be analyzed is calculated, and recorded as the complex representation value of the grayscale distribution of the suspected defective pixel S. The process of obtaining the gradient direction of the pixel and the process of obtaining the information entropy are well-known technologies; then, the mean of the grayscale values of all suspected defective pixels in the cluster to be analyzed is obtained, and recorded as the grayscale mean of the cluster to be analyzed; the standard deviation of the grayscale values of all suspected defective pixels in the cluster to be analyzed is obtained, and recorded as the grayscale value of the cluster to be analyzed. The standard deviation of the cluster is analyzed, and the mean of the grayscale values of all the pixels to be detected on the surface image is obtained and recorded as the global grayscale mean; then the ratio of the grayscale mean of the cluster to be analyzed to the global grayscale mean is obtained and recorded as the characteristic ratio, and then the characteristic ratio is mapped using the inverse function to obtain the regional brightness representation value of the suspected defective pixel S; finally, the product of the standard deviation of the cluster to be analyzed, the regional brightness representation value of the suspected defective pixel S and the complex representation value of the grayscale distribution of the suspected defective pixel S is obtained and used as the defect confidence of the suspected defective pixel S; and the specific calculation expression of the defect confidence of the suspected defective pixel S is:
[0044]
[0045] Among them, Z is the defect confidence of the suspected defect pixel S, σ is the standard deviation of the cluster to be analyzed, G is the feature ratio, is the regional brightness representation value of the suspected defect pixel S, H S is the complex representation value of the grayscale distribution of the suspected defective pixel S, and is also the information entropy of the gradient direction of all suspected defective pixels in the cluster to be analyzed; and the larger σ is, the lower the grayscale uniformity in the area corresponding to the cluster to be analyzed is, and the smaller the characteristic ratio G is, the darker the brightness of the area corresponding to the cluster to be analyzed is relative to the overall brightness of the surface image, that is, the less significant highlight features are in the area corresponding to the cluster to be analyzed, and H S The larger the H is, the higher the complexity of the grayscale distribution in the area corresponding to the cluster to be analyzed is. Since the real defect area has lower grayscale uniformity and overall brightness uniformity than the metal reflection interference area, there is no significant highlight feature, and the local complexity is higher, so when H is larger, G is smaller, and H is S The larger the value, that is, the larger the Z value, the greater the probability that the suspected defective pixel S is a real defective pixel. Conversely, the smaller the Z value, the greater the probability that the suspected defective pixel S is a normal pixel.
[0046] Since defects are regional features rather than single-point features, the local continuity of pixels must be considered when obtaining the true degree of abnormality. That is, based on the defect confidence and difference representation value of the suspected defective pixel S, the local continuity of the suspected defective pixel must be considered to determine the abnormality representation value of the suspected defective pixel S. The specific process for obtaining the abnormality representation value of the suspected defective pixel S is as follows:
[0047] First, all the pixels to be detected within the eight neighborhoods of the suspected defective pixel S are obtained, and the set constructed by all the pixels to be detected within the eight neighborhoods of the suspected defective pixel S is recorded as the neighborhood set of the suspected defective pixel S; then, the label value of each detection pixel in the neighborhood set is obtained, and the specific acquisition process of the label value of each detection pixel in the neighborhood set is: for the jth pixel to be detected in the neighborhood set, if the jth pixel to be detected is a suspected defective pixel, the difference representation value of the jth pixel to be detected is directly used as the label value of the jth pixel to be detected; if the jth detection pixel is not a suspected defective pixel, the preset constant is directly used as the label value of the jth detection pixel; in specific applications, the implementer needs to set the preset constant according to the actual situation, such as setting the preset constant to 0 in this embodiment.
[0048] Then, the mean of the label values of all the pixels to be detected in the neighborhood set is obtained, and recorded as the neighborhood label value mean, the standard deviation of the label values of all the pixels to be detected in the neighborhood set is obtained, and recorded as the neighborhood label value standard deviation; then the ratio of the neighborhood label value mean to the neighborhood label value standard deviation is obtained, and recorded as the local continuous characterization value of the suspected defective pixel S; finally, the product of the local continuous characterization value, the difference characterization value and the defect confidence of the suspected defective pixel S is obtained, and the product of the local continuous characterization value, the difference characterization value and the defect confidence of the suspected defective pixel S is normalized, and the normalized result is recorded as the abnormality degree characterization value of the suspected defective pixel S. Here, the normalization function Norm() is also used to normalize the product result; and since the larger the local continuous characterization value, the greater the abnormality in the neighborhood of the suspected defective pixel S. The better the continuity of the difference representation value, that is, the better the continuity of the local difference representation value of the suspected defective pixel S, and when the continuity of the local difference representation value is better, it indicates that the probability that the suspected defective pixel S is located in the defective area is greater, which also indicates that the probability that the suspected defective pixel S is a real defective pixel is greater. Therefore, when the local continuous representation value is larger, the abnormality degree representation value of the suspected defective pixel S should be larger. It can be seen that when the local continuous representation value, the difference representation value and the defect confidence of the suspected defective pixel S are larger, the abnormality degree representation value of the suspected defective pixel S is larger, and the larger the abnormality degree representation value of the suspected defective pixel S is, the greater the probability that the suspected defective pixel S is a real defective pixel. Conversely, when the abnormality degree representation value of the suspected defective pixel S is smaller, the probability that the suspected defective pixel S is a normal pixel is greater.
[0049] Therefore, this embodiment can obtain the abnormality level representation of each suspected defective pixel through the above process, and the value of the abnormality level representation ranges from 0 to 1.
[0050] Step S005 : identifying printing defects on the surface of the printed metal plate to be inspected according to the abnormality degree characterization value.
[0051] After obtaining the abnormality degree representation of each suspected defective pixel point on the surface image, it is determined whether the abnormality degree representation of each suspected defective pixel point is greater than the suspected defective pixel point of the preset abnormality threshold. If so, the corresponding suspected defective pixel point is determined to be a real defective pixel point, and the corresponding suspected defective pixel point is recorded as a defective pixel point; and in specific applications, the implementer needs to set the preset abnormality threshold according to the actual situation such as the value range of the abnormality degree representation, experimental statistics, etc. For example, in this embodiment, the preset abnormality threshold can be set to 0.7.
[0052] After obtaining all the defective pixel points on the surface image, all the printing defect areas on the surface image are obtained using the existing algorithm. After obtaining the printing defect areas, the classification model can also be used to obtain the types of each printing defect area. In addition, this embodiment can choose to use the region growing algorithm and morphological processing to obtain the printing defect area, that is, first perform region growing on the defective pixel points on the surface image, and then perform closing operation on the grown area to obtain the printing defect area. The process of obtaining the printing defect area on the surface image using the existing algorithm is a well-known technology, so this embodiment will not be described in detail.
[0053] At this point, this embodiment has completed the detection of printed defects on the surface of the metal plate. Based on the known difference characterization values of the pixels to be detected, this embodiment further analyzes the characteristics of the interference area and the defective area, that is, by combining the suspected judgment index value of the pixels to be detected, the gradient direction of the suspected defective pixels in the cluster to which the suspected defective pixels belong, and the standard deviation and mean of the grayscale values of all suspected defective pixels in the cluster to which they belong, to complete the accurate identification of the defective pixels on the surface image of the printed metal plate to be detected, thereby achieving accurate identification of the defective area on the surface image of the printed metal plate to be detected.
[0054] To sum up, this embodiment first obtains the surface image and the standard image of the printed metal plate to be inspected; then, based on the difference between the pixel to be inspected and the standard pixel at the same position, obtains the difference representation value of each pixel to be inspected; then, based on the difference representation value of the pixel to be inspected, the grayscale co-occurrence matrix eigenvalue of the pixel to be inspected and the neighboring pixel to be inspected, obtains the suspected judgment index value of the pixel to be inspected, and obtains the suspected defective pixel based on the suspected judgment index value; then, all the suspected defective pixels are clustered according to the suspected judgment index value and coordinate value of the suspected defective pixel to obtain each cluster cluster, and based on the difference representation value of the suspected defective pixel, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the grayscale value standard deviation and mean of all the suspected defective pixels in the cluster to which it belongs, obtains the abnormality degree representation value of the suspected defective pixel; finally, printing defects are identified on the surface of the printed metal plate to be inspected according to the abnormality degree representation value. In addition, this embodiment, based on the known difference characterization values of the pixels to be detected, analyzes the characteristics of the interference area and the defective area, that is, by combining the suspected judgment index value of the pixel to be detected, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all the suspected defective pixels in the cluster to which they belong to obtain the abnormality degree characterization value, thereby improving the accuracy of identifying the printed defective area on the surface of the printed metal plate to be detected.
[0055] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for efficiently identifying and detecting printing defects on metal plate surfaces, characterized in that: The method comprises the following steps: Acquire a surface image and a standard image of the printed metal plate to be inspected; Obtaining a difference representation value for each pixel to be detected based on a difference between the pixel to be detected and the standard pixel at the same position, wherein the pixel to be detected belongs to the surface image and the standard pixel belongs to the standard image; Obtaining a suspected defective pixel based on the difference representation value of the pixel to be detected, the gray level co-occurrence matrix eigenvalue of the pixel to be detected, and the neighboring pixels to be detected of the pixel to be detected; and obtaining a suspected defective pixel based on the suspected determination index value; Clustering all suspected defective pixels according to the suspected determination index value and coordinate value of the suspected defective pixel to obtain each cluster, and obtaining the abnormality degree representation value of the suspected defective pixel according to the difference representation value of the suspected defective pixel, the gradient direction of the suspected defective pixel in the cluster to which the suspected defective pixel belongs, and the standard deviation and mean of the grayscale values of all suspected defective pixels in the cluster to which the suspected defective pixel belongs; Printing defects are identified on the surface of the printed metal plate to be inspected according to the abnormality degree characterization value.
2. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 1, characterized in that: The method for obtaining the difference representation value of the pixel to be detected includes: With the pixel to be detected as the center, a window with a length and width of a preset first length is established, and the window is recorded as the first local window corresponding to the pixel to be detected; with the standard pixel as the center, a window with a length and width of the preset first length is established, and the window is recorded as the first local window corresponding to the standard pixel; For any pixel to be detected on the surface image, the standard pixel on the standard image with the same coordinates as the pixel to be detected is recorded as the standard pixel at the same position as the pixel to be detected, and a set constructed by all grayscale value types appearing in the first local window of the pixel to be detected is obtained, and recorded as the grayscale value type set corresponding to the pixel to be detected. According to the grayscale difference between the pixel to be detected and the standard pixel at the same position of the pixel to be detected and the probability of each grayscale value type in the grayscale value type set appearing in the first local window of the pixel to be detected and the first local window of the standard pixel at the same position, the difference characterization value of the pixel to be detected is obtained.
3. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 2, characterized in that: The method for obtaining a difference representation value of the pixel to be detected based on a grayscale difference between the pixel to be detected and a standard pixel at the same position as the pixel to be detected and a probability of each grayscale value type in the grayscale value type set appearing in a first local window of the pixel to be detected and in a first local window of the standard pixel at the same position, includes: The absolute value of the grayscale value difference between the pixel to be detected and the standard pixel at the same position as the pixel to be detected is recorded as the grayscale feature difference value of the pixel to be detected, the probability difference value corresponding to each grayscale value type in the grayscale value type set is obtained, and the average of the probability difference values corresponding to all grayscale value types in the neighborhood grayscale value set is recorded as the probability feature difference value of the pixel to be detected, the product of the grayscale feature difference value of the pixel to be detected and the probability feature difference value is recorded as the difference representation value of the pixel to be detected, and the probability difference value corresponding to the bth grayscale value type in the grayscale value type set is the absolute value of the difference between the probability of the bth grayscale value type appearing in the first local window of the pixel to be detected and the probability of the bth grayscale value type appearing in the first local window of the standard pixel at the same position.
4. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 3, wherein: The method for obtaining the suspected judgment index value of the pixel to be detected includes: For any pixel to be detected on the surface image: with the pixel to be detected as the center, a window with a length and a width of a preset second length is established, and is recorded as the second local window of the pixel to be detected, a window constructed by the grayscale feature difference values of all the pixels to be detected in the second local window of the pixel to be detected is recorded as the second feature window corresponding to the pixel to be detected, a window constructed by the grayscale feature difference values of all the pixels to be detected in the first local window of the pixel to be detected is recorded as the first feature window corresponding to the pixel to be detected, and a pixel to be detected in the first local window is detected according to the grayscale feature difference values of the pixels to be detected. The grayscale value of the pixel point is obtained, and the grayscale co-occurrence matrix corresponding to the pixel point to be detected is obtained, and the defect characterization value of the pixel point to be detected is obtained according to the inverse difference eigenvalue of the grayscale co-occurrence matrix of the pixel point to be detected and the difference between the mean of all grayscale feature difference values in the first feature window of the pixel point to be detected and the mean of all grayscale feature difference values in the second feature window of the pixel point to be detected; the product of the defect characterization value of the pixel point to be detected and the difference degree characterization value of the pixel point to be detected is normalized, and the result obtained is recorded as the suspected judgment index value of the pixel point to be detected.
5. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 4, characterized in that: The method for determining the defect characterization value of a pixel to be detected comprises: An inverse function mapping is performed on the inverse difference eigenvalue of the grayscale co-occurrence matrix of the pixel to be detected, and recorded as the local texture representation value; the absolute value of the difference between the mean of all grayscale feature difference values in the first feature window of the pixel to be detected and the mean of all grayscale feature difference values in the second feature window of the pixel to be detected is recorded as the window mean difference, and the product of the local texture representation value and the window mean difference is used as the defect representation value of the pixel to be detected.
6. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 1, characterized in that: The method for obtaining suspected defective pixels includes: If the suspected determination index value of the pixel to be detected is greater than a preset suspected determination threshold, the pixel to be detected is recorded as a suspected defective pixel.
7. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 1, characterized in that: The method for obtaining the abnormality representation value of the suspected defective pixel includes: For any suspected defective pixel point: obtain the cluster to which the suspected defective pixel point belongs, and record it as the cluster cluster to be analyzed, obtain the gradient direction of each suspected defective pixel point in the cluster cluster to be analyzed, calculate the information entropy of the gradient direction of all suspected defective pixels in the cluster cluster to be analyzed, and record it as the complex representation value of grayscale distribution, record the mean of the grayscale values of all suspected defective pixels in the cluster cluster to be analyzed as the grayscale mean of the cluster cluster to be analyzed, record the standard deviation of the grayscale values of all suspected defective pixels in the cluster cluster to be analyzed as the standard deviation of the cluster cluster to be analyzed, record the mean of the grayscale values of all pixels on the surface image as the global grayscale mean, and obtain the defect confidence of the suspected defective pixel point based on the grayscale mean and standard deviation of the cluster cluster to be analyzed, the global grayscale mean, and the complex representation value of grayscale distribution; Obtain a set constructed from all the pixels to be detected within the eight neighborhoods of the suspected defective pixel, and record it as the neighborhood set of the suspected defective pixel, and obtain the label value of each pixel to be detected in the neighborhood set; record the mean and standard deviation of the label values of all the pixels to be detected in the neighborhood set as the neighborhood label value mean and the neighborhood label value standard deviation, respectively, and normalize the ratio of the neighborhood label value mean to the neighborhood label value standard deviation, the difference representation value of the suspected defective pixel, and the defect confidence of the suspected defective pixel, and record the result as the abnormality degree representation value of the suspected defective pixel.
8. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 7, characterized in that: The defect confidence level method for suspected defective pixels includes: An inverse function mapping is performed on the ratio of the grayscale mean of the cluster to be analyzed to the global grayscale mean, and recorded as the regional brightness characterization value; the product of the standard deviation of the cluster to be analyzed, the regional brightness characterization value and the grayscale distribution complex characterization value is used as the defect confidence of the suspected defective pixel.
9. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 7, characterized in that: Methods for obtaining tag values include: For the jth pixel to be detected in the neighborhood set, if the jth pixel to be detected is a suspected defective pixel, the difference representation value of the jth pixel to be detected is directly used as the mark value of the jth pixel to be detected; if the jth pixel to be detected is not a suspected defective pixel, the preset constant is used as the mark value of the jth pixel to be detected.
10. The method for efficiently identifying and detecting printing defects on a metal plate surface according to claim 1, wherein: The method for identifying printing defects on the surface of a printed metal plate to be inspected according to the abnormality degree characterization value comprises: All suspected defective pixels whose abnormality degree characterization values are greater than a preset abnormality threshold are recorded as defective pixels, and all printing defect areas on the surface image of the printed metal plate to be inspected are obtained based on the defective pixels on the surface image.
Citation Information
Patent Citations
Flexible leather material scabies defect detection method and system based on artificial intelligence
CN114913176A
Printing defect identification method for textile fabric with periodic patterns
CN115100206A
Bearing defect identification method
CN115272347A
Visual inspection system for high-precision printing plate
CN116990323A
Weld defect detection method based on threshold segmentation
CN116993744A
Cited By
Impurity detection method for foreign fiber removing machine based on photoelectric detection technology
CN120846990A
Flexible photovoltaic module surface defect detection method based on machine vision
CN120852432A
PCB (Printed Circuit Board) defect visual detection method and system based on feature extraction
CN121527479A
Precious metal quality defect detection method based on image recognition
CN121545021A
Image processing-based secret code ink printing defect detection method
CN121883496A