A method for detecting surface defects of label printing products

By constructing a standard image set and calculating adaptive adjustment parameters, combined with adaptive dynamic threshold difference calculation technology, the problem of defect detection accuracy and inefficiency of complex printed graphics and uneven brightness label printed images in the prior art is solved, and the accurate extraction and positioning of defects in label printed images is achieved.

CN119579600BActive Publication Date: 2025-05-09CHINA JILIANG UNIV

Patent Information

Application Number
CN202510138018.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-09
Estimated Expiration
2045-02-08

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process the label print image with complex printing graphics and uneven brightness, resulting in inaccuracy and inefficient defect detection.

Method used

By acquiring multiple surface images of label prints, pre-processing to construct a standard image set, statistical calculations are used to obtain template images and brightness deviation images, combined with adaptive adjustment parameters alpha and beltta, and adaptive dynamic threshold difference calculation technology is used to achieve accurate extraction and positioning of defects in label prints.

Benefits of technology

Accurate extraction and positioning of defects in label print images with complex printing graphics and uneven brightness is achieved, which improves detection flexibility and accuracy and reduces the error detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579600B_ABST
    Figure CN119579600B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of printed matter detection technology, and in particular to a method for detecting surface defects of label printed matter. The method comprises the following steps: S1, obtaining multiple surface images of label printed matter; S2, constructing a detection model according to a standard image set; S3, obtaining the image of the printed matter to be detected, and performing preprocessing to obtain the image to be extracted; S4, calculating the adaptive adjustment parameter alpha according to the degree of pixel difference between the template image and the image to be processed, and calculating the adaptive adjustment parameter beta according to the gradient difference information between the template image and the image to be processed; S5, combining the adaptive adjustment parameter alpha, the adaptive adjustment parameter beta, the brightness deviation image and the detection model image, obtaining a defect segmentation image, and locating the defect according to the segmentation image. The present invention provides a method for detecting surface defects of label printed matter, which can accurately extract and locate defects in label printed matter images with printed graphics and uneven brightness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printed matter detection, and in particular to a method for detecting surface defects of label printed matter. Background Art

[0002] Label printing refers to an industrial product that forms text or graphics by printing ink on paper. It is mainly used in the surface packaging of products in the food, daily chemical, medical and electronic industries. When using the digital image detection method based on machine vision to detect defects in label printing, the quality of the label image collected by the industrial camera equipment must be ensured first. However, due to the interference of various factors such as mechanical vibration, raw material changes and production environment, the label image collected by the camera equipment has uneven brightness distribution, which greatly affects the stability of the label image quality. Traditional manual detection methods have long been abandoned by most manufacturers due to their low efficiency and high cost. Some existing print defect detection methods are difficult to deal with label print images with complex printed graphics and uneven brightness. There are also some methods that collect a large number of samples for deep learning. This method has high detection accuracy and is favored by researchers. However, the high frequency of format changes of label printing and the difficulty in collecting defect samples make it difficult for deep learning methods to meet the requirements.

[0003] For example, in the patent publication number CN118429353A, the patent name is "A method and system for detecting defects in printed labels", first turn on the light source and camera, start collecting the label images printed on the assembly line, store the image data transmitted by the camera in the hard disk or memory stick for subsequent interface use, and after the industrial computer receives the label image data, start preprocessing the data, complete the positioning of the barcode, and then obtain the barcode inspection area through threshold segmentation and connected domain processing, and then use the minimum circumscribed rectangle size and area rectangularity two image features to roughly screen the barcode, store the defective bar area in a new area and delete it from the original inspection area, and then traverse the remaining images to be inspected, and use the skeleton image features to finely screen out the defective bar, store it in a new area, and finally mark the defective barcode, which is convenient for the quality tracing of the defective barcode, improves the image detection efficiency, and reduces the product's false detection rate. The disadvantage is that although it can effectively detect barcode defects, it is difficult to deal with complex printed graphics and brightness problems. Summary of the invention

[0004] In view of the problem in the prior art that it is difficult to effectively process label printed images with complex printed graphics and uneven brightness, the present invention provides a label printed surface defect detection method that can accurately extract and locate defects in label printed images with printed graphics and uneven brightness.

[0005] In order to achieve the above technical purpose, the present invention provides a technical solution, which is a method for detecting surface defects of label printing, comprising the following steps:

[0006] S1, obtaining multiple surface images of label printing materials and performing preprocessing to obtain a standard image set;

[0007] S2, based on the standard image set, statistically calculate the template image and the brightness deviation image to build a detection model;

[0008] S3, obtaining the image of the printed matter to be detected, and performing preprocessing to obtain the image to be extracted;

[0009] S4, calculating an adaptive adjustment parameter alpha according to the pixel difference between the template image and the image to be processed, and calculating an adaptive adjustment parameter belt according to the gradient difference information between the template image and the image to be processed;

[0010] S5, combining the adaptive adjustment parameter alpha, the adaptive adjustment parameter beta, the brightness deviation image and the detection model image, performing adaptive dynamic threshold difference calculation on the image to be extracted, obtaining a defect segmentation image, and locating the defect according to the segmentation image.

[0011] In this technical solution, first, a standard image set is constructed by collecting multiple surface images of label prints and performing preprocessing steps. Then, a template image and a brightness deviation image are extracted from the standard image set using statistical calculation methods. These two are key elements for constructing an accurate detection model. Subsequently, the same preprocessing process is performed on the printed image to be detected to obtain the image to be extracted. In step S4, the adaptive adjustment parameter alpha is obtained by calculating the degree of difference between the template image and the image to be processed at the pixel level; at the same time, another adjustment parameter belta is calculated based on the difference in gradient information between the two. These two parameters can be dynamically adjusted according to the specific features of the image, thereby improving the flexibility and accuracy of defect detection. Finally, in step S5, the adaptive adjustment parameters alpha and belta are combined with the brightness deviation image and the detection model image, and the differential calculation technology of the adaptive dynamic threshold is used to accurately extract the defect segmentation image, which not only realizes the accurate capture of defects, but also accurately locates the defects through the segmented image.

[0012] The present invention is further configured as follows: S2 further includes S21: obtaining a mean image, a maximum image and a minimum image by performing statistical calculation on the standard image set, wherein the mean image is a template image, and the construction formula of the template image and the maximum image is:

[0013] ;

[0014] ;

[0015] in, As the image, is the template image, is the maximum value image, is the minimum image, N is the number of images in the standard image set, x is the horizontal coordinate, and y is the vertical coordinate.

[0016] The present invention is further configured as follows: S21 further includes S210: calculating a brightness deviation image that measures the brightness variation information of the printed image acquisition space through the template image and the maximum value image, and the template image and the maximum value image of the brightness deviation image are constructed by the formula:

[0017] ;

[0018] in, is the bright deviation image, is the dark deviation image, is the template image, is the maximum value image, is the minimum image, N is the number of images in the standard image set, x is the horizontal coordinate, and y is the vertical coordinate.

[0019] The present invention is further configured as follows: S4 further includes S410, the adaptive adjustment parameter alpha is weighted indexed by a Gaussian weight table in the image pixel domain, and the weight table formula is:

[0020] ;

[0021] in, is the Gaussian weight table in pixel domain, is the index value of the weight table, , Represents the weight control standard deviation, which is used to adjust the dividing line of weight attenuation.

[0022] The present invention is further configured as follows: S4 also includes S411, using the pixel absolute difference between the template image and the image to be processed to index the weight and perform parameter calculation, and the adaptive adjustment parameter alpha is:

[0023] ;

[0024] in, is the pixel value of the image to be processed, and Im(x,y) is the pixel value of the template image.

[0025] The present invention is further configured as follows: the S42 further includes S420, performing gradient calculation on the image and obtaining image gradient amplitude information, wherein the gradient amplitude calculation formula is:

[0026] ;

[0027] ;

[0028] ;

[0029] in, and are the gradients of the image in the x and y directions, respectively. is the gradient amplitude, is the pixel value of the image to be processed.

[0030] The present invention is further configured as follows: S42 further includes S421: calculating the gradient difference between the template image and the image to be processed by using structural similarity, and calculating the adaptive adjustment parameter belta, the parameter formula is:

[0031] ;

[0032] ;

[0033] in, and are the mean values ​​of the gradient amplitude images of the template image and the image to be processed, respectively. and are the variances of the two amplitude images, is the covariance of the two amplitude images, and is a constant, and L is the dynamic range of the pixel value of the image.

[0034] The present invention is further configured as follows: S5 calculates a dynamic threshold through a brightness deviation image combined with adaptive adjustment parameters alpha and belta, and performs defect discrimination and segmentation on the difference result between the template image and the image to be processed according to the threshold, and the discrimination formula is:

[0035] ;

[0036] ;

[0037] in, and are the dynamic thresholds for distinguishing bright defects and dark defects corresponding to the pixels to be tested in the image to be processed, respectively. is the defect segmentation binary image, is the difference image between the template image and the image to be processed, is the dynamic threshold; T is the absolute static threshold and , is the bright deviation image, is a dark deviation image.

[0038] The present invention is further configured as follows: S1 further includes S11: registering a plurality of label surface images according to a reference template, and cutting out redundant areas to obtain a standard image set.

[0039] The present invention is further configured as follows: S3 also includes S31: registering the printed product image to be detected according to the reference template, cutting out the redundant area, and obtaining the image to be extracted through filtering and smoothing.

[0040] The beneficial effects of the present invention are as follows: (1) it can accurately extract and locate defects in label print images with printed graphics and uneven brightness; (2) through optical characteristics, an adaptive dynamic threshold is used to distinguish defects and perform segmentation, the weight is obtained based on the weight table fast indexing method and the threshold adaptive adjustment parameter alpha is calculated in combination with the absolute pixel difference between the template image and the image to be extracted, the threshold adaptive adjustment parameter beta is calculated by calculating the gradient amplitude structure similarity between the template image and the image to be extracted, and the adaptive dynamic threshold is calculated by combining the adaptive adjustment parameter and the brightness deviation image; based on the adaptive dynamic threshold and the absolute static threshold, the absolute difference between the template image and the image to be extracted is used to distinguish bright and dark defects and perform segmentation, so that the detection of label print defects can be accurately completed. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flow chart of the present invention;

[0042] Figure 2 It is a comparison diagram of label image registration and cropping in the present invention;

[0043] Figure 3 It is the template image and the local area map of the image to be processed in the present invention;

[0044] Figure 4 It is a three-dimensional projection of the template image and the local area of ​​the image to be processed in the present invention;

[0045] Figure 5 It is the second three-dimensional projection of the template image and the local area of ​​the image to be processed in the present invention;

[0046] Figure 6 is a three-dimensional projection of the adaptive adjustment parameters of the local area in the present invention;

[0047] Figure 7 is the three-dimensional projection two of the adaptive adjustment parameters of the local area in the present invention;

[0048] Figure 8 It is a three-dimensional projection of the brightness deviation image in the local area of ​​the present invention;

[0049] Fig. 9 It is the second three-dimensional projection of the brightness deviation image in the local area in the present invention;

[0050] Fig.10 It is a three-dimensional projection comparison of the threshold value and the differential image in the local area of ​​the present invention;

[0051] Fig.11 It is the three-dimensional projection comparison of the threshold value and the differential image in the local area in the present invention;

[0052] Fig.12 It is the three-dimensional projection comparison of the threshold value and the difference image in the local area in the present invention;

[0053] Fig.13 This is a graph showing the effect of smoothing the texture of the test image in the present invention. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation method described herein is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0055] like Figures 1 to 13 As shown, as a first embodiment of the present invention, a method for detecting surface defects of a label printing product comprises the following steps:

[0056] Step S1, obtaining multiple label surface images and performing preprocessing to obtain a standard image set;

[0057] The step S1 also includes a step S11, which describes the preprocessing in detail. Specifically, the step S11 is to obtain a first expected image by registering the label surface image, such as Figure 2 As shown, the captured label surface image is first subjected to affine correction processing (affine correction processing is also a prior art), and then the first expected image is further cropped to extract the region of interest (RIO) to obtain a standard image set.

[0058] Step S2, reference Figure 8 , Fig. 9 , the standard image set is statistically calculated to obtain the template image and the brightness deviation image to obtain the detection model;

[0059] Step S3, obtaining the image to be detected and performing preprocessing to obtain the image to be extracted;

[0060] Step S3 also includes step S31, which has the same affine transformation correction operation as step S11, and then performs filtering and smoothing processing (filtering and smoothing processing is also a prior art).

[0061] Step S4, reference Figure 6 , Figure 7 , calculate the parameters for adaptive adjustment of the threshold; step S4 also includes step S41, calculating the parameter alpha according to the degree of pixel difference between the template image and the image to be processed, and step S4 also includes step S42, calculating the parameter belta according to the gradient difference information between the template image and the image to be processed, that is, calculating the adaptive adjustment parameters alpha and belt corresponding to the threshold for distinguishing defects.

[0062] Specifically, step S41 also includes step S410, establishing a Gaussian weight table in the image pixel domain. According to the Gaussian distribution principle, the greater the absolute difference in pixel values ​​between the template image and the image to be extracted, the smaller the corresponding adjustment weight, thereby adjusting the threshold for distinguishing the defective area downward, and when the pixel values ​​are more similar, the threshold can remain almost unchanged. The length of the weight table represents the range in which the weights can be obtained. For pixel domain weights, it is usually the pixel value range of an unsigned integer image, that is, 0-255. The weight table formula is:

[0063] ;

[0064] in, is the Gaussian weight table in pixel domain, is the index value of the weight table, , Represents the weight control standard deviation, which is used to adjust the dividing line of weight attenuation.

[0065] Specifically, refer to Figure 3 , Figure 4 and Figure 5 Step S41 also includes step S411, using the pixel absolute difference between the template image and the image to be processed to index the weight and perform parameter calculation, when the adjustment parameter alpha is:

[0066] ;

[0067] in, is the pixel value of the image to be processed.

[0068] For further reference, Figure 6 , Figure 7 The step S4 also includes a step S42, wherein the adaptive adjustment parameter belt is calculated according to the gradient difference information between the template image and the image to be processed.

[0069] Specifically, step S42 also includes step S420, which performs gradient calculation on the image and obtains image gradient amplitude information. The gradient amplitude formula is:

[0070] ;

[0071] ;

[0072] ;

[0073] in, and are the gradients of the image in the x and y directions, respectively. is the gradient amplitude.

[0074] Specifically, step S42 also includes step S421, which uses structural similarity to calculate the gradient difference between the template image and the image to be processed, thereby calculating the adjustment parameter belt. The normal areas between the two images have similar gradients, while the defective areas have obvious differences in gradients. The more similar the gradients are, the higher the structural similarity is. Based on this, the discrimination threshold of the defect-free area is increased to further avoid false detection. The parameter formula is:

[0075] ;

[0076] ;

[0077] in, and is the gradient amplitude image mean of the template image and the image to be processed, and is the variance of the two amplitude images, is the covariance of the two amplitude images, and is a constant, usually and , L is the dynamic range of the pixel value of the image, which is 255 here.

[0078] Step S5, reference Figures 10 to 13 In step S5, the dynamic threshold is calculated by combining the brightness deviation image with the adaptive adjustment parameters alpha and belta, and the difference result between the template image and the image to be processed is used for defect discrimination and segmentation according to the maximum value of the dynamic threshold and the absolute static threshold. When the difference value exceeds the maximum discrimination threshold, the defect is marked as 1, otherwise it is marked as 0, thereby obtaining a defect segmentation binary image. The defect discrimination formula is:

[0079]

[0080] ;

[0081] in, and is the dynamic threshold for distinguishing bright defects and dark defects corresponding to the pixels to be tested in the image to be processed, is the defect segmentation binary image, is the difference image between the template image and the image to be processed, Refers to the dynamic threshold, j=a,b; T is the absolute static threshold, which is set here .

[0082] The specific description of the present invention in the above embodiments is only used to further illustrate the present invention and cannot be understood as limiting the scope of protection of the present invention. Technical engineers in this field may make some non-essential improvements and adjustments to the present invention based on the contents of the above invention, which fall within the scope of protection of the present invention.

Claims

1. A method for detecting surface defects of label printing, characterized in that: The following steps are involved: S1, obtaining multiple surface images of label printing materials and performing preprocessing to obtain a standard image set; S2, based on the standard image set, statistically calculate the template image and the brightness deviation image to construct the detection model image; S3, obtaining the image of the printed matter to be detected, and performing preprocessing to obtain the image to be processed; S4, calculating an adaptive adjustment parameter alpha according to the pixel difference between the template image and the image to be processed, and calculating an adaptive adjustment parameter belt according to the gradient difference information between the template image and the image to be processed; S5, combining the adaptive adjustment parameter alpha, the adaptive adjustment parameter beta, the brightness deviation image and the detection model image, performing adaptive dynamic threshold difference calculation on the image to be processed, obtaining a defect segmentation image, and locating the defect according to the segmentation image; The S5 calculates the dynamic threshold by combining the brightness deviation image with the adaptive adjustment parameters alpha and belt, and performs defect discrimination and segmentation based on the difference result between the template image and the image to be processed according to the threshold. The discrimination formula is: ; ; in, and are the dynamic thresholds for distinguishing bright defects and dark defects corresponding to the pixels to be tested in the image to be processed, respectively. is the defect segmentation binary image, is the difference image between the template image and the image to be processed, is the dynamic threshold; T is the absolute static threshold and , is the bright deviation image, is a dark deviation image.

2. A method for detecting surface defects of label printing according to claim 1, characterized in that: The S2 also includes S21: obtaining a mean image, a maximum image and a minimum image by performing statistical calculation on the standard image set, wherein the mean image is a template image, and the construction formula of the template image and the maximum image is: ; ; in, is a standard image, is the template image, is the maximum value image, is the minimum image, N is the number of images in the standard image set, x is the horizontal coordinate, and y is the vertical coordinate.

3. A method for detecting surface defects of label printing according to claim 2, characterized in that: The S21 further includes S210: calculating a brightness deviation image that measures the brightness variation information of the printed image acquisition space through the template image and the maximum value image, and the template image and the maximum value image of the brightness deviation image are constructed by the formula: ; in, is the bright deviation image, is the dark deviation image, is the template image, is the maximum value image, is the minimum image, N is the number of images in the standard image set, x is the horizontal coordinate, and y is the vertical coordinate.

4. The method for detecting surface defects of label printing according to claim 1, characterized in that: The S4 further includes S410, wherein the adaptive adjustment parameter alpha is weighted indexed by a Gaussian weight table in the image pixel domain, and the weight table formula is: ; in, is the Gaussian weight table in pixel domain, is the index value of the weight table, , Represents the weight control standard deviation, which is used to adjust the dividing line of weight attenuation.

5. A method for detecting surface defects of label printing according to claim 4, characterized in that: The S4 also includes S411, using the pixel absolute difference between the template image and the image to be processed to index the weight and perform parameter calculation, and the adaptive adjustment parameter alpha is: ; in, is the pixel value of the image to be processed, and Im(x,y) is the pixel value of the template image.

6. The method for detecting surface defects of label printing according to claim 1, characterized in that: The S42 also includes S420, performing gradient calculation on the image and obtaining image gradient amplitude information, and the gradient amplitude calculation formula is: ; ; ; in, and are the gradients of the image in the x and y directions, respectively. is the gradient amplitude, is the pixel value of the image to be processed.

7. A method for detecting surface defects of label printing according to claim 6, characterized in that: The S42 also includes S421: using structural similarity to calculate the gradient difference between the template image and the image to be processed, and calculating the adaptive adjustment parameter belt, the parameter formula is: ; ; in, and are the mean values ​​of the gradient amplitude images of the template image and the image to be processed, respectively. and are the variances of the two amplitude images, is the covariance of the two amplitude images, and is a constant, and L is the dynamic range of the pixel value of the image.

8. The method for detecting surface defects of label printing according to claim 1, characterized in that: The S1 also includes S11: registering the plurality of label surface images according to the reference template, and cutting out the redundant areas to obtain a standard image set.

9. The method for detecting surface defects of label printing according to claim 1, characterized in that: The S3 also includes S31: registering the printed product image to be detected according to the reference template, cutting out the redundant area, and obtaining the image to be processed by filtering and smoothing.

Citation Information

Patent Citations

  • Printing label defect detection method and system

    CN118429353A

  • Method for detecting defects of cosmetic paper label

    CN108548820A

  • Printed matter surface defect detection method, device and equipment and storage medium

    CN117350946A

Cited By

  • Printed matter defect automatic detection method and system based on image recognition

    CN120894323A

  • An image recognition-based printed matter defect automatic detection method and system

    CN120894323B

  • Intelligent visual detection system for surface defects of label paper

    CN122289139A