Textile color fastness detection method and system based on machine vision
Through hyperspectral imaging technology and spectral similarity-color fastness grade equation, the problems of strong subjectivity and low accuracy in textile color fastness testing are solved, fast and reliable textile color fastness testing is realized, and the intelligentization of the textile industry is promoted. develop.
Patent Information
- Application Number
- CN202410931955.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-18
AI Technical Summary
Existing textile color fastness testing methods have problems such as high subjectivity, low accuracy, and inability to evaluate the overall situation. In particular, photoelectric integral color measuring instruments are not very accurate, spectroscopic color measuring instruments cannot evaluate the overall fabric, and digital color measuring instruments Metamerism cannot be avoided.
Hyperspectral imaging technology based on machine vision is used to adjust hyperspectral image test conditions by obtaining fabric information of textile samples, collect hyperspectral images, perform data processing and analysis on the images, and use the spectral similarity-color fastness grade equation to calculate the properties of textiles. Color fastness grade.
It achieves rapid detection without physical damage, shortens the detection cycle, improves detection efficiency and result reliability, enables quantitative evaluation of the color fastness of textiles, and promotes the development of the textile industry towards intelligence and automation.
Smart Images

Figure CN118794895A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of textile detection, and relates to a textile color fastness detection method and system based on machine vision. Background Art
[0002] The dyes commonly used in the market are mostly colored organic compounds that can be dissolved in water or other media to form dye solutions or dispersions, and can color fabrics directly or indirectly through mordants. Color fastness of textiles is a routine test item for textiles. Color fastness refers to the degree of fading of dyed textiles under the influence of external factors (repeated friction, washing, sun exposure, rain, saliva, water stains, sweat stains, etc.) during use or processing. It is an important indicator of fabric performance.
[0003] The color fastness of textiles directly affects consumers' wearing and use. Textiles with poor color fastness not only have a poor wearing experience, but also can cause the dye to fall off and fade due to rain, sun, sweat, and saliva during wearing. In addition, the dye molecules and heavy metal ions in them may be absorbed by the human body through the skin, which can cause certain harm to the human body, especially for infants and young children. Although the color fastness test items of textiles are simple, their importance is self-evident.
[0004] At present, the color fastness grade evaluation methods can be mainly divided into two categories: visual rating and instrument rating. Among them, there are many types of textile color fastness test items and a large amount of testing, which brings a heavy workload to textile quality inspectors. Visual rating is a subjective evaluation. The inspectors compare the original sample and the sample after the test with the gray sample card, and evaluate the color fastness grade by visual inspection. The visual rating results are easily affected by factors such as the psychological state, physiological state, fatigue level and work experience of the inspectors. Instrument rating is an objective evaluation. According to the color measurement principle, the color measuring instruments currently on the market can be divided into photoelectric integral color measuring instruments, spectrophotometric color measuring instruments and digital color measuring instruments (systems). Based on different color measurement principles, instruments obtain the chromaticity value of textiles, calculate the color difference using the color difference formula, and then convert the color difference into color fastness grades through certain formulas. The instrument rating results are relatively scientific and stable, but there are also some defects. For example, the accuracy of photoelectric integral color measuring instruments is not high; spectrophotometric color measuring instruments can only sample a small area of the fabric and cannot achieve an overall evaluation of the fabric. The results need to be combined with the visual rating results for a comprehensive rating; digital color measuring instruments can only record and reproduce a limited range of colors, and cannot avoid the situation of different spectra of the same color. Summary of the invention
[0005] In view of the above problems existing in the prior art, the present invention provides a method and system for detecting color fastness of textiles based on machine vision, which are used to solve the above technical problems.
[0006] In order to achieve the above purpose and other purposes, the technical solution adopted by the present invention is as follows:
[0007] In one aspect, the present invention provides a method for detecting color fastness of textiles based on machine vision, the method comprising the following steps:
[0008] (1) obtaining fabric information of the textile sample to be tested, and then adjusting the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density, and fabric texture;
[0009] (2) After completing the adjustment of the hyperspectral image test conditions, use the hyperspectral imaging system to collect hyperspectral images of the textile samples to be tested;
[0010] (3) performing data processing and analysis on the collected spectral images of the textile samples to be tested, and obtaining the spectral similarity between the original textile samples to be tested and the textile samples to be tested after the color fastness test;
[0011] (4) Obtaining a spectral similarity-color fastness grade equation, and obtaining the color fastness grade of the textile sample to be tested based on the spectral similarity-color fastness grade equation.
[0012] Exemplarily, the hyperspectral image test conditions are adjusted for the textile sample to be tested, and the specific adjustment process is as follows:
[0013] The hyperspectral image test conditions of the textile samples to be tested are specifically the moving speed of the electronically controlled moving platform, the color of the storage plate, and the number of fabric folding layers;
[0014] Obtain the fabric color of the textile sample to be tested, compare it with the standard color card, and obtain the color depth level of the textile sample to be tested, wherein the color depth level is divided into light-colored fabric, medium-colored fabric, and dark-colored fabric, and then compare the color depth level of the textile sample to be tested with the color adjustment function corresponding to each color depth level stored in the fabric database to obtain the color adjustment function K(C) of the textile sample to be tested;
[0015] Calculate the moving speed of the electronically controlled mobile platform corresponding to the hyperspectral image test of the textile sample to be tested V 0 is the default speed of the reference movement, α′ is the fabric density of the textile sample to be tested, and α 1 , α 2 are the predefined adjustment coefficients for the effects of fabric density and texture on speed, respectively, and α″ is the fabric texture coefficient of the textile sample to be tested;
[0016] The fabric color of the textile sample to be tested is sampled to obtain the RGB value of the textile sample to be tested, and the complementary color RGB value ξ of the fabric color corresponding to the textile sample to be tested is calculated by using the calculation formula ξ=[(255-R), (255-G), (255-B)], and ξ is compared with the RGB values corresponding to each color stored in the fabric database, thereby obtaining the complementary color of the fabric color corresponding to the textile sample to be tested, and using it as the color of the storage plate corresponding to the hyperspectral image test of the textile sample to be tested;
[0017] The analysis shows the number of fabric folds corresponding to the hyperspectral image test of the textile sample to be tested. β 1 is the fabric thickness of the textile sample to be tested, β opt The total thickness required for the predefined test.
[0018] Exemplarily, the specific calculation formula of the fabric texture coefficient of the textile sample to be tested is as follows:
[0019] Acquire a fabric texture image of a textile sample to be tested;
[0020] Create an initial GLCM matrix and initialize all elements to 0, grayscale the fabric texture image of the tested textile sample to obtain the grayscale of the fabric texture image corresponding to the tested textile sample, and normalize the initial GLCM matrix to obtain the pixel with a specified spatial relationship in the initial GLCM matrix for each pixel in the fabric texture image corresponding to the tested textile sample, and finally obtain the frequency of occurrence ρ(i, j) of pixel values i and j in the pixel pairs with a specified spatial relationship in the fabric texture image corresponding to the tested textile sample;
[0021] Calculate the contrast of the grayscale distribution in the fabric texture image corresponding to the textile sample to be tested N is the gray level of the fabric texture image corresponding to the textile sample to be tested;
[0022] Calculate the uniformity of the grayscale distribution in the fabric texture image corresponding to the tested textile sample
[0023] Calculate the homogeneity of the grayscale distribution in the fabric texture image corresponding to the tested textile sample
[0024] Calculate the entropy value of the grayscale distribution in the fabric texture image corresponding to the tested textile sample
[0025] The fabric texture coefficient α″=ω1×A1+ω2×A2+ω3×A3+ω4×A4 of the tested textile sample is thus comprehensively calculated, wherein ω1, ω2, ω3, and ω4 represent the predefined weighting factors of contrast, uniformity, homogeneity, and entropy values, respectively.
[0026] Exemplarily, data processing and analysis are performed on the collected spectral image of the textile sample to be tested, and the specific processing process is as follows:
[0027] Acquire a spectral image of the textile sample to be tested, and obtain the spectral reflectance, absorptivity and radiation intensity of each pixel in each band in the spectral image corresponding to the textile sample to be tested;
[0028] The variance ratio of each band in the spectral image corresponding to the tested textile sample is obtained by calculation, so that the band with the largest variance ratio in the spectral image corresponding to the tested textile sample is screened out as the designated band.
[0029] Exemplarily, the variance ratio of each band in the spectral image corresponding to the textile sample to be tested is calculated, and the specific calculation process includes the following steps:
[0030] Get the spectral reflectance δ of each pixel in each band in the spectral image corresponding to the textile sample to be tested bf , b is the number of each band, b = 1, 2, ... v, f is the number of each pixel, f = 1, 2, ... m;
[0031] The total mean value of the spectral reflectance in the spectral image corresponding to the textile sample to be tested is obtained by calculation v and m represent the total number of bands and pixels, respectively;
[0032] Calculate the sum of the squares of the average value in each band and the total mean value in the spectral image corresponding to the textile sample to be tested is the average value of the bth band in the spectral image corresponding to the textile sample to be tested;
[0033] Calculate the square sum of each pixel and the corresponding band average value in the spectral image of the textile sample to be tested
[0034] Calculate the average value of each band in the spectral image corresponding to the textile sample to be tested
[0035] Calculate the pixel average value in the spectral image corresponding to the textile sample to be tested
[0036] Finally, the spectral reflectance variance ratio of each band in the spectral image corresponding to the tested textile sample is calculated comprehensively. And according to the calculation method, the spectral absorption rate variance ratio F of each band in the spectral image of the textile sample to be tested is calculated in the same way. b ″ and the radiation intensity variance ratio F b ″′;
[0037] The variance ratio of the spectral reflectance, the variance ratio of the spectral absorbance and the variance ratio of the radiation intensity of each band in the spectral image corresponding to the tested textile sample are added together, and the result of the addition is divided by the number 3, thereby calculating the variance ratio of each band in the spectral image corresponding to the tested textile sample.
[0038] Exemplarily, the spectral similarity between the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test is obtained, and the specific acquisition process is:
[0039] Obtain the reflectance value φ of each wavelength point in the specified band in the spectral image corresponding to the textile sample to be tested f ;
[0040] At the same time, obtain the reflectance value of each wavelength point in the specified band of the corresponding spectral image of the original sample of the tested textile
[0041] Obtain the spectra of the original textile sample to be tested and the textile sample to be tested after color fastness testing and first calculate the similarity
[0042] Obtain the spectrum of the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test and calculate the similarity of the spectrum
[0043] The first calculated spectral similarity and the second calculated spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test are added, and the result of the addition is divided by the number 2, thereby calculating the spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test.
[0044] Exemplarily, the color fastness grade of the textile sample to be tested is obtained by:
[0045] Obtain the spectral similarity of the original textile sample and the textile sample after color fastness testing Import it into the spectral similarity-color fastness grade equation to calculate the color fastness grade of the textile sample to be tested. Where p1, p2 and p3 represent the parameters fitted in the spectral similarity-color fastness grade equation.
[0046] In one aspect, the present invention provides a textile color fastness detection system based on machine vision, the system comprising:
[0047] A fabric test condition adjustment module is used to obtain fabric information of the textile sample to be tested, and then adjust the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density and fabric texture;
[0048] A fabric hyperspectral image acquisition module is used to acquire hyperspectral images of the textile samples to be tested using a hyperspectral imaging system after the hyperspectral image test conditions are adjusted;
[0049] The fabric spectrum similarity analysis module is used to perform data processing and analysis on the collected spectrum images of the textile samples to be tested, and obtain the spectrum similarity between the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test;
[0050] A fabric color fastness grade acquisition module is used to obtain a spectrum similarity-color fastness grade equation, and obtain the color fastness grade of the textile sample to be tested based on the spectrum similarity-color fastness grade equation;
[0051] The fabric database is used to store the RGB value corresponding to each color and the color adjustment function corresponding to each color depth level.
[0052] Another aspect of the present invention provides a textile color fastness detection device based on machine vision, comprising an electronic device and a computer-readable storage medium;
[0053] The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor;
[0054] The communication bus realizes the connection and communication between the processor and the memory;
[0055] When the processor executes the computer-readable program, the steps in the above-mentioned method and system for detecting color fastness of textiles based on machine vision are implemented;
[0056] The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the above-mentioned method and system for detecting color fastness of textiles based on machine vision.
[0057] As described above, the present invention provides a method and system for detecting color fastness of textiles based on machine vision, which has at least the following beneficial effects:
[0058] The present invention provides a method and system for detecting color fastness of textiles based on machine vision. The method obtains fabric information of a textile sample to be tested, and performs hyperspectral image test conditions adjustment on the textile sample to be tested. After the hyperspectral image test conditions adjustment is completed, a hyperspectral imaging system is used to collect hyperspectral images of the textile sample to be tested. Then, data processing and analysis are performed on the collected spectral images of the textile sample to be tested to obtain spectral similarities between the original textile sample to be tested and the textile sample to be tested after color fastness detection. The spectral similarities are introduced into a spectral similarity-color fastness grade equation to obtain the color fastness grade of the textile sample to be tested. First, traditional color fastness test methods usually require physical actions such as shearing, washing or rubbing on the sample, while hyperspectral imaging technology does not need to cause any physical damage to the textile sample, and can keep the sample intact. This is especially important for expensive or indestructible textiles; secondly, by quickly scanning textile samples using a hyperspectral imaging system, a large amount of spectral data can be obtained in a short time, and the color fastness grade of the sample can be quickly analyzed. Compared with traditional testing methods, the testing cycle is greatly shortened and the testing efficiency is improved, which is especially important for quality control in the production process. It can realize quantitative evaluation of color fastness and improve the reliability of test results; finally, with the development of artificial intelligence and big data technology, the combination of hyperspectral imaging technology and intelligent data analysis methods can realize intelligent control of the color fastness testing process of textiles, which can not only improve the accuracy and efficiency of detection, but also monitor the production process in real time, adjust process parameters in time, ensure product quality, and promote the development of the textile industry towards intelligence and automation. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0060] Figure 1 It is a schematic diagram of the connection of each step of the method of the present invention.
[0061] Figure 2 Schematic diagram of the structure of the hyperspectral imaging system shown in this invention.
[0062] Figure 3 It is a schematic diagram of the connection of various modules of the system of the present invention.
[0063] Figure 4 It is a schematic diagram of the structure of the device shown in the present invention. DETAILED DESCRIPTION
[0064] The above contents in combination with the implementation of the present invention are merely examples and explanations of the concept of the present invention. The technical personnel in the relevant technical field may make various modifications or supplements to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the claims, they shall all fall within the protection scope of the present invention.
[0065] Example 1
[0066] See also Figure 1-Figure 2 As shown, a method for detecting color fastness of textiles based on machine vision comprises the following steps:
[0067] (1) obtaining fabric information of the textile sample to be tested, and then adjusting the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density, and fabric texture;
[0068] In a preferred technical solution of the present application, the hyperspectral image test conditions of the textile sample to be tested are adjusted, and the specific adjustment process is:
[0069] The hyperspectral image test conditions of the textile samples to be tested are specifically the moving speed of the electronically controlled moving platform, the color of the storage plate, and the number of fabric folding layers;
[0070] Obtain the fabric color of the textile sample to be tested, compare it with the standard color card, and obtain the color depth level of the textile sample to be tested, wherein the color depth level is divided into light-colored fabric, medium-colored fabric, and dark-colored fabric, and then compare the color depth level of the textile sample to be tested with the color adjustment function corresponding to each color depth level stored in the fabric database to obtain the color adjustment function K(C) of the textile sample to be tested;
[0071] It should be added that for light-colored fabrics, K(C) = 1; for medium-colored fabrics, K(C) = 1.1; for dark-colored fabrics, K(C) = 1.2;
[0072] Calculate the moving speed of the electronically controlled mobile platform corresponding to the hyperspectral image test of the textile sample to be tested V 0 is the default speed of the reference movement, α′ is the fabric density of the textile sample to be tested, and α 1 , α 2 are the predefined adjustment coefficients for the effects of fabric density and texture on speed, respectively, and α″ is the fabric texture coefficient of the textile sample to be tested;
[0073] The fabric color of the textile sample to be tested is sampled to obtain the RGB value of the textile sample to be tested, and the complementary color RGB value ξ of the fabric color corresponding to the textile sample to be tested is calculated by using the calculation formula ξ=[(255-R), (255-G), (255-B)], and ξ is compared with the RGB values corresponding to each color stored in the fabric database, thereby obtaining the complementary color of the fabric color corresponding to the textile sample to be tested, and using it as the color of the storage plate corresponding to the hyperspectral image test of the textile sample to be tested;
[0074] The analysis shows the number of fabric folds corresponding to the hyperspectral image test of the textile sample to be tested. β 1 is the fabric thickness of the textile sample to be tested, β opt The total thickness required for the predefined test.
[0075] In a preferred technical solution of the present application, the specific calculation formula of the fabric texture coefficient of the textile sample to be tested is as follows:
[0076] Acquire a fabric texture image of a textile sample to be tested;
[0077] Create an initial GLCM matrix and initialize all elements to 0, grayscale the fabric texture image of the tested textile sample to obtain the grayscale of the fabric texture image corresponding to the tested textile sample, and normalize the initial GLCM matrix to obtain the pixel with a specified spatial relationship in the initial GLCM matrix for each pixel in the fabric texture image corresponding to the tested textile sample, and finally obtain the frequency of occurrence ρ(i, j) of pixel values i and j in the pixel pairs with a specified spatial relationship in the fabric texture image corresponding to the tested textile sample;
[0078] It needs to be explained that, assuming there is a simplified 4x4 pixel image, the gray level has been quantized to 4 levels, and the direction is selected as 0° and the distance is 1 to calculate the GLCM.
[0079] Image (grayscale):
[0080]
[0081] Calculate GLCM (direction 0°, distance 1):
[0082] For grayscale values 0 and 1, they appear 3 times as a pair at the specified direction and distance.
[0083] For gray values 1 and 2, they appear 3 times as a pair, and so on.
[0084] Example of a GLCM matrix (not normalized):
[0085]
[0086] Normalized GLCM: Divide each element in the above matrix by the sum of all elements in the matrix (12) to obtain the normalized GLCM.
[0087] Calculate the contrast of the grayscale distribution in the fabric texture image corresponding to the textile sample to be tested N is the gray level of the fabric texture image corresponding to the tested textile sample; the uniformity of the gray distribution in the fabric texture image corresponding to the tested textile sample is calculated.
[0088] Calculate the homogeneity of the grayscale distribution in the fabric texture image corresponding to the tested textile sample
[0089] Calculate the entropy value of the grayscale distribution in the fabric texture image corresponding to the tested textile sample
[0090] The fabric texture coefficient α″=ω1×A1+ω2×A2+ω3×A3+ω4×A4 of the tested textile sample is thus comprehensively calculated, wherein ω1, ω2, ω3, and ω4 represent the predefined weighting factors of contrast, uniformity, homogeneity, and entropy values, respectively.
[0091] (2) After completing the adjustment of the hyperspectral image test conditions, use the hyperspectral imaging system to collect hyperspectral images of the textile samples to be tested;
[0092] (3) performing data processing and analysis on the collected spectral images of the textile samples to be tested, and obtaining the spectral similarity between the original textile samples to be tested and the textile samples to be tested after the color fastness test;
[0093] In a preferred technical solution of the present application, data processing and analysis are performed on the collected spectral image of the textile sample to be tested, and the specific processing process is:
[0094] Acquire a spectral image of the textile sample to be tested, and obtain the spectral reflectance, absorptivity and radiation intensity of each pixel in each band in the spectral image corresponding to the textile sample to be tested;
[0095] The variance ratio of each band in the spectral image corresponding to the tested textile sample is obtained by calculation, so that the band with the largest variance ratio in the spectral image corresponding to the tested textile sample is screened out as the designated band.
[0096] In a preferred technical solution of the present application, the variance ratio of each band in the spectral image corresponding to the textile sample to be tested is calculated, and the specific calculation process includes the following steps:
[0097] Get the spectral reflectance δ of each pixel in each band in the spectral image corresponding to the textile sample to be tested bf, b is the number of each band, b = 1, 2, ... v, f is the number of each pixel, f = 1, 2, ... m;
[0098] The total mean value of the spectral reflectance in the spectral image corresponding to the textile sample to be tested is obtained by calculation v and m represent the total number of bands and pixels, respectively;
[0099] Calculate the sum of the squares of the average value in each band and the total mean value in the spectral image corresponding to the textile sample to be tested is the average value of the bth band in the spectral image corresponding to the textile sample to be tested;
[0100] Calculate the square sum of each pixel and the corresponding band average value in the spectral image of the textile sample to be tested
[0101] Calculate the average value of each band in the spectral image corresponding to the textile sample to be tested
[0102] Calculate the pixel average value in the spectral image corresponding to the textile sample to be tested
[0103] Finally, the spectral reflectance variance ratio of each band in the spectral image corresponding to the tested textile sample is calculated comprehensively. And according to the calculation method, the spectral absorption rate variance ratio F″ of each band in the spectral image corresponding to the tested textile sample is calculated in the same way b and radiation intensity variance ratio F″′ b ;
[0104] The variance ratio of the spectral reflectance, the variance ratio of the spectral absorbance and the variance ratio of the radiation intensity of each band in the spectral image corresponding to the tested textile sample are added together, and the result of the addition is divided by the number 3, thereby calculating the variance ratio of each band in the spectral image corresponding to the tested textile sample.
[0105] In a preferred technical solution of the present application, the spectral similarity between the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test is obtained, and the specific acquisition process is:
[0106] Obtain the reflectance value φ of each wavelength point in the specified band in the spectral image corresponding to the textile sample to be tested f ;
[0107] At the same time, obtain the reflectance value of each wavelength point in the specified band of the corresponding spectral image of the original sample of the tested textile
[0108] Obtain the spectra of the original textile sample to be tested and the textile sample to be tested after color fastness testing and first calculate the similarity
[0109] Obtain the spectrum of the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test and calculate the similarity of the spectrum
[0110] The first calculated spectral similarity and the second calculated spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test are added, and the result of the addition is divided by the number 2, thereby calculating the spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test.
[0111] (4) Obtaining a spectral similarity-color fastness grade equation, and obtaining the color fastness grade of the textile sample to be tested based on the spectral similarity-color fastness grade equation.
[0112] In a preferred technical solution of the present application, the color fastness grade of the textile sample to be tested is obtained by:
[0113] Obtain the spectral similarity of the original textile sample and the textile sample after color fastness testing Import it into the spectral similarity-color fastness grade equation to calculate the color fastness grade of the textile sample to be tested. Where p1, p2 and p3 represent the parameters fitted in the spectral similarity-color fastness grade equation.
[0114] Example 2
[0115] See also Figure 3 As shown, a textile color fastness detection system based on machine vision includes:
[0116] Among them, the fabric test condition adjustment module is connected to the fabric hyperspectral image acquisition module, the fabric spectrum similarity analysis module is connected to the fabric hyperspectral image acquisition module and the fabric color fastness grade acquisition module, and the fabric database is connected to the fabric hyperspectral image acquisition module;
[0117] A fabric test condition adjustment module is used to obtain fabric information of the textile sample to be tested, and then adjust the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density and fabric texture;
[0118] A fabric hyperspectral image acquisition module is used to acquire hyperspectral images of the textile samples to be tested using a hyperspectral imaging system after the hyperspectral image test conditions are adjusted;
[0119] The fabric spectrum similarity analysis module is used to perform data processing and analysis on the collected spectrum images of the textile samples to be tested, and obtain the spectrum similarity between the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test;
[0120] A fabric color fastness grade acquisition module is used to obtain a spectrum similarity-color fastness grade equation, and obtain the color fastness grade of the textile sample to be tested based on the spectrum similarity-color fastness grade equation;
[0121] The fabric database is used to store the RGB value corresponding to each color and the color adjustment function corresponding to each color depth level.
[0122] Example 3
[0123] According to an exemplary embodiment, a textile color fastness detection device based on machine vision includes: an electronic device and a computer-readable storage medium;
[0124] Figure 4 It is a structural schematic diagram of a textile color fastness detection device based on machine vision provided in an embodiment of the present application. The device may have relatively large differences due to different configurations or performances, and can include one or more processors (Central Processing Units, CPU) and one or more memories, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the above-mentioned textile color fastness detection method based on machine vision.
[0125] The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor;
[0126] The communication bus realizes the connection and communication between the processor and the memory;
[0127] The processor implements the above-mentioned method for detecting color fastness of textiles based on machine vision by calling the computer program stored in the memory and executing the computer readable program;
[0128] The computer-readable storage medium stores one or more programs. When executed on an electronic device, the one or more programs can be executed by one or more processors to provide a user input interface to implement the above-mentioned method for detecting color fastness of textiles based on machine vision.
[0129] The present invention provides a method and system for detecting color fastness of textiles based on machine vision. The method obtains fabric information of a textile sample to be tested, and performs hyperspectral image test condition adjustment on the textile sample to be tested. After the hyperspectral image test condition adjustment is completed, a hyperspectral imaging system is used to collect hyperspectral images of the textile sample to be tested, and then data processing and analysis are performed on the collected spectral images of the textile sample to be tested to obtain the spectral similarity between the original textile sample to be tested and the textile sample to be tested after color fastness detection, and the spectral similarity is introduced into the spectral similarity-color fastness grade equation to obtain the color fastness grade of the textile sample to be tested. First, the traditional color fastness test method usually requires physical actions such as shearing, washing or rubbing on the sample, while the hyperspectral imaging system Spectral imaging technology does not need to cause any physical damage to textile samples and can maintain the integrity of samples, which is particularly important for expensive or indestructible textiles. Secondly, by using a hyperspectral imaging system to quickly scan textile samples, a large amount of spectral data can be obtained in a short time, and the color fastness level of the sample can be quickly analyzed. Compared with traditional testing methods, the detection cycle is greatly shortened and the detection efficiency is improved. This is particularly important for quality control in the production process. It can achieve quantitative evaluation of color fastness and improve the reliability of test results. Finally, with the development of artificial intelligence and big data technology, the combination of hyperspectral imaging technology and intelligent data analysis methods can realize intelligent control of the color fastness detection process of textiles. This can not only improve the accuracy and efficiency of detection, but also monitor the production process in real time, adjust process parameters in time, ensure product quality, and promote the development of the textile industry towards intelligence and automation.
[0130] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0131] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.
[0132] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0133] Finally: 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 spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting color fastness of textiles based on machine vision, characterized in that: include: (1) obtaining fabric information of the textile sample to be tested, and then adjusting the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density, and fabric texture; (2) After completing the adjustment of the hyperspectral image test conditions, use the hyperspectral imaging system to collect hyperspectral images of the textile samples to be tested; (3) performing data processing and analysis on the collected spectral images of the textile samples to be tested, and obtaining the spectral similarity between the original textile samples to be tested and the textile samples to be tested after the color fastness test; (4) Obtaining a spectral similarity-color fastness grade equation, and obtaining the color fastness grade of the textile sample to be tested based on the spectral similarity-color fastness grade equation.
2. The method for detecting color fastness of textiles based on machine vision according to claim 1, characterized in that: The hyperspectral image test conditions of the textile samples to be tested are adjusted. The specific adjustment process is as follows: The hyperspectral image test conditions of the textile samples to be tested are specifically the moving speed of the electronically controlled moving platform, the color of the storage plate, and the number of fabric folding layers; Obtain the fabric color of the textile sample to be tested, compare it with the standard color card, and obtain the color depth level of the textile sample to be tested, wherein the color depth level is divided into light-colored fabric, medium-colored fabric, and dark-colored fabric, and then compare the color depth level of the textile sample to be tested with the color adjustment function corresponding to each color depth level stored in the fabric database to obtain the color adjustment function K(C) of the textile sample to be tested; Calculate the moving speed of the electronically controlled mobile platform corresponding to the hyperspectral image test of the textile sample to be tested V0 is the default speed of the reference movement, α′ is the fabric density of the textile sample to be tested, α1 and α2 are the adjustment coefficients of the predefined fabric density and texture on the speed, respectively, and α″ is the fabric texture coefficient of the textile sample to be tested; The fabric color of the textile sample to be tested is sampled to obtain the RGB value of the textile sample to be tested, and the complementary color RGB value ξ of the fabric color corresponding to the textile sample to be tested is calculated by using the calculation formula ξ=[(255-R), (255-G), (255-B)], and ξ is compared with the RGB values corresponding to each color stored in the fabric database, thereby obtaining the complementary color of the fabric color corresponding to the textile sample to be tested, and using it as the color of the storage plate corresponding to the hyperspectral image test of the textile sample to be tested; The analysis shows the number of fabric folds corresponding to the hyperspectral image test of the textile sample to be tested. β1 is the fabric thickness of the textile sample to be tested, β opt The total thickness required for the predefined test.
3. The method for detecting color fastness of textiles based on machine vision according to claim 2, characterized in that: The specific calculation formula of the fabric texture coefficient of the textile sample to be tested is as follows: Acquire a fabric texture image of a textile sample to be tested; Create an initial GLCM matrix and initialize all elements to 0, grayscale the fabric texture image of the tested textile sample to obtain the grayscale of the fabric texture image corresponding to the tested textile sample, and normalize the initial GLCM matrix to obtain the pixel with a specified spatial relationship in the initial GLCM matrix for each pixel in the fabric texture image corresponding to the tested textile sample, and finally obtain the frequency of occurrence ρ(i, j) of pixel values i and j in the pixel pairs with a specified spatial relationship in the fabric texture image corresponding to the tested textile sample; Calculate the contrast of the grayscale distribution in the fabric texture image corresponding to the textile sample to be tested N is the gray level of the fabric texture image corresponding to the textile sample to be tested; Calculate the uniformity of the grayscale distribution in the fabric texture image corresponding to the tested textile sample Calculate the homogeneity of the grayscale distribution in the fabric texture image corresponding to the tested textile sample Calculate the entropy value of the grayscale distribution in the fabric texture image corresponding to the tested textile sample The fabric texture coefficient α″=ω1×A1+ω2×A2+ω3×A3+ω4×A4 of the tested textile sample is thus comprehensively calculated, wherein ω1, ω2, ω3, and ω4 represent the predefined weighting factors of contrast, uniformity, homogeneity, and entropy values, respectively.
4. The method for detecting color fastness of textiles based on machine vision according to claim 1, characterized in that: The collected spectral images of the textile samples to be tested are subjected to data processing and analysis. The specific processing process is as follows: Acquire a spectral image of the textile sample to be tested, and obtain the spectral reflectance, absorptivity and radiation intensity of each pixel in each band in the spectral image corresponding to the textile sample to be tested; The variance ratio of each band in the spectral image corresponding to the tested textile sample is obtained by calculation, so that the band with the largest variance ratio in the spectral image corresponding to the tested textile sample is screened out as the designated band.
5. The method for detecting color fastness of textiles based on machine vision according to claim 4, characterized in that: The variance ratio of each band in the spectral image corresponding to the textile sample to be tested is calculated. The specific calculation process includes the following steps: Obtain the spectral reflectance δ of each wavelength point in each band in the spectral image corresponding to the textile sample to be tested bf , b is the number of each band, b = 1, 2, ... v, f is the number of each wavelength point, f = 1, 2, ... m; The total mean value of the spectral reflectance in the spectral image corresponding to the textile sample to be tested is obtained by calculation v and m represent the total number of bands and pixels, respectively; Calculate the sum of the squares of the average value in each band and the total mean value in the spectral image corresponding to the textile sample to be tested is the average value of the bth band in the spectral image corresponding to the textile sample to be tested; Calculate the sum of the squares of each wavelength point and the average value of the corresponding band in the spectral image of the textile sample to be tested Calculate the average value of each band in the spectral image corresponding to the textile sample to be tested Calculate the average value of the wavelength points in the spectral image corresponding to the textile sample to be tested Finally, the spectral reflectance variance ratio of each band in the spectral image corresponding to the tested textile sample is calculated comprehensively. And according to the calculation method, the spectral absorption rate variance ratio F″ of each band in the spectral image corresponding to the tested textile sample is calculated in the same way b and radiation intensity variance ratio F″′ b ; The variance ratio of the spectral reflectance, the variance ratio of the spectral absorbance and the variance ratio of the radiation intensity of each band in the spectral image corresponding to the tested textile sample are added together, and the result of the addition is divided by the number 3, thereby calculating the variance ratio of each band in the spectral image corresponding to the tested textile sample.
6. The method for detecting color fastness of textiles based on machine vision according to claim 5, characterized in that: The spectral similarity between the original sample of the tested textile and the sample of the tested textile after the color fastness test is obtained. The specific acquisition process is as follows: Obtain the reflectance value φ of each wavelength point in the specified band in the spectral image corresponding to the textile sample to be tested f ; At the same time, obtain the reflectance value of each wavelength point in the specified band of the corresponding spectral image of the original sample of the tested textile Obtain the spectra of the original textile sample to be tested and the textile sample to be tested after color fastness testing and first calculate the similarity Obtain the spectrum of the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test and calculate the similarity of the spectrum The first calculated spectral similarity and the second calculated spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test are added, and the result of the addition is divided by the number 2, thereby calculating the spectral similarity of the original textile sample to be tested and the textile sample to be tested after the color fastness test.
7. The method for detecting color fastness of textiles based on machine vision according to claim 6, characterized in that: To obtain the color fastness grade of the textile sample to be tested, the specific process is as follows: Obtain the spectral similarity θ of the original textile sample to be tested and the textile sample to be tested after color fastness test, import it into the spectral similarity-color fastness grade equation, and calculate the color fastness grade of the textile sample to be tested θ′=p1×θ 2 +p2×θ+p3, where p1, p2 and p3 represent the parameters fitted in the spectral similarity-color fastness grade equation.
8. A textile color fastness detection system based on machine vision, characterized in that: The method for detecting color fastness of textiles based on machine vision as described in claims 1 to 7 above is implemented, comprising: A fabric test condition adjustment module is used to obtain fabric information of the textile sample to be tested, and then adjust the hyperspectral image test conditions of the textile sample to be tested, wherein the fabric information of the textile sample to be tested includes fabric color, fabric thickness, fabric density and fabric texture; A fabric hyperspectral image acquisition module is used to acquire hyperspectral images of the textile samples to be tested using a hyperspectral imaging system after the hyperspectral image test conditions are adjusted; The fabric spectrum similarity analysis module is used to perform data processing and analysis on the collected spectrum images of the textile samples to be tested, and obtain the spectrum similarity between the original sample of the textile to be tested and the sample of the textile to be tested after the color fastness test; A fabric color fastness grade acquisition module is used to obtain a spectrum similarity-color fastness grade equation, and obtain the color fastness grade of the textile sample to be tested based on the spectrum similarity-color fastness grade equation; The fabric database is used to store the RGB value corresponding to each color and the color adjustment function corresponding to each color depth level.
9. A textile color fastness detection device based on machine vision, characterized in that: It is implemented based on a method for detecting color fastness of textiles based on machine vision as described in any one of claims 1 to 7, comprising an electronic device and a computer-readable storage medium; The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor; The communication bus realizes the connection and communication between the processor and the memory; When the processor executes the computer-readable program, the steps in the method for detecting color fastness of textiles based on machine vision as described in any one of claims 1 to 7 are implemented; The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the method for detecting color fastness of textiles based on machine vision as described in any one of claims 1 to 7.
Citation Information
Cited By
CNN-Transform fusion model-based textile color fastness automatic rating method and system
CN119850607A
Automatic Colorfastness Rating Method and System for Textiles Based on CNN-Transformer Fusion Model
CN119850607B
Parameter generation method and textile color fastness calculation method and system
CN120198515A
Method, equipment and system for detecting color fastness of textile products for children
CN121068508A
Outdoor sunshade fabric color fastness analysis optimization system based on environmental exposure data
CN121384909A
