Methods for detecting defects in printed fabrics

CN119648654BActive Publication Date: 2026-09-01PEKING UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411704402.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2026-09-01
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

[0003]当前市场中采用的瑕疵检测方法多采用固定阈值或简单的图像比较,难以适应各种复杂的图像特征及瑕疵类型,尤其在数码印花过程中,由于图像的多样性和复杂性,传统方法的检测准确性和可靠性仍存在不足

Benefits of technology

[0028]本发明能够适应不同类型和高度的图像,使得整个检测系统在各种印刷环境中均可稳定运行,允许灵活调整检测参数,以满足不同生产线的特定需求,提高了整体的实用性和可操作性。本发明采用Z-score度量在保证准确率足够的同时,能够极大的减少程序运行处理时间,能够匹配实时的数字印刷流水线的检测需求,可以在流水线中进行实时瑕疵检测,满足生产过程中的即时反馈需求,而且有效减少由于图像偏移带来的误判,提供更为精确的瑕疵检测结果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648654B_ABST
    Figure CN119648654B_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting defects in printed fabrics. The method involves: acquiring an image of the printed fabric to be inspected and determining the height of the repeat pattern; extracting an image containing n repeat patterns from the acquired image as a standard image (n≥1); converting the standard image to the Lab color space and extracting the L channel to obtain a first image; segmenting the first image to obtain a first image sub-image and summing the pixels in each column of the first image sub-image; obtaining at least one image of the printed fabric to be inspected from the acquired image; the height of the image to be inspected being consistent with the standard image; converting the image to be inspected to the Lab color space and extracting the L channel to obtain a second image; segmenting the second image to obtain a second image sub-image and summing the pixels in each column of the second image sub-image; and detecting defects in the printed fabric 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing technology, and more specifically to a method for detecting defects in printed fabrics. Background Technology

[0002] In the digital printing industry, image quality directly impacts a product's market competitiveness. Traditional defect detection methods rely primarily on manual inspection, which is inefficient and susceptible to human error, failing to meet the demands of modern production. With the development of machine vision and image processing technologies, automated defect detection methods based on computer vision are gradually becoming an industry trend.

[0003] Current defect detection methods in the market mostly rely on fixed thresholds or simple image comparisons, making it difficult to adapt to various complex image features and defect types. This is especially true in digital printing, where the diversity and complexity of images render traditional methods insufficient in terms of accuracy and reliability. Meanwhile, while some machine learning detection methods show good accuracy, they are often time-consuming and cannot meet the demands of production implementation. Therefore, the need for a real-time defect detection system in the assembly line production environment of printing companies is becoming increasingly urgent. Summary of the Invention

[0004] Methods for detecting defects in printed fabrics:

[0005] Acquire images of the printed fabric to be inspected and determine the height of the pattern repeat;

[0006] From the acquired images, extract an image containing n flower repetitions as a standard image, where n≥1;

[0007] The standard image is converted to the Lab color space and the L channel is extracted to obtain the first image;

[0008] The first image is segmented to obtain a first image sub-image, and the sum of the pixels in each column of the first image sub-image is counted and saved.

[0009] At least one image of the printed fabric to be detected is obtained from the acquired images; the height of the image to be detected is consistent with that of the standard image;

[0010] The image to be detected is converted to the Lab color space and the L channel is extracted to obtain a second image;

[0011] The second image is segmented to obtain a second image sub-image, and the sum of the pixels in each column of the second image sub-image is calculated.

[0012] Defects in printed fabric 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 cycle is determined using a matching search and normalized coefficient matching method.

[0014] Furthermore, the conversion method includes:

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

[0016] The color space is converted from RGB format to XYZ color space and then to Lab color space.

[0017] Furthermore, the method for detecting defects in printed fabric includes:

[0018] Calculate the difference values ​​of each column of the second image sub-image. The difference value is the minimum value among the differences between the sum of the pixels in the current column of the second image sub-image and the sum of the pixels in each column of the corresponding column of the first image sub-image and the columns before and after it.

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

[0020] The printed fabric is deemed to have defects when the Z-score value of at least a set column is greater than a set threshold.

[0021] Furthermore, the formula for calculating the Z-score is as follows:

[0022]

[0023] Where, Δ n The variance is represented by n, the image width by n, the population mean by μ, and the population standard deviation by σ. i This represents the Z-score value of the i-th column.

[0024] Furthermore, histogram calculation is performed on the acquired images. 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 fabric has been replaced.

[0025] Furthermore, the height of each individual repeat was redefined after the printed fabric was replaced.

[0026] Furthermore, the formula for calculating the similarity is as follows: Where h 1,i and h 2,i These represent the histogram values ​​of the standard image and the image to be detected at grayscale value i, respectively.

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

[0028] This invention can adapt to images of different types and heights, enabling the entire inspection system to operate stably in various printing environments. It allows for flexible adjustment of inspection parameters to meet the specific needs of different production lines, improving overall practicality and operability. The invention employs Z-score metric, ensuring sufficient accuracy while significantly reducing program processing time. It can match the inspection requirements of real-time digital printing production lines, enabling real-time defect detection on the production line and meeting the need for immediate feedback during production. Furthermore, it effectively reduces misjudgments caused by image offset, providing more accurate defect detection results. Attached Figure Description

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

[0030] Figure 2 This is a schematic diagram of the foreground image and an image containing a single floral repetition.

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

[0032] Figure 4 This is a schematic diagram of the defect identification and judgment effect. Detailed Implementation

[0033] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. The described embodiments are only intended to facilitate the understanding of the present invention and are not intended to limit it in any way.

[0034] The specific process of this invention embodiment is as follows: Figure 1 As shown, the detection system uses a line scan camera to continuously acquire images of the printed fabric on the production line. At the start of acquisition, the detection system needs to synchronize with the printing system running on the production line. Since the production line is driven by rollers, the printing system drives the production line by setting the roller's rolling speed. Simultaneously, it acquires the electrical signals regularly emitted by the encoder in the roller due to the rolling motion. After this signal is transmitted to the detection system, the system can obtain the production line's operating speed and match the line scan camera's acquisition frequency with the production line platform's operating speed. This ensures that there is almost no vertical stretching between the acquired printed images, reducing interference factors during defect detection and improving the accuracy of defect detection.

[0035] The detection system of this invention uses the first image taken after the production line speed has stabilized after image acquisition begins as the preceding image. In printed pattern design, a "repeated pattern" refers to a repeating unit of a pattern, or a basic unit in which a complete pattern repeats on the printed fabric. Each "repeated pattern" includes all the pattern elements, and when this unit is continuously repeated on the fabric, it forms the overall printed pattern.

[0036] The image first selects a region containing multiple flower patterns from the preceding image. A 100px x 100px small image in the upper left corner is used as the search template to ensure the basic features of the flower patterns are captured. To improve matching efficiency, the search area is set to 300 pixels to the left of the standard image multiplied by the original image height. The matching degree is calculated using a normalized coefficient matching method, calculated using the following formula:

[0037]

[0038] Where T(x) ′ ,y ′ Let I(x,y) be the template image and I(x,y) be the search region image. After the template matching algorithm runs, it outputs a matching result matrix R(x,y), which has a length and width of (W-w+1)×(H-h+1), where W and H are the width and height of the search region image, respectively, and w and h are the width and height of the template image, respectively.

[0039] If the matching result is higher than a set threshold, the matching region 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 subsequent image acquisition and detection processes. The formula for calculating the height of the flower return is: Flower return height = min(h match if P match >Matching threshold, where h match For the matched height, P match The matching degree is the value of each R(x,y) in the matching result matrix.

[0040] like Figure 2 As shown, the image displays a pre-printed image containing multiple repeats and a printed image after retaining the height of a single repeat. The area within the bounded box represents the region at the height of a single repeat. Therefore, after determining this image, the detection system stores the image at the height of a single repeat as a standard image. This saves on image storage size and reduces the computational load for subsequent defect detection, improving the efficiency of the defect detection algorithm. Simultaneously, the system retains the height of a single repeat as the acquisition height for subsequent images to be detected. This allows for image acquisition based on one repeat at a time during subsequent image acquisition, ensuring that each acquired image to be detected maintains consistency with the standard image in terms of basic content, reducing detection errors and improving detection efficiency.

[0041] In this embodiment of the invention, a standard image is converted into the Lab color space, and the L channel (luminance channel) is separated from the Lab color space to obtain a first image, thereby enhancing the luminance features 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 the Lab color space:

[0049]

[0050] Where X n ,Y n Z n The XYZ values ​​are the standard white point values, and f(t) is defined as (where δ = 2). 6 9):

[0051]

[0052] The first image is divided into several sub-images according to a set sub-image segmentation height. The sub-image segmentation formula is: At the same time, the width of each sub-image is the same as that of the current first image.

[0053] For each segmented first image sub-image, perform statistical analysis on 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 in the x-th column and y-th row of the image. The pixel sum of each column of the first image sub-image is calculated and saved. Due to the different types of defects in digital printing images compared to traditional printing, they are more difficult to distinguish, and the contrast is usually lower. Uneven printing often occurs in digital printing due to the blockage of a certain color printhead. The contrast is more difficult to distinguish than the streaks in traditional printing. Moreover, since this uneven printing is often caused by more than one printhead, coupled with the variable colors of digital printing itself, such defects often do not present a significant straight line shape in the vertical direction, which easily generates 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. This can blur the influence of a specific column of pixels and focus more on outliers in the overall statistical significance of the image.

[0054] This invention utilizes a line scan camera to acquire images of printed fabric on an assembly line, continuously obtaining images to be detected. The height of the image to be detected is equal to the height of a single pattern repeat. In other words, the acquired image is divided equally according to the height of a single pattern repeat to obtain the image to be detected. The image to be detected is converted to the Lab color space using the aforementioned conversion method to obtain a second image. The second image is then divided into second image sub-images using the aforementioned segmentation method. The height and width of the second image sub-images are the same as those of the first image sub-images. The sum of the pixels in each column of the second image sub-image is calculated using the aforementioned statistical method.

[0055] This invention utilizes a sliding window to calculate and eliminate the influence of lateral image offset values. Since defects in digital printing often do not present a significant straight line shape vertically, if only the deviation of the pixel sum of corresponding columns between the standard image and the image to be detected is considered, the presence of lateral offset could lead to a larger cumulative error. Therefore, this study uses a sliding window to mitigate the influence of lateral image offset values. Specifically, for the pixel sum of any column in the second image sub-image, the system compares and subtracts it from the pixel sum of the corresponding column and the two columns before and after it in the first image sub-image, for a total of five columns. The smallest difference is taken as the difference value of the pixel sum of that column in the image to be detected. The correspondence in the image is as follows: Figure 3 As shown, let the second image sub-image examine the sum of pixel values ​​in the nth column, and let the sum of pixels in this column be Σ. n Then, it corresponds to columns n-2 to n+2 in the first image sub-image, and let their sums be Σ. ′ n-2 ,Σ ′ n-1 ,Σ ′ n ,Σ ′ n+1 ,Σ ′ n+2 Then, the difference value in the nth column of the second image sub-image that needs to be obtained at this time is min. n-2≤i≤n+2 {|Σ n -Σ i ′ By following this logic, the difference values ​​for all columns in the second image sub-image can be obtained.

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

[0057]

[0058] Finally, defect determination is performed. The Z-score Z for each column is obtained. i The system then identifies outliers to determine if the Z-score of a column is excessively biased. Generally, an absolute Z-score greater than a certain threshold (such as 2 or 3) is considered an outlier. For example, in common image comparisons, an absolute value greater than 2 indicates that the data point deviates from the mean by more than 2 standard deviations, which may be a potential outlier; an absolute value greater than 3 indicates that the data point deviates from the mean by more than 3 standard deviations, which is usually considered an outlier.

[0059] Meanwhile, as known from the previous steps, the height of the current detected image is the image height of the previously determined single pattern image. Since the threshold for Z-score outlier determination is related to image height, applying a fixed threshold to all detected images of different heights during actual detection will cause significant deviations. A threshold suitable for certain image heights might classify most detected images as defective at smaller heights (or classify most detected images as defect-free at larger heights). Through actual experiments, the system uses a certain threshold as the outlier determination threshold for the Z-score of the sub-image with height H. It should be noted that, as mentioned earlier, defects in digital printing exhibit lateral shifts. A single outlier may not necessarily represent a definite defect, and defects often exhibit lateral shifts, typically appearing consecutively in multiple columns. Therefore, the system analyzes the Z-score values ​​of all columns. If k consecutive columns of Z-score values ​​are outliers, a defect is determined to exist there. In actual operation, depending on the characteristics of different printed fabrics, k can be set to a number between 5 and 10. Detection results are as follows Figure 4 As shown, in most cases, defects in digital printing images can be successfully identified and determined.

[0060] In the process of detecting printing defects, this invention also compares the histogram statistics of the standard image and the current image to be detected to determine whether the printed fabric in the production line has been replaced in a short time. Histogram calculations are performed on the standard image and the image to be detected, recording the number of pixels with different grayscale or brightness values. The calculation formula is: H(i)=∑ (x,y)∈R I(x,y) = i, where H(i) represents the number of pixels with gray value i, I(x,y) is the gray value of the pixel, and R is the total number of pixels in the image.

[0061] Then, the histogram similarity metric between the current image to be detected and the standard image is calculated. Where h 1,i and h 2,i These represent the histogram values ​​of the standard image and the current image to be detected at grayscale value i, respectively. If the calculated similarity is lower than a set threshold, the current image to be detected is determined to be different from the standard image, a new standard image is determined, and the flower return height is recalculated. The set threshold is determined based on the actual flower return pattern.

[0062] The above histograms have low computational complexity, allowing for rapid comparison through simple mathematical operations. They are also unaffected by changes in image size and position, making them suitable for rapid filtering and matching of large-scale images.

[0063] In this field, existing deep learning-based defect detection methods have an efficiency of 0.1–1 second for detecting 200*200 pixel images. The method of this invention achieves a detection efficiency of 0.2 seconds for 16384*5000 pixel images after multi-threaded processing.

[0064] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for detecting defects in printed fabrics, including the following steps: Acquire images of the printed fabric to be inspected and determine the height of the pattern repeat; From the acquired images, extract an image containing n flower repetitions as a standard image, where n≥1; The standard image is converted to the Lab color space and the L channel is extracted to obtain the first image; The first image is segmented to obtain a first image sub-image, and the sum of the pixels in each column of the first image sub-image is counted and saved. At least one image of the printed fabric to be detected is obtained from the acquired images; the height of the image to be detected is consistent with that of the standard image; The image to be detected is converted to the Lab color space and the L channel is extracted to obtain a second image; The second image is segmented to obtain a second image sub-image, and the sum of the pixels in each column of the second image sub-image is calculated. Defects in the printed fabric, including lateral offset defects, 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. The method of detecting defects in printed fabric 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 includes: Calculate the difference values ​​of each column of the second image sub-image. The difference value is the minimum value among the differences between the sum of the pixels in the current column of the second image sub-image and the sum of the pixels in each column of the corresponding column of the first image sub-image and the columns before and after it. The Z-score value is calculated from the difference value; The printed fabric is deemed to have defects when the Z-score value of at least a set column is greater than a set threshold for at least one consecutive column. The calculation of the difference values ​​of each column in the second image sub-image includes using a sliding window to exclude the influence of the horizontal offset value of the image. The steps are as follows: for the sum of pixels in any column of the second image sub-image, compare and subtract the sum of pixels in the corresponding column of the first image sub-image and the two columns before and after it, for a total of five columns. Take the smallest difference value as the difference value of the sum of pixels in that column in the image to be detected; and so on, to obtain the difference values ​​of all columns in the second image sub-image.

2. The method according to claim 1, characterized in that, The height of the flower cycle is determined by matching search and normalized coefficient matching method.

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

4. The method according to claim 1, characterized in that, The formula for calculating the Z-score is as follows: in, This represents the difference value, where n represents the image width. This represents the population mean. Indicates the population standard deviation. This represents the Z-score value of the i-th column.

5. The method according to claim 1, characterized in that, Histograms are calculated on the acquired images. 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 fabric has been replaced.

6. The method according to claim 5, characterized in that, The height of each individual repeat was determined after the printed fabric was replaced.

7. The method according to claim 5, characterized in that, The formula for calculating the similarity is as follows: ,in and The grayscale values ​​of the standard image and the image to be detected are respectively represented. Histogram values ​​at the location.

8. An electronic device comprising a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the method of any one of claims 1 to 7.

9. A storage medium storing a computer program, which, when executed by a computer, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Automatic eliminating method for redundant image data of capsule endoscope

    CN102096917A

  • Automatic cloth inspection machine using contact image sensor

    CN105738376A

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

    CN113706455A