Knitted fabric dyeing quality detection method and system based on image processing
Through image processing based methods, multi-state images of knitted fabrics are collected, dye uniformity and color difference are calculated, and dyeing quality index is determined, which solves the problem of low accuracy of dyeing quality detection in the prior art, and realizes high-precision dyeing quality detection of knitted fabrics.
Patent Information
- Application Number
- CN202510297343.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-27
AI Technical Summary
When detecting the dyeing quality of knitted fabrics, the prior art cannot effectively evaluate the inconsistency and color difference of dye results caused by different uniformity of dye distribution, resulting in a decrease in detection accuracy.
Using an image processing-based method, images in the front, back and stretched states of knitted fabrics are collected through a high-resolution camera. After pre-processing, the color offset area is identified, the color difference degree is calculated, the color distribution image is generated, the dye uniformity is evaluated, and the stretched area is determined through key point detection, and the dyeing quality index is calculated.
It effectively improves the dyeing quality detection accuracy of knitted fabrics, can accurately identify and quantify chromatic aberration and dyeing unevenness problems, optimizes the dyeing process, and improves product quality.
Smart Images

Figure CN120219328A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dyeing quality detection of knitted fabrics, and specifically provides a method and system for detecting the dyeing quality of knitted fabrics based on image processing. Background Art
[0002] Compared with traditional woven fabrics, knitted fabrics have greater stretchability and softness due to their special weaving structure, and are often used in the clothing field with higher comfort requirements, such as sportswear and casual clothing. In addition, the weaving method of knitted fabrics can form more air layers, which helps to improve the warmth retention and breathability, enabling them to provide a good wearing experience in different seasons. However, the uniformity and color consistency of knitted fabrics during the dyeing process are important factors affecting their final quality. Due to the relatively loose structure of knitted fabrics and the different arrangements of yarns, problems such as color differences and color spots are likely to occur during the dyeing process, directly affecting the appearance and use experience of the product. Therefore, the dyeing quality detection technology is crucial for the production of knitted fabrics, which can timely detect problems in the dyeing process, ensure the dyeing uniformity and stability of knitted fabrics, and improve the market competitiveness and user satisfaction of products.
[0003] Currently, the existing technology often uses the same method to detect the dyeing quality of woven fabrics and knitted fabrics, ignoring both the differences in the textures of the front and back sides of knitted fabrics and the extensibility of the knitted fabric structure. As a result, it is impossible to effectively evaluate the inconsistencies and color difference phenomena caused by different uniformities of dye distribution during the detection process, reducing the accuracy of dyeing quality detection.
[0004] To solve the above problems, a method and system for detecting the dyeing quality of knitted fabrics based on image processing are proposed. Summary of the Invention
[0005] The purpose of the present invention is to provide a method and system for detecting the dyeing quality of knitted fabrics based on image processing. To solve the problems existing in the prior art, the present invention first collects images of the front, back, and stretched states of the target knitted fabric through a high-resolution camera, and preprocesses these images. Then, it identifies the color offset regions in the front image, calculates the color difference degree, and generates corresponding color distribution images to evaluate the dyeing uniformity. At the same time, it combines the chromaticity diagram to detect the color difference degree and dyeing uniformity of the back image, uses key point detection to determine the stretching region, and obtains the dyeing uniformity in the stretched state. Finally, by integrating the color difference degree and dyeing uniformity, the dyeing quality index is calculated to achieve a comprehensive evaluation and grading of the dyeing quality of knitted fabrics. The present invention can effectively improve the detection accuracy of the dyeing quality of knitted fabrics, effectively detect and quantify color differences and dyeing non-uniformity problems, optimize the dyeing process, and improve product quality.
[0006] A method for detecting the dyeing quality of knitted fabrics based on image processing, and the specific implementation steps include:
[0007] Taking pictures of the target knitted fabric through a high-resolution camera to collect the first original image, the second original image, and the third original image;
[0008] Preprocessing the first original image, the second original image, and the third original image to obtain the first fabric image, the second fabric image, and the third fabric image;
[0009] Obtaining the texture images of the three color channels of the first fabric image and determining the color offset area; combining the first fabric image and the color offset area to obtain the first color difference degree; combining the first fabric image and the texture images to obtain three corresponding color distribution images; obtaining the pixel value mutation areas of each color distribution image and calculating the first dyeing uniformity;
[0010] Obtaining the first fabric chromaticity diagram and the second fabric chromaticity diagram, and calculating the second color difference degree according to the neighborhood pixel difference; obtaining the second dyeing uniformity through the global pixel comparison of the second fabric chromaticity diagram;
[0011] Through the key point detection method, obtaining the key points of the first fabric image and the third fabric image; combining the matching algorithm and the key point screening strategy to determine the stretching area of the third fabric image; obtaining the third dyeing uniformity according to the pixel value change in the adjacent area of the stretching area;
[0012] Combining the color difference degree and the dyeing uniformity to obtain the dyeing quality index of the target knitted fabric and performing dyeing quality grade classification.
[0013] Preferably, the first original image and the second original image are respectively the front and back images of the target knitted fabric; the third original image is the front fabric image of the target knitted fabric taken in the stretched state; preprocessing the first original image, the second original image, and the third original image includes denoising processing, segmentation processing, and data standardization.
[0014] Preferably, the process of obtaining the texture images of the three color channels of the first fabric image and calculating the first color difference degree includes:
[0015] Using a Gabor filter, obtain the texture images of the red, green, and blue channels of the first fabric image to obtain a first texture image, a second texture image, and a third texture image; perform a logical exclusive OR operation on the three texture images to generate a color offset map and obtain the color offset region; perform grayscale processing on the first fabric image to obtain a first fabric grayscale image; compare the pixel values of the first fabric grayscale image inside and outside the color offset region to obtain a first color difference degree.
[0016] Preferably, in the process of obtaining the pixel value mutation region of each color distribution image and calculating the first dyeing uniformity, it includes:
[0017] According to the texture image, remove the texture information of the corresponding color channel image in the first fabric image to obtain three color distribution images; obtain the average pixel value of the color distribution image, calculate the difference between the pixel value of each pixel point and the average pixel value to obtain a pixel deviation value; determine the pixel value mutation region according to the pixel deviation value; if the pixel deviation value is greater than a predetermined pixel difference threshold, the corresponding pixel point is a mutation point; obtain the proportion of the mutation points in each color distribution image to obtain the first dyeing uniformity.
[0018] Preferably, in the process of obtaining the first fabric chromaticity map and the second fabric chromaticity map and calculating the first color difference degree, it includes:
[0019] Through color space mapping, obtain the chromaticity maps of the first fabric image and the second fabric image to obtain the first fabric chromaticity map and the second fabric chromaticity map; according to a sliding window of size k×k, extract the means of the first fabric chromaticity map and the second fabric chromaticity map within the corresponding sliding window to obtain a first chromaticity mean and a second chromaticity mean; calculate the difference between the first chromaticity mean and the second chromaticity mean to obtain a chromaticity difference; by moving the sliding window, obtain K chromaticity differences, and calculate the second color difference degree through averaging.
[0020] Preferably, the specific process of obtaining the second dyeing uniformity by global pixel comparison of the second fabric chromaticity map includes:
[0021] Obtain the mean of the chromaticity value differences between each pixel point and the remaining pixel points in the neighborhood to obtain a neighborhood chromaticity difference; obtain the global average chromaticity of the second fabric chromaticity map, calculate the difference between the chromaticity value of each pixel point and the global average chromaticity to obtain a global chromaticity difference; according to the ratio of the neighborhood chromaticity difference to the global chromaticity difference, obtain a chromaticity difference ratio; calculate the mean of all chromaticity difference ratios to obtain the second dyeing uniformity.
[0022] Preferably, the specific process of obtaining the key points of the first fabric image and the third fabric image and determining the stretching area of the third fabric image through the key point detection method includes:
[0023] Perform key point detection on the first fabric image and the third fabric image to determine a first set of key points and a second set of key points; match the two sets of key points through a matching algorithm to obtain Q pairs of key points; obtain the r key points closest to the edge in the first fabric image to obtain the coordinates of r boundary key points; calculate the distances between the boundary key points and adjacent key points within the a×a area to obtain a first distance; obtain the distances of the corresponding key points in the third fabric image to obtain a second distance; if there are adjacent key points that make the first distance equal to the second distance, remove the boundary key points and update the adjacent key points as the boundary key points; otherwise, retain the boundary key points; determine the stretching area according to the coordinates of all the boundary key points in the third fabric image.
[0024] Preferably, the specific implementation process of obtaining the third dyeing uniformity according to the pixel value change in the adjacent area of the stretching area includes:
[0025] Obtain all the pixel points within the stretching area and calculate the average pixel value to obtain the stretched pixel mean value; calculate the pixel value change amplitude of each pixel point within its c×c adjacent area within the stretching area to obtain the color dispersion; obtain the average pixel value of the third fabric image outside the stretching area, and combine the color dispersion and the stretched pixel mean value to obtain the third dyeing uniformity.
[0026] Preferably, the process of obtaining the dyeing quality index by combining the color difference degree and the dyeing uniformity includes:
[0027] Obtain the ideal image of the target knitted fabric and combine it with the first fabric image to calculate the dyeing accuracy; combine the first color difference degree, the second color difference degree, the first dyeing uniformity, the second dyeing uniformity and the third dyeing uniformity to obtain the dyeing quality index; if the dyeing quality index is greater than a predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is qualified; if the dyeing quality index is less than or equal to the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is unqualified.
[0028] A knitted fabric dyeing quality detection system based on image processing includes:
[0029] An image acquisition module that takes pictures of the target knitted fabric through a high-resolution camera to acquire a first original image, a second original image and a third original image;
[0030] An image preprocessing module preprocesses the first original image, the second original image, and the third original image to obtain a first fabric image, a second fabric image, and a third fabric image;
[0031] A front - side dyeing quality detection module obtains texture images of three color channels of the first fabric image and determines a color offset area; combines the first fabric image and the color offset area to obtain a first color difference degree; combines the first fabric image and the texture images to obtain three corresponding color distribution images; obtains the pixel - value mutation areas of each color distribution image and calculates a first dyeing uniformity;
[0032] A back - side dyeing quality detection module obtains a first fabric chromaticity map and a second fabric chromaticity map, and calculates a second color difference degree according to the neighborhood pixel difference; obtains a second dyeing uniformity through the global pixel comparison of the second fabric chromaticity map;
[0033] An internal - side dyeing quality detection module obtains key points of the first fabric image and the third fabric image; combines a matching algorithm and a key - point screening strategy to determine the stretching area of the third fabric image; obtains a third dyeing uniformity according to the pixel - value change in the adjacent area of the stretching area;
[0034] A dyeing quality comprehensive evaluation module combines the color difference degree and the dyeing uniformity to obtain the dyeing quality index of the target knitted fabric and conducts dyeing quality grade division.
[0035] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0036] 1. The color difference degree proposed by the present invention can effectively identify the color offset that occurs on the front and back sides of the knitted fabric during the dyeing process. By analyzing the color offset and neighborhood pixel difference in the texture image, it can accurately identify and quantify the color difference problem in the knitted fabric. This method not only improves the accuracy of color quality evaluation but also can timely discover potential problems in the dyeing process, optimize the dyeing process, and reduce material waste.
[0037] 2. The dyeing uniformity proposed by the present invention effectively improves the accuracy of the dyeing quality detection of the knitted fabric by comprehensively detecting the dyeing conditions on the front, back, and inside of the knitted fabric. The first dyeing uniformity can accurately evaluate the consistency of the front - side dyeing of the fabric, ensuring uniform color distribution; the second dyeing uniformity focuses on the color consistency between the front and back sides of the knitted fabric, and through global pixel comparison, it reduces the color difference between the front and back sides, further improving the overall dyeing quality of the knitted fabric; the third dyeing uniformity combines the pixel - value change in the stretching area to effectively detect the dyeing stability inside the fabric, ensuring that the fabric does not show color distortion due to stretching during use.
[0038] 3. The dyeing quality index proposed by the present invention, combining color difference degree and dyeing uniformity, can accurately quantify the dyeing quality of knitted fabrics. This index comprehensively considers the dyeing quality of the front, back, and interior of knitted fabrics, can more comprehensively reflect the overall dyeing quality of the fabric, not only can effectively distinguish the dyeing quality of qualified and unqualified knitted fabrics, improve the accuracy of dyeing quality detection, but also provides an important basis for subsequent improvement and optimization of the dyeing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flowchart of a method for detecting the dyeing quality of knitted fabrics based on image processing provided by an embodiment of the present invention application;
[0040] Figure 2 It is a schematic diagram for calculating the chromaticity difference in the neighborhood in the second fabric chromaticity diagram provided by an embodiment of the present invention application;
[0041] Figure 3 It is a flowchart for determining the stretching area of the third fabric image provided by an embodiment of the present invention application;
[0042] Figure 4 It is a flowchart of a system for detecting the dyeing quality of knitted fabrics based on image processing provided by an embodiment of the present invention application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0044] Due to the good characteristics of knitted fabrics such as comfort, breathability, and elasticity, it is widely used in multiple fields such as clothing, home textiles, and industry. However, in the production process of knitted fabrics, especially in the dyeing link, it is easily affected by various factors such as yarn characteristics, process control, and environmental changes, resulting in problems such as color difference and color spots on the fabric surface. Therefore, introducing dyeing quality detection can timely discover problems in the dyeing of knitted fabrics, adjust the production process, and thus improve the color consistency and durability of the finished products.
[0045] The present invention proposes a method and system for detecting the dyeing quality of knitted fabrics based on image processing to detect the dyeing quality of knitted fabrics and improve the dyeing effect of knitted fabrics. To illustrate the effectiveness of the method and system of the present invention, it will be specifically described in conjunction with the accompanying drawings of this embodiment and the following two embodiments.
[0046] Embodiment 1
[0047] An embodiment of the present application discloses a method for detecting the dyeing quality of knitted fabrics based on image processing to detect the dyeing quality of Class A knitted fabrics. Refer to Figure 1 , the specific steps of the method proposed by the present invention include: S1. Collect the first original image, the second original image, and the third original image of the target knitted fabric; S2. Preprocess the original images to obtain the first fabric image, the second fabric image, and the third fabric image; S3. Calculate the first color difference degree and the first dyeing uniformity of the first fabric image; S4. Calculate the second color difference degree and the second dyeing uniformity of the second fabric image; S5. Determine the stretching area of the third fabric image and calculate the third dyeing uniformity; S6. Combine the color difference degree and the dyeing uniformity to obtain the dyeing quality index.
[0048] Further, set the image acquisition area, and transmit the Class A knitted fabric to be quality inspected to the image acquisition area; use a high-resolution camera to photograph the Class A knitted fabric to collect the first original image, the second original image, and the third original image, corresponding to the above S1 step; wherein, the image acquisition area includes a lighting device, a high-resolution camera, and a robotic arm; the lighting device provides a light source that meets the shooting conditions to ensure clear texture and true color of the image; the robotic arm is used to control the knitted fabric to be quality inspected to achieve flipping and stretching operations on the Class A knitted fabric; the first original image and the second original image are respectively the front and back images of the Class A knitted fabric; the third original image is the front fabric image of the Class A knitted fabric taken in the stretched state.
[0049] Further, preprocess the first original image, the second original image, and the third original image to obtain the first fabric image, the second fabric image, and the third fabric image, corresponding to the above S2 step; wherein, preprocessing the original images includes denoising processing, segmentation processing, and data standardization; the denoising processing includes median filtering, Gaussian filtering, wavelet transform, etc., which are used to eliminate the interference introduced by the shooting environment or equipment noise to ensure the clarity and detail integrity of the image; the segmentation processing includes segmentation algorithms based on threshold segmentation, region growing, or edge detection, etc., which are used to remove the background information and only retain the image of the knitted fabric to be quality inspected; the data standardization is used to adjust the pixel value range of the image for subsequent quality comparison of different images.
[0050] In the embodiments of the present application, by setting an image acquisition area, multi-state image acquisition of type A knitted fabrics is achieved; a high-resolution camera can accurately capture the texture and details of the fabrics, ensuring that the images of the front, back, and stretched states of the fabrics are clear and real, providing reliable quality inspection data. In addition, image preprocessing can effectively eliminate the noise and background interference that may occur during the shooting process, ensuring that the extracted fabric images are clear and accurate, and also providing reliable data support for subsequent quality inspection.
[0051] Further, obtain the texture images of the three color channels of the first fabric image, and determine the color offset area; combine the first fabric image and the color offset area to obtain the first color difference degree; corresponding to the above S3 step, the specific calculation process of the first color difference degree includes:
[0052] Through a Gabor filter, obtain the texture images of the red, green, and blue channels of the first fabric image, to obtain a first texture image, a second texture image, and a third texture image; perform a logical exclusive OR operation on the three texture images to generate a color offset map, and the specific calculation formula is;
[0053]
[0054] where CS represents the color offset map, which is used to represent the texture differences of the three texture images; respectively represent the first texture image, the second texture image, and the third texture image; the color offset map and the three texture images are all binary images, that is, the pixel values of the texture part in the image are 1, and the pixel values of the non-texture part are 0; represents the logical exclusive OR operation, which is used to retain the different texture information of the three texture images;
[0055] According to the color offset map, obtain the pixel point coordinates of the texture part; by comparing the magnitudes of the pixel point coordinates, obtain the color offset area; perform grayscale processing on the first fabric image to obtain a first fabric grayscale image; compare the pixel values of the first fabric grayscale image inside and outside the color offset area to obtain the first color difference degree, and the specific calculation formula is expressed as:
[0056]
[0057] where represents the first color difference degree; N represents the number of pixel points in the color offset area; p i represents the pixel value of the i-th pixel point of the first fabric grayscale image inside the color offset area; represents the average pixel value of the first fabric grayscale image outside the color offset area.
[0058] In the embodiment of the present application, by comparing the texture differences of the three color channels, the color offset area of the fabric image can be effectively obtained. Combining the texture information of the color channels, the color difference degree of the knitted fabric can be accurately calculated. By comparing the difference between the pixel values within the color offset area and the average pixel value outside the color offset area, the subtle texture changes on the fabric surface and the unevenness of the color distribution are fully considered, and the color difference problem generated during the dyeing process of the knitted fabric can be detected more accurately, thereby improving the accuracy and efficiency of the fabric dyeing quality detection.
[0059] Further, combining the first fabric image and the corresponding texture image, three color distribution images are obtained; the pixel value mutation area of each color distribution image is obtained, and the first dyeing uniformity is calculated; corresponding to the above S3 step, the specific calculation process of the first dyeing uniformity includes:
[0060] According to the texture image, the texture information of the corresponding color channel image in the first fabric image is removed to obtain three color distribution images; the average pixel value of the color distribution image is obtained, the difference between the pixel value of each pixel point and the average pixel value is calculated to obtain the pixel deviation value; according to the pixel deviation value, the pixel value mutation area is determined; if the pixel deviation value is greater than the predetermined pixel difference threshold, the corresponding pixel point is a mutation point; the proportion of the mutation points in each color distribution image is obtained to obtain the first dyeing uniformity, and the specific calculation formula is:
[0061]
[0062] Wherein, represents the first dyeing uniformity; m1, m2, and m3 respectively represent the number of mutation points in the three color distribution images; M represents the number of pixel points of the first fabric image; α1, α2, and α3 represent color weights, which are obtained from the proportion of pixel values of the first fabric image in different color channels, and α1, α2, and α3 are all in the interval (0, 1) and α1 + α2 + α3 = 1.
[0063] In the embodiment of the present application, by combining the first fabric image and the corresponding texture image, color distribution images are obtained, and the pixel value mutation area is calculated, thereby realizing the accurate detection of the dyeing uniformity. By removing texture interference and only retaining the effective information of the color channels, the dyeing effect of the knitted fabric can be evaluated more accurately, and misjudgment caused by fabric texture or structural differences can be avoided; by identifying pixel value mutation points, the areas with uneven colors on the knitted fabric can be accurately located, and weighted analysis of the dyeing uniformity can be performed according to the different color proportions of the knitted fabric, thereby improving the accuracy of the dyeing quality detection.
[0064] Further, obtain the first fabric chromaticity map and the second fabric chromaticity map, and calculate the second color difference degree according to the neighborhood pixel difference; through the global pixel comparison of the second fabric chromaticity map, obtain the second dyeing uniformity, corresponding to Figure 1 step S4; The specific calculation process of the second color difference degree includes:
[0065] Through color space mapping, obtain the chromaticity maps of the first fabric image and the second fabric image, and obtain the first fabric chromaticity map and the second fabric chromaticity map; According to the sliding window of size k×k, extract the means of the first fabric chromaticity map and the second fabric chromaticity map within the corresponding sliding window to obtain the first chromaticity mean and the second chromaticity mean; Calculate the difference between the first chromaticity mean and the second chromaticity mean to obtain the chromaticity difference; By moving the sliding window, obtain K chromaticity differences to obtain the second color difference degree. The specific calculation formula is:
[0066]
[0067] Wherein, represents the second color difference degree; represents the first chromaticity mean of the first fabric chromaticity map within the j-th sliding window; represents the second chromaticity mean of the second fabric chromaticity map within the j-th sliding window; K represents the number of sliding windows, which is obtained according to the size of the first fabric image, the size of the sliding window and the moving step size.
[0068] The embodiments of the present application process the chromaticity maps of the front and back sides of the knitted fabric, can accurately obtain the color difference degree of the fabric on the front and back sides, and calculate the chromaticity difference of the local area by means of a sliding window, effectively improving the analysis accuracy of the fabric dyeing uniformity. Through color space mapping and mean value calculation within the sliding window, the consistency and accuracy of the front and back images of the knitted fabric in chromaticity comparison are ensured, avoiding the local noise interference caused by single pixel comparison, improving the sensitivity to color difference, and ensuring the stability and reliability of color difference detection.
[0069] Further, the specific implementation process of obtaining the second dyeing uniformity through the global pixel comparison of the second fabric chromaticity map includes:
[0070] Obtain the mean value of the chromaticity value differences between each pixel point and the remaining pixel points in the neighborhood to obtain the neighborhood chromaticity difference; Refer to Figure 2 , with each pixel point as the center, is the total number of pixel points in the neighborhood. If the neighborhood range of pixel point x exceeds the second fabric chromaticity map, the chromaticity values of the pixel points in the exceeded part are equal to the chromaticity value of pixel point x. Obtain the global average chromaticity of the second fabric chromaticity map, calculate the difference between the chromaticity value of each pixel point and the global average chromaticity to obtain the global chromaticity difference. Obtain the chromaticity difference ratio according to the ratio of the neighborhood chromaticity difference to the global chromaticity difference. Calculate the mean value of all chromaticity difference ratios to obtain the second dyeing uniformity. The specific calculation formula is as follows:
[0071]
[0072] Among them, represents the second dyeing uniformity; M represents the number of pixel points of the second fabric chromaticity map; represents the chromaticity value of the i-th pixel point of the second fabric chromaticity map; represents the global average chromaticity; ΔHue i represents the neighborhood chromaticity difference of the i-th pixel point; represents the l-th chromaticity value in the neighborhood of the i-th pixel point of the second fabric chromaticity map; l represents the total number of pixel points in the neighborhood.
[0073] In the embodiment of the present application, by combining the neighborhood chromaticity difference and the global chromaticity difference, the dyeing uniformity of the reverse side of the knitted fabric is obtained, effectively improving the accuracy of dyeing quality detection. By obtaining the chromaticity difference of each pixel point in the neighborhood, the problem of local uneven dyeing can be sensitively captured, preventing small-range color differences from being ignored; at the same time, by comparing the chromaticity value of each pixel point with the global average chromaticity, the color difference distribution of the overall fabric can be accurately reflected, thereby realizing a comprehensive evaluation of the fabric dyeing quality, overcoming the limitations of simply relying on local or global chromaticity analysis, and ensuring the accuracy and objectivity of the detection results.
[0074] Specifically, when detecting the dyeing quality of Class A knitted fabrics, due to the different texture characteristics of the front and back sides of the knitted fabric, there may be significant differences in the dyeing effect. This difference affects the overall quality of the knitted fabric. Especially in applications such as clothing, the dyeing quality of the reverse side directly affects the wearing experience and the overall visual effect. By detecting the first fabric image (front image) and the second fabric image (reverse image), the color shift and non-uniformity in the dyeing process of the reverse side of Class A knitted fabrics can be effectively identified, thereby ensuring the appearance consistency of the entire fabric during use.
[0075] Further, through the key point detection method, obtain the key points of the first fabric image and the third fabric image; combine the matching algorithm and the key point screening strategy to determine the stretching area of the third fabric image; obtain the third dyeing uniformity according to the change of the neighborhood pixel values in the stretching area, correspondingFigure 1 Step S5; Refer to Figure 3 , determining the implementation process of the stretching area includes:
[0076] Perform key point detection on the first fabric image and the third fabric image to determine the first key point set and the second key point set; match the two key point sets through a matching algorithm to obtain Q groups of key point pairs; obtain the r key points closest to the edge in the first fabric image to obtain the coordinates of r boundary key points; calculate the distances between the boundary key points and adjacent key points within the a×a area to obtain the first distance; obtain the distances of the corresponding key points in the third fabric image to obtain the second distance; if there are adjacent key points that make the first distance equal to the second distance, remove the boundary key points and update the adjacent key points as the boundary key points; otherwise, retain the boundary key points; determine the stretching area according to the coordinates of all the boundary key points in the third fabric image.
[0077] In the embodiment of the present application, key points of the first fabric image and the third fabric image are obtained through the key point detection method, and the stretching area of the third fabric image is determined by combining the matching algorithm and the key point screening strategy, which can effectively improve the recognition accuracy of the stretching area. The matching of the two key point sets and the screening process of the boundary key points ensure that the determination of the stretching area is more accurate and efficient, further improving the stability and accuracy of quality inspection.
[0078] Further, the implementation process of obtaining the third dyeing uniformity according to the pixel value change in the adjacent area of the stretching area includes:
[0079] Obtain all pixel points within the stretching area and calculate the average pixel value to obtain the stretching pixel mean value; calculate the pixel value change amplitude of each pixel point within its c×c adjacent area in the stretching area to obtain the color dispersion; obtain the average pixel value of the third fabric image outside the stretching area, and combine the color dispersion and the stretching pixel mean value to obtain the third dyeing uniformity. The specific calculation formula is:
[0080]
[0081] Wherein, represents the third dyeing uniformity; pr i , pg i , pb i respectively represent the pixel values of the i-th pixel point in the stretching area on the three color channels; pr i,j , pg i,j , pb i,j respectively represent the pixel values of the j-th pixel point in the adjacent area of the i-th pixel point in the stretching area on the three color channels; respectively represent the average pixel values of the third fabric image on three color channels within the stretching region; d represents the number of pixel points within the stretching region; c×c represents the number of pixel points within the adjacent region; β represents the dyeing uniformity inside and outside the stretching region; respectively represent the average pixel values of the third fabric image on three color channels outside the stretching region.
[0082] Through the analysis and calculation of the pixel values within the stretching region in the embodiments of the present application, the evaluation of the third dyeing uniformity can be effectively achieved, thereby improving the dyeing quality and consistency. By combining the average pixel values outside the stretching region with the color dispersion within the region, the evaluation of the dyeing effect is further optimized, the accuracy and comprehensiveness of the dyeing quality detection are improved, and thus the rejection rate caused by uneven dyeing is reduced.
[0083] Specifically, since Class A knitted fabrics have high ductility and are often stretched and deformed during use, it is crucial to detect the dyeing uniformity of Class A knitted fabrics for the images in the stretched state. The detection of the dyeing uniformity in the stretched state can effectively evaluate the color stability and consistency of the fabric under actual use conditions, ensure that even in the stretched state, the dyeing effect of the fabric remains uniform, and avoid color distortion or unevenness caused by the deformation of the knitted fabric. By analyzing the change of pixel values in the stretched state, the dyeing quality of the knitted fabric in different states can be accurately detected, providing data support for the subsequent improvement of the dyeing process.
[0084] Furthermore, combining the color difference degree and the dyeing uniformity, obtain the dyeing quality index of Class A knitted fabrics and conduct the classification of dyeing quality levels; corresponding Figure 1 to step S6, the implementation process includes:
[0085] Obtain the ideal image of Class A knitted fabrics, and combine it with the first fabric image to calculate the dyeing accuracy; combine the first color difference degree, the second color difference degree, the first dyeing uniformity, the second dyeing uniformity and the third dyeing uniformity to obtain the dyeing quality index, and the specific calculation formula is:
[0086]
[0087] DA = SSIM(X1, Y);
[0088] where DQI represents the dyeing quality index; respectively represent the first color difference degree and the second color difference degree; respectively represent the first dyeing uniformity, the second dyeing uniformity, and the third dyeing uniformity; DA represents the dyeing accuracy; SSIM() represents the structural similarity function; X1 represents the first fabric image; Y represents the ideal image of Class A knitted fabric; ∈1, ∈2, ∈3 represent influencing factors and 0 < ∈3 ≤ ∈2 ≤ ∈1 < 1, which are used to measure the importance of the front-side dyeing quality, the back-side dyeing quality, and the internal dyeing quality to the overall dyeing quality of Class A knitted fabric; γ1, γ2, γ3, γ4 represent adjustment parameters, and their values are all in the interval (0, 1) and γ1 + γ2 = 1, γ3 + γ4 = 1, which are used to measure the importance of the color difference degree and the dyeing uniformity.
[0089] If the dyeing quality index is greater than the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is qualified; if the dyeing quality index is less than or equal to the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is unqualified.
[0090] To further illustrate the role of the dyeing quality index proposed by the present invention, the dyeing quality indexes of the same batch of Class A knitted fabrics are given exemplarily for comparison. Refer to Table 1, which lists the dyeing quality indexes and dyeing quality grades of the same batch of Class A knitted fabrics; among them, the influencing factor ∈1 = 0.4, ∈2 = 0.3, ∈3 = 0.3, the adjustment parameters γ1 = γ2 = γ3 = γ4 = 0.5, and the predetermined quality threshold is 0.9.
[0091] Table 1. Dyeing quality indexes and dyeing quality grades of the same batch of Class A knitted fabrics
[0092]
[0093] According to Table 1, when detecting the dyeing quality of the same batch of Class A knitted fabrics, the color difference degree, the dyeing accuracy, and the dyeing uniformity are equally important. For example, for the Class A knitted fabric numbered ZZ01, its color difference degree and dyeing uniformity are relatively high, but due to the influence of the dyeing accuracy, the dyeing quality is unqualified; while for the knitted fabric ZZ02, although the dyeing accuracy is relatively high, the first color difference degree is relatively high and the second dyeing uniformity is relatively low, resulting in a relatively low overall dyeing quality index of this knitted fabric, thus failing to meet the qualified standard. Therefore, the color difference degree and the dyeing uniformity directly affect the consistency and effect of the knitted fabric dyeing, and the dyeing accuracy reflects the degree of fit between the actual dyeing and the ideal image. These data show that through the balanced setting of the influencing factors and the adjustment parameters, in the dyeing quality detection, the color difference degree, the dyeing uniformity, and the dyeing accuracy of Class A knitted fabrics in different states will be equally concerned.
[0094] In the embodiments of the present application, by combining the color difference degree and the dyeing uniformity, the dyeing quality index of Class A knitted fabrics is obtained, which not only improves the detection accuracy of the dyeing quality, but also can effectively identify the problems existing in the dyeing process, promoting the improvement and optimization of the dyeing process. By comparing the ideal image with the actual fabric image to calculate the dyeing accuracy, the reliability of the dyeing quality detection is improved; in addition, considering the comprehensive influence of the dyeing uniformity and the color difference degree in different states, the overall dyeing quality detection is more comprehensive.
[0095] In the embodiments of the present application, by introducing the color difference degree, the dyeing uniformity and the dyeing quality index, the accurate detection of the dyeing quality of knitted fabrics is realized. The specific implementation process mainly includes the following steps: (1) Detecting the color offset of the front and back sides of the knitted fabric; (2) Comprehensively detecting the color uniformity of the front and back sides and the interior of the knitted fabric; (3) Calculating the dyeing quality index by integrating the color difference degree and the dyeing uniformity. For the above three processes, a color difference detection method, a uniformity detection method and a dyeing quality index calculation are respectively proposed; the color difference detection method realizes the accurate quantification of the color difference problem in the knitted fabric and improves the accuracy of the color quality evaluation; the uniformity detection method further improves the consistency of the dyeing on the front and back sides and the interior, ensuring the stability of the overall dyeing quality; the calculation of the dyeing quality index further improves the ability to distinguish between qualified and unqualified knitted fabrics, providing an important basis for optimizing the dyeing process.
[0096] Embodiment 2
[0097] In Embodiment 1, the method of the present invention is used to detect the dyeing quality of Class A knitted fabrics. In the embodiments of the present application, a dyeing quality detection system for knitted fabrics based on image processing proposed by the present invention will be described to realize the dyeing quality evaluation of several types of knitted fabrics in Factory B. Refer to Figure 4 , the quality detection system includes: an image acquisition module, an image preprocessing module, a front dyeing quality detection module, a back dyeing quality detection module, an internal dyeing quality detection module and a dyeing quality comprehensive evaluation module.
[0098] Furthermore, the image acquisition module captures the target knitted fabric through a high-resolution camera to acquire a first original image, a second original image and a third original image; the image preprocessing module preprocesses the first original image, the second original image and the third original image to obtain a first fabric image, a second fabric image and a third fabric image.
[0099] Further, the front dyeing quality detection module acquires texture images of three color channels of the first fabric image and determines the color offset area; combines the first fabric image and the color offset area to obtain the first color difference degree; combines the first fabric image and the texture images to obtain three corresponding color distribution images; acquires the pixel value mutation areas of each color distribution image, and calculates the first dyeing uniformity.
[0100] Further, the back dyeing quality detection module acquires the first fabric chromaticity diagram and the second fabric chromaticity diagram, and calculates the second color difference degree according to the neighborhood pixel difference; obtains the second dyeing uniformity through the global pixel comparison of the second fabric chromaticity diagram.
[0101] Further, the internal dyeing quality detection module acquires the key points of the first fabric image and the third fabric image; combines the matching algorithm and the key point screening strategy to determine the stretching area of the third fabric image; obtains the third dyeing uniformity according to the pixel value change in the adjacent area of the stretching area.
[0102] Further, the dyeing quality comprehensive evaluation module combines the color difference degree and the dyeing uniformity to obtain the dyeing quality index of the A-class knitted fabric and conducts the dyeing quality grade division; the specific implementation process includes:
[0103] Acquire the ideal image of the knitted fabric to be detected, and combine it with the first fabric image to calculate the dyeing accuracy; combine the first color difference degree, the second color difference degree, the first dyeing uniformity, the second dyeing uniformity and the third dyeing uniformity to obtain the dyeing quality index, and the specific calculation formula is:
[0104]
[0105] DA = SSIM(X1, Y);
[0106] where DQI represents the dyeing quality index; respectively represent the first color difference degree and the second color difference degree; respectively represent the first dyeing uniformity, the second dyeing uniformity, and the third dyeing uniformity; DA represents the dyeing accuracy; SSIM() represents the structural similarity function; X1 represents the first fabric image; Y represents the ideal image of Class A knitted fabric; ∈1, ∈2, ∈3 represent influencing factors and 0 < ∈3 ≤ ∈2 ≤ ∈1 < 1, which are used to measure the importance of the front dyeing quality, the back dyeing quality, and the internal dyeing quality to the overall dyeing quality of Class A knitted fabric; γ1, γ2, γ3, γ4 represent adjustment parameters, and their values are all in the interval (0, 1) and γ1 + γ2 = 1, γ3 + γ4 = 1, which are used to measure the importance of the color difference degree and the dyeing uniformity.
[0107] If the dyeing quality index is greater than the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is qualified; if the dyeing quality index is less than or equal to the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is unqualified.
[0108] To further illustrate the role of the dyeing quality index proposed by the present invention in the dyeing quality detection process of different types of knitted fabrics, the dyeing quality indexes and dyeing quality grades of different types of knitted fabrics in Factory B are exemplarily given here for comparison. Refer to Table 2 which lists the influencing factors and adjustment parameters of different types of knitted fabrics in Factory B, and Table 3 which lists the dyeing quality indexes and dyeing quality grades of different types of knitted fabrics in Factory B; among them, the predetermined quality threshold for different types of knitted fabrics is 0.9.
[0109] Table 2. Influencing factors and adjustment parameters of different types of knitted fabrics in Factory B
[0110]
[0111] Table 3. Dyeing quality indexes and dyeing quality grades of different types of knitted fabrics in Factory B
[0112]
[0113] It can be seen from the data comparison of different types of knitted fabrics in Table 2 and Table 3 that the parameters of different types of knitted fabrics have a great influence on the evaluation of the overall dyeing quality grade. For example, the color difference degree, dyeing uniformity, and dyeing accuracy of ZL01 and ZL02 knitted fabrics are relatively close. Due to the different adjustment parameters of the two, the final dyeing quality grades are different; while the influencing factors of ZL01 and ZL03 knitted fabrics are different, indicating that ZL03 pays more attention to the dyeing situation on the front of the knitted fabric. For example, knitted fabrics such as terry cloth or household items generally use single-sided dyeing methods, and have low requirements for the dyeing quality of the back and stretched state of the knitted fabric. Therefore, for different types of knitted fabrics, reasonably setting the influencing factors and adjustment parameters plays an important role in improving the dyeing quality of knitted fabrics.
[0114] It should be noted that the product quality inspection area of Factory B is equipped with the quality inspection system to conduct dyeing quality inspection on several types of knitted fabrics (such as cotton, polyester, and silk knitted fabrics), ensuring the color consistency and uniformity of different types of knitted fabrics during the dyeing process, thereby improving the visual effect of the finished products. However, different types of knitted fabrics vary in texture, thickness, and material, so parameters need to be adjusted according to specific characteristics during the inspection process. For example, for thicker knitted fabrics, the penetration time of dyes during the dyeing process is shorter, and the color difference between the front and back is more obvious; therefore, more attention should be paid to the second color difference degree in the reverse side dyeing quality inspection module and the dyeing quality comprehensive evaluation module, such as adjusting the parameters γ1 and γ3 higher to more accurately identify potential problems; for thick knitted fabrics in a stretched state, the internal dyeing quality inspection module must pay more attention to the third dyeing uniformity inspection in the stretched area, such as expanding the adjacent area operation to ensure that there is no color distortion in the knitted fabric during use.
[0115] The embodiment of the present application realizes a comprehensive evaluation of the dyeing quality of knitted fabrics through a multi-dimensional dyeing quality inspection module. This system can effectively identify and quantify color differences and dyeing uniformity, providing real-time monitoring and feedback during the production process, thereby improving the accuracy and consistency of the dyeing process. By combining the dyeing quality inspection structures of the front, back, and inside of the knitted fabric through the dyeing quality comprehensive evaluation module to form a systematic dyeing quality index, it not only improves the comprehensiveness and accuracy of the dyeing quality inspection, but also provides a scientific basis for the dyeing quality control of knitted fabrics, promoting the improvement of product quality.
[0116] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A knitted fabric dyeing quality detection method based on image processing, characterized in that: include: The target knitted fabric is photographed by a high-resolution camera to collect a first original image, a second original image, and a third original image; Preprocessing the first original image, the second original image and the third original image to obtain a first fabric image, a second fabric image and a third fabric image; Acquire texture images of three color channels of the first fabric image, and determine a color shift region; combine the first fabric image and the color shift region to obtain a first color difference; combine the first fabric image and the texture image to obtain three corresponding color distribution images; acquire a pixel value mutation region of each color distribution image, and calculate a first dyeing uniformity; Obtaining a first fabric chromaticity diagram and a second fabric chromaticity diagram, and calculating a second color difference degree according to a neighborhood pixel difference; and obtaining a second dyeing uniformity degree by global pixel comparison of the second fabric chromaticity diagram; By using a key point detection method, key points of the first fabric image and the third fabric image are obtained; a stretching area of the third fabric image is determined by combining a matching algorithm and a key point screening strategy; and a third dyeing uniformity is obtained according to a change in pixel values of an area adjacent to the stretching area; The color difference and the dyeing uniformity are combined to obtain the dyeing quality index of the target knitted fabric, and the dyeing quality grade is divided.
2. The method for detecting the dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The first original image and the second original image are the front and back images of the target knitted fabric, respectively; the third original image is a front image of the target knitted fabric taken in a stretched state; the first original image, the second original image and the third original image are preprocessed, including denoising, segmentation and data standardization.
3. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The process of obtaining the texture images of the three color channels of the first fabric image and calculating the first color difference includes: The texture images of the red, green and blue channels of the first fabric image are obtained through a Gabor filter to obtain a first texture image, a second texture image and a third texture image; a logical XOR operation is performed on the three texture images to generate a color shift map to obtain the color shift area; the first fabric image is grayscaled to obtain a first fabric grayscale map; and pixel values of the first fabric grayscale map within the color shift area and outside the color shift area are compared to obtain a first color difference.
4. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The process of obtaining the pixel value mutation area of each color distribution image and calculating the first dyeing uniformity includes: According to the texture image, the texture information of the corresponding color channel image in the first fabric image is removed to obtain the three color distribution images; the average pixel value of the color distribution image is obtained, and the difference between the pixel value of each pixel point and the average pixel value is calculated to obtain the pixel deviation value; according to the pixel deviation value, the pixel value mutation area is determined; if the pixel deviation value is greater than a predetermined pixel difference threshold, the corresponding pixel point is a mutation point; the proportion of the mutation points in each of the color distribution images is obtained to obtain the first dyeing uniformity.
5. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The process of obtaining the first fabric chromaticity diagram and the second fabric chromaticity diagram and calculating the first color difference includes: Through color space mapping, the chromaticity diagrams of the first fabric image and the second fabric image are obtained to obtain the first fabric chromaticity diagram and the second fabric chromaticity diagram; according to a sliding window of size k×k, the means of the first fabric chromaticity diagram and the second fabric chromaticity diagram in the corresponding sliding window are extracted to obtain a first chromaticity mean and a second chromaticity mean; the difference between the first chromaticity mean and the second chromaticity mean is calculated to obtain a chromaticity difference; by moving the sliding window, K of the chromaticity differences are obtained, and the second color difference degree is obtained by calculating the average value.
6. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The specific process of obtaining the second dyeing uniformity by global pixel comparison of the second fabric chromaticity diagram includes: Obtain the mean of the chromaticity value differences between each pixel point and the remaining pixels in the neighborhood to obtain the neighborhood chromaticity difference; obtain the global average chromaticity of the second fabric chromaticity diagram, calculate the difference between the chromaticity value of each pixel point and the global average chromaticity, and obtain the global chromaticity difference; obtain the chromaticity difference ratio according to the ratio of the neighborhood chromaticity difference to the global chromaticity difference; calculate the mean of all chromaticity difference ratios to obtain the second dyeing uniformity.
7. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The specific process of obtaining the key points of the first fabric image and the third fabric image by the key point detection method and determining the stretching area of the third fabric image includes: Key point detection is performed on the first fabric image and the third fabric image to determine a first key point set and a second key point set; the two sets of key point sets are matched by a matching algorithm to obtain Q groups of key point pairs; r key points closest to the edge in the first fabric image are obtained to obtain the coordinates of r boundary key points; the distance between the boundary key point and the adjacent key point in the a×a area is calculated to obtain a first distance; the distance between the corresponding key point in the third fabric image is obtained to obtain a second distance; if there is an adjacent key point that makes the first distance equal to the second distance, the boundary key point is removed and the adjacent key point is updated to the boundary key point; otherwise, the boundary key point is retained; and the stretching area is determined according to the coordinates of all the boundary key points in the third fabric image.
8. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The process of obtaining the third dyeing uniformity according to the change of pixel values in the adjacent area of the stretching area includes: All pixel points in the stretching area are obtained, and the average pixel value is calculated to obtain the stretching pixel mean; the pixel value variation amplitude of each pixel point in the stretching area within its c×c neighboring area is calculated to obtain the color dispersion; the average pixel value of the third fabric image outside the stretching area is obtained, and the third dyeing uniformity is obtained by combining the color dispersion and the stretching pixel mean.
9. The method for detecting dyeing quality of knitted fabrics based on image processing according to claim 1, characterized in that: The process of obtaining the dyeing quality index by combining the color difference and the dyeing uniformity includes: An ideal image of the target knitted fabric is obtained, and the dyeing accuracy is calculated in combination with the first fabric image; the dyeing quality index is obtained in combination with the first color difference, the second color difference, the first dyeing uniformity, the second dyeing uniformity and the third dyeing uniformity; if the dyeing quality index is greater than a predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is qualified; if the dyeing quality index is less than or equal to the predetermined quality threshold, it indicates that the dyeing quality of the target knitted fabric is unqualified.
10. A knitted fabric dyeing quality detection system based on image processing, characterized in that: include: An image acquisition module, which photographs the target knitted fabric through a high-resolution camera to acquire a first original image, a second original image, and a third original image; An image preprocessing module preprocesses the first original image, the second original image and the third original image to obtain a first fabric image, a second fabric image and a third fabric image; The front dyeing quality detection module obtains texture images of three color channels of the first fabric image and determines the color shift area; combines the first fabric image and the color shift area to obtain a first color difference; combines the first fabric image and the texture image to obtain three corresponding color distribution images; obtains the pixel value mutation area of each color distribution image and calculates the first dyeing uniformity; The reverse dyeing quality detection module obtains the first fabric chromaticity diagram and the second fabric chromaticity diagram, calculates the second color difference according to the neighborhood pixel difference; obtains the second dyeing uniformity by global pixel comparison of the second fabric chromaticity diagram; The internal dyeing quality detection module obtains key points of the first fabric image and the third fabric image; determines the stretching area of the third fabric image by combining the matching algorithm and the key point screening strategy; and obtains the third dyeing uniformity according to the change of the pixel value of the adjacent area of the stretching area; The dyeing quality comprehensive evaluation module combines the color difference and the dyeing uniformity to obtain the dyeing quality index of the target knitted fabric and classifies the dyeing quality into grades.
Citation Information
Cited By
Dyeing image processing method and system
CN122453834A