Polyester fabric printing defect detection method and system

By using color image processing methods, the detection errors caused by dye sublimation and yarn shrinkage in polyester fabric printing inspection were resolved, achieving accurate defect identification and temperature correction, and improving the accuracy of the inspection system.

CN122347702APending Publication Date: 2026-07-07NINGBO GUANZHONG PRINTING & DYEING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO GUANZHONG PRINTING & DYEING CO LTD
Filing Date
2026-04-03
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing machine vision inspection systems cannot accurately distinguish between true color mixing defects caused by dye sublimation and geometric misalignment caused by yarn shrinkage in polyester fabric printing inspection, resulting in missed reports, false reports, and the inability to provide effective temperature correction basis.

Method used

Using color image processing methods, the lightness and chroma channel data are calculated, a color variation probability comparison matrix and the total color distribution slip cost are constructed, the edge tangent skeleton is extracted, a continuous spatial sequence of lightness and chroma is generated, the dye diffusion location is identified, and the printing defect type is determined.

Benefits of technology

Accurately identify printing defects in polyester fabrics, reduce missed and false reports, provide reliable temperature correction basis, and improve detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347702A_ABST
    Figure CN122347702A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of defect visual inspection, and proposes a polyester fabric printing defect detection method and system, which comprises the following steps: color images of a printing original sample and a test sample are collected respectively, and brightness channel data and chroma channel data of pixel points are calculated; intermediate transition probability weight and minimum color distribution sliding cost total amount are calculated, and a color variation probability control matrix is constructed; an edge tangent skeleton of the color image of the test sample is extracted, a reference midpoint is set, and a brightness continuous space sequence, a chroma continuous space sequence and a coordinate mapping dictionary are generated along the normal direction of the reference midpoint; a boundary diffusion span value is calculated according to the matching results of the brightness continuous space sequence and the chroma continuous space sequence; color overflow points are identified according to the boundary diffusion span value and the coordinate mapping dictionary, and the type of the polyester fabric printing defect is judged. The present application can improve the accuracy of fabric printing defect visual inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual defect detection technology, specifically to a method and system for detecting defects in polyester fabric printing. Background Technology

[0002] In the color fastness testing process of printed fabrics made of polyester and other synthetic fibers, the internal stress of the fabric will inevitably be released after dry heat setting or washing, resulting in irregular shrinkage, wrinkling, and geometric deformation of the warp and weft yarns on the fabric surface. The detection algorithms of the machine vision inspection systems widely used in industry at present mostly rely on the absolute geometric registration of image coordinate pixels or edge size measurement, which is difficult to adapt to the above deformation scenarios.

[0003] Geometric misalignment caused by yarn wrinkling can shift the physical coordinates of pixels at the pattern edges. Conventional algorithms often misinterpret this geometric displacement as a large-scale color diffusion at the coordinate points, leading to numerous false color mixing alarms. Simultaneously, disperse dyes used in multi-color printing are prone to sublimation at high temperatures, detaching from the yarn dots and spilling into colorless areas, creating genuine color mixing defects. Conventional average color difference calculation methods perform global mixing calculations of color changes across the entire image, failing to distinguish between genuine color mixing caused by dye sublimation and geometric misalignment caused by yarn shrinkage. This makes it impossible for the detection system to objectively identify the true physical cause of blurred pattern edges, resulting in missed or false alarms. Furthermore, it cannot accurately trace the original printing formula corresponding to the heat spillage, making it difficult to provide effective numerical data for temperature correction in upstream dyeing and printing machines. Summary of the Invention

[0004] This invention provides a method and system for detecting printing defects in polyester fabrics, to solve the problem that irregular geometric wrinkles caused by heat in the polyester fabric printing detection process cannot be identified, leading to missed and false detections of printing defects. The specific technical solution adopted is as follows: In a first aspect, one embodiment of the present invention provides a method for detecting printing defects in polyester fabrics, the method comprising the following steps: Color images of the original printing sample and the sample to be printed were collected respectively. The lightness channel data and chroma channel data of each pixel in the color image were calculated. The color image after removing blank background pixels was evenly divided into different color block boxes. Based on the proportion of pixels retained in the non-empty color block box of the color images of the original print and the sample, the intermediate transition probability weight and the minimum color distribution slip cost are calculated, and a color variation probability comparison matrix is ​​constructed. The intermediate transition probability weight is used to characterize the probability that the base color of the original print changes to the color of the sample, and the minimum color distribution slip cost is used to characterize the degree of overall fading and color degradation variation of the sample relative to the original print. Extract the edge tangent skeleton of the color image of the sample, set different reference midpoints on the edge tangent skeleton, and generate the lightness continuous space sequence, chroma continuous space sequence and coordinate mapping dictionary of the reference midpoints along the normal direction of the reference midpoints; Based on the matching results of the lightness continuous space sequence and the chroma continuous space sequence, the boundary diffusion span value of the bidirectional sampling ray at the reference midpoint is calculated. The boundary diffusion span value is used to characterize the relative topological difference after excluding the distance scaling interference caused by wrinkling. Based on the boundary diffusion span value and coordinate mapping dictionary, the color spill points where dye diffusion occurs are identified. By combining the sample color discrete distribution ratio dictionary and color variation probability comparison matrix, the source dye is determined, and the type of printing defect in polyester fabric is judged.

[0005] Furthermore, the brightness channel data of the pixel is the pixel's value in CIELAB space. The chroma channel data refers to the pixel's position in the CIELAB space. Quantity and The root mean square of the component.

[0006] Furthermore, the specific calculation method for the intermediate transition probability weight is as follows: The percentage of pixels in each non-empty color block box in the color images of the original print and the test sample is counted out to the total number of all pixels that were not removed. This percentage is recorded as the original color distribution ratio and the test color distribution ratio of the corresponding non-empty color block box, respectively. Based on the original color distribution ratios of all non-empty color block boxes, a dictionary of discrete color distribution ratios of the original print and the test color images of the test sample are generated. Based on the test color distribution ratios of all non-empty color block boxes, a dictionary of discrete color distribution ratios of the test sample is generated. Continuous indices are assigned to the non-empty color block boxes present in the original print and test sample color discrete distribution ratio dictionaries, respectively. The distributed transfer cost algorithm is used to process the original sample color discrete distribution ratio dictionary and the sample color discrete distribution ratio dictionary to calculate the three-dimensional... The Euclidean distance between the center coordinates of the color block corresponding to the original printing sample index and the center coordinates of the color block corresponding to the sample index is recorded as the distance cost weight for transporting the color block. The intermediate transfer probability weight of the color block corresponding to the original printing sample index being mutated and transferred to the color block corresponding to the sample index is also obtained.

[0007] Furthermore, the specific calculation method for the total minimum color distribution slip cost is as follows: The variation of the color block corresponding to the original printing sample index is transferred to the product of the intermediate transfer probability weight of the color block corresponding to the index in the sample and the corresponding distance cost weight, which is denoted as the first product. The sum of all first products is denoted as the minimum color distribution slip cost.

[0008] Furthermore, the color variation probability comparison matrix is ​​a matrix formed by arranging all intermediate transfer probability weights, with the original printing sample index corresponding to the intermediate transfer probability weight as the row and the sample index corresponding to the intermediate transfer probability weight as the column.

[0009] Furthermore, the specific methods for generating the lightness continuous space sequence, chroma continuous space sequence, and coordinate mapping dictionary of the reference midpoint are as follows: Along the extension direction of the edge tangent skeleton, the reference midpoints are selected sequentially with a preset pixel step size. With each reference midpoint as the geometric center, a preset fixed number of pixels are extended at both ends along the normal direction of the reference midpoint to construct a bidirectional sampling ray of the reference midpoint. The lightness channel data in the color image of the sample is smoothed. The corresponding lightness channel data and chroma channel data are extracted pixel by pixel along the bidirectional sampling ray of the reference midpoint. A lightness continuous space sequence and a chroma continuous space sequence of the reference midpoint are generated. The coordinates of the pixels corresponding to each value in the lightness continuous space sequence and the chroma continuous space sequence are extracted in the color image. The indices of the lightness channel data and chroma channel data corresponding to the coordinates in the lightness continuous space sequence and the chroma continuous space sequence are determined. The coordinates and indices are bound in the form of key-value pairs to generate a coordinate mapping dictionary of the reference midpoint.

[0010] Furthermore, the specific calculation method for the boundary diffusion span value is as follows: Extract the ranges of the lightness continuous space sequence and the chroma continuous space sequence at the reference midpoint. When the range is less than the preset minimum value, generate a sequence of the same length as the range sequence, consisting of the number 0. When the range is greater than or equal to the preset minimum value, reverse the polarity of the lightness continuous space sequence. Normalize all values ​​in the normalized sequence of the range sequence and uniformly map them to integers from 0 to 15. Record the generated sequences corresponding to the lightness continuous space sequence and the chroma continuous space sequence as the lightness discrete state sequence and the chroma discrete state sequence, respectively. The Needleman-Wunsch algorithm is used to process the discrete state sequences of lightness and chroma to obtain the optimal topological alignment sequence path. The total number of blank placeholders actually inserted in the discrete state sequence of lightness in order to compensate for the length difference of the outward extension of chroma in the optimal topological alignment sequence path is denoted as the boundary diffusion span value of the bidirectional sampling ray at the corresponding reference midpoint.

[0011] Furthermore, the method for identifying the color spill points is as follows: When the boundary diffusion span value is greater than zero, the position of the actually inserted blank placeholder in the discrete chroma state sequence is obtained, and then the position of the actually inserted blank placeholder in the continuous chroma space sequence is determined. According to the coordinate mapping dictionary, the pixel coordinates of the corresponding position in the continuous chroma space sequence are queried in the color image of the sample. All pixels in the color image determined by the inserted blank placeholders are recorded as color spill points.

[0012] Furthermore, the specific method for determining the type of printing defect in the polyester fabric is as follows: When the total minimum color distribution slip cost is greater than the preset global color degradation tolerance threshold, and the boundary diffusion span values ​​corresponding to all reference midpoints are less than or equal to the preset local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a fabric overall color concentration degradation defect. When the boundary diffusion span value corresponding to the reference midpoint is greater than the preset local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a dye heat overflow diffusion defect.

[0013] Secondly, embodiments of the present invention also provide a polyester fabric printing defect detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0014] The beneficial effects of this invention are: This application aims to extract the light and dark information representing the yarn dot structure and the vividness information representing the disperse dye concentration. It calculates the lightness and chroma channel data for each pixel in the color image. To eliminate the geometric misalignment interference caused by wrinkling, it analyzes the overall proportion changes of the printing formula in the original printing sample and the sample, calculates the probability that the base color of the original printing sample will change to the color of the sample, and evaluates the degree of overall fading and color degradation variation of the sample relative to the original printing sample. It obtains the minimum total color distribution slip cost and a color variation probability comparison matrix. Fabric yarn shrinkage causes the boundary to shorten proportionally, while dye diffusion causes the chroma boundary of dye concentration to shift outwards relative to the lightness boundary representing the yarn structure in the topological sequence. To capture this relative topological misalignment shift, in... The macroscopic transition boundary of the pattern in the color image of the sample is located, the edge tangent skeleton is extracted, and the spatial gradient trend of the brightness of the yarn physical structure and the chemical concentration of the dye at the same edge position of the edge tangent skeleton entropy is analyzed to determine the continuous spatial sequence of brightness and the continuous spatial sequence of chroma. The absolute orientation distance measurement is converted into the measurement of the number of empty placeholders inserted by forcibly aligning the waveform. The relative topological difference after excluding the distance scaling interference caused by wrinkling is calculated to obtain the boundary diffusion span value, thereby isolating the interference of fabric wrinkling error. Finally, the color spill point where the dye diffusion occurs is located, the source dye is determined, and the type of printing defect in polyester fabric is determined. This solves the problem that irregular geometric wrinkles caused by heat in polyester fabric printing detection cannot be identified, resulting in missed and false reports of fabric printing defects. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a schematic flowchart of a method for detecting printing defects in polyester fabrics according to an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Please see Figure 1The diagram illustrates a flowchart of a method for detecting printing defects in polyester fabrics according to an embodiment of the present invention. The method includes the following steps: Step S001: Collect color images of the original printing sample and the sample to be printed, calculate the lightness channel data and chroma channel data of each pixel in the color image, and divide the color image after removing blank background pixels into different color block boxes.

[0019] To ensure consistent optical input conditions for color comparison between the printed sample and the test sample, a robotic arm is controlled to place the printed sample and the test sample (which has undergone high-temperature dry heat testing or high-temperature water washing testing) flat in a sealed standard light source box. After placing the printed sample and the test sample, an industrial area scan camera mounted directly above the light source box is controlled to perform imaging operations under constant illumination and a fixed focal length to acquire color images of the printed sample and the test sample.

[0020] In this embodiment, the environment of the light source box is set to a standard D65 constant light source to simulate standard natural daylight conditions.

[0021] Because the RGB color space does not conform to the linear perception of color difference by the human eye, a standard color space conversion calculation is performed to uniformly convert all pixel values ​​in the color images of the original print and the sample to the CIELAB color space. In the CIELAB color space, each pixel is represented by three independent components: a lightness component representing the degree of darkness from black to white. , representing the chromaticity components from green to red. and the chromaticity components representing the range from blue to yellow. .

[0022] Furthermore, in order to extract the brightness information characterizing the yarn dot structure and the vividness information characterizing the disperse dye concentration, for each pixel of the color images of the printed original and the sample, the pixel is mapped in CIELAB space. The components are recorded as the brightness channel data of the pixel, and the pixel is represented in CIELAB space. Quantity and The root mean square of the component is denoted as the chroma channel data of the pixel.

[0023] The larger the chroma channel data of a pixel, the higher the concentration of disperse dye at the pixel location and the more vivid the color; the smaller the chroma channel data of a pixel, the closer the pixel location is to a colorless white background or a gray-black color only affected by shadows.

[0024] Because printed fabrics typically contain large areas of unprinted, colorless white space—the background color—and the fabric wrinkles when heated, a significant amount of shadow is created on the surface. If all pixels in the color images of the original print and the sample are included in the statistics, these shadows will cause a large number of originally white background pixels to appear... The spatial brightness shifts, diluting the statistical variation cost of the actual printing dye. Therefore, a background stripping operation is performed.

[0025] Specifically, the baseline brightness threshold of the unprinted area of ​​the fabric is extracted in advance. In this embodiment, pixels with brightness channel data greater than 90 and chroma channel data less than 5 are set as blank background pixels. Blank background pixels in the color images of the original printed sample and the sample are removed, and only pixels that are not blank background pixels are retained.

[0026] A preset color distance step size is used. The color images of the original print sample and the test sample are meshed according to the preset color distance step size. The color distribution of the retained pixels in the CIELAB space is divided into a three-dimensional mesh. The color images of the original print sample and the test sample are divided into discrete color bins, and each discrete color bin is assigned a globally unique integer index. A fixed global color retrieval grid is established, ensuring that the pixel colors in the color images of the original print sample and the test sample can be mapped to a unified discrete bin index.

[0027] To balance computational efficiency and color difference resolution accuracy, the color distance step size is set to 2.0 color difference tolerance units in this embodiment.

[0028] At this point, we have obtained different color blocks in the color images of the original print and the sample, as well as the lightness channel data and chroma channel data of each pixel in the color images of the original print and the sample.

[0029] Step S002: Based on the proportion of pixels retained in the non-empty color block box of the color images of the original printing sample and the sample, calculate the intermediate transfer probability weight and the minimum color distribution slip cost, and construct a color variation probability comparison matrix. The intermediate transfer probability weight is used to characterize the probability that the base color of the original printing sample changes to the color of the sample, and the minimum color distribution slip cost is used to characterize the degree of overall fading and color degradation variation of the sample relative to the original printing sample.

[0030] In order to completely sever the correlation between color changes and the geometric position of the fabric, only the frequency of color values ​​was statistically analyzed.

[0031] Because blank background pixels were removed from the color images of the original print sample and the test sample, the number of remaining pixels in different color boxes will differ. The percentage of pixels in each non-empty color box in the original print sample's color image relative to the total number of pixels not removed is recorded as the original color distribution ratio of the corresponding non-empty color box. Based on the original color distribution ratios of all non-empty color boxes, a dictionary of the original print sample's color discrete distribution ratios is generated. To facilitate matrix operations, continuous indices are reassigned to the non-empty color boxes in the original print sample's color discrete distribution ratio dictionary. Similarly, the percentage of pixels in each non-empty color box in the test sample's color image relative to the total number of pixels not removed is recorded as the test sample's color distribution ratio of the corresponding non-empty color box. Based on the test sample's color distribution ratios of all non-empty color boxes, a dictionary of the test sample's color discrete distribution ratios is generated. To facilitate matrix operations, continuous indices are reassigned to the non-empty color boxes in the test sample's color discrete distribution ratio dictionary.

[0032] Understandably, the original color discrete distribution ratio dictionary and the sample color discrete distribution ratio dictionary are completely free from the geometric misalignment interference caused by wrinkling, and fully characterize the change in the overall proportion of the printing formula before and after the test.

[0033] Because fading caused by high temperatures or washing manifests as a complex migration of high-concentration dyes to low-concentration colors, simple average color difference formulas cannot pinpoint exactly which base color has transformed into which lighter or mixed color. Therefore, a distribution transfer cost algorithm based on bulldozer distance is introduced to calculate the mathematical transfer probability of converting the original color distribution ratio into the tested color distribution ratio. Specifically, the distribution transfer cost algorithm is used to construct the optimal statistical mapping relationship of visual appearance features. That is, based on visual engineering experience, the minimum slip cost in the color space can hit the actual source color patch where fading occurs with the highest probability, rather than simulating real chemical reactions and dye molecule movement paths.

[0034] The original color discrete distribution ratio dictionary and the sample color discrete distribution ratio dictionary are input into the distribution transfer cost algorithm to calculate the three-dimensional... In-space, print sample index Corresponding color patch center coordinates and sample index The Euclidean distance between the center coordinates of the corresponding color blocks is recorded as the distance cost weight for transporting this set of colors. The distributed transfer cost algorithm is used to perform linear programming optimization based on the network flow model to obtain the color block variation corresponding to the original printing sample index and transfer it to the intermediate transfer probability weight of the color block corresponding to the sample index. The goal of the optimization solution is to find a set of color weight allocation schemes that minimize the cumulative sum of the global transport product under the constraint of ensuring the conservation of the total proportion of each color. The global transport product is the transfer proportion multiplied by the distance cost weight.

[0035] Using the original print index corresponding to the intermediate transfer probability weight as the row and the sample index corresponding to the intermediate transfer probability weight as the column, arrange all intermediate transfer probability weights to construct a color variation probability comparison matrix.

[0036] The color variation probability comparison matrix is ​​essentially a data-driven color probability distribution table. The greater the weight of the intermediate transition probability in the color variation probability comparison matrix, the higher the mathematical probability that the base color of the printed sample will change to the color of the sample.

[0037] When a localized abnormal overflow is detected and mixed variant colors are extracted, the color variant probability comparison matrix can be directly invoked. By retrieving the row indices with the largest values ​​in the corresponding columns of the variant colors, the candidate source dyes causing the color mixing defects can be identified. Therefore, the color variant probability comparison matrix can provide a reliable data index for tracing the loss of single-color dyes in a wrinkled environment.

[0038] The variation of the color block corresponding to the original printing sample index is transferred to the product of the intermediate transfer probability weight of the color block corresponding to the index in the sample and the corresponding distance cost weight, which is denoted as the first product. The sum of all first products is denoted as the minimum color distribution slip cost.

[0039] The greater the total minimum color distribution slip cost, the wider the range and the greater the color difference of the sample relative to the original printed sample, resulting in overall fading and color degradation. Conversely, the smaller the total minimum color distribution slip cost, the better the overall color of the fabric is maintained relative to the original printed sample.

[0040] Thus, the color variation probability comparison matrix and the minimum total color distribution slip cost are obtained.

[0041] Step S003: Extract the edge tangent skeleton of the color image of the sample, set different reference midpoints in the edge tangent skeleton, and generate the lightness continuous space sequence, chroma continuous space sequence and coordinate mapping dictionary of the reference midpoints along the normal direction of the reference midpoints.

[0042] Traditional edge dimension measurement methods in industrial inspection rely directly on absolute geometric pixel spans. However, polyester fabrics inevitably undergo nonlinear wrinkling and shrinkage in the warp and weft directions after high temperatures or washing. Directly measuring the absolute pixel width of the pattern boundary can lead to confusion between simple fabric warp and weft yarn deformation errors and actual dye diffusion defects caused by heat. To completely isolate the influence of yarn deformation from the data level, the core logic of the analysis is as follows: fabric yarn shrinkage causes the boundary to shorten proportionally overall, but if dye diffusion occurs, the chroma boundary, representing dye concentration, will shift outwards relative to the lightness boundary, representing yarn structure, in the topological sequence. To capture this relative topological misalignment, microscopic local features are further extracted.

[0043] When disperse dyes are heated, they detach from the original yarn dots and diffuse into the surrounding colorless background area. At this time, the range of chroma values, which represent dye concentration, extends outward, exceeding the range of lightness values, which represent yarn structure. To accurately capture this edge spillover characteristic, the macroscopic transition boundary of the pattern is first located in the color image of the sample.

[0044] Specifically, fabric wrinkling refers to microscopic high-frequency local wrinkles caused by the shrinkage of warp and weft yarns. The fabric as a whole is in a two-dimensional flat laying state, and its microscopic wrinkles have been smoothed out through mean filtering and morphological operations, so that the normal extraction has geometric meaning.

[0045] A two-dimensional Gaussian low-pass filtering algorithm is applied to the chroma channel data in the color image of the sample to effectively eliminate local micro-color fluctuations and dot shadows caused by the interlacing of warp and weft yarns on the fabric. The first-order differential edge extraction operator is applied to calculate the horizontal and vertical color gradients of the chroma channel data of the pixel, and the line connecting the maximum values ​​of the color gradient is found to extract the macro-boundary of the pattern transition area with a single pixel width, which is denoted as the edge tangent skeleton.

[0046] In the filtering process, the kernel size parameter of the filter is set to be larger than the actual pixel width of a single polyester yarn in the image. Specifically, in this embodiment, the Gaussian kernel size is set to [value missing]. Set the standard deviation as In this embodiment, the Sobel operator in the first-order differential edge extraction operator is selected to extract the edge tangent skeleton.

[0047] Along the extension direction of the edge tangent skeleton, multiple reference midpoints are selected sequentially with a preset pixel step size. Taking each reference midpoint as the geometric center, a preset fixed number of pixels are extended bidirectionally towards the interior of the high-density area of ​​the pattern and the exterior of the colorless background area along the normal direction of the reference midpoint to construct a bidirectional sampling ray of the reference midpoint.

[0048] In this embodiment, when selecting the reference midpoint, every [time / percentage] Each pixel takes a reference midpoint; in this embodiment, the preset fixed number is set to 30; each bidirectional sampling ray crosses the light and dark transition area, and each bidirectional sampling ray contains 60 pixels.

[0049] High-temperature testing can cause macroscopic wrinkling of fabrics. This wrinkling introduces a large number of local shadows in optical imaging. These shadows will produce severe high-frequency fluctuations in the brightness channel, resulting in false boundaries. In order to avoid these high-frequency noises from ruining subsequent comparisons, the brightness channel data in the color image of the test sample is subjected to shadow removal and smoothing processing.

[0050] Specifically, the brightness channel data in the color image of the sample is used... The rectangular structural elements are used to perform morphological closing operations to fill in the dark shadows and grooves caused by small wrinkles on the fabric surface, using a filter window of size [size missing]. One-dimensional mean filtering of each pixel smooths the brightness channel data, effectively eliminating wrinkling shadow fluctuation noise at non-pattern boundaries, and ensuring that the processed brightness channel data retains only the macroscopic brightness transition topological features generated by the color step of the printed pattern.

[0051] Along the bidirectional sampling ray at the reference midpoint, the corresponding lightness and chroma channel data are extracted pixel by pixel synchronously to generate a continuous lightness space sequence and a continuous chroma space sequence at the reference midpoint. Simultaneously, to synchronously record the mapping relationship between one-dimensional indices and two-dimensional coordinates and to prevent the loss of corresponding physical positions in the continuous lightness and chroma space sequences, the coordinates of the pixels corresponding to each value in the continuous lightness and chroma space sequences are extracted in the color image. The indices of the corresponding lightness and chroma channel data in the continuous lightness and chroma space sequences are determined, and the coordinates and indices are bound as key-value pairs to generate a coordinate mapping dictionary for the reference midpoint.

[0052] The lightness and chroma continuous spatial sequences are identical in physical pixel sampling length, reflecting the spatial gradient trends of yarn physical structure brightness and dye chemical concentration at the same edge location. The indices of the lightness and chroma channel data within the lightness and chroma continuous spatial sequences represent their respective orders.

[0053] The coordinate mapping dictionary can act as a spatial decoder to return from one-dimensional topological space to two-dimensional image space. When the sequence index of abnormal diffusion is located by one-dimensional sequence alignment algorithm, the coordinate mapping dictionary can be directly queried to seamlessly restore the abnormal index to the two-dimensional geometric space where the color image of the sample is located, and accurately extract the true mixed color of the diffusion area.

[0054] At this point, the lightness continuous space sequence, chroma continuous space sequence, and coordinate mapping dictionary of the reference midpoint are obtained.

[0055] Step S004: Based on the matching results of the lightness continuous space sequence and the chroma continuous space sequence, calculate the boundary diffusion span value of the bidirectional sampling ray at the reference midpoint. The boundary diffusion span value is used to characterize the relative topological difference after excluding the distance scaling interference caused by wrinkling.

[0056] Simple wrinkling and shrinkage of fabric causes a proportional shortening of both the lightness and chroma continuous spatial sequences in terms of physical pixel length. This shortening manifests as displacement and blurring of pattern edges in a two-dimensional geometric image. However, when dye diffuses outward due to heat, the concentration step phase of the chroma continuous spatial sequence shifts outward relative to the yarn edge phase of the lightness continuous spatial sequence. If two sequences of the same physical pixel length are extracted, this phase shift causes the chroma transition zone to protrude out of the topological waveform due to misalignment. Therefore, a topological alignment algorithm used in bioinformatics for matching asynchronous long sequences is introduced into fabric detection. The absolute orientation distance measurement is transformed into measuring the number of empty placeholders inserted during forced waveform alignment, thereby isolating the interference of fabric wrinkling errors.

[0057] The ranges of the continuous lightness space sequence and the continuous chroma space sequence at the reference midpoint are extracted separately. When the range is less than a preset minimum value, a sequence consisting of 0s of the same length as the sequence corresponding to the range is generated. When the range is greater than or equal to the preset minimum value, the mean values ​​of the background region and the pattern region at both ends of the bidirectional sampling ray are compared, and the polarity of the continuous lightness space sequence is flipped so that the flipped lightness and chroma sequences approach the minimum value in the background region and approach the maximum value in the pattern region. Subsequently, all values ​​in the normalized sequence of the sequence corresponding to the range are normalized and uniformly mapped to integers from 0 to 15. The generated sequences corresponding to the continuous lightness space sequence and the continuous chroma space sequence are denoted as the discrete lightness state sequence and the discrete chroma state sequence, respectively.

[0058] When the range is greater than or equal to the preset minimum value, the polarity of the continuous lightness space sequence is reversed, and all values ​​in the normalized sequence corresponding to the range are normalized and uniformly mapped to integers from 0 to 15. The generated sequences corresponding to the continuous lightness space sequence and the continuous chroma space sequence are respectively denoted as the discrete lightness state sequence and the discrete chroma state sequence.

[0059] When the range is less than the preset minimum value, the sequence corresponding to the range is in a smooth background region without fluctuations; when the range is greater than or equal to the preset minimum value, the bidirectional sampling ray corresponding to the sequence corresponding to the range crosses the pattern transition region. The discretization operation in the sequence generation process filters out the small amplitude jitter in the optical imaging process and only retains the step topology of color transition, providing a standard input for the sequence alignment algorithm.

[0060] It should be noted that in this embodiment, the preset minimum value is set to 0.01. The preset minimum value must be greater than the lower limit of the system's floating-point arithmetic precision and greater than the inherent dark current noise floor amplitude of the image sensor to prevent division by zero overflow during normalization calculation. This embodiment uses the maximum-minimum value normalization method to calculate the normalized value. In practical applications, implementers may use other methods of existing technology, such as the tanh function and the sigmoid function, to calculate the normalized value, which are not limited here.

[0061] use The algorithm's dynamic programming solution logic processes two sequences with asynchronous phase deviations: the lightness discrete state sequence and the chroma discrete state sequence. It backtracks along the alignment matrix with the highest score to extract the optimal topological alignment sequence path. The total number of blank placeholders actually inserted in the lightness discrete state sequence in the optimal topological alignment sequence path to compensate for the length difference of the chroma extension is denoted as the boundary diffusion span value of the bidirectional sampling ray at the corresponding reference midpoint.

[0062] In this embodiment, The scoring rules for the algorithm are set as follows: 1. Matching score: When the brightness status character and the chroma status character of a certain position in the sequence have the same value, it is determined that the two channels have not been separated at this point, and a set positive score is assigned. In this embodiment, the set positive score is set to +1 point.

[0063] 2. Mismatch penalty score: When the brightness status character and the chroma status character of a certain position in the sequence are different, it is determined that there is a small transition phase difference between the two channels at this point, and a small negative penalty is assigned. In this embodiment, the small negative penalty is set to -1 point.

[0064] 3. Vacancy Penalty Score: Capture the core action of dye overflow. When it is found that there is an extra high-concentration state in the discrete state sequence of chroma in the dynamic programming matrix, and a blank placeholder must be forcibly inserted into the discrete state sequence of lightness to maintain the best topological alignment of the waveform, a large negative penalty is set for each insertion action. In this embodiment, the large negative penalty is set to -2 points.

[0065] The specific parameter values ​​for matching, mismatch, and space penalty mentioned above are determined in advance by the system through grid search optimization based on sample data of standard qualified fabrics from the same batch. The goal of positive scoring and negative penalty is to minimize the number of blank placeholders generated at the edges of qualified printed patterns that have not experienced dye spillage after sequence alignment.

[0066] The compression caused by physical wrinkles occurs proportionally; the discrete state sequences of lightness and chroma will shorten by the same length, requiring no placeholders. Only when the actual dye components break free from the constraints of the yarn dots and detach outwards are the alignment algorithm forced to insert blank placeholders to accommodate the extra chroma data. Therefore, the boundary diffusion span value only extracts the relative topological difference between the two channels, completely eliminating the interference of absolute geometric distance scaling caused by overall fabric wrinkling. The larger the boundary diffusion span value, the more empty placeholders are inserted, and the larger the physical pixel span of the dye molecules detaching from the yarn and detaching outwards.

[0067] At this point, the boundary diffusion span value of the bidirectional sampling ray at the reference midpoint is obtained.

[0068] Step S005: Based on the boundary diffusion span value and coordinate mapping dictionary, identify the color spill points where dye diffusion occurs. Combine the sample color discrete distribution ratio dictionary and color variation probability comparison matrix to determine the source dye and identify the type of printing defect in the polyester fabric.

[0069] When heated and overflowing, the dye undergoes concentration dilution and cross-mixing of various dye molecules during diffusion, often appearing as an unknown intermediate transition color in the image. The core objective of industrial vision inspection systems is not only to provide abstract color difference values, but also to establish a clear logical decision-making chain, restoring the mixed and varied colors to their original monochromatic formula, and ultimately translating this into specific machine tool process control instructions. Without a coordinate mapping mechanism to restore one-dimensional placeholders to two-dimensional images, it will be impossible to locate the true color-mixed areas on wrinkled fabric.

[0070] To extract the true spillover colors, it is first necessary to locate the exact positions of these spillover pixels in the two-dimensional image of the sample.

[0071] When the boundary diffusion span value is greater than zero, it is determined that abnormal dye diffusion has occurred in the bidirectional sampling ray corresponding to the boundary diffusion span value, and the following information is obtained: The algorithm inserts blank placeholders in the alignment result path and the lightness discrete state sequence, obtains the actual element index position in the chroma discrete state sequence aligned by the blank placeholders; then determines the position corresponding to the actual element index position in the chroma continuous space sequence; according to the coordinate mapping dictionary, queries the pixel coordinates corresponding to this position in the color image of the sample, and records it as the color spill point.

[0072] It is important to understand that since the blank placeholders inserted in the brightness discrete state sequence are virtual nodes inserted by the alignment algorithm to lengthen the waveform, they do not exist in the bidirectional sampling ray of the corresponding reference midpoint. Therefore, the corresponding original spatial coordinates cannot be directly determined, and the position of the corresponding pixel in the color image needs to be determined by looking up the coordinate mapping dictionary.

[0073] The color spill point precisely defines the fabric area where color actually spills outwards after excluding the interference of fabric wrinkles.

[0074] The vector formed by the arithmetic mean of all color spill points in the three color dimensions of the CIELAB color space is denoted as the mean vector of the tested mixed variant color. Using the sample color discrete distribution ratio dictionary, the Euclidean distance between the mean vector of the tested mixed variant color and the non-empty color swatch boxes in the sample color discrete distribution ratio dictionary is calculated. The color swatch box corresponding to the minimum Euclidean distance is designated as the target test color swatch box. The column corresponding to the target test color swatch box in the color variation probability comparison matrix is ​​retrieved. In the intermediate transition probability weights contained in this column, after excluding the row index corresponding to the blank background color of the original printed sample, the largest preset number of the remaining sample base colors are selected as candidate source dyes that trigger color spill.

[0075] In this embodiment, the preset number is set to 3. The unknown color characteristics after the mixing of shed dyes are considered in the fabric region where color spillage occurs due to the mean vector of the tested mixed color variation.

[0076] To identify the final monochromatic responsible dye from all candidate source dyes, the local neighborhood of the pixel corresponding to the color spill point in the color image of the original print is extracted. The mean CIELAB color difference distance between the candidate source dye and all pixels in the local neighborhood is calculated. The candidate source dye corresponding to the minimum mean CIELAB color difference distance is denoted as the source dye.

[0077] In this embodiment, the local neighborhood of a pixel is set to be centered on the pixel. Pixel area; the calculation of CIELAB color difference distance is a well-known technique and will not be elaborated further.

[0078] The process of determining the source dye combines a macroscopic probability matrix to screen the candidate range and uses local color difference for secondary verification, which effectively solves the technical problem that statistical probability is prone to misjudgment when dealing with the mixing of multiple dyes.

[0079] The pre-set standard parameters are retrieved. The standard parameters include the global color degradation tolerance threshold and the local diffusion span tolerance threshold. In this embodiment, based on the industry's color difference tolerance, the global color degradation tolerance threshold is set to 15.0 units, and based on the minimum overflow width that the human eye can perceive, the local diffusion span tolerance threshold is set to 3 pixels.

[0080] When the total minimum color distribution slip cost is greater than the global color degradation tolerance threshold, and the boundary diffusion span values ​​corresponding to all reference midpoints are less than or equal to the local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a fabric overall color concentration degradation defect. At this time, the original printed color on the fabric has faded or darkened by a large proportion, but the dye molecules have not overflowed the boundary into the colorless area.

[0081] When the boundary diffusion span value corresponding to the reference midpoint exceeds the local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a dye thermal overflow diffusion defect. At this time, the dye molecules undergo violent sublimation, detaching from the original yarn pores and floating to the outer blank area, producing a real edge color bleeding phenomenon. Then, the specific process machine number responsible for the color formula printing of the source dye in the printing and dyeing workshop is retrieved. A person skilled in the art determines the exclusive process cooling parameters and the control and diagnostic report of the fixing agent addition ratio adjustment for the process machine. The control and diagnostic report is then sent to the MES manufacturing execution system on the production site via the Ethernet industrial communication bus, and the manufacturing execution system automatically completes the parameter correction operation of the machine. Among them, the exclusive process cooling parameter is, for example, reducing the operating temperature of the setting machine by 5°C.

[0082] This completes the defect detection for printing on polyester fabrics.

[0083] Based on the same inventive concept as the above method, this embodiment of the invention also provides a polyester fabric printing defect detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described polyester fabric printing defect detection methods.

[0084] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting printing defects in polyester fabrics, characterized in that, The method includes the following steps: Color images of the original printing sample and the sample to be printed were collected respectively. The lightness channel data and chroma channel data of each pixel in the color image were calculated. The color image after removing blank background pixels was evenly divided into different color block boxes. Based on the proportion of pixels retained in the non-empty color block box of the color images of the original print and the sample, the intermediate transition probability weight and the minimum color distribution slip cost are calculated, and a color variation probability comparison matrix is ​​constructed. The intermediate transition probability weight is used to characterize the probability that the base color of the original print changes to the color of the sample, and the minimum color distribution slip cost is used to characterize the degree of overall fading and color degradation variation of the sample relative to the original print. Extract the edge tangent skeleton of the color image of the sample, set different reference midpoints on the edge tangent skeleton, and generate the lightness continuous space sequence, chroma continuous space sequence and coordinate mapping dictionary of the reference midpoints along the normal direction of the reference midpoints; Based on the matching results of the lightness continuous space sequence and the chroma continuous space sequence, the boundary diffusion span value of the bidirectional sampling ray at the reference midpoint is calculated. The boundary diffusion span value is used to characterize the relative topological difference after excluding the distance scaling interference caused by wrinkling. Based on the boundary diffusion span value and coordinate mapping dictionary, the color spill points where dye diffusion occurs are identified. By combining the sample color discrete distribution ratio dictionary and color variation probability comparison matrix, the source dye is determined, and the type of printing defect in polyester fabric is judged.

2. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The brightness channel data of the pixel is the pixel's value in CIELAB space. The chroma channel data refers to the pixel's position in the CIELAB space. Quantity and The root mean square of the component.

3. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The specific calculation method for the intermediate transition probability weight is as follows: The percentage of pixels in each non-empty color block box in the color images of the original print and the test sample is counted out to the total number of all pixels that were not removed. This percentage is recorded as the original color distribution ratio and the test color distribution ratio of the corresponding non-empty color block box, respectively. Based on the original color distribution ratios of all non-empty color block boxes, a dictionary of discrete color distribution ratios of the original print and the test color images of the test sample are generated. Based on the test color distribution ratios of all non-empty color block boxes, a dictionary of discrete color distribution ratios of the test sample is generated. Continuous indices are assigned to the non-empty color block boxes present in the original print and test sample color discrete distribution ratio dictionaries, respectively. The distributed transfer cost algorithm is used to process the original sample color discrete distribution ratio dictionary and the sample color discrete distribution ratio dictionary to calculate the three-dimensional... The Euclidean distance between the center coordinates of the color block corresponding to the original printing sample index and the center coordinates of the color block corresponding to the sample index is recorded as the distance cost weight for transporting the color block. The intermediate transfer probability weight for the color block corresponding to the original printing sample index to be mutated and transferred to the color block corresponding to the sample index is also obtained.

4. The method for detecting printing defects in polyester fabric according to claim 3, characterized in that, The specific method for calculating the total minimum color distribution slip cost is as follows: The variation of the color block corresponding to the original printing sample index is transferred to the product of the intermediate transfer probability weight of the color block corresponding to the index in the sample and the corresponding distance cost weight, which is denoted as the first product. The sum of all first products is denoted as the minimum color distribution slip cost.

5. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The color variation probability comparison matrix is ​​a matrix formed by arranging all intermediate transfer probability weights, with the original printing sample index corresponding to the intermediate transfer probability weight as the row and the sample index corresponding to the intermediate transfer probability weight as the column.

6. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The specific methods for generating the lightness continuous space sequence, chroma continuous space sequence, and coordinate mapping dictionary of the reference midpoint are as follows: Along the extension direction of the edge tangent skeleton, the reference midpoints are selected sequentially with a preset pixel step size. With each reference midpoint as the geometric center, a preset fixed number of pixels are extended at both ends along the normal direction of the reference midpoint to construct a bidirectional sampling ray of the reference midpoint. The lightness channel data in the color image of the sample is smoothed. The corresponding lightness channel data and chroma channel data are extracted pixel by pixel along the bidirectional sampling ray of the reference midpoint. A lightness continuous space sequence and a chroma continuous space sequence of the reference midpoint are generated. The coordinates of the pixels corresponding to each value in the lightness continuous space sequence and the chroma continuous space sequence are extracted in the color image. The indices of the lightness channel data and chroma channel data corresponding to the coordinates in the lightness continuous space sequence and the chroma continuous space sequence are determined. The coordinates and indices are bound in the form of key-value pairs to generate a coordinate mapping dictionary of the reference midpoint.

7. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The specific calculation method for the boundary diffusion span value is as follows: Extract the ranges of the lightness continuous space sequence and the chroma continuous space sequence at the reference midpoint. When the range is less than the preset minimum value, generate a sequence of the same length as the range sequence, consisting of the number 0. When the range is greater than or equal to the preset minimum value, reverse the polarity of the lightness continuous space sequence. Normalize all values ​​in the normalized sequence of the range sequence and uniformly map them to integers from 0 to 15. Record the generated sequences corresponding to the lightness continuous space sequence and the chroma continuous space sequence as the lightness discrete state sequence and the chroma discrete state sequence, respectively. The Needleman-Wunsch algorithm is used to process the discrete state sequences of lightness and chroma to obtain the optimal topological alignment sequence path. The total number of blank placeholders actually inserted in the discrete state sequence of lightness in order to compensate for the length difference of the outward extension of chroma in the optimal topological alignment sequence path is denoted as the boundary diffusion span value of the bidirectional sampling ray at the corresponding reference midpoint.

8. The method for detecting printing defects in polyester fabric according to claim 7, characterized in that, The method for identifying the color spill points is as follows: When the boundary diffusion span value is greater than zero, the position of the actually inserted blank placeholder in the discrete chroma state sequence is obtained, and then the position of the actually inserted blank placeholder in the continuous chroma space sequence is determined. According to the coordinate mapping dictionary, the pixel coordinates of the corresponding position in the continuous chroma space sequence are queried in the color image of the sample. All pixels in the color image determined by the inserted blank placeholders are recorded as color spill points.

9. The method for detecting printing defects in polyester fabric according to claim 1, characterized in that, The specific methods for determining the type of printing defects in polyester fabrics are as follows: When the total minimum color distribution slip cost is greater than the preset global color degradation tolerance threshold, and the boundary diffusion span values ​​corresponding to all reference midpoints are less than or equal to the preset local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a fabric overall color concentration degradation defect. When the boundary diffusion span value corresponding to the reference midpoint is greater than the preset local diffusion span tolerance threshold, the fabric condition of the sample is determined to be a dye heat overflow diffusion defect.

10. A polyester fabric printing defect detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as claimed in any one of claims 1-9.