Fabric high-fidelity color-changing soft proofing method and system based on color mapping
By performing color correction and image decomposition on textile fabrics, combined with mean-shift clustering algorithm and grayscale deviation adjustment method, the problem of texture structure influence and color and texture relationship in textile fabrics is solved, and a high-fidelity color change effect with the consistent texture effect with the target color fabric is achieved.
Patent Information
- Application Number
- CN202510058250.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-09
AI Technical Summary
The high-fidelity color change of textile fabrics faces the problem of complex texture structure affecting the color segmentation accuracy and not fully considering the relationship between color and texture, resulting in a large difference between the image texture effect after color change and the target color fabric.
The digital image of the fabric sample was taken through a digital camera. After color correction was performed, the image decomposition technology was used to decompose the image into cartoon parts and texture parts, and the mean-shift clustering algorithm was used to cluster and segment the cartoon parts to obtain the fabric color separation map. Then, convert the image to be changed and the target color image to a grayscale map, adjust the grayscale value according to the mean and standard deviation, calculate the grayscale deviation and expand it to three channels, and finally add the RGB mean value of the reference color image to obtain the color change result of the color separation map.
It effectively reduces the impact of fabric texture on segmentation. While keeping the color close to the real fabric, the texture strength and weakness are consistent with the real fabric.
Smart Images

Figure CN119963667A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer digital image processing, and in particular relates to a fabric high-fidelity color-changing soft proofing method and system based on color mapping. Background Art
[0002] The design and proofing process of textile fabrics usually involves multiple complex process steps. Designers constantly adjust patterns and colors according to the proofing results. It usually takes multiple proofings to achieve the ideal effect and then put it into mass production. This traditional manual proofing method not only has a long cycle and a large workload, but may also lead to a waste of resources. Therefore, researchers have proposed a variety of digital online color change methods, which can be roughly divided into two categories: traditional methods and deep learning methods. The traditional method divides the different color areas of the textile fabric and then applies color mapping technology to achieve color change. The deep learning method can provide a more refined and natural color change effect through training with a large number of samples, but it has a large demand for samples and is highly dependent on samples. Therefore, the traditional method is more practical in the field of textile fabric color change.
[0003] However, high-fidelity color change of textile fabrics faces multiple challenges. First, textile fabrics usually have complex texture structures, which affect the accuracy of color segmentation, making it difficult to accurately segment and process different areas during the color change process. Second, many existing color change methods fail to fully consider the relationship between color and texture, resulting in the color-changed image retaining the characteristics of the original fabric in terms of texture intensity and details, despite the color change, and failing to effectively show the texture changes that the target color fabric should have. Therefore, despite the color adjustment, the texture effect of the color-changed fabric image is quite different from the actual texture of the target color fabric. Summary of the invention
[0004] The purpose of the present invention is to solve the problem described in the background technology and to propose a fabric high-fidelity color-changing soft proofing method based on color mapping.
[0005] In view of the problems existing in the above-mentioned existing research, the present invention proposes a method to solve the problem. First, a digital camera is used to take a digital image of a fabric sample in an experimental light box, and color correction is performed on it to ensure the accuracy of the color. Then, the fabric image is decomposed into a cartoon part and a texture part using image decomposition technology, and the cartoon part is clustered and segmented using the mean-shift clustering algorithm to obtain a color separation map of the fabric. After selecting the part to be changed in color from the color separation map, the image to be changed in color and the target color image are converted into grayscale images, and their mean values and standard deviations are calculated respectively, and the grayscale value of the image to be changed in color is adjusted according to the mean and standard deviation. The adjusted grayscale deviation is calculated and expanded to three channels, and the RGB mean of the reference color image is added to the color deviation to obtain the color change result of the color separation map. Finally, all color separation maps are merged to obtain the final fabric color change result.
[0006] The technical solution of the present invention is a fabric high-fidelity color-changing soft proofing method based on color mapping, which specifically comprises the following steps:
[0007] Step 1, taking a digital image of a fabric sample;
[0008] Step 2, color correction is performed on the digital image of the fabric sample;
[0009] Step 3, decomposing the fabric image into a cartoon part and a texture part using image decomposition technology;
[0010] Step 4, clustering and segmenting the cartoon part to obtain a color separation map of the fabric image;
[0011] Step 5, convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation;
[0012] Step 6, calculating the grayscale deviation of the adjusted grayscale image and expanding it to three channels;
[0013] Step 7, calculate the RGB mean of the target color image, and expand it to the size of the image to be color-changed, add the expanded color mean to the expanded grayscale deviation, and obtain the color-changed result image of the color separation image;
[0014] Step 8: merge the color-changing result image of the color separation image with other color separation images into a complete color-changing result image.
[0015] Furthermore, in step 1, a digital camera is used to capture a digital image of the fabric sample in the experimental light box. The specific method is as follows: the digital camera is installed on the top of the experimental light box to form an overall system, the digital camera is connected to a computer, and then the fabric sample is placed in a drawer of the experimental light box, the drawer is closed, the camera shooting parameters are adjusted, and a shooting button is pressed to obtain a digital image of the sample.
[0016] Furthermore, the specific implementation method of color correction of the digital image of the fabric sample in step 2 is as follows:
[0017] Take a digital image of a standard color card in a closed light box, build a color correction model, use a spectrophotometer to get the standard XYZ tristimulus color data C of the color card, and get the standard RGB data S of the color card based on the XYZ to RGB color space conversion matrix M. The formula is as follows:
[0018]
[0019] The standard RGB data S is obtained by matrix multiplication:
[0020] S=MC (2)
[0021] Using the captured color card digital image, extract the RGB data D of each color block, and use the polynomial model to expand the obtained RGB data value matrix. Taking the second-order polynomial model as an example, its expansion form is as follows:
[0022] V=(1,R,G,B,R 2 ,G 2 ,B 2 ,RG,RB,GB) T (3)
[0023] Among them, R, G and B correspond to the values of the three color channel components of the color block respectively, V is the color value vector after polynomial expansion, and the expansion matrix V is obtained according to the color card standard RGB color data S and the RGB data D obtained by color card shooting, and the following mapping relationship is established:
[0024] S=V×Q T (4)
[0025] Among them, Q is the 3×K dimensional color correction coefficient matrix to be determined, K is the number of terms in the polynomial expansion, and the matrix is obtained by the least squares method, that is:
[0026]
[0027] Where J is the number of color blocks in the color card, ∥∥ F is the F norm; the color correction model Q is obtained by formula (5), and the final correction method is as follows:
[0028] I c =IQ T (6)
[0029] Among them, I is the color data of the digital image of the textile fabric, Q is the color correction model, and I c is the corrected digital image color data.
[0030] Furthermore, the specific implementation method of decomposing the fabric image into a cartoon part and a texture part by using the image decomposition technology in step 3 is as follows:
[0031] The goal of image decomposition is to transform the image f∈R n Decomposed into corresponding texture part and cartoon part, that is,
[0032] f=u+v (7)
[0033] Among them, f is the original image, u,v∈R n , u is the cartoon part of the image, which contains the main structure and general outline of the image, and v is the texture part, which contains the detail information and noise in the image; the CLRP model is used to decompose the image, and the specific formula is as follows:
[0034]
[0035] Among them, τ and μ are two regularization parameters used to balance the cartoon and texture parts, b0 is the input image, is the absolute value of the gradient of the cartoon part u, ∥∥1 is the l1 norm, ∥∥ * is the nuclear norm, and ∥∥2 is the L2 norm, which is used to measure the difference between two images.
[0036] Furthermore, in step 4, the mean-shift clustering algorithm is used to cluster and segment the cartoon part.
[0037] Furthermore, the specific implementation method of step 4 is as follows:
[0038] Convert the cartoon part from RGB color space to CIELab color space, apply mean-shift algorithm in CIELab color space, cluster the pixels of the cartoon part, and get the color segmentation result. i , calculate its mean shift vector:
[0039]
[0040] Among them, x i represents the position of the i-th data point, S = {x j ∈X||x i -x j ∥≤h} represents a neighborhood set, including all distances x i Points that do not exceed the bandwidth parameter h are used to calculate the mean shift vector X, which is the set of all pixel points in the image, K h (||x i -x j ||) is a Gaussian kernel function, which is used to calculate the weights between data points. The formula is as follows:
[0041]
[0042] Where h is the bandwidth parameter; the algorithm iteratively updates the position of each data point until the moving distance of all data points is less than the set threshold:
[0043] x i t+1 =x i t +m(x i ) (11)
[0044] Where t represents the number of iterations, and the updated position is the new position of the data point after the offset. By adjusting the bandwidth parameter h, the fineness of the segmentation can be controlled to adapt to different image characteristics. Finally, similar cluster merging and morphological operations are used to obtain the final fabric image color separation map.
[0045] Furthermore, the specific implementation method of adjusting the grayscale channel of the image to be changed in color according to the mean and standard deviation in step 5 is as follows:
[0046] First, the image to be changed and the target color image are converted into grayscale images, as shown in formula (12):
[0047] Y=0.299*R+0.587*G+0.144*B (12)
[0048] Among them, Y represents the gray value of any pixel of the textile fabric image, R represents the color value of the red channel of the pixel, G represents the color value of the green channel of the pixel, and B represents the color value of the blue channel of the pixel;
[0049] Secondly, calculate the mean and standard deviation of the grayscale images of the image to be color-changed and the target color image respectively, and adjust the grayscale channel of the image to be color-changed according to the formula so that its mean and standard deviation match the target color image:
[0050]
[0051] Among them, Y r Represents the adjusted grayscale value, μ t ,σ t Represents the mean and standard deviation of the grayscale image to be changed, μ c ,σ c Represents the mean and standard deviation of the grayscale image of the target color image, Y t is the grayscale value of the image to be changed.
[0052] Furthermore, the specific implementation method of calculating the grayscale deviation of the adjusted grayscale image in step 6 and expanding it to three channels is as follows:
[0053] Calculate the grayscale deviation of the adjusted image to be changed:
[0054] ΔY=Y r -μ r (14)
[0055] Among them, ΔY represents the grayscale deviation, Y r Represents the adjusted grayscale value, μ r Represents the average value of the adjusted grayscale image, expanding the grayscale deviation to three channels.
[0056] In a second aspect, the present invention further provides a fabric high-fidelity color-changing soft proofing system based on color mapping, comprising the following modules:
[0057] A digital image acquisition module, used for taking a digital image of a fabric sample;
[0058] A color correction module, used for color correction of digital images of fabric samples;
[0059] An image decomposition module, used for decomposing the fabric image into a cartoon part and a texture part by using an image decomposition technology;
[0060] The clustering segmentation module is used to perform clustering segmentation on the cartoon part to obtain a color separation map of the fabric image;
[0061] A grayscale adjustment module is used to convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation;
[0062] Grayscale deviation calculation module, used to calculate the grayscale deviation of the adjusted grayscale image and expand it to three channels;
[0063] The color-changing module of the color separation image is used to calculate the RGB mean value of the target color image and expand it to the size of the image to be changed, and add the expanded color mean value to the expanded grayscale deviation to obtain the color-changing result image of the color separation image;
[0064] The color-changing result output module is used to merge the color-changing result image of the color separation image with other color separation images into a complete color-changing result image.
[0065] In a third aspect, the present invention also provides a high-fidelity color-changing soft proofing device for fabrics based on color mapping, comprising: a processor and a memory, the memory being used to store program instructions, and the processor being used to call the stored instructions in the memory to execute a high-fidelity color-changing soft proofing method for fabrics based on color mapping as described in the above technical solution.
[0066] The present invention aims at the problem that the existing color-changing method for textile fabrics does not fully consider the influence of color on texture perception, resulting in the problem that although the image after color change has achieved color change, its texture strength is inconsistent with the real target color fabric. After color correction of the fabric image, the image is divided into a cartoon part and a texture part by using image decomposition technology, and the cartoon part is segmented by using mean-shift clustering algorithm to obtain a fabric color separation map. The part to be changed in color is selected from the color separation map, and the grayscale value of the color-changing image is adjusted according to the mean and standard deviation of the grayscale images of the image to be changed in color and the target color image, and the adjusted grayscale deviation is calculated and expanded to three channels. The RGB mean of the reference color image is added with the color deviation to obtain the color change result of the color separation map. Finally, the color separation maps are merged to obtain the final fabric color change result. The present invention can effectively reduce the influence of fabric texture on segmentation, and when changing colors, while keeping the color close to the real fabric, the texture strength can also achieve visual perception consistency with the real fabric. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flow chart of an embodiment of the present invention.
[0068] Figure 2 This is the experimental light box used in the embodiments of the present invention.
[0069] Figure 3 This is the color change result of the textile sample according to the embodiment of the present invention. DETAILED DESCRIPTION
[0070] When the technical solution of the present invention is specifically implemented, it can be operated by those skilled in the art using computer software technology.
[0071] like Figure 1 As shown, the embodiment of the present invention proposes a fabric high-fidelity color-changing soft proofing method based on color mapping, which specifically includes the following steps:
[0072] Step 1, using a digital camera to take a digital image of a fabric sample in an experimental light box;
[0073] Step 2, color correction of the fabric sample image;
[0074] Step 3, decomposing the fabric image into a cartoon part and a texture part using image decomposition technology;
[0075] Step 4, using mean-shift clustering algorithm to cluster and segment the cartoon part to obtain a color separation map of the fabric image;
[0076] Step 5, convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation;
[0077] Step 6, calculating the grayscale deviation of the adjusted grayscale image and expanding it to three channels;
[0078] Step 7, calculate the RGB mean of the target color image, and expand it to the size of the image to be color-changed, add the expanded color mean to the expanded grayscale deviation, and obtain the color-changed result image of the color separation image;
[0079] Step 8: Merge all color separation images to obtain the final color change result.
[0080] The following is a specific example to illustrate the embodiment of the present invention.
[0081] Embodiments The method of the present invention was tested based on a self-developed enclosed daylight lighting box, a Nikon D7200 digital camera, a ColorChecker SG140 color card, a ColorChecker 24 color card and textile fabrics.
[0082] In step 1, the specific process of using a digital camera to capture a digital image of a fabric sample in an experimental light box in the embodiment is as follows: install the digital camera on the top of the experimental light box to form an integrated system, connect the digital camera to the computer, and then place the fabric sample in the effective photographing area of the experimental light box, close the drawer, adjust the camera shooting parameters, and press the shooting button to obtain the sample digital image. The experimental light box is illuminated by a full-spectrum daylight light source, which can meet the requirements of photographic color measurement for full-spectrum visible light lighting conditions; at the same time, the light box is a closed light box, which is not affected by the external lighting environment, and can ensure the uniformity of lighting in the imaging area at the bottom of the light box; and the light box adopts completely diffuse reflection lighting, which can effectively avoid the shortcomings of direct lighting of existing light boxes. Then, the effective area of the fabric in the captured image is cropped. The experimental light box used in the present invention is as shown in the attached Figure 2 shown.
[0083] In step 2, a digital image of a standard color card is taken in a closed light box to construct a color correction model. The standard XYZ tristimulus value color data C of the color card is obtained using a spectrophotometer, and the standard RGB data S of the color card is obtained based on the XYZ to RGB color space conversion matrix M, as shown in the following formula:
[0084]
[0085] The standard RGB data S is obtained by matrix multiplication:
[0086] S=MC (2)
[0087] Using the captured color card digital image, extract the RGB data D of each color block, and use the polynomial model to expand the obtained RGB data value matrix. Taking the second-order polynomial model as an example, its expansion form is as follows:
[0088] V=(1,R,G,B,R 2 ,G 2 ,B 2 ,RG,RB,GB) T (3)
[0089] Among them, R, G and B correspond to the values of the three color channel components of the color block respectively, and V is the color value vector after polynomial expansion. According to the expansion matrix V obtained by the color card standard RGB color data S and the RGB data D obtained by color card shooting, the following mapping relationship is established:
[0090] S=V×Q T (4)
[0091] Among them, Q is the 3×K dimensional color correction coefficient matrix to be determined, K is the number of terms in the polynomial expansion, and the matrix is obtained by the least squares method, that is:
[0092]
[0093] Where J is the number of color blocks in the color card, ∥∥ F is the F norm; the color correction model Q obtained through the above process can be used to perform color correction on digital images of textile fabrics obtained under the same shooting conditions, further improving the color accuracy. The final correction method is as follows:
[0094] I c =IQ T (6)
[0095] Among them, I is the color data of the digital image of the textile fabric, Q is the color correction model, and I c is the corrected digital image color data.
[0096] In the embodiment, digital images of the ColorChecker SG140 color card and the ColorChecker 24 color card are captured in a closed light box, the ColorChecker SG140 color card is used as a training sample, and the ColorChecker 24 color card is used as a test sample, the RGB data of all pixels in the m×m pixel area at the center of each color block are extracted, and the RGB data of the m×m pixels are averaged, and a third-order polynomial expansion is used to obtain a color vector V.
[0097] In step 3, the specific implementation method of decomposing the fabric image into a cartoon part and a texture part using image decomposition technology is as follows:
[0098] The goal of image decomposition is to transform the image f∈R n Decomposed into corresponding texture part and cartoon part, that is,
[0099] f=u+v (7)
[0100] Among them, f is the original image, u,v∈R n , u is the cartoon part of the image, which contains the main structure and general outline of the image, and v is the texture part, which contains the details and noise in the image. The CLRP model (customized low-rank prior model) is used to decompose the fabric image into the cartoon part and the texture part. The specific formula is as follows:
[0101]
[0102] Among them, u is the cartoon part, v is the texture part, b0 is the input image, is the absolute value of the gradient of the cartoon part u, τ and μ are two regularization parameters used to balance the cartoon and texture parts. ∥∥1 is the l1 norm, ∥∥ * is the nuclear norm. ∥∥2 is the L2 norm, which is used to measure the difference between two images. is the data fidelity term, ensuring that the decomposed image is as close to the original image as possible. From formula (8), we can see that this is an optimization problem, and the goal is to minimize this objective function and solve the variables u and v.
[0103] In step 4, the cartoon part of the fabric image is converted from the RGB color space to the CIELab color space, the mean-shift algorithm is applied in the CIELab color space to cluster the cartoon part pixels, and then similar cluster merging and morphological operations are used to obtain the final fabric image color separation map. The specific implementation method is as follows:
[0104] Convert the cartoon part from RGB color space to CIELab color space, apply mean-shift algorithm in CIELab color space, cluster the pixels of the cartoon part, and get the color segmentation result. i , calculate its mean shift vector:
[0105]
[0106] Among them, x i represents the position of the i-th data point, S = {x j ∈X||x i -x j ∥≤h} represents a neighborhood set, including all distances x i Points that do not exceed the bandwidth parameter h are used to calculate the mean shift vector, X is the set of all pixel points in the image, K h (||x i -x j||) is a Gaussian kernel function, which is used to calculate the weights between data points. The formula is as follows:
[0107]
[0108] Where h is the bandwidth parameter. The algorithm iteratively updates the position of each data point until the moving distance of all data points is less than the set threshold:
[0109] x i t+1 =x i t +m(x i ) (11)
[0110] Where t represents the number of iterations, and the updated position is the new position of the data point after the offset. By adjusting the bandwidth parameter h, the fineness of the segmentation can be controlled to adapt to different image characteristics. Finally, similar cluster merging and morphological operations are used to obtain the final fabric image color separation map.
[0111] In step 5, the image to be changed and the target color image are converted into grayscale images, as shown in formula (12):
[0112] Y=0.299*R+0.587*G+0.144*B (12)
[0113] Among them, Y represents the gray value of any pixel of the textile fabric image, R represents the color value of the red channel of the pixel, G represents the color value of the green channel of the pixel, and B represents the color value of the blue channel of the pixel.
[0114] Secondly, calculate the mean and standard deviation of the grayscale images of the image to be color-changed and the target color image respectively, and adjust the grayscale channel of the image to be color-changed according to the formula so that its mean and standard deviation match the target color image:
[0115]
[0116] Among them, Yr represents the adjusted grayscale value, μ t ,σ t Represents the mean and standard deviation of the grayscale image to be changed, μ c ,σ c represents the mean and standard deviation of the grayscale image of the target color image, and Yt is the grayscale value of the image to be changed.
[0117] In step 6, the grayscale deviation of the adjusted image to be changed is calculated:
[0118] ΔY=Y r -μ r (14)
[0119] Among them, ΔY represents the grayscale deviation, Yr represents the adjusted grayscale value, μ r Represents the average value of the adjusted grayscale image. Expand the grayscale deviation to three channels.
[0120] In step 7, the RGB color mean of the target color image is calculated, expanded to the same size as the image to be color-changed, and the grayscale deviation after expansion is added to obtain the color-changed result image of the color separation image.
[0121] In step 8, the color-changing result of the color separation image is finally merged with other color separation images into a complete color-changing result image. The final result is as follows: Figure 3 shown.
[0122] The embodiment of the present invention also provides a fabric high-fidelity color-changing soft proofing system based on color mapping, comprising the following modules:
[0123] A digital image acquisition module, used for taking a digital image of a fabric sample;
[0124] A color correction module, used for color correction of digital images of fabric samples;
[0125] An image decomposition module, used for decomposing the fabric image into a cartoon part and a texture part by using an image decomposition technology;
[0126] The clustering segmentation module is used to perform clustering segmentation on the cartoon part to obtain a color separation map of the fabric image;
[0127] A grayscale adjustment module is used to convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation;
[0128] Grayscale deviation calculation module, used to calculate the grayscale deviation of the adjusted grayscale image and expand it to three channels;
[0129] The color-changing module of the color separation image is used to calculate the RGB mean value of the target color image and expand it to the size of the image to be changed, and add the expanded color mean value to the expanded grayscale deviation to obtain the color-changing result image of the color separation image;
[0130] The color-changing result output module is used to merge the color-changing result image of the color separation image with other color separation images into a complete color-changing result image.
[0131] An embodiment of the present invention also provides a high-fidelity color-changing soft proofing device for fabrics based on color mapping, comprising: a processor and a memory, the memory being used to store program instructions, and the processor being used to call the stored instructions in the memory to execute a high-fidelity color-changing soft proofing method for fabrics based on color mapping as described in the above technical solution.
[0132] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
Claims
1. A fabric high-fidelity color-changing soft proofing method based on color mapping, characterized in that: The steps include: Step 1, taking a digital image of a fabric sample; Step 2, color correction is performed on the digital image of the fabric sample; Step 3, decomposing the fabric image into a cartoon part and a texture part using image decomposition technology; Step 4, clustering and segmenting the cartoon part to obtain a color separation map of the fabric image; Step 5, convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation; Step 6, calculating the grayscale deviation of the adjusted grayscale image and expanding it to three channels; Step 7, calculate the RGB mean of the target color image, and expand it to the size of the image to be color-changed, add the expanded color mean to the expanded grayscale deviation, and obtain the color-changed result image of the color separation image; Step 8: merge the color-changing result image of the color separation image with other color separation images into a complete color-changing result image.
2. A fabric high-fidelity color-changing soft proofing method based on color mapping as claimed in claim 1, characterized in that: In step 1, a digital camera is used to capture a digital image of the fabric sample in the experimental light box. The specific method is as follows: install the digital camera on the top of the experimental light box to form an overall system, connect the digital camera to the computer, and then place the fabric sample in the drawer of the experimental light box, close the drawer, adjust the camera shooting parameters, and press the shooting button to obtain the sample digital image.
3. The method for high-fidelity color-changing soft proofing of fabric based on color mapping as claimed in claim 1, characterized in that: The specific implementation method of color correction of the digital image of the fabric sample in step 2 is as follows: Take a digital image of a standard color card in a closed light box, build a color correction model, use a spectrophotometer to get the standard XYZ tristimulus color data C of the color card, and get the standard RGB data S of the color card based on the XYZ to RGB color space conversion matrix M. The formula is as follows: The standard RGB data S is obtained by matrix multiplication: S=MC (2) Using the captured color card digital image, extract the RGB data D of each color block, and use the polynomial model to expand the obtained RGB data value matrix. Taking the second-order polynomial model as an example, its expansion form is as follows: V=(1,R,G,B,R 2 ,G 2 ,B 2 ,RG,RB,GB) T (3) Where R, G and B correspond to the values of the three color channel components of the color block respectively, V is the color value vector after polynomial expansion, and the expansion matrix V is obtained based on the color card standard RGB color data S and the RGB data D obtained by color card shooting, and the following mapping relationship is established: S=V×Q T (4) Among them, Q is the 3×K dimensional color correction coefficient matrix to be determined, K is the number of terms in the polynomial expansion, and the matrix is obtained by the least squares method, that is: Where J is the number of color blocks in the color card, ∥∥ F is the F norm; the color correction model Q is obtained by formula (5), and the final correction method is as follows: I c =IQ T (6) Among them, I is the color data of the digital image of the textile fabric, Q is the color correction model, and I c is the corrected digital image color data.
4. The method for high-fidelity color-changing soft proofing of fabric based on color mapping as claimed in claim 1, characterized in that: The specific implementation method of decomposing the fabric image into a cartoon part and a texture part using the image decomposition technology in step 3 is as follows: The goal of image decomposition is to transform the image f∈R n Decomposed into corresponding texture part and cartoon part, that is, f=u+v (7) Among them, f is the original image, u,v∈R n , u is the cartoon part of the image, which contains the main structure and general outline of the image, and v is the texture part, which contains the detail information and noise in the image; the CLRP model is used to decompose the image, and the specific formula is as follows: Among them, τ and μ are two regularization parameters used to balance the cartoon and texture parts, b0 is the input image, is the absolute value of the gradient of the cartoon part u, ∥∥1 is the l1 norm, ∥∥ * is the nuclear norm, and ∥∥2 is the L2 norm, which is used to measure the difference between two images.
5. The method for high-fidelity color-changing soft proofing of fabric based on color mapping as claimed in claim 1, characterized in that: In step 4, the mean-shift clustering algorithm is used to cluster and segment the cartoon part.
6. A fabric high-fidelity color-changing soft proofing method based on color mapping as claimed in claim 1 or 5, characterized in that: The specific implementation method of step 4 is as follows: Convert the cartoon part from RGB color space to CIELab color space, apply mean-shift algorithm in CIELab color space, cluster the pixels of the cartoon part, and get the color segmentation result. i , calculate its mean shift vector: Among them, x i represents the position of the i-th data point, S = {x j ∈X||x i -x j ∥≤h} represents a neighborhood set, including all distances x i Points that do not exceed the bandwidth parameter h are used to calculate the mean shift vector X, which is the set of all pixel points in the image, K h (‖x i -x j ‖) is a Gaussian kernel function, which is used to calculate the weights between data points. The formula is as follows: Where h is the bandwidth parameter; the algorithm iteratively updates the position of each data point until the moving distance of all data points is less than the set threshold: x i t+1 =x i t +m(x i ) (11) Where t represents the number of iterations, and the updated position is the new position of the data point after the offset. By adjusting the bandwidth parameter h, the fineness of the segmentation can be controlled to adapt to different image characteristics. Finally, similar cluster merging and morphological operations are used to obtain the final fabric image color separation map.
7. The method for high-fidelity color-changing soft proofing of fabric based on color mapping as claimed in claim 1, characterized in that: The specific implementation method of adjusting the grayscale channel of the image to be changed color according to the mean and standard deviation in step 5 is as follows: First, the image to be changed and the target color image are converted into grayscale images, as shown in formula (12): Y=0.299*R+0.587*G+0.144*B (12) Among them, Y represents the gray value of any pixel of the textile fabric image, R represents the color value of the red channel of the pixel, G represents the color value of the green channel of the pixel, and B represents the color value of the blue channel of the pixel; Secondly, calculate the mean and standard deviation of the grayscale images of the image to be color-changed and the target color image respectively, and adjust the grayscale channel of the image to be color-changed according to the formula so that its mean and standard deviation match the target color image: Among them, Y r Represents the adjusted grayscale value, μ t ,σ t Represents the mean and standard deviation of the grayscale image to be changed, μ c ,σ c Represents the mean and standard deviation of the grayscale image of the target color image, Y t is the grayscale value of the image to be changed.
8. The method for high-fidelity color-changing soft proofing of fabric based on color mapping as claimed in claim 1, characterized in that: The specific implementation method of calculating the grayscale deviation of the adjusted grayscale image in step 6 and expanding it to three channels is as follows: Calculate the grayscale deviation of the adjusted image to be changed: ΔY=Y r -m r (14) Among them, ΔY represents the grayscale deviation, Y r Represents the adjusted grayscale value, μ r Represents the average value of the adjusted grayscale image, expanding the grayscale deviation to three channels.
9. A fabric high-fidelity color-changing soft proofing system based on color mapping, characterized in that: Includes the following modules: A digital image acquisition module, used for taking a digital image of a fabric sample; A color correction module, used for color correction of digital images of fabric samples; An image decomposition module, used for decomposing the fabric image into a cartoon part and a texture part by using an image decomposition technology; The clustering segmentation module is used to perform clustering segmentation on the cartoon part to obtain a color separation map of the fabric image; A grayscale adjustment module is used to convert the image to be color-changed and the target color image into grayscale images, calculate their mean and standard deviation, and adjust the grayscale channel of the image to be color-changed according to the mean and standard deviation; Grayscale deviation calculation module, used to calculate the grayscale deviation of the adjusted grayscale image and expand it to three channels; The color-changing module of the color separation image is used to calculate the RGB mean value of the target color image and expand it to the size of the image to be changed. The expanded color mean value is added to the expanded grayscale deviation to obtain the color-changing result image of the color separation image; The color-changing result output module is used to merge the color-changing result image of the color separation image with other color separation images into a complete color-changing result image.
10. A high-fidelity color-changing soft proofing device for fabrics based on color mapping, characterized in that: include: A processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute a high-fidelity color-changing soft proofing method for fabrics based on color mapping as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image analysis method for embroidery fabric design colors
CN104036529A
Visual high-fidelity textile fabric color changing method and system
CN115797260A