Defect detection method for printed cloth

By collecting and processing the printed cloth images in digital printing, and using Z-score values ​​and matching search methods for defect detection, the problems of inefficiency and inability to meet real-time detection requirements in the prior art are solved, and efficient and accurate defect detection is achieved.

CN119648654AActive Publication Date: 2025-03-18PEKING UNIV +1

Patent Information

Application Number
CN202411704402.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

Existing defect detection methods are inefficient in digital printing, difficult to adapt to complex image features, and traditional methods cannot meet real-time detection requirements.

Method used

By collecting the printed cloth images, determining the flower back height, converting it to Lab color space, dividing the image sub-map, counting the sum of pixels in each column, and using the Z-score value and matching search method for defect detection to achieve real-time detection.

Benefits of technology

This method can adapt to images of different types and heights, improves the stability and flexibility of the detection system, reduces detection time, meets real-time detection requirements, and reduces the misjudgment rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648654A_ABST
    Figure CN119648654A_ABST
Patent Text Reader

Abstract

The invention discloses a printed cloth defect detection method, and belongs to the technical field of printing. The method comprises the following steps: acquiring an image of to-be-detected printed cloth, and determining the height of a printed loop; intercepting an image containing n patterns from the acquired image as a standard image, wherein n is greater than or equal to 1; converting the standard image into a Lab color space and extracting an L channel to obtain a first image; segmenting the first image to obtain a first image sub-image, and counting and storing the sum of each column of pixels of the first image sub-image; acquiring at least one to-be-detected image of the printed cloth from the acquired images; the height of the to-be-detected image is consistent with that of the standard image; converting the to-be-detected image into a Lab color space and extracting an L channel to obtain a second image; segmenting the second image to obtain a second image sub-image, and counting the sum of each column of pixels of the second image sub-image; and detecting flaws of the printed cloth based on the sum of the columns of pixels of the first image sub-graph and the sum of the columns of pixels of the second image sub-graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of printing, and in particular to a method for detecting defects of printed cloth. Background Art

[0002] In the digital printing industry, image quality directly affects the market competitiveness of products. Traditional defect detection methods mainly rely on manual inspection, which is inefficient and easily affected by human factors, and cannot meet the needs of modern production. With the development of machine vision and image processing technology, automated defect detection methods based on computer vision have gradually become an industry trend.

[0003] The defect detection methods currently used in the market mostly use fixed thresholds or simple image comparisons, which are difficult to adapt to various complex image features and defect types. Especially in the digital printing process, due to the diversity and complexity of images, the detection accuracy and reliability of traditional methods are still insufficient. At the same time, some current machine learning detection methods have good performance in detection accuracy, but they often take a long time and cannot meet the needs of production implementation. Therefore, in the assembly line production environment of printing companies, the need to implement a real-time defect detection system is becoming more and more urgent. Summary of the invention

[0004] Printed fabric defect detection method:

[0005] Collect the image of the printed fabric to be tested and determine the height of the printed fabric;

[0006] Intercepting an image containing n flower turns from the collected image as a standard image, where n≥1;

[0007] Convert the standard image into Lab color space and extract the L channel to obtain a first image;

[0008] Dividing the first image into first image sub-images, and statistically saving the sum of pixels in each column of the first image sub-images;

[0009] Acquire at least one image to be detected of the printed cloth from the collected images; the height of the image to be detected is consistent with that of the standard image;

[0010] Convert the image to be detected into Lab color space and extract the L channel to obtain a second image;

[0011] Segmenting the second image to obtain second image sub-images, and counting the sum of pixels in each column of the second image sub-images;

[0012] Defects of the printed cloth are detected based on the sum of the pixels in each column of the first image sub-image and the sum of the pixels in each column of the second image sub-image.

[0013] Furthermore, the height of the flower return is determined by using matching search and normalized coefficient matching methods.

[0014] Furthermore, the conversion method includes:

[0015] Convert the image from BGR format to RGB format;

[0016] Convert from RGB format to XYZ color space and then to Lab color space.

[0017] Furthermore, the method for detecting defects in printed cloth comprises:

[0018] Calculating the difference value of each column of the second image sub-image, wherein the difference value is the minimum value of the difference between the pixel of the current column of the second image sub-image and the sum of the pixels of each column of the corresponding column of the first image sub-image and the set columns before and after it;

[0019] The Z-score value is calculated by the difference value.

[0020] When the Z-score values ​​of at least a set column are continuously greater than a set threshold, it is determined that the printed cloth has a defect.

[0021] Furthermore, the calculation formula of the Z-score value is as follows:

[0022]

[0023] Among them, Δ n represents the difference value, n represents the image width, μ represents the population mean, σ represents the population standard deviation, Z i Represents the Z-score value of the i-th column.

[0024] Furthermore, a histogram calculation is performed on the acquired image, and when the similarity between the histogram of the image to be detected and the histogram of the standard image is less than a set threshold, it is determined that the printed cloth is replaced.

[0025] Furthermore, the height of the individual flowers is re-determined after the printed cloth is replaced.

[0026] Furthermore, the calculation formula of the similarity is: where h 1,i and h 2,i Respectively represent the histogram values ​​of the standard image and the image to be detected at the gray value i.

[0027] The beneficial effects of the present invention are as follows:

[0028] The present invention can adapt to images of different types and heights, so that the entire detection system can operate stably in various printing environments, allowing flexible adjustment of detection parameters to meet the specific needs of different production lines, thereby improving overall practicality and operability. The present invention uses Z-score measurement to ensure sufficient accuracy while greatly reducing program running processing time, matching the detection requirements of real-time digital printing production lines, and performing real-time defect detection in the production line to meet the needs of instant feedback during the production process. It can also effectively reduce misjudgments caused by image offset and provide more accurate defect detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 This is a flow chart of the defect detection method for printed fabrics

[0030] Figure 2 This is a schematic diagram of the front image and the image containing a single flower return.

[0031] Figure 3 This is a schematic diagram of the difference value calculation

[0032] Figure 4 This is a schematic diagram of the defect recognition and judgment effect. DETAILED DESCRIPTION

[0033] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments. The described embodiments are only intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.

[0034] The specific process of the embodiment of the present invention is as follows Figure 1 As shown. The detection system uses a linear array camera to continuously capture images of the printed fabric in the assembly line. At the beginning of the acquisition, the detection system needs to be synchronized with the printing system running on the assembly line. Since the operation of the assembly line requires the roller to drive, the printing system drives the operation of the assembly line by setting the rolling speed of the roller. At the same time, it can obtain the electrical signal regularly emitted by the encoder in the roller due to the rolling. After this signal is transmitted to the detection system, the detection system can obtain the running speed of the assembly line, and can match the acquisition frequency of the linear array camera with the running speed of the assembly line platform to ensure that there is almost no longitudinal stretching between the collected printed images, reduce interference factors during defect detection, and improve the accuracy of defect detection.

[0035] After the detection system of the embodiment of the present invention starts image acquisition, it uses the first image after the running speed of the assembly line is stabilized as the front image. In the design of printed patterns, "flower return" refers to the repeating unit of the pattern, or the basic unit of a complete pattern that appears repeatedly on the printed fabric. Each "flower return" includes all the pattern elements. When this unit is continuously repeated on the fabric, the overall printed pattern is formed.

[0036] Select an area containing multiple flower returns from the front image, and set the 100 pixel × 100 pixel small image in the upper left corner as the search template to ensure that the basic features of the flower return are captured. In order to improve the matching efficiency, the search area is set to the area 300 pixels to the left of the standard image × the original image height. The normalized coefficient matching method is used to calculate the matching degree, which is calculated by the following formula:

[0037]

[0038] Where T(x ′ ,y ′ ) is the template image, and I(x,y) is the search area image. After the template matching algorithm runs, the matching result matrix R(x,y) is output, whose length and width are (W-w+1)×(H-h+1), where W and H are the width and height of the search area image, respectively, and w and h are the width and height of the template image, respectively.

[0039] When the matching result is higher than the set threshold, the matching area with the lowest vertical pixel height is selected to obtain the height of the flower return. The height of the flower return is used for unified processing in the subsequent image acquisition and detection process. The calculation formula for the flower return height is: Flower return height = min (h match )if P match >matching threshold, where h match is the matched height, P match is the matching degree, that is, the value of each R(x,y) in the matching result matrix.

[0040] like Figure 2 As shown in the figure, a pre-image containing multiple flower returns and a printed image after retaining the height of a single flower return are shown. The frame range in the figure is the area of ​​the height of a single flower return. Therefore, after determining the image, the detection system retains the image of the height of a single flower return as a standard image for storage, which can not only save the size of the stored image, but also reduce the amount of calculation for subsequent defect detection, and improve the operating efficiency of the defect detection algorithm. At the same time, the system retains the height of a single flower return as the acquisition height for subsequent acquisition of the image to be detected. In this way, in the subsequent image acquisition process, the image can be acquired according to one flower return each time, ensuring that the basic content of the image to be detected each time is consistent with the standard image, reducing the generation of detection errors and improving detection efficiency.

[0041] The embodiment of the present invention converts the standard image into the Lab color space, and separates the L channel (brightness channel) from the Lab color space to obtain a first image, so as to enhance the brightness feature of the image for subsequent defect detection processing.

[0042] Convert the current standard image from BGR to RGB format:

[0043] R=B,G=G,B=R

[0044] Then convert RGB to XYZ color space:

[0045] X=0.4124564·R+0.3575761·G+0.1804375·B

[0046] Y=0.2126729·R+0.7151522·G+0.0721750·B

[0047] Z=0.0193339·R+0.1191920·G+0.9503041·B

[0048] Then convert the XYZ color space to Lab color space:

[0049]

[0050] Where X n ,Y n ,Z n is the XYZ value of the standard white point, f(t) is defined as (where δ = 2 6 9):

[0051]

[0052] The first image is divided into a number of first image sub-images according to the set sub-image division height. The sub-image division formula is: At the same time, the width of each sub-image is consistent with the current first image.

[0053] For each segmented first image sub-image, count the pixels in each column and calculate the sum of the pixels Where H is the sub-image segmentation height, and I(x,y) is the pixel value of the xth column and yth row in the image. Calculate the pixel sum of each column of the first image sub-image and save it. Due to the defect type of digital printing images, it is more difficult to distinguish than traditional printing, and the contrast is usually lower. Uneven printing caused by the blockage of a certain color nozzle often occurs in digital printing. The contrast is more difficult to distinguish than the pull strip in traditional printing. Moreover, since this uneven printing is often caused by more than one nozzle, and is superimposed with the variable color of the digital printing itself, such defects often do not present a significant straight line shape in the vertical direction, which is prone to produce more interference factors. Therefore, the detection system traverses each column of the L channel image and calculates the sum of the image pixels in each column of the image. It can blur the influence of a specific column of pixels and pay more attention to the abnormal values ​​in the overall statistical sense of the image.

[0054] The embodiment of the present invention utilizes a linear array camera to perform image acquisition on the printed cloth in the production line, and continuously obtains the image to be detected, wherein the height of the image to be detected is equal to the height of the above-mentioned single flower return. That is to say, the acquired picture is equally divided according to the height of the above-mentioned single flower return to obtain the image to be detected. The image to be detected is converted into a Lab color space according to the above-mentioned conversion method to obtain a second image. The second image is divided into a second image sub-image according to the above-mentioned segmentation method. The height of the second image sub-image is consistent with the height of the first image sub-image, and the width of the second image sub-image is consistent with the width of the first image sub-image. The sum of the pixels in each column of the second image sub-image is counted according to the above-mentioned statistical method.

[0055] The embodiment of the present invention utilizes a sliding window calculation to eliminate the influence of the lateral offset value of the image. Since the defects of digital printing often do not present a significant straight line shape in the vertical direction, if only the deviation of the sum of pixels of the corresponding columns of the standard image and the image to be detected is considered, it is possible to superimpose a larger error based on the existence of the lateral offset. Therefore, this study uses a sliding window to weaken the influence of the lateral offset value of the image. In specific implementation, for the pixel sum of any column in the second image sub-image, the system compares and subtracts it with the corresponding column of the first image sub-image and the two columns before and after it, a total of five columns of pixel sum data, and takes the smallest difference as the difference value of the pixel sum of that column in the image to be detected. The corresponding relationship in the image is as follows: Figure 3 As shown, suppose the second image sub-image examines the sum of the pixel values ​​of the nth column, and the sum of the pixels in this column is Σ n , then it corresponds to the n-2th column to the n+2th column in the first image sub-image, and let their sums be Σ ′ n-2 ,Σ ′ n-1 ,Σ ′ n ,Σ ′ n+1 ,Σ ′ n+2 , then the difference value of the nth column in the second image sub-image that needs to be obtained is min n-2≤i≤n+2 {|Σ n -Σ i ′ |}. And so on, the difference values ​​of all columns in the second image sub-image can be obtained.

[0056] The embodiment of the present invention calculates the Z-score value corresponding to each column difference value. Z-score is a statistical measure used to describe the relative position of a specific data point in a population. Specifically, Z-score represents the distance between a data point and the overall mean, and is measured in standard deviations, which helps to understand whether the data point is above or below the mean, and the degree of deviation from the mean. Therefore, Z-score can help determine whether a pixel difference deviates significantly from the normal pixel variation range, and is a commonly used statistical method. In specific calculations, it is assumed that the previously obtained difference values ​​of all columns are Δ1-Δ n , where n is the image width. First, we need to calculate the population mean μ and population standard deviation σ of this set of data. The calculation formulas are shown in formulas (1)-(2). Then, we can calculate the Z-score of each data point separately. For the i-th column, the Z-score value Z i The calculation formula is shown in formula (3).

[0057]

[0058] Finally, the defect determination is performed. The Z-score value Z of each column is obtained. i After that, the system determines whether the Z-score value of a column deviates too much by identifying outliers. Generally speaking, the absolute value of the Z-score greater than a certain threshold (such as 2 or 3) is considered an outlier. For example, in common image comparison, an absolute value greater than 2 means that the data point deviates from the mean by more than 2 standard deviations and may be a potential outlier; an absolute value greater than 3 means that the data point deviates from the mean by more than 3 standard deviations and is usually considered an outlier.

[0059] At the same time, it can be seen from the previous steps that the height of the current detection image is the image height of the single flower return image previously determined. Since the threshold for Z-score outlier determination is related to the image height, in the actual detection process, if a fixed determination threshold is applied to all detection images of different heights, it will cause a large deviation. The threshold applicable to certain detection image heights may determine that most detection images have defects at a smaller image height (or determine that most detection images do not have defects at a larger image height). Through actual experiments, it is concluded that the system uses a certain threshold as the threshold for outlier determination of the Z-score of the sub-image with a height of H. It should be noted that, as mentioned above, there is a lateral offset in the defects of digital printing. A single outlier sometimes does not necessarily represent the occurrence of a certain defect. At the same time, defects often have a lateral offset and usually appear continuously in multiple columns. Therefore, the system analyzes the Z-score values ​​of all columns. If the Z-score values ​​of consecutive k columns are all outliers, it is determined that there is a defect here. In actual operation, according to the characteristics of different printed fabrics, k can be set to a number between 5 and 10. Detection effect Figure 4 As shown, in most cases, defects in digital printing images can be successfully identified and determined.

[0060] In the process of printing defect detection, the embodiment of the present invention also compares the standard image with the current image to be detected by histogram statistics, so as to determine whether the printed fabric in the production line has been replaced in a short time. The histogram of the standard image and the image to be detected is calculated, and the number of pixels with different grayscale values ​​or brightness values ​​is recorded. The calculation formula is: H(i) = ∑ (x,y)∈R I(x,y)=i, where H(i) represents the number of pixels with grayscale value i, I(x,y) is the grayscale value of the pixel, and R is all the pixels in the image.

[0061] Then calculate the histogram similarity measure between the current image to be detected and the standard image where h 1,i and h 2,i Respectively represent the histogram values ​​of the standard image and the current image to be detected at grayscale value i. If the calculated similarity is lower than the set threshold, it is determined that the current image to be detected is different from the standard image, and the standard image is re-determined and the height of the flower return is recalculated. The set threshold is determined according to the actual flower return pattern.

[0062] The above histogram has low computational complexity and can be quickly compared through simple mathematical operations. It is not affected by changes in image size and position and is suitable for rapid screening and matching of large-scale images.

[0063] In the art, the existing deep learning-based defect detection method has an efficiency of 0.1 to 1 second for a 200*200 pixel image. The detection efficiency of the method of the present invention is 0.2 seconds for a 16384*5000 pixel image after multi-threaded processing.

[0064] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.

Claims

1. Defect detection method of printed fabric: Collect the image of the printed fabric to be tested and determine the height of the printed fabric; Intercepting an image containing n flower turns from the collected image as a standard image, where n≥1; Convert the standard image into Lab color space and extract the L channel to obtain a first image; The first image is divided into first image sub-images, and the sum of the pixels in each column of the first image sub-image is statistically saved; at least one image to be detected of the printed cloth is obtained from the collected image; the height of the image to be detected is consistent with that of the standard image; Convert the image to be detected into Lab color space and extract the L channel to obtain a second image; Segmenting the second image to obtain second image sub-images, and counting the sum of pixels in each column of the second image sub-images; Defects of the printed cloth are detected based on the sum of the pixels in each column of the first image sub-image and the sum of the pixels in each column of the second image sub-image.

2. The method according to claim 1, characterized in that The height of the flower return was determined using matching search and normalized coefficient matching methods.

3. The method according to claim 1, characterized in that The conversion method includes: Convert the image from BGR format to RGB format; Convert from RGB format to XYZ color space and then to Lab color space.

4. The method according to claim 1, characterized in that: The method for detecting defects in printed cloth comprises: Calculating the difference value of each column of the second image sub-image, wherein the difference value is the minimum value of the difference between the pixel of the current column of the second image sub-image and the sum of the pixels of each column of the corresponding column of the first image sub-image and the set columns before and after it; The Z-score value is calculated by the difference value. When the Z-score values ​​of at least a set column are continuously greater than a set threshold, it is determined that the printed cloth has a defect.

5. The method according to claim 1, characterized in that The calculation formula of the Z-score value is as follows: Among them, Δ n represents the difference value, n represents the image width, μ represents the population mean, σ represents the population standard deviation, Z i Represents the Z-score value of the i-th column.

6. The method according to claim 1, characterized in that A histogram is calculated for the acquired image, and when the similarity between the histogram of the image to be detected and the histogram of the standard image is less than a set threshold, it is determined that the printed cloth is replaced.

7. The method according to claim 6, characterized in that After the printed fabric is replaced, the height of the individual flowers is re-determined.

8. The method according to claim 6, characterized in that The calculation formula of the similarity is: where h 1,i and h 2,i Respectively represent the histogram values ​​of the standard image and the image to be detected at the gray value i.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 8.

10. A storage medium storing a computer program, wherein when the computer program is executed by a computer, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Automatic eliminating method for redundant image data of capsule endoscope

    CN102096917A

  • Automatic cloth inspection machine using contact image sensor

    CN105738376A

  • Method, device and equipment for detecting appearance blemish of screw

    CN108982540A

  • A rapid damage detection method for a 330kV cable porcelain insulator sleeve

    CN113706455A

  • Flaw inspection device of image, and flaw inspection method of image

    JP2007078572A

Cited By

  • Printing defect detection method and equipment based on computer vision and medium

    CN122391170A