A fabric intelligent colorimetric method and system

By adaptively calculating the brightness and chromatic weight factors and combining the CMC color difference formula, the problems of low accuracy and low efficiency of traditional fabric colorimetric methods are solved, achieving higher colorimetric accuracy and efficiency.

CN119067968BActive Publication Date: 2025-03-11SHI HONG CHANG XING YE ZHANG JIA GANG ZHI RAN YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411554671.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-03-11
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

The traditional CMC color difference formula comparison method has low accuracy and low efficiency when colorizing fabrics. Especially when dealing with different types and colors of fabrics, it is difficult to ensure the accuracy of colorimetric results.

Method used

An intelligent colorimetric method for fabrics is proposed. By obtaining the images of the fabric to be detected and compared, calculating its color uniformity and the average value of the brightness, adaptively calculate the brightness weight factor and the color weight factor, and colorimetric weight factor are used in combination with the CMC color difference formula.

Benefits of technology

The accuracy of the color difference results during colorimetric quality of fabrics is improved, and the process of adjusting the brightness weight factor and color weight factor is reduced, thereby improving the colorimetric efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067968B_ABST
    Figure CN119067968B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and the present invention relates to a method and system for intelligent colorimetry of fabrics. The method comprises: obtaining an image of a fabric to be detected and an image of a comparison fabric, and determining the color uniformity of the image of the fabric to be detected, the brightness of all pixels, and the brightness of all pixels in the image of the comparison fabric; calculating a brightness weight factor according to the color uniformity of the image of the fabric to be detected, the average brightness of all pixels in the image of the fabric to be detected and the image of the comparison fabric; calculating a chroma weight factor according to the brightness weight factor, and the chroma weight factor is negatively correlated with the brightness weight factor; and performing colorimetry of the fabric to be detected and the comparison fabric according to the brightness weight factor and the chroma weight factor through the CMC color difference formula. The method of the present invention can improve the accuracy of the color difference calculated when comparing the fabric to be detected and the comparison fabric, and improve the efficiency of color difference comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more specifically, to a method and system for intelligent colorimetry of fabrics. Background Art

[0002] During the fabric production process, the color of the final product may vary slightly due to slight differences in dye concentration, dyeing process, temperature and humidity. This may cause customers to return products due to color inconsistencies. Therefore, in the process of mass production of fabrics, it is crucial to maintain the consistency of the color of each batch of fabrics. In order to maintain the consistency of the color of each batch of fabrics, it is necessary to compare the color of the produced fabrics with the standard comparison fabrics. In the prior art, the CMC color difference formula is usually used to calculate the color difference between the fabric to be tested and the standard comparison fabric, so as to achieve the color comparison between the produced fabrics and the standard comparison fabrics. Figure 1 As shown, the method of the traditional CMC color difference formula comparison method is: first collect the first picture and the second picture, then set the brightness weight factor and the chroma weight factor, and finally calculate the color difference between the first picture and the second picture based on the set brightness weight factor and chroma weight factor combined with the color difference formula.

[0003] However, the traditional CMC color difference formula comparison method only has a good comparison effect on the measurement of the color difference between two pure color blocks. Cloth is woven from silk threads. The texture, glossiness and reflection characteristics of the cloth surface will affect the color performance of the cloth in the image. Even if the cloth looks uniform in color to the naked eye, it will appear uneven in the image. When using the CMC color difference formula for color comparison, in order to improve the comparison effect, it is necessary to select appropriate brightness weight factors and chroma weight factors.

[0004] When using the CMC color difference formula to compare the color of fabrics, fixed lightness weight factors and chroma weight factors are usually used. However, actual production involves fabrics of various types and colors. If uniform lightness weight factors and chroma weight factors are used for fabrics of different types and colors, the accuracy of the color comparison results will be poor. In order to improve the accuracy of the color comparison results, the values ​​of the lightness weight factor and chroma weight factor can be adjusted during the color comparison process using the CMC color difference formula. However, this method will result in low efficiency when comparing the color of fabrics. Summary of the invention

[0005] In order to solve the technical problems of low accuracy and low efficiency when using the traditional CMC color difference formula to compare the color of fabrics, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for intelligent colorimetry of fabrics, comprising:

[0007] Acquire an image of the fabric to be detected and an image of the comparison fabric, and determine the color uniformity, brightness of all pixels in the image of the fabric to be detected, and brightness of all pixels in the image of the comparison fabric;

[0008] The brightness weight factor is calculated based on the color uniformity of the image of the fabric to be detected, the average brightness of all pixels in the image of the fabric to be detected and the image of the comparison fabric. The calculation expression is:

[0009] ;

[0010] In the formula, represents the brightness weight factor, Represents the average brightness of all pixels in the image of the fabric to be detected, is the average value of the brightness of all pixels in the image of the comparison cloth, Indicates the color uniformity of the image of the fabric to be detected, exp () is an exponential function with the natural constant e as base;

[0011] Calculating a chroma weight factor according to the brightness weight factor, wherein the chroma weight factor is negatively correlated with the brightness weight factor;

[0012] According to the lightness weight factor and the chroma weight factor, the colorimetry of the fabric to be tested and the fabric to be compared is performed using a CMC color difference formula.

[0013] The beneficial effects are as follows: the intelligent colorimetric method for fabrics of the present invention takes into account the influence of the overall brightness difference between the image of the fabric to be detected and the image of the comparison fabric on the color difference value when calculating the brightness weight factor, and makes the brightness weight factor larger when the overall brightness difference is larger, so as to increase the relative tolerance of the color difference result to the image brightness and reduce the sensitivity of the brightness to the total color difference; and makes the brightness weight factor smaller when the overall brightness difference is smaller, so as to reduce the relative tolerance of the color difference result to the image brightness and increase the sensitivity of the brightness to the total color difference;

[0014] After the brightness weight factor is preliminarily calculated, the calculated brightness weight factor is further corrected in combination with the influence of the color uniformity of the image of the fabric to be tested on the color difference value. When the color uniformity is high, the calculated brightness weight factor is adjusted to a smaller value to reduce the relative tolerance of the color difference result to the image brightness and increase the sensitivity of the brightness to the total color difference; when the color uniformity is low, the calculated brightness weight factor is adjusted to a larger value to increase the relative tolerance of the color difference result to the image brightness and reduce the sensitivity of the brightness to the total color difference.

[0015] When calculating the chroma weighting factor, the brightness difference between the fabric image to be tested and the comparison fabric image is taken into account. When the brightness difference is large, a smaller chroma weighting factor is used to amplify the influence of chroma in color difference to ensure that the overall difference in the visual performance of the fabric can be accurately captured; when the brightness difference is small, a larger chroma weighting factor is used so that the overall color difference can more accurately reflect the subtle differences in fabric brightness, thereby avoiding unnecessary chroma amplification.

[0016] Therefore, the method of the present invention can greatly improve the accuracy of the color difference calculated when the CMC color difference formula is used to compare the color of the fabric to be tested and the comparison fabric. In addition, when the method of the present invention is used to compare the color difference between the fabric to be tested and the comparison fabric, the lightness weight factor and the chroma weight factor that can make the color difference calculation result more accurate are calculated adaptively, thereby avoiding the process of adjusting the lightness weight factor and the chroma weight factor, thereby greatly improving the efficiency of color difference comparison.

[0017] Preferably, the calculation expression of the chroma weight factor is:

[0018] ;

[0019] In the formula, c represents the chroma weight factor, exp () is an exponential function with the natural constant e as its base.

[0020] Preferably, the calculation expression of the chroma weight factor is:

[0021] ;

[0022] In the formula, c represents the chroma weight factor, exp () is an exponential function with the natural constant e as base, is the average value of the red and green component gradients of all pixels in the image of the fabric to be detected, is the average value of the gradient of the red and green components of all pixels in the image of the contrast cloth, is the average value of the gradient of the yellow-blue component of all pixels in the image of the fabric to be detected, It is the average value of the gradient of the yellow and blue components of all pixels in the image of the contrast cloth.

[0023] The beneficial effects are as follows: after the chroma weight factor is preliminarily calculated based on the lightness weight factor, the chroma weight factor is further corrected based on the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image. When the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image is large, the calculated chroma weight factor is adjusted to a smaller value to reduce the relative tolerance of the color difference result to the image chroma, improve the sensitivity of the lightness to the total color difference, and make the chroma difference occupy a larger relative proportion in the CMC color difference formula; when the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image is small, the calculated chroma weight factor is adjusted to a larger value to improve the relative tolerance of the color difference result to the image chroma, reduce the sensitivity of the lightness to the total color difference, and make the chroma difference occupy a smaller relative proportion in the CMC color difference formula. Thus, the accuracy of the color difference calculated using the CMC color difference formula is further improved.

[0024] Preferably, the method for acquiring the color uniformity of the image of the cloth to be detected includes:

[0025] Gray-scale the image of the fabric to be detected, thereby obtaining a grayscale image of the fabric to be detected, and obtaining a maximum grayscale value and a minimum grayscale value in the grayscale image of the fabric to be detected;

[0026] The color uniformity of the image of the cloth to be detected is calculated according to the difference between the maximum grayscale value and the minimum grayscale value, and the color uniformity is negatively correlated with the difference.

[0027] The beneficial effect is as follows: under normal circumstances, the greater the difference between the maximum grayscale value and the minimum grayscale value of the grayscale image, the more grayscale levels there may be in the grayscale image of the fabric. Since different grayscale levels correspond to different colors, the greater the difference, the more types of colors there may be in the fabric image, the more uneven the color of the fabric in the image may be, and the smaller the color uniformity of the fabric image; conversely, the smaller the difference, the fewer grayscale levels there may be in the grayscale image of the fabric image. Since different grayscale levels correspond to different colors, the smaller the difference, the fewer types of colors there may be in the fabric image, the more uniform the color of the fabric in the image may be, and the greater the color uniformity of the fabric image. Therefore, the method for obtaining the color uniformity of the image of the fabric to be detected of the present invention can more accurately calculate the color uniformity of the image of the fabric to be detected.

[0028] Preferably, the calculation expression of the color uniformity is:

[0029] ;

[0030] In the formula, M Indicates the color uniformity of the image of the fabric to be detected, exp() is an exponential function with the natural constant e as base, Indicates the maximum grayscale value of the grayscale image of the cloth to be detected, Indicates the minimum grayscale value of the grayscale image of the cloth to be detected.

[0031] Its beneficial effect is: when calculating the color uniformity, The value of is normalized to ensure that the calculation result of color uniformity is a value between 0 and 1, thereby preventing the calculated brightness weight factor from being too large or too small.

[0032] Preferably, the method further includes: performing statistics on the grayscale values ​​of all pixels in the grayscale image of the fabric to be detected, so as to obtain a grayscale histogram of the grayscale image of the fabric to be detected; obtaining the maximum number of pixels with the same grayscale value in the grayscale image of the fabric to be detected according to the grayscale histogram; and correcting the color uniformity according to the ratio of the maximum number to the total number of pixels in the grayscale image of the fabric to be detected, wherein the corrected color uniformity is positively correlated with the ratio.

[0033] The beneficial effects are: since there will be some noise when collecting cloth images, the existence of noise may If the value is too large, the color uniformity of the color uniform cloth image may be too small. Therefore, the color uniformity is corrected upward by using the ratio of the maximum number of pixels with the same gray value to the total number of pixels in the grayscale image of the cloth to be detected. When the ratio is larger, it means that the color in the cloth image is purer, and the degree of upward correction of the color uniformity is greater. On the contrary, when the ratio is smaller, it means that the color in the cloth image may be less pure, and the degree of correction of the color uniformity is smaller. Therefore, the method of the present invention can make the calculated color uniformity more accurate, thereby further improving the accuracy of the color comparison result of the cloth to be detected.

[0034] Preferably, the calculation expression of the corrected color uniformity is:

[0035] ;

[0036] In the formula, n represents the maximum number of pixels with the same grayscale value, N represents the total number of pixels in the grayscale image of the fabric to be detected, Indicates the color uniformity after correction.

[0037] Its beneficial effects are: due to is a value between 0 and 1. The smaller it is, the purer the color in the cloth image is. The larger the value, the smaller the color uniformity after correction. The larger the value, the less pure the color in the cloth image is. The smaller the value, the greater the color uniformity after correction. By using the expression of the present invention, the color uniformity can be corrected quickly and accurately.

[0038] Preferably, when acquiring the images of the to-be-detected fabric and the comparison fabric, the shooting angle, light source and lighting conditions of the to-be-detected fabric and the comparison fabric are the same.

[0039] Preferably, when acquiring the images of the fabric to be detected and the comparison fabric, the fabric to be detected and the comparison fabric are both laid flat, and the textures of the fabric to be detected and the comparison fabric are in the same direction.

[0040] In a second aspect, the present invention provides a fabric intelligent colorimetric system, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the fabric intelligent colorimetric method of the present invention is implemented.

[0041] In summary, the beneficial effect of the present invention is that the method of the present invention can greatly improve the accuracy of the color difference calculated when comparing the color of the fabric to be tested with the comparison fabric, and greatly improve the efficiency of color difference comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0043] Figure 1 is a flow chart schematically showing a method for colorimetric comparison of fabrics in the prior art;

[0044] Figure 2 is a flowchart schematically showing a method for intelligent colorimetry of fabrics according to an embodiment of the present invention;

[0045] Figure 3 is a grayscale image schematically showing a cloth to be detected according to an embodiment of the present invention;

[0046] Figure 4 is a grayscale histogram schematically showing a grayscale image of a cloth to be detected according to an embodiment of the present invention;

[0047] Figure 5 FIG. 1 is a schematic diagram showing the structure of an intelligent colorimetric system for fabrics according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0049] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0050] Fabric intelligent colorimetric method embodiment:

[0051] like Figure 2 As shown, the intelligent colorimetric method for fabrics of the present invention comprises:

[0052] S101, obtaining an image of the fabric and determining relevant parameters, specifically: obtaining an image of the fabric to be detected and an image of the comparison fabric, and determining the color uniformity, brightness of all pixels in the image of the fabric to be detected, and brightness of all pixels in the image of the comparison fabric;

[0053] In order to ensure the accuracy of the comparison result, the fabric to be detected and the comparison fabric should be photographed under the same conditions to obtain an image of the fabric to be detected and an image of the comparison fabric. In this embodiment, when photographing the images of the fabric to be detected and the comparison fabric, the shooting angle, light source and lighting conditions of the fabric to be detected and the comparison fabric are the same, and the fabric to be detected and the comparison fabric are both laid flat, and the texture directions of the fabric to be detected and the comparison fabric are the same.

[0054] When shooting, an industrial camera can be used for shooting, and it should be ensured that the background of the cloth is not included in the photographed picture. If the photographed image contains a background image, the background image needs to be removed. In other embodiments, a camera device such as a mobile phone can also be used for shooting.

[0055] There are many ways to determine the color uniformity of the image of the fabric to be detected, for example: obtain the grayscale histogram corresponding to the image of the fabric to be detected, calculate the mean of the grayscale histogram, and use it as a measure of color uniformity; the larger the mean, the more uniform the grayscale value distribution, and thus the higher the color uniformity. Another example: separate the image of the fabric to be detected into three channels, R, G, and B, calculate the mean of the R, G, and B channels respectively, and evaluate the color uniformity by comparing the differences in the R, G, and B mean values. If the differences in the three mean values ​​are small, the color uniformity is high.

[0056] S102, calculating the brightness weight factor, specifically: calculating the brightness weight factor according to the color uniformity of the image of the to-be-detected fabric, the average brightness of all pixels in the image of the to-be-detected fabric and the image of the comparison fabric, and the calculation expression thereof is:

[0057] ;

[0058] In the formula, represents the brightness weight factor, Represents the average brightness of all pixels in the image of the fabric to be detected, is the average value of the brightness of all pixels in the image of the comparison cloth, Indicates the color uniformity of the image of the fabric to be detected, exp () is an exponential function with the natural constant e as its base.

[0059] The overall brightness difference between the image of the fabric to be tested and the image of the comparison fabric. The larger the value, the more obvious the difference in brightness between the fabric to be tested and the comparison fabric. A larger brightness weight factor should be used to increase the relative tolerance of the color difference result to the image brightness, reduce the sensitivity of brightness to the total color difference, and avoid excessive color difference values ​​due to obvious differences in brightness. The smaller the value, the closer the brightness between the fabric to be tested and the comparison fabric, the smaller the brightness weight factor should be used to reduce the relative tolerance of the color difference result to the image brightness, increase the sensitivity of brightness to the total color difference, and make the brightness difference occupy a larger relative proportion in the CMC color difference formula, thereby amplifying the influence of the brightness part on the overall color difference. In order to facilitate calculation, the value is divided by 100 here. Normalize.

[0060] When calculating the brightness of pixels in the image of the fabric to be detected and the brightness of pixels in the image of the comparison fabric, it is necessary to first convert the image of the fabric to be detected and the image of the comparison fabric from the RGB color space into the LAB color space.

[0061] The greater the color uniformity of the image of the fabric to be tested, the more consistent the visual effects of the various parts of the image of the fabric to be tested are. At this time, it is necessary to capture the brightness changes more sensitively. A smaller brightness weight factor should be used to reduce the relative tolerance of the color difference result to the image brightness and increase the sensitivity of the brightness to the total color difference. The smaller the value, the more inconsistent the visual effects of the various parts of the image of the fabric to be tested are. At this time, a slight brightness difference may have a significant impact on the overall color perception. A larger brightness weight factor should be used to increase the relative tolerance of the color difference result to the image brightness and reduce the sensitivity of the brightness to the total color difference.

[0062] During the fabric production process, the fabric in the fabric image may have local color changes due to dyeing, weaving processes, etc. Although this local color change does not affect the human eye's perception of the fabric color, it will affect the colorimetric results obtained when comparing the fabric color. Therefore, the color uniformity of the fabric image needs to be considered when calculating the brightness weight factor.

[0063] Different fabrics have differences in dyeing, texture and material, which will affect the brightness in the fabric image, and thus different brightness weight factors need to be set when calculating color difference. Calculating the brightness weight factor according to the actual characteristics of the fabric can improve the accuracy of fabric color difference evaluation and make the colorimetric result more consistent with the visual performance of a specific fabric. Therefore, the present invention calculates the brightness weight factor according to the color uniformity of the fabric image and the brightness of the fabric image, thereby improving the accuracy of the colorimetric result obtained when the CMC color difference formula is used to compare the fabric.

[0064] S103, calculating a chroma weight factor, specifically: calculating a chroma weight factor according to the brightness weight factor, wherein the chroma weight factor is negatively correlated with the brightness weight factor;

[0065] Since the lightness weight factor is obtained based on the lightness of the fabric image to be tested and the comparison fabric image, the larger the lightness weight factor, the more significant the lightness difference, and the more the tolerance for chroma changes needs to be reduced in the color difference calculation. A smaller chroma weight factor is used to amplify the influence of chroma in color difference to ensure that the overall difference in the visual performance of the fabric can be accurately captured. The smaller the lightness weight factor, the smaller the lightness difference, and the color difference calculation should increase the tolerance for chroma changes. A larger chroma weight factor is used, so that the overall color difference can more accurately reflect the subtle differences in fabric lightness, thereby avoiding unnecessary chroma amplification. Therefore, the chroma weight factor needs to be negatively correlated with the lightness weight factor.

[0066] S104, performing color comparison between the fabric to be tested and the fabric to be compared according to the lightness weight factor and the chroma weight factor using a CMC color difference formula.

[0067] The specific process of colorimetric comparison between the fabric to be tested and the comparison fabric using the CMC color difference formula is as follows:

[0068] The average values ​​of the lightness channel pixel values, the red-green channel pixel values, and the yellow-blue channel pixel values ​​of all pixels in the image of the fabric to be tested are calculated; the average values ​​of the lightness channel pixel values, the red-green channel pixel values, and the yellow-blue channel pixel values ​​of all pixels in the image of the comparison fabric are calculated; and the CMC color difference is calculated based on the lightness weight factor and the chroma weight factor to obtain the color difference between the fabric to be tested and the comparison fabric. When the color difference value is less than 1 (empirical value), it is considered that the color difference of the fabric is within the allowable range; when the color difference value is greater than or equal to 1 (empirical value), it is considered that the color difference of the fabric exceeds the allowable range.

[0069] In this embodiment, the CMC color difference calculation is performed using the average value of the pixel values ​​of the image in each channel. In other embodiments, the CMC color difference between the corresponding pixels at the same position in the fabric image to be detected and the comparison image can also be calculated, and the average value of the color difference of all pixels is used as the color difference between the two images.

[0070] The method for fabric colorimetry reduces the number of parameter adjustments during the fabric colorimetry process, thereby improving the fabric colorimetry efficiency and bringing certain convenience to the fabric colorimetry process.

[0071] The intelligent colorimetric method for fabrics in this embodiment takes into account the influence of the overall brightness difference between the image of the fabric to be detected and the image of the comparison fabric on the color difference value when calculating the brightness weight factor. When the overall brightness difference is large, the brightness weight factor is made larger to increase the relative tolerance of the color difference result to the image brightness and reduce the sensitivity of the brightness to the total color difference. When the overall brightness difference is small, the brightness weight factor is made smaller to reduce the relative tolerance of the color difference result to the image brightness and increase the sensitivity of the brightness to the total color difference.

[0072] After the brightness weight factor is preliminarily calculated, the calculated brightness weight factor is further corrected in combination with the influence of the color uniformity of the image of the fabric to be tested on the color difference value. When the color uniformity is high, the calculated brightness weight factor is adjusted to a smaller value to reduce the relative tolerance of the color difference result to the image brightness and increase the sensitivity of the brightness to the total color difference; when the color uniformity is low, the calculated brightness weight factor is adjusted to a larger value to increase the relative tolerance of the color difference result to the image brightness and reduce the sensitivity of the brightness to the total color difference.

[0073] When calculating the chroma weighting factor, the brightness difference between the fabric image to be tested and the comparison fabric image is taken into account. When the brightness difference is large, a smaller chroma weighting factor is used to amplify the influence of chroma in color difference to ensure that the overall difference in the visual performance of the fabric can be accurately captured; when the brightness difference is small, a larger chroma weighting factor is used so that the overall color difference can more accurately reflect the subtle differences in fabric brightness, thereby avoiding unnecessary chroma amplification.

[0074] Therefore, the method of the present invention can greatly improve the accuracy of the color difference calculated when the CMC color difference formula is used to compare the color of the fabric to be tested and the comparison fabric. In addition, when the method of the present invention is used to compare the color difference between the fabric to be tested and the comparison fabric, the lightness weight factor and the chroma weight factor that can make the color difference calculation result more accurate are calculated adaptively, thereby avoiding the process of adjusting the lightness weight factor and the chroma weight factor, thereby greatly improving the efficiency of color difference comparison.

[0075] It can be seen from the above embodiments that the chroma weight factor is negatively correlated with the lightness weight factor. In one embodiment, the calculation expression of the chroma weight factor is:

[0076] ;

[0077] In the formula, c represents the chroma weight factor, exp () is an exponential function with the natural constant e as base, Represents the brightness weight factor.

[0078] In another embodiment, the calculation expression of the chroma weight factor is:

[0079] ;

[0080] In the formula, c represents the chroma weight factor, exp () is an exponential function with the natural constant e as base, is the average value of the red and green component gradients of all pixels in the image of the fabric to be detected, is the average value of the gradient of the red and green components of all pixels in the image of the contrast cloth, is the average value of the gradient of the yellow-blue component of all pixels in the image of the fabric to be detected, is the average value of the gradient of the yellow-blue component of all pixels in the image of the contrast cloth, Represents the brightness weight factor.

[0081] In this embodiment, the pixel values ​​of the red and green channels of the image may be processed by the Sobel operator to obtain the red and green channel change gradient of the image, and the pixel values ​​of the yellow and blue channels of the image may be processed by the Sobel operator to obtain the yellow and blue channel change gradient of the image. In other embodiments, other suitable algorithms may also be used to obtain the red and green channel change gradient of each pixel point in the image and the yellow and blue channel change gradient of each pixel point in the image.

[0082] represents the gradient of the image of the cloth to be detected, represents the gradient of the image of the contrasting cloth, It indicates the size of the overall gradient of the image of the fabric to be tested and the image of the comparison fabric. The larger the value, the more dramatic the chroma change in the image, and the more likely the human eye is to be sensitive to such chroma changes. At this time, a smaller chroma weight factor should be used to reduce the relative tolerance of the color difference result to the image chroma, increase the sensitivity of the brightness to the total color difference, and make the chroma difference occupy a larger relative proportion in the CMC color difference formula. The smaller the value, the more gradual the chroma change in the image, and the less obvious the chroma change is visually. At this time, a larger chroma weight factor should be used to increase the relative tolerance of the color difference result to the image chroma, reduce the sensitivity of the brightness to the total color difference, and make the chroma difference occupy a smaller relative proportion in the CMC color difference formula. Dividing by 100 normalizes the gradient.

[0083] After the chroma weight factor is preliminarily calculated according to the lightness weight factor, the chroma weight factor is further corrected according to the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image. When the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image is large, the calculated chroma weight factor is adjusted to a smaller value to reduce the relative tolerance of the color difference result to the image chroma, improve the sensitivity of the lightness to the total color difference, and make the chroma difference occupy a larger relative proportion in the CMC color difference formula; when the mean value of the gradient of the fabric image to be detected and the gradient of the contrast fabric image is small, the calculated chroma weight factor is adjusted to a larger value to improve the relative tolerance of the color difference result to the image chroma, reduce the sensitivity of the lightness to the total color difference, and make the chroma difference occupy a smaller relative proportion in the CMC color difference formula. Thus, the accuracy of the color difference calculated using the CMC color difference formula is further improved.

[0084] It can be seen from the above embodiments that the brightness weight factor needs to be calculated based on the color uniformity of the image of the cloth to be detected. In one embodiment, the method for obtaining the color uniformity of the image of the cloth to be detected includes:

[0085] S201, graying the image of the fabric to be detected to obtain a grayscale image of the fabric to be detected, and obtaining a maximum grayscale value and a minimum grayscale value in the grayscale image of the fabric to be detected;

[0086] The grayscale image of the cloth to be detected is obtained as follows Figure 3 shown.

[0087] S202: Calculate the color uniformity of the image of the fabric to be detected according to the difference between the maximum grayscale value and the minimum grayscale value, wherein the color uniformity is negatively correlated with the difference.

[0088] Generally, the larger the difference between the maximum grayscale value and the minimum grayscale value of the grayscale image, the more grayscale levels there may be in the grayscale image of the fabric. Since different grayscale levels correspond to different colors, the larger the difference, the more types of colors there may be in the fabric image, the more uneven the color of the fabric in the image may be, and the smaller the color uniformity of the fabric image; conversely, the smaller the difference, the fewer grayscale levels there may be in the grayscale image of the fabric image. Since different grayscale levels correspond to different colors, the smaller the difference, the fewer types of colors there may be in the fabric image, the more uniform the color of the fabric in the image may be, and the larger the color uniformity of the fabric image. Therefore, the method for obtaining the color uniformity of the image of the fabric to be detected in this embodiment can more accurately calculate the color uniformity of the image of the fabric to be detected.

[0089] It can be seen from the above embodiments that the color uniformity is negatively correlated with the difference between the maximum grayscale value and the minimum grayscale value of the grayscale image of the fabric to be detected. In one embodiment, the calculation expression of the color uniformity is:

[0090] ;

[0091] In the formula, M Indicates the color uniformity of the image of the fabric to be detected, exp () is an exponential function with the natural constant e as base, Indicates the maximum grayscale value of the grayscale image of the cloth to be detected, Indicates the minimum grayscale value of the grayscale image of the cloth to be detected. and The difference is divided by 255 in order to and The difference is normalized.

[0092] When calculating the color uniformity, The value of is normalized to ensure that the calculation result of color uniformity is a value between 0 and 1, thereby preventing the calculated brightness weight factor from being too large or too small.

[0093] In one embodiment, it further includes:

[0094] S301, performing statistics on the grayscale values ​​of all pixels in the grayscale image of the cloth to be detected, so as to obtain a grayscale histogram of the grayscale image of the cloth to be detected;

[0095] The grayscale histogram of the grayscale image of the cloth to be detected is obtained as follows: Figure 4 shown.

[0096] S302, obtaining the maximum number of pixels having the same grayscale value in the grayscale image of the fabric to be detected according to the grayscale histogram;

[0097] S303, correcting the color uniformity according to the ratio of the maximum number to the total number of pixels in the grayscale image of the fabric to be detected, wherein the corrected color uniformity is positively correlated with the ratio.

[0098] Since there will be some noise when collecting cloth images, the existence of noise may If the value is too large, the color uniformity of the color uniformity image may be too small. Therefore, the color uniformity is corrected upward by using the ratio of the maximum number of pixels with the same gray value to the total number of pixels in the grayscale image of the to-be-detected fabric. When the ratio is larger, it means that the color in the fabric image is purer, and the degree of upward correction of the color uniformity is greater. On the contrary, when the ratio is smaller, it means that the color in the fabric image may be less pure, and the degree of correction of the color uniformity is smaller. Therefore, the method of this embodiment can make the calculated color uniformity more accurate, thereby further improving the accuracy of the color comparison result of the to-be-detected fabric.

[0099] It can be seen from the above embodiments that the corrected color uniformity is positively correlated with the ratio. In one embodiment, the calculation expression of the corrected color uniformity is:

[0100] ;

[0101] In the formula, n represents the maximum number of pixels with the same grayscale value, N represents the total number of pixels in the grayscale image of the fabric to be detected, Indicates the color uniformity after correction. exp () is an exponential function with the natural constant e as base, Indicates the maximum grayscale value of the grayscale image of the cloth to be detected, Indicates the minimum grayscale value of the grayscale image of the cloth to be detected.

[0102] because is a value between 0 and 1. The smaller it is, the purer the color in the cloth image is. The larger the value, the smaller the color uniformity after correction. The larger the value, the less pure the color in the cloth image is. The smaller the value, the greater the color uniformity after correction. By using the expression of this embodiment, the color uniformity can be corrected quickly and accurately.

[0103] Fabric intelligent colorimetric system implementation example:

[0104] The present invention also provides a fabric intelligent colorimetric system. Figure 5 As shown, the fabric intelligent colorimetric system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a fabric intelligent colorimetric method in the above embodiment is implemented.

[0105] The fabric intelligent colorimetric system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0106] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.

[0107] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0108] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A fabric intelligent colorimetric method, characterized in that: include: Acquire an image of the fabric to be detected and an image of the comparison fabric, and determine the color uniformity, brightness of all pixels in the image of the fabric to be detected, and brightness of all pixels in the image of the comparison fabric; The brightness weight factor is calculated based on the color uniformity of the image of the fabric to be detected, the average brightness of all pixels in the image of the fabric to be detected and the image of the comparison fabric. The calculation expression is: ; In the formula, represents the brightness weight factor, Represents the average brightness of all pixels in the image of the fabric to be detected, is the average value of the brightness of all pixels in the image of the comparison cloth, Indicates the color uniformity of the image of the fabric to be detected, exp () is an exponential function with the natural constant e as base; The chroma weight factor is calculated based on the brightness weight factor, and the calculation expression is: ; In the formula, c represents the chroma weight factor, is the average value of the red and green component gradients of all pixels in the image of the fabric to be detected, is the average value of the gradient of the red and green components of all pixels in the image of the contrast cloth, is the average value of the gradient of the yellow-blue component of all pixels in the image of the fabric to be detected, is the average value of the gradient of the yellow-blue component of all pixels in the image of the contrasting cloth; the chroma weight factor is negatively correlated with the lightness weight factor; According to the lightness weight factor and the chroma weight factor, the colorimetry of the fabric to be tested and the fabric to be compared is performed using a CMC color difference formula.

2. The intelligent colorimetric method for fabrics according to claim 1, characterized in that: The calculation expression of the chroma weight factor can also be replaced by: ; In the formula, c represents the chroma weight factor, exp () is an exponential function with the natural constant e as its base.

3. The intelligent colorimetric method for fabrics according to claim 1, characterized in that: The method for obtaining the color uniformity of the image of the cloth to be detected includes: Gray-scale the image of the fabric to be detected, thereby obtaining a grayscale image of the fabric to be detected, and obtaining a maximum grayscale value and a minimum grayscale value in the grayscale image of the fabric to be detected; The color uniformity of the image of the cloth to be detected is calculated according to the difference between the maximum grayscale value and the minimum grayscale value, and the color uniformity is negatively correlated with the difference.

4. The intelligent colorimetric method for fabrics according to claim 3, characterized in that: The calculation expression of the color uniformity is: ; In the formula, M Indicates the color uniformity of the image of the fabric to be detected, exp () is an exponential function with the natural constant e as base, Indicates the maximum grayscale value of the grayscale image of the cloth to be detected, Indicates the minimum grayscale value of the grayscale image of the cloth to be detected.

5. The intelligent colorimetric method for fabrics according to claim 4, characterized in that: Also includes: Counting the grayscale values ​​of all pixels in the grayscale image of the fabric to be detected, so as to obtain a grayscale histogram of the grayscale image of the fabric to be detected; Acquire the maximum number of pixels having the same grayscale value in the grayscale image of the fabric to be detected according to the grayscale histogram; The color uniformity is corrected according to the ratio of the maximum number to the total number of pixels of the grayscale image of the fabric to be detected, and the corrected color uniformity is positively correlated with the ratio.

6. The intelligent colorimetric method for fabrics according to claim 5, characterized in that: The calculation expression of the corrected color uniformity is: ; In the formula, n represents the maximum number of pixels with the same grayscale value, N represents the total number of pixels in the grayscale image of the fabric to be detected, Indicates the color uniformity after correction.

7. The intelligent colorimetric method for fabrics according to any one of claims 1 to 6, characterized in that: When acquiring the images of the to-be-detected fabric and the comparison fabric, the shooting angle, light source and lighting conditions of the to-be-detected fabric and the comparison fabric are the same.

8. The intelligent colorimetric method for fabrics according to claim 7, characterized in that: When acquiring the images of the fabric to be detected and the comparison fabric, the fabric to be detected and the comparison fabric are both laid flat, and the texture directions of the fabric to be detected and the comparison fabric are the same.

9. A fabric intelligent colorimetric system, comprising a processor and a memory, wherein the memory stores computer program instructions, characterized in that: When the computer program instructions are executed by the processor, the intelligent colorimetric method for fabrics according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Color comparing method and device

    CN105488820A

  • Image processing method and device

    CN110430403A