


技术领域technical field
本发明属于计算机数字图像处理技术领域,具体涉及一种视觉高保真纺织面料换色方法及系统。The invention belongs to the technical field of computer digital image processing, and in particular relates to a visual high-fidelity textile fabric color changing method and system.
背景技术Background technique
纺织面料打样是纺织生产中的关键环节,一方面,通过纺织面料打样技术,企业可以跟客户对产品进行客观有效的沟通,企业可以跟客户进行客观有效的产品沟通,以确定产品的生产配方和工艺参数,另一方面,纺织面料打样技术是企业进行新产品和新款式研发的重要支撑。Textile fabric proofing is a key link in textile production. On the one hand, through textile fabric proofing technology, enterprises can communicate objectively and effectively with customers about products, and enterprises can communicate objectively and effectively with customers to determine the production formula and Process parameters, on the other hand, textile fabric proofing technology is an important support for enterprises to develop new products and new styles.
与纺织设计流程中的屏幕模拟打样技术不同,纺织面料的实体打样产品相对于屏幕模拟打样而言,视觉感知效果更加真实。然而,纺织面料的实际打样不仅周期长、人力物力耗费大、过程较为繁琐,而且纺织面料打样过程涉及包括织物类型、织物颜色以及纺织工艺参数在内的诸多复杂因素。以棉纺生产中的色织和色纺工艺为例,不同颜色纱线与各种纺织工艺参数(如针数、织法、克重、配比等)匹配打样时,能够得到成千上万种打样参数的不同组合,在面向新产品和新款式研发设计时,将所有的工艺参数与颜色组合进行实际打样,对于打样技术人员而言工作量巨大、负担重、周期长,执行起来存在困难,并且大部分的最终打样品不被选用,造成巨大的浪费。Different from the screen simulation proofing technology in the textile design process, the visual perception effect of the physical proofing products of textile fabrics is more realistic than that of the screen simulation proofing. However, the actual proofing of textile fabrics is not only a long cycle, a lot of manpower and material resources, and a cumbersome process, but also involves many complicated factors including fabric type, fabric color and textile process parameters. Taking the dyed weaving and dyed spinning process in cotton spinning production as an example, when different color yarns are matched with various textile process parameters (such as needle number, weaving method, gram weight, proportioning, etc.) For different combinations of proofing parameters, when developing and designing new products and styles, all the process parameters and color combinations are actually proofed. For the proofing technicians, the workload is huge, the burden is heavy, the cycle is long, and it is difficult to implement. And most of the final samples are not selected, resulting in huge waste.
发明内容Contents of the invention
本发明的目的是为了解决背景技术中所述问题,提出一种视觉高保真纺织面料换色方法。首先搭建均匀光照纺织面料图像数字拍摄系统,建立纺织面料高保真采集技术;利用拍摄系统拍摄标准色卡数字图像,并依据色卡标准颜色数据,对数码相机进行颜色特性化校正,得到颜色校正模型;利用拍摄系统拍摄待换色纺织面料获得数字图像,并进行颜色校正,得到待换色纺织面料颜色校正后的数字图像;设定待换色纺织面料的目标颜色;若待换纺织色面料为单色面料,则直接对其进行换色,若待换色纺织面料是多色面料,则首先对其进行图像分割处理,得到每种颜色对应的子图像,然后对任意待换色子图像进行换色;最后对所有换色子图像进行合并,得到多色纺织面料的最终换色图。本发明在结合颜色校正实现视觉高保真的色彩再现基础上,综合计算机图像处理技,通过构建纺织面料图像纹理模板和高保真的颜色映射技术,实现了视觉高保真纺织面料换色方法,具有重要应用价值。The object of the present invention is to propose a method for changing the color of textile fabrics with high visual fidelity in order to solve the problems described in the background technology. Firstly, build a uniformly illuminated textile fabric image digital shooting system, and establish high-fidelity acquisition technology for textile fabrics; use the shooting system to shoot digital images of standard color cards, and perform color characteristic correction on digital cameras based on the standard color data of the color card, and obtain a color correction model ; Utilize the shooting system to shoot the textile fabric to be changed in color to obtain a digital image, and perform color correction to obtain the digital image after the color correction of the textile fabric to be changed in color; set the target color of the textile fabric to be changed in color; if the textile color fabric to be changed is For single-color fabrics, change the color directly. If the textile fabric to be changed is a multi-color fabric, first perform image segmentation processing on it to obtain sub-images corresponding to each color, and then perform any color-changing sub-image Color-changing; finally, all color-changing sub-images are merged to obtain the final color-changing map of the multi-color textile fabric. Based on the combination of color correction to realize visual high-fidelity color reproduction, the present invention integrates computer image processing technology, and realizes a visual high-fidelity textile fabric color-changing method by constructing a textile fabric image texture template and high-fidelity color mapping technology, which has important Value.
本发明的技术方案为一种视觉高保真纺织面料换色方法,具体包括以下步骤:The technical solution of the present invention is a method for changing the color of textile fabrics with high visual fidelity, which specifically includes the following steps:
步骤1,搭建均匀光照纺织面料图像数字拍摄系统;Step 1, build a uniformly illuminated textile fabric image digital shooting system;
步骤2,利用拍摄系统拍摄标准色卡数字图像,并依据色卡标准颜色数据,对数码相机进行颜色特性化校正,得到颜色校正模型;Step 2, use the shooting system to take digital images of the standard color card, and perform color characteristic correction on the digital camera according to the standard color data of the color card to obtain a color correction model;
步骤3,相同拍摄条件下,利用拍摄系统拍摄待换色纺织面料获得数字图像;Step 3, under the same shooting conditions, use the shooting system to shoot the textile fabric to be color-changed to obtain a digital image;
步骤4,利用步骤2中建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像;Step 4, using the color correction model established in step 2 to perform color correction on the digital image of the textile fabric to be color-changed to obtain a color-corrected digital image of the textile fabric to be color-changed;
步骤5,设定待换色纺织面料的目标颜色;Step 5, setting the target color of the textile fabric to be changed;
步骤6,若待换色纺织面料为单色面料,则直接对其进行换色,得到换色纺织面料图像;Step 6, if the textile fabric to be color-changed is a monochrome fabric, then directly change its color to obtain the image of the color-changed textile fabric;
步骤7,若待换色纺织面料是多色面料,则首先对其进行图像分割处理,得到每种颜色对应的子图像,然后利用步骤6中所述换色方法,对任意待换色子图像进行换色;Step 7, if the textile fabric to be color-changed is a multi-color fabric, first perform image segmentation processing on it to obtain sub-images corresponding to each color, and then use the color-changing method described in step 6 to perform any color-changing sub-images change color;
步骤8,最后,将步骤7中所有换色子图像进行合并,得到多色纺织面料的最终换色图。Step 8, finally, merge all the color-changing sub-images in step 7 to obtain the final color-changing image of the multi-color textile fabric.
进一步的,步骤1中,搭建均匀光照纺织面料图像数字拍摄系统的具体方法为:在封闭式的照明灯箱内,采用模拟日光照明的全光谱照明灯管构建漫反射式照明条件,一方面可以防止外部环境的杂光对成像质量的影响,另一方面可以保证有效拍摄区域内光照的均匀性,此外,高质量的全光谱照明条件配合商业单反数码相机,可以充分再现纺织面料的颜色和纹理特征,达到视觉高保真的效果。Furthermore, in step 1, the specific method of building a digital image capture system for uniformly illuminated textile fabrics is as follows: in a closed lighting light box, a full-spectrum lighting tube that simulates daylight lighting is used to construct a diffuse reflection lighting condition, on the one hand, it can prevent The impact of stray light in the external environment on the imaging quality, on the other hand, can ensure the uniformity of illumination in the effective shooting area. In addition, high-quality full-spectrum lighting conditions can be combined with commercial SLR digital cameras to fully reproduce the color and texture characteristics of textile fabrics. , to achieve a high-fidelity visual effect.
进一步的,步骤2中,依据色卡标准颜色数据对数码相机进行颜色特性化校正,获得颜色校正模型的方法如下:首先,利用分光光度计测量获得色卡的XYZ三刺激值颜色数据C,依据色度学理论,三刺激值XYZ的测量原理如式(1)至式(2)所示,Further, in step 2, the digital camera is subjected to color characteristic correction according to the standard color data of the color card, and the method of obtaining the color correction model is as follows: First, the XYZ tristimulus value color data C of the color card is obtained by measuring with a spectrophotometer, according to Chromaticity theory, the measurement principle of tristimulus value XYZ is shown in formula (1) to formula (2),
其中,in,
式中,x(λ)、y(λ)和z(λ)为标准观察者颜色匹配函数,E(λ)为物体的光谱反射率,S(λ)为光源的相对光谱功率分布函数,λ为波长,k为调节因子,X、Y和Z分别为色卡的三刺激值数据,m为色卡中颜色的数量,XYZi为第i个颜色的三刺激值,C为包含所有色卡的三刺激值矩阵,上标‘T’为转置符号。In the formula, x(λ), y(λ) and z(λ) are standard observer color matching functions, E(λ) is the spectral reflectance of the object, S(λ) is the relative spectral power distribution function of the light source, λ is the wavelength, k is the adjustment factor, X, Y and Z are the tristimulus value data of the color card, m is the number of colors in the color card, XYZi is the tristimulus value of the i-th color, and C is the tristimulus value containing all color cards The matrix of tristimulus values, the superscript 'T' is the transpose symbol.
其次,利用三刺激值XYZ到标准RGB颜色数据的转换关系矩阵M,如式(4)所示,计算得到色卡的标准RGB颜色数据Ds,具体如式(5)所示:Secondly, using the conversion relationship matrix M from the tristimulus value XYZ to the standard RGB color data, as shown in formula (4), the standard RGB color data Ds of the color card is calculated, as shown in formula (5):
Ds=MC, (5)Ds =MC, (5)
然后,利用拍摄系统拍摄色卡的数字图像,以k像素为边长,提取每个色块中心k×k像素区域的所有RGB值,并计算其平均值,得到色卡的拍摄RGB颜色数据Dc;Then, use the shooting system to take digital images of the color card, take k pixels as the side length, extract all the RGB values of the k×k pixel area in the center of each color block, and calculate the average value to obtain the captured RGB color data D of the color cardc ;
其次,利用色卡的标准RGB颜色数据Ds和拍摄RGB颜色数据Dc计算颜色校正模型,方法如下:Secondly, use the standard RGB color data Ds of the color card and the captured RGB color data Dc to calculate the color correction model, the method is as follows:
1)对色卡的拍摄RGB颜色数据进行根多项式扩展,以一个颜色数据和三阶的根多项式扩展为例,具体如式(6)所示,1) Carry out root polynomial expansion on the captured RGB color data of the color card, taking a color data and third-order root polynomial expansion as an example, specifically as shown in formula (6),
式中,r、g和b分别为一个颜色的R通道、G通道和B通道的颜色值,上标‘T’为转置符号,dexp表示根多项式扩展后的颜色值向量。In the formula, r, g, and b are the color values of the R channel, G channel, and B channel of a color, respectively, the superscript 'T' is the transpose symbol, and dexp represents the color value vector after the root polynomial expansion.
2)利用伪逆算法,由色卡标准RGB颜色数据Ds和拍摄RGB颜色数据Dc的扩展矩阵Dexp计算颜色校正模型Q的方法如下:2) Using the pseudo-inverse algorithm, the method of calculating the color correction model Q from the color card standard RGB color data Ds and the expansion matrix Dexp of the captured RGB color data Dc is as follows:
式中,Ds色卡标准RGB颜色数据,Dexp为色卡拍摄RGB颜色数据Dc的扩展数据,Q为颜色校正模型,上标‘T’为转置符号,上标‘-1’表示求逆运算,λ为正则化约束系数,I为单位矩阵,其中λ的值通常取0.001。In the formula, Ds is the standard RGB color data of the color card, Dexp is the extended data of the RGB color data Dc captured by the color card, Q is the color correction model, the superscript 'T' is the transposition symbol, and the superscript '-1' means Inverse operation, λ is the regularization constraint coefficient, I is the identity matrix, where the value of λ is usually 0.001.
最后,得到颜色校正模型Q,并且对于任意拍摄的纺织面料数字图像数据,均可采用颜色模型对其颜色数据进行标准化校正,进一步提升颜色的准确性和视觉保真效果。Finally, the color correction model Q is obtained, and for any digital image data of textile fabrics, the color model can be used to standardize and correct the color data, further improving the accuracy of color and visual fidelity.
进一步的,步骤3中,利用拍摄系统拍摄待换色纺织面料获得数字图像的具体方法为,在与拍摄色卡完全一致的拍摄参数下,将待换色纺织面料平铺于拍摄系统的拍摄区域,拍摄获得待换色纺织面料的数字图像。Further, in step 3, the specific method of using the shooting system to shoot the textile fabric to be color-changed to obtain a digital image is to spread the textile fabric to be color-changed on the shooting area of the shooting system under the shooting parameters that are completely consistent with the shooting color card , take a digital image of the textile fabric to be color-changed.
进一步的,步骤4中,利用步骤2中建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像的方法如式(8)所示:Further, in step 4, using the color correction model established in step 2, the digital image of the textile fabric to be color-changed is color-corrected, and the method for obtaining the color-corrected digital image of the textile fabric to be color-changed is shown in formula (8):
Dimg_c=QDimg, (8)Dimg_c = QDimg , (8)
式中,Dimg为待换色纺织面料数字图像数据,Q为颜色校正模型,Dimg_c为颜色校正后的待换色纺织面料数字图像数据。In the formula, Dimg is the digital image data of the textile fabric to be color-changed, Q is the color correction model, and Dimg_c is the digital image data of the textile fabric to be color-changed after color correction.
进一步的,步骤5中,待换色纺织面料的目标颜色的设定可以有多种方式,设计师可以根据创意设定目标颜色,也可以从现有公开的标准色彩体系中选定目标颜色,还可以依据客户实际来样的测量结果,按照步骤2中所述标准RGB颜色计算方法,计算出目标颜色。Further, in step 5, there are many ways to set the target color of the textile fabric to be color-changed. The designer can set the target color according to creativity, or select the target color from the existing public standard color system. The target color can also be calculated according to the standard RGB color calculation method described in step 2 based on the measurement results of the customer's actual samples.
进一步的,步骤6中,对单色面料换色的具体方法如下:Further, in step 6, the specific method of changing the color of the monochromatic fabric is as follows:
首先,利用计算机图像处理相关方法将待换色纺织面料图像灰度化,从而获得待换色纺织面料图像纹理模板,将彩色图像转换为灰度图像的方法如式(9)所示:First of all, use computer image processing related methods to grayscale the image of the textile fabric to be color-changed, thereby obtaining the image texture template of the textile fabric to be color-changed, and convert the color image into a grayscale image as shown in formula (9):
y=0.299*r+0.587*g+0.144*b, (9)y=0.299*r+0.587*g+0.144*b, (9)
式中,y表示纺织面料图像任一像素点的灰度值,r表示该像素点红色通道的颜色值,g表示该像素点绿色通道的颜色值,b表示该像素点蓝色通道的颜色值。In the formula, y represents the gray value of any pixel in 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 .
然后,利用纹理特征保持的颜色映射方法,将目标颜色映射至待换色纺织面料图像纹理模板,得到初始换色图像Dt,具体实现方法如式(10)至式(11)所示,即对于待换色纺织面料图像纹理模板的任一像素点,用目标颜色值叠加经过调整系数k调整后的灰度偏差,得到该像素点换色后的颜色数据。Then, using the color mapping method of texture feature preservation, the target color is mapped to the image texture template of the textile fabric to be color-changed, and the initial color-changed image Dt is obtained. The specific implementation method is shown in formula (10) to formula (11), namely For any pixel point of the image texture template of the textile fabric to be color-changed, the target color value is superimposed on the gray scale deviation adjusted by the adjustment coefficient k to obtain the color data of the pixel point after color-changing.
其中,in,
式中,r、g和b表示该像素点红、绿、蓝三通道的颜色值,k为灰度偏差调整系数,计算方法如式(11)所示,其中σR、σG和σB为待换色纺织面料图像红、绿、蓝三个颜色通道的标准差,σY为待换色纺织面料灰度图像的标准差,Δy为该像素点的灰度值相对于待换色纺织面料灰度图像平均灰度值的偏差,rt、gt和bt分别表示该像素点换色之后的红、绿、蓝三通道颜色值。In the formula, r, g and b represent the color values of the red, green and blue channels of the pixel, and k is the adjustment coefficient of the gray scale deviation. The calculation method is shown in formula (11), where σR , σG and σB is the standard deviation of the red, green, and blue color channels of the textile fabric image to be changed, σY is the standard deviation of the gray image of the textile fabric to be changed, and Δy is the gray value of the pixel relative to the color of the textile to be changed The deviation of the average gray value of the fabric gray image, rt , gt and bt represent the red, green and blue three-channel color values of the pixel point after color change.
最后,依据目标颜色值和换色后的纺织面料图像Dt,对初始换色后的纺织面料图像总体平均灰度进行校正,使得换色面料的图像的总体平均灰度与目标颜色的灰度一致,校正方法如式(12)所示,Finally, according to the target color value and the textile fabric image Dt after the color change, the overall average gray level of the textile fabric image after the initial color change is corrected, so that the overall average gray level of the color-changed fabric image is consistent with the gray level of the target color Consistent, the correction method is shown in formula (12),
式中,ys为目标颜色的灰度值,yt为初始换色纺织面料任一像素点的灰度值,rt、gt和bt分别为初始换色纺织面料对应像素点的红、绿、蓝三通道颜色值,rt_f、gt_f和bt_f分别为经过灰度校正的换色纺织面料Df对应像素点的红、绿、蓝三通道颜色值。In the formula, ys is the gray value of the target color, yt is the gray value of any pixel of the initial color-changing textile fabric, rt , gt and bt are the red values of the corresponding pixel of the initial color-changing textile fabric , green and blue three-channel color values, rt_f , gt_f and bt_f are respectively the red, green and blue three-channel color values of the corresponding pixels of the color-changing textile fabric Df after gray scale correction.
进一步的,步骤7中,对于多色纺织面料,首先对其进行图像分割,得到每种颜色的分布图,然后针对需要换色的颜色子图,利用上述步骤6中的方法完成目标颜色的换色处理。图像分割的方法多种多样,对于多色纺织面料图像的高精度分割,可参考发明人已发表学术论文中基于改进超像素的古代壁画图像分割优化方法(见参考文献1),以完成多色纺织面料图像的精细化分割,也可采用其他能够完成多色纺织面料图像精细化分割的方法或算法。Further, in step 7, for multi-color textile fabrics, image segmentation is first performed to obtain the distribution map of each color, and then for the color sub-graph that needs to be changed, the method in step 6 above is used to complete the target color change. color processing. There are various methods of image segmentation. For the high-precision segmentation of multi-color textile fabric images, reference can be made to the optimization method for image segmentation of ancient murals based on improved superpixels in the academic papers published by the inventor (see reference 1), in order to complete multi-color image segmentation. For the refined segmentation of textile fabric images, other methods or algorithms that can complete the fine segmentation of multi-color textile fabric images can also be used.
参考文献1:Jinxing Liang,Anping Liu,Jing Zhou,et al.Optimized methodfor segmentation of ancient mural images based on superpixel algorithm.DOI:10.3389/fnins.2022.1031524Reference 1: Jinxing Liang, Anping Liu, Jing Zhou, et al. Optimized method for segmentation of ancient mural images based on superpixel algorithm. DOI: 10.3389/fnins.2022.1031524
进一步的,步骤8中,将步骤7中所有换色子图像进行合并,得到多色面料的最终换色图图像。Further, in step 8, all the color-changing sub-images in step 7 are combined to obtain the final color-changing image of the multi-color fabric.
本发明还提供一种视觉高保真纺织面料换色系统,包括如下模块:The present invention also provides a visual high-fidelity textile fabric color changing system, including the following modules:
拍摄系统搭建模块,用于搭建均匀光照纺织面料图像数字拍摄系统;The shooting system building module is used to build a digital shooting system for uniformly illuminated textile fabric images;
颜色校正模型获取模块,用于利用拍摄系统拍摄标准色卡数字图像,并依据色卡标准颜色数据,对数码相机进行颜色特性化校正,得到颜色校正模型;The color correction model acquisition module is used to use the shooting system to take digital images of standard color cards, and perform color characteristic correction on digital cameras according to the standard color data of the color cards to obtain color correction models;
数字图像获取模块,用于在相同拍摄条件下,利用拍摄系统拍摄待换色纺织面料获得数字图像;The digital image acquisition module is used to obtain a digital image by using the imaging system to capture the textile fabric to be color-changed under the same shooting conditions;
颜色校正模块,用于利用建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像;The color correction module is used to use the established color correction model to perform color correction on the digital image of the textile fabric to be color-changed to obtain a color-corrected digital image of the textile fabric to be color-changed;
目标颜色设定模块,用于设定待换色纺织面料的目标颜色;The target color setting module is used to set the target color of the textile fabric to be changed in color;
单色换色模块,若待换色纺织面料为单色面料,则直接对其进行换色,得到换色纺织面料图像;Monochrome color change module, if the textile fabric to be color-changed is a monochrome fabric, then directly change its color to obtain the image of the color-changed textile fabric;
多色换色模块,若待换色纺织面料是多色面料,则首先对其进行图像分割处理,得到每种颜色对应的子图像,然后利用单色换色模块中所述换色方法,对任意待换色子图像进行换色;In the multi-color color-changing module, if the textile fabric to be color-changed is a multi-color fabric, image segmentation processing is first performed on it to obtain sub-images corresponding to each color, and then the color-changing method described in the single-color color-changing module is used to Change the color of any sub-image to be changed;
合并模块,将所有换色子图像进行合并,得到多色纺织面料的最终换色图。The merging module merges all the color-changing sub-images to obtain the final color-changing map of the multi-color textile fabric.
进一步的,获得颜色校正模型的方法如下;Further, the method for obtaining the color correction model is as follows;
首先,利用分光光度计测量获得色卡的XYZ三刺激值颜色数据C,依据色度学理论,三刺激值XYZ的测量原理如式(1)至式(2)所示,First, use a spectrophotometer to measure the XYZ tristimulus value color data C of the color card. According to the theory of colorimetry, the measurement principle of the tristimulus value XYZ is shown in formula (1) to formula (2),
其中,in,
式中,x(λ)、y(λ)和z(λ)为标准观察者颜色匹配函数,E(λ)为物体的光谱反射率,S(λ)为光源的相对光谱功率分布函数,λ为波长,k为调节因子,X、Y和Z分别为色卡的三刺激值数据,m为色卡中颜色的数量,XYZi为第i个颜色的三刺激值,C为包含所有色卡的三刺激值矩阵,上标‘T’为转置符号;In the formula, x(λ), y(λ) and z(λ) are standard observer color matching functions, E(λ) is the spectral reflectance of the object, S(λ) is the relative spectral power distribution function of the light source, λ is the wavelength, k is the adjustment factor, X, Y and Z are the tristimulus value data of the color card, m is the number of colors in the color card, XYZi is the tristimulus value of the i-th color, and C is the tristimulus value containing all color cards The tristimulus value matrix of , the superscript 'T' is the transpose symbol;
其次,利用三刺激值XYZ到标准RGB颜色数据的转换关系矩阵M,如式(4)所示,计算得到色卡的标准RGB颜色数据Ds,具体如式(5)所示:Secondly, using the conversion relationship matrix M from the tristimulus value XYZ to the standard RGB color data, as shown in formula (4), the standard RGB color data Ds of the color card is calculated, as shown in formula (5):
Ds=MC, (5)Ds =MC, (5)
然后,利用拍摄系统拍摄色卡的数字图像,以k像素为边长,提取每个色块中心k×k像素区域的所有RGB值,并计算其平均值,得到色卡的拍摄RGB颜色数据Dc;Then, use the shooting system to take digital images of the color card, take k pixels as the side length, extract all the RGB values of the k×k pixel area in the center of each color block, and calculate the average value to obtain the captured RGB color data D of the color cardc ;
其次,利用色卡的标准RGB颜色数据Ds和拍摄RGB颜色数据Dc计算颜色校正模型,方法如下:Secondly, use the standard RGB color data Ds of the color card and the captured RGB color data Dc to calculate the color correction model, the method is as follows:
1)对色卡的拍摄RGB颜色数据进行根多项式扩展,以一个颜色数据和三阶的根多项式扩展为例,具体如式(6)所示,1) Carry out root polynomial expansion on the captured RGB color data of the color card, taking a color data and third-order root polynomial expansion as an example, specifically as shown in formula (6),
式中,r、g和b分别为一个颜色的R通道、G通道和B通道的颜色值,上标‘T’为转置符号,dexp表示根多项式扩展后的颜色值向量。In the formula, r, g, and b are the color values of the R channel, G channel, and B channel of a color, respectively, the superscript 'T' is the transpose symbol, and dexp represents the color value vector after the root polynomial expansion.
2)利用伪逆算法,由色卡标准RGB颜色数据Ds和拍摄RGB颜色数据Dc的扩展矩阵Dexp计算颜色校正模型Q的方法如下:2) Using the pseudo-inverse algorithm, the method of calculating the color correction model Q from the color card standard RGB color data Ds and the expansion matrix Dexp of the captured RGB color data Dc is as follows:
式中,Ds色卡标准RGB颜色数据,Dexp为色卡拍摄RGB颜色数据Dc的扩展数据,Q为颜色校正模型,上标‘T’为转置符号,上标‘-1’表示求逆运算,λ为正则化约束系数,I为单位矩阵;In the formula, Ds is the standard RGB color data of the color card, Dexp is the extended data of the RGB color data Dc captured by the color card, Q is the color correction model, the superscript 'T' is the transposition symbol, and the superscript '-1' means Inverse operation, λ is the regularization constraint coefficient, I is the identity matrix;
最后,得到颜色校正模型Q。Finally, the color correction model Q is obtained.
进一步的,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像的方法如式(8)所示:Further, the method of performing color correction on the digital image of the textile fabric to be color-changed to obtain the color-corrected digital image of the textile fabric to be color-changed is shown in formula (8):
Dimg_c=QDimg, (8)Dimg_c = QDimg , (8)
式中,Dimg为待换色纺织面料数字图像数据,Q为颜色校正模型,Dimg_c为颜色校正后的待换色纺织面料数字图像数据。In the formula, Dimg is the digital image data of the textile fabric to be color-changed, Q is the color correction model, and Dimg_c is the digital image data of the textile fabric to be color-changed after color correction.
进一步的,对单色面料换色的具体方法如下:Further, the specific method of changing the color of monochromatic fabrics is as follows:
首先,利用计算机图像处理相关方法将待换色纺织面料图像灰度化,从而获得待换色纺织面料图像纹理模板,将彩色图像转换为灰度图像的方法如式(9)所示:First of all, use computer image processing related methods to grayscale the image of the textile fabric to be color-changed, thereby obtaining the image texture template of the textile fabric to be color-changed, and convert the color image into a grayscale image as shown in formula (9):
y=0.299*r+0.587*g+0.144*b, (9)y=0.299*r+0.587*g+0.144*b, (9)
式中,y表示纺织面料图像任一像素点的灰度值,r表示该像素点红色通道的颜色值,g表示该像素点绿色通道的颜色值,b表示该像素点蓝色通道的颜色值;In the formula, y represents the gray value of any pixel in 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 ;
然后,利用纹理特征保持的颜色映射方法,将目标颜色映射至待换色纺织面料图像纹理模板,得到初始换色图像Dt,具体实现方法如式(10)至式(11)所示,即对于待换色纺织面料图像纹理模板的任一像素点,用目标颜色值叠加经过调整系数k调整后的灰度偏差,得到该像素点换色后的颜色数据。Then, using the color mapping method of texture feature preservation, the target color is mapped to the image texture template of the textile fabric to be color-changed, and the initial color-changed image Dt is obtained. The specific implementation method is shown in formula (10) to formula (11), namely For any pixel point of the image texture template of the textile fabric to be color-changed, the target color value is superimposed on the gray scale deviation adjusted by the adjustment coefficient k to obtain the color data of the pixel point after color-changing.
其中,in,
式中,r、g和b表示该像素点红、绿、蓝三通道的颜色值,k为灰度偏差调整系数,计算方法如式(11)所示,其中σR、σG和σB为待换色纺织面料图像红、绿、蓝三个颜色通道的标准差,σY为待换色纺织面料灰度图像的标准差,Δy为该像素点的灰度值相对于待换色纺织面料灰度图像平均灰度值的偏差,rt、gt和bt分别表示该像素点换色之后的红、绿、蓝三通道颜色值。In the formula, r, g and b represent the color values of the red, green and blue channels of the pixel, and k is the adjustment coefficient of the gray scale deviation. The calculation method is shown in formula (11), where σR , σG and σB is the standard deviation of the red, green, and blue color channels of the textile fabric image to be changed, σY is the standard deviation of the gray image of the textile fabric to be changed, and Δy is the gray value of the pixel relative to the color of the textile to be changed The deviation of the average gray value of the fabric gray image, rt , gt and bt represent the red, green and blue three-channel color values of the pixel point after color change.
最后,依据目标颜色值和换色后的纺织面料图像Dt,对初始换色后的纺织面料图像总体平均灰度进行校正,使得换色面料的图像的总体平均灰度与目标颜色的灰度一致,校正方法如式(12)所示,Finally, according to the target color value and the textile fabric image Dt after the color change, the overall average gray level of the textile fabric image after the initial color change is corrected, so that the overall average gray level of the color-changed fabric image is consistent with the gray level of the target color Consistent, the correction method is shown in formula (12),
式中,ys为目标颜色的灰度值,yt为初始换色纺织面料任一像素点的灰度值,rt、gt和bt分别为初始换色纺织面料对应像素点的红、绿、蓝三通道颜色值,rt_f、gt_f和bt_f分别为经过灰度校正的换色纺织面料Df对应像素点的红、绿、蓝三通道颜色值。In the formula, ys is the gray value of the target color, yt is the gray value of any pixel of the initial color-changing textile fabric, rt , gt and bt are the red values of the corresponding pixel of the initial color-changing textile fabric , green and blue three-channel color values, rt_f , gt_f and bt_f are respectively the red, green and blue three-channel color values of the corresponding pixels of the color-changing textile fabric Df after gray scale correction.
本发明针对当前纺织面料实体打样存在周期长、大量浪费等问题,以计算机技术为基础,提出了一种视觉高保真纺织面料换色方法。方法在结合颜色校正实现视觉高保真的色彩再现基础上,综合计算机图像处理技,通过构建纺织面料图像纹理模板和高保真的颜色映射技术,实现了视觉高保真纺织面料换色。本方法能够辅助纺织企业技术人员进行高保真的换色打样,解决了对纺织面料实体打样的人力物力浪费问题,提升企业竞争力。Aiming at the problems of long period and large waste of current textile fabric entity proofing, the invention proposes a visual high-fidelity textile fabric color changing method based on computer technology. Methods On the basis of combining color correction to achieve visual high-fidelity color reproduction, integrated computer image processing technology, through the construction of textile fabric image texture templates and high-fidelity color mapping technology, visual high-fidelity textile fabric color change was realized. The method can assist technical personnel of textile enterprises to perform high-fidelity color-changing proofing, solves the waste of manpower and material resources for physical proofing of textile fabrics, and improves the competitiveness of enterprises.
附图说明Description of drawings
图1为本发明实施例的流程图。Fig. 1 is a flowchart of an embodiment of the present invention.
图2为本发明对单色面料的换色实例。Fig. 2 is the color changing example of the present invention to monochrome fabric.
图3为本发明对多色面料的换色实例。Fig. 3 is the color-changing example of the present invention to multi-color fabric.
具体实施方式Detailed ways
本发明技术方案具体实施时可由本领域技术人员采用计算机软件技术运行,结合提供本发明实施例具体描述如下。When the technical solution of the present invention is specifically implemented, it can be run by those skilled in the art using computer software technology, and the specific description is as follows in conjunction with providing the embodiments of the present invention.
如图1所示,实施例中提供了一种视觉高保真纺织面料换色方法,可以有效解决纺织面料实际打样不仅周期长、人力物力耗费大、过程较为繁琐等问题,在结合颜色校正实现视觉高保真的色彩再现基础上,进一步综合计算机图像处理技,通过构建纺织面料图像纹理模板和高保真的颜色映射技术,实现了视觉高保真纺织面料换色方法,具有广阔的市场前景和重要应用价值。实施例中,以发明人搭建的封闭式照明灯箱系统为基础,配置尼康D7200数码相机,组成拍摄系统,以单色和多色色织面料样本为基础,对本发明的方法进行具体说明。需要说明的是,本发明并不仅仅局限于上述数据样本和应用支持,对于任意能实现上述设备功能的同等性质的设备同样适用。As shown in Figure 1, the embodiment provides a visual high-fidelity textile fabric color-changing method, which can effectively solve the problems of the actual proofing of textile fabrics, such as long cycle time, large manpower and material resources, and cumbersome process. On the basis of high-fidelity color reproduction, computer image processing technology is further integrated, and by constructing textile fabric image texture templates and high-fidelity color mapping technology, a visual high-fidelity textile fabric color change method has been realized, which has broad market prospects and important application value . In the embodiment, based on the enclosed lighting light box system built by the inventor, Nikon D7200 digital camera is configured to form a shooting system, and the method of the present invention is specifically described on the basis of monochrome and multicolor yarn-dyed fabric samples. It should be noted that the present invention is not limited to the above-mentioned data sample and application support, and is also applicable to any device of the same nature that can realize the functions of the above-mentioned device.
实施例主要包括以下步骤:Embodiment mainly comprises the following steps:
步骤1、搭建均匀光照纺织面料图像数字拍摄系统;Step 1. Build a uniformly illuminated textile fabric image digital shooting system;
实施例中,在封闭式的照明灯箱内,采用模拟日光照明的全光谱照明灯管构建漫反射式照明条件,一方面可以防止外部环境的杂光对成像质量的影响,另一方面可以保证有效拍摄区域内光照的均匀性,此外,高质量的全光谱照明条件配合商业单反数码相机,可以充分再现纺织面料的颜色和纹理特征,达到视觉高保真的效果。In the embodiment, in the closed lighting light box, full-spectrum lighting tubes that simulate daylight lighting are used to construct diffuse reflection lighting conditions. On the one hand, it can prevent the impact of stray light from the external environment on the imaging quality, and on the other hand, it can ensure effective lighting. The uniformity of illumination in the shooting area. In addition, high-quality full-spectrum lighting conditions combined with commercial SLR digital cameras can fully reproduce the color and texture characteristics of textile fabrics to achieve visual high-fidelity effects.
步骤2、利用拍摄系统拍摄标准色卡数字图像,并依据色卡标准颜色数据,对数码相机进行颜色特性化校正,得到颜色校正模型;Step 2. Use the shooting system to take digital images of the standard color card, and perform color characteristic correction on the digital camera according to the standard color data of the color card to obtain a color correction model;
实施例中,采用ColorChecker SG色卡作为建模样本,该色卡包含140个颜色,能够均匀覆盖自然界常见物体颜色,能够较好的对数码相机进行建模。In the embodiment, the ColorChecker SG color card is used as a modeling sample. The color card contains 140 colors, can evenly cover the colors of common objects in nature, and can better model digital cameras.
首先,利用分光光度计测量获得色卡的XYZ三刺激值颜色数据C,依据色度学理论,三刺激值XYZ的测量原理如式(1)至式(2)所示,First, use a spectrophotometer to measure the XYZ tristimulus value color data C of the color card. According to the theory of colorimetry, the measurement principle of the tristimulus value XYZ is shown in formula (1) to formula (2),
其中,in,
式中,x(λ)、y(λ)和z(λ)为标准观察者颜色匹配函数,E(λ)为物体的光谱反射率,S(λ)为光源的相对光谱功率分布函数,λ为波长,k为调节因子,X、Y和Z分别为色卡的三刺激值数据,m为色卡中颜色的数量,XYZi为第i个颜色的三刺激值,C为包含所有色卡的三刺激值矩阵,上标‘T’为转置符号。In the formula, x(λ), y(λ) and z(λ) are standard observer color matching functions, E(λ) is the spectral reflectance of the object, S(λ) is the relative spectral power distribution function of the light source, λ is the wavelength, k is the adjustment factor, X, Y and Z are the tristimulus value data of the color card, m is the number of colors in the color card, XYZi is the tristimulus value of the i-th color, and C is the tristimulus value containing all color cards The matrix of tristimulus values, the superscript 'T' is the transpose symbol.
其次,利用三刺激值XYZ到标准RGB颜色数据的转换关系矩阵M,如式(4)所示,计算得到色卡的标准RGB颜色数据Ds,具体如式(5)所示:Secondly, using the conversion relationship matrix M from the tristimulus value XYZ to the standard RGB color data, as shown in formula (4), the standard RGB color data Ds of the color card is calculated, as shown in formula (5):
Ds=MC, (5)Ds =MC, (5)
然后,利用实施例步骤1中搭建的拍摄系统拍摄色卡的数字图像,以50像素为边长,提取每个色块中心50×50像素区域的所有RGB值,并计算其平均值,得到色卡的拍摄RGB颜色数据Dc;Then, use the camera system built in step 1 of the embodiment to take a digital image of the color card, take 50 pixels as the side length, extract all the RGB values of the 50×50 pixel area in the center of each color block, and calculate the average value to obtain the color The shooting RGB color data Dc of the card;
其次,利用色卡的标准RGB颜色数据Ds和拍摄RGB颜色数据Dc计算颜色校正模型,方法如下:Secondly, use the standard RGB color data Ds of the color card and the captured RGB color data Dc to calculate the color correction model, the method is as follows:
1)对色卡的拍摄RGB颜色数据进行根多项式扩展,以一个颜色数据和三阶的根多项式扩展为例,具体如式(6)所示,1) Carry out root polynomial expansion on the captured RGB color data of the color card, taking a color data and third-order root polynomial expansion as an example, specifically as shown in formula (6),
式中,r、g和b分别为一个颜色的R通道、G通道和B通道的颜色值,上标‘T’为转置符号,dexp表示根多项式扩展后的颜色值向量。In the formula, r, g, and b are the color values of the R channel, G channel, and B channel of a color, respectively, the superscript 'T' is the transpose symbol, and dexp represents the color value vector after the root polynomial expansion.
2)利用伪逆算法,由色卡标准RGB颜色数据Ds和拍摄RGB颜色数据Dc的扩展矩阵Dexp计算颜色校正模型Q的方法如下:2) Using the pseudo-inverse algorithm, the method of calculating the color correction model Q from the color card standard RGB color data Ds and the expansion matrix Dexp of the captured RGB color data Dc is as follows:
式中,Ds色卡标准RGB颜色数据,Dexp为色卡拍摄RGB颜色数据Dc的扩展数据,Q为颜色校正模型,上标‘T’为转置符号,上标‘-1’表示求逆运算,λ为正则化约束系数,I为单位矩阵,其中λ的值通常取0.001。In the formula, Ds is the standard RGB color data of the color card, Dexp is the extended data of the RGB color data Dc captured by the color card, Q is the color correction model, the superscript 'T' is the transposition symbol, and the superscript '-1' means Inverse operation, λ is the regularization constraint coefficient, I is the identity matrix, where the value of λ is usually 0.001.
最后,得到颜色校正模型Q,并且对于任意拍摄的纺织面料数字图像数据,均可采用颜色模型对其颜色数据进行标准化校正,进一步提升颜色的准确性和视觉保真效果。Finally, the color correction model Q is obtained, and for any digital image data of textile fabrics, the color model can be used to standardize and correct the color data, further improving the accuracy of color and visual fidelity.
步骤3、相同拍摄条件下,利用拍摄系统拍摄待换色纺织面料获得数字图像;Step 3. Under the same shooting conditions, use the shooting system to shoot the textile fabric to be color-changed to obtain a digital image;
实施例中,利用拍摄系统拍摄待换色纺织面料获得数字图像的具体方法为,在与拍摄色卡完全一致的拍摄参数下,将待换色纺织面料平铺于拍摄系统的拍摄区域,拍摄获得待换色纺织面料的数字图像。实施例中分别拍摄一张单色色织面料和一张多色色织面料的图像,作为具体展示实例。In the embodiment, the specific method of using the imaging system to photograph the textile fabric to be color-changed to obtain a digital image is to spread the textile fabric to be color-changed on the imaging area of the imaging system under the shooting parameters that are completely consistent with the photographed color card, and photograph to obtain Digital image of the textile fabric to be color-changed. In the embodiment, images of a single-color yarn-dyed fabric and a multi-color yarn-dyed fabric are respectively taken as specific demonstration examples.
步骤4、利用步骤2中建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像;Step 4, using the color correction model established in step 2, to perform color correction on the digital image of the textile fabric to be color-changed, to obtain a color-corrected digital image of the textile fabric to be color-changed;
实施例中,利用步骤2中建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像的方法如式(8)所示:In the embodiment, using the color correction model established in step 2, the digital image of the textile fabric to be color-changed is color-corrected, and the method for obtaining the color-corrected digital image of the textile fabric to be color-changed is as shown in formula (8):
Dimg_c=QDimg, (8)Dimg_c = QDimg , (8)
式中,Dimg为待换色纺织面料数字图像数据,Q为颜色校正模型,Dimg_c为颜色校正后的待换色纺织面料数字图像数据。In the formula, Dimg is the digital image data of the textile fabric to be color-changed, Q is the color correction model, and Dimg_c is the digital image data of the textile fabric to be color-changed after color correction.
步骤5、设定待换色纺织面料的目标颜色;Step 5, setting the target color of the textile fabric to be changed;
实施例中,待换色纺织面料的目标颜色的设定可以有多种方式,设计师可以根据创意设定目标颜色,也可以从现有公开的标准色彩体系中选定目标颜色,还可以依据客户实际来样的测量结果,按照步骤2中所述标准RGB颜色计算方法,计算出目标颜色。本实施例采用制定目标颜色的方式,分别为单色色织面料和多色色织面料指定换色的颜色数据,其中单色色织面料的换色数据为[220,160,30],多色色织面料的目标色换色颜色数据为[180,50,10]。In the embodiment, there are many ways to set the target color of the textile fabric to be changed in color. The designer can set the target color according to creativity, or select the target color from the existing public standard color system. Calculate the target color according to the standard RGB color calculation method described in step 2 from the measurement results of the customer's actual samples. In this embodiment, the method of setting the target color is used to specify the color data of the color change for the monochrome yarn-dyed fabric and the multi-color yarn-dyed fabric respectively, wherein the color-change data of the monochrome yarn-dyed fabric is [220,160,30], and the multi-color yarn-dyed fabric The target color color change color data of is [180,50,10].
步骤6、若待换色纺织面料为单色面料,则直接对其进行换色,得到换色的纺织面料图像;Step 6. If the textile fabric to be color-changed is a monochromatic fabric, then directly change its color to obtain a color-changed textile fabric image;
实施例中,对单色色织面料换色的具体方法如下:In an embodiment, the specific method for changing the color of monochromatic yarn-dyed fabrics is as follows:
首先,利用计算机图像处理相关方法将待换色纺织面料图像灰度化,从而获得待换色纺织面料图像纹理模板,将彩色图像转换为灰度图像的方法如式(9)所示:First of all, use computer image processing related methods to grayscale the image of the textile fabric to be color-changed, thereby obtaining the image texture template of the textile fabric to be color-changed, and convert the color image into a grayscale image as shown in formula (9):
y=0.299*r+0.587*g+0.144*b, (9)y=0.299*r+0.587*g+0.144*b, (9)
式中,y表示纺织面料图像任一像素点的灰度值,r表示该像素点红色通道的颜色值,g表示该像素点绿色通道的颜色值,b表示该像素点蓝色通道的颜色值。In the formula, y represents the gray value of any pixel in 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 .
然后,利用纹理特征保持的颜色映射方法,将目标颜色映射至待换色纺织面料图像纹理模板,得到初始换色图像,具体实现方法如式(10)至式(11)所示,即对于待换色纺织面料图像纹理模板的任一像素点,用目标颜色值叠加经过调整系数k调整后的灰度偏差,得到该图像换色后的颜色数据。Then, using the color mapping method of texture feature preservation, the target color is mapped to the image texture template of the textile fabric to be color-changed, and the initial color-changed image is obtained. The specific implementation method is shown in formula (10) to formula (11). For any pixel of the color-changing textile fabric image texture template, the target color value is superimposed on the gray scale deviation adjusted by the adjustment coefficient k to obtain the color data of the image after color-changing.
其中,in,
式中,r、g和b表示该像素点红、绿、蓝三通道的颜色值,k为灰度偏差调整系数,计算方法如式(11)所示,其中σR、σG和σB为待换色纺织面料图像红、绿、蓝三个颜色通道的标准差,σY为待换色纺织面料灰度图像的标准差,Δy为该像素点的灰度值相对于待换色纺织面料灰度图像平均灰度值的偏差,rt、gt和bt分别表示该像素点换色之后的红、绿、蓝三通道颜色值。In the formula, r, g and b represent the color values of the red, green and blue channels of the pixel, and k is the adjustment coefficient of the gray scale deviation. The calculation method is shown in formula (11), where σR , σG and σB is the standard deviation of the red, green, and blue color channels of the textile fabric image to be changed, σY is the standard deviation of the gray image of the textile fabric to be changed, and Δy is the gray value of the pixel relative to the color of the textile to be changed The deviation of the average gray value of the fabric gray image, rt , gt and bt represent the red, green and blue three-channel color values of the pixel point after color change.
最后,依据目标颜色值和换色后的纺织面料图像Dt,对换色后的纺织面料图像总体平均灰度进行校正,使得换色面料的图像的总体平均灰度与目标颜色的灰度一致,校正方法如式(12)所示,Finally, according to the target color value and the textile fabric image Dt after the color change, the overall average gray level of the textile fabric image after the color change is corrected, so that the overall average gray level of the color-changed fabric image is consistent with the gray level of the target color , the correction method is shown in formula (12),
式中,ys为目标颜色的灰度值,yt为换色纺织面料任一像素点的灰度值,rt、gt和bt分别为换色纺织面料对应像素点的红、绿、蓝三通道颜色值,rt_f、gt_f和bt_f分别为经过灰度校正的换色纺织面料对应像素点的红、绿、蓝三通道颜色值。实施例的单色色织面料换色结果如附图2所示。In the formula, ys is the gray value of the target color, yt is the gray value of any pixel of the color-changing textile fabric, rt , gt and bt are the red and green colors of the corresponding pixel of the color-changing textile fabric , blue three-channel color value, rt_f , gt_f and bt_f are respectively the red, green and blue three-channel color values of the corresponding pixels of the color-changing textile fabric after gray scale correction. The color-changing result of the monochrome yarn-dyed fabric of embodiment is as shown in accompanying drawing 2.
步骤7、若待换色纺织面料是多色面料,则首先对其进行图像分割处理,得到每种颜色对应的子图像,然后利用步骤6中所述换色方法,对任意待换色子图像进行换色;Step 7. If the textile fabric to be color-changed is a multi-color fabric, first perform image segmentation processing on it to obtain sub-images corresponding to each color, and then use the color-changing method described in step 6 to perform any color-changing sub-images change color;
实施例中,对于多色纺织面料,首先其进行图像分割,得到每种颜色的分布图,然后针对需要换色的颜色子图,利用上述步骤6中的方法完成目标颜色的换色处理。图像分割的方法多种多样,对于多色纺织面料图像的高精度分割,可参考发明人已发表学术论文中基于改进超像素的古代壁画图像分割优化方法(见参考文献1),以完成多色纺织面料图像的精细化分割,也可采用其他能够完成多色纺织面料图像精细化分割的方法或算法。In the embodiment, for multi-color textile fabrics, image segmentation is first performed to obtain the distribution map of each color, and then for the color sub-image that needs to be changed, the method in step 6 above is used to complete the color change process of the target color. There are various methods of image segmentation. For the high-precision segmentation of multi-color textile fabric images, reference can be made to the optimization method for image segmentation of ancient murals based on improved superpixels in the academic papers published by the inventor (see reference 1), in order to complete multi-color image segmentation. For the refined segmentation of textile fabric images, other methods or algorithms that can complete the fine segmentation of multi-color textile fabric images can also be used.
参考文献1:Jinxing Liang,Anping Liu,Jing Zhou,et al.Optimized methodfor segmentation of ancient mural images based on superpixel algorithm.DOI:10.3389/fnins.2022.1031524Reference 1: Jinxing Liang, Anping Liu, Jing Zhou, et al. Optimized method for segmentation of ancient mural images based on superpixel algorithm. DOI: 10.3389/fnins.2022.1031524
本实施例中,由于测试的色织面料有两种颜色,故采用了著名的大津法(又称OSTU阈值分割方法),对双色的色织面料进行图像分割,并按照实施例中步骤6所述方法对其中的咖啡色进行换色。In this embodiment, since the yarn-dyed fabric tested has two colors, the famous Otsu method (also known as the OSTU threshold segmentation method) is used to segment the image of the two-color yarn-dyed fabric, and according to step 6 in the embodiment The method described above changes the color of the brown color therein.
步骤8、最后,将步骤7中所有换色子图像进行合并,得到多色纺织面料的最终换色图。Step 8. Finally, merge all the color-changing sub-images in step 7 to obtain the final color-changing image of the multi-color textile fabric.
实施例中,将换色后的子图与未换色的子图进行合并,得到最终的换色效果,最终换色效果如附图3所示。In the embodiment, the color-changed sub-picture is merged with the non-color-changed sub-picture to obtain the final color-changing effect, which is shown in FIG. 3 .
本发明实施例还提供一种视觉高保真纺织面料换色系统,包括如下模块:The embodiment of the present invention also provides a visual high-fidelity textile fabric color changing system, including the following modules:
拍摄系统搭建模块,用于搭建均匀光照纺织面料图像数字拍摄系统;The shooting system building module is used to build a digital shooting system for uniformly illuminated textile fabric images;
颜色校正模型获取模块,用于利用拍摄系统拍摄标准色卡数字图像,并依据色卡标准颜色数据,对数码相机进行颜色特性化校正,得到颜色校正模型;The color correction model acquisition module is used to use the shooting system to take digital images of standard color cards, and perform color characteristic correction on digital cameras according to the standard color data of the color cards to obtain color correction models;
数字图像获取模块,用于在相同拍摄条件下,利用拍摄系统拍摄待换色纺织面料获得数字图像;The digital image acquisition module is used to obtain a digital image by using the imaging system to capture the textile fabric to be color-changed under the same shooting conditions;
颜色校正模块,用于利用建立的颜色校正模型,对待换色纺织面料数字图像进行颜色校正,得到待换色纺织面料颜色校正后的数字图像;The color correction module is used to use the established color correction model to perform color correction on the digital image of the textile fabric to be color-changed to obtain a color-corrected digital image of the textile fabric to be color-changed;
目标颜色设定模块,用于设定待换色纺织面料的目标颜色;The target color setting module is used to set the target color of the textile fabric to be changed in color;
单色换色模块,若待换色纺织面料为单色面料,则直接对其进行换色,得到换色纺织面料图像;Monochrome color change module, if the textile fabric to be color-changed is a monochrome fabric, then directly change its color to obtain the image of the color-changed textile fabric;
多色换色模块,若待换色纺织面料是多色面料,则首先对其进行图像分割处理,得到每种颜色对应的子图像,然后利用单色换色模块中所述换色方法,对任意待换色子图像进行换色;In the multi-color color-changing module, if the textile fabric to be color-changed is a multi-color fabric, image segmentation processing is first performed on it to obtain sub-images corresponding to each color, and then the color-changing method described in the single-color color-changing module is used to Change the color of any sub-image to be changed;
合并模块,将所有换色子图像进行合并,得到多色纺织面料的最终换色图。The merging module merges all the color-changing sub-images to obtain the final color-changing map of the multi-color textile fabric.
各模块的具体实现方式和各步骤相应,本发明不予撰述。The specific implementation of each module is corresponding to each step, which is not described in the present invention.
本文中所描述的具体实施例仅仅是对本发明精神作举例说明。本发明所属技术领域的技术人员可以对所描述的具体实施例做各种各样的修改或补充或采用类似的方式替代,但并不会偏离本发明的精神或者超越所附权利要求书所定义的范围。The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which the present invention belongs can make various modifications or supplements to the described specific embodiments or adopt similar methods to replace them, but they will not deviate from the spirit of the present invention or go beyond the definition of the appended claims range.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211367817.3ACN115797260B (en) | 2022-11-03 | 2022-11-03 | A visual high-fidelity textile fabric color changing method and system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211367817.3ACN115797260B (en) | 2022-11-03 | 2022-11-03 | A visual high-fidelity textile fabric color changing method and system |
| Publication Number | Publication Date |
|---|---|
| CN115797260Atrue CN115797260A (en) | 2023-03-14 |
| CN115797260B CN115797260B (en) | 2023-07-07 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211367817.3AActiveCN115797260B (en) | 2022-11-03 | 2022-11-03 | A visual high-fidelity textile fabric color changing method and system |
| Country | Link |
|---|---|
| CN (1) | CN115797260B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117073842A (en)* | 2023-07-21 | 2023-11-17 | 武汉纺织大学 | Textile fabric photographing and color measuring method and system based on texture feature weighting correction |
| CN119963667A (en)* | 2025-01-14 | 2025-05-09 | 武汉纺织大学 | A fabric high-fidelity color-changing soft proofing method and system based on color mapping |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2010015196A1 (en)* | 2008-08-04 | 2010-02-11 | 香港纺织及成衣研发中心 | Device and method for testing fabric color |
| CN105354864A (en)* | 2015-09-25 | 2016-02-24 | 浙江大学 | Textile tissue color replacement simulation method with relatively high truth |
| CN111047539A (en)* | 2019-12-27 | 2020-04-21 | 上海工程技术大学 | A Color Calibration Algorithm for Fabric Image Based on Spectral Reflectance Reconstruction |
| CN112907483A (en)* | 2021-03-18 | 2021-06-04 | 武汉纺织大学 | Computer simulation method for colored fabric |
| CN114386295A (en)* | 2022-03-23 | 2022-04-22 | 武汉纺织大学 | A Fabric Computer Simulation Method Based on Color Spinning Color Separation and Color Change |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2010015196A1 (en)* | 2008-08-04 | 2010-02-11 | 香港纺织及成衣研发中心 | Device and method for testing fabric color |
| CN105354864A (en)* | 2015-09-25 | 2016-02-24 | 浙江大学 | Textile tissue color replacement simulation method with relatively high truth |
| CN111047539A (en)* | 2019-12-27 | 2020-04-21 | 上海工程技术大学 | A Color Calibration Algorithm for Fabric Image Based on Spectral Reflectance Reconstruction |
| CN112907483A (en)* | 2021-03-18 | 2021-06-04 | 武汉纺织大学 | Computer simulation method for colored fabric |
| CN114386295A (en)* | 2022-03-23 | 2022-04-22 | 武汉纺织大学 | A Fabric Computer Simulation Method Based on Color Spinning Color Separation and Color Change |
| Title |
|---|
| 张建海,张森林: "交互式彩色图像分色换色算法及实现", 纺织学报, no. 02* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117073842A (en)* | 2023-07-21 | 2023-11-17 | 武汉纺织大学 | Textile fabric photographing and color measuring method and system based on texture feature weighting correction |
| CN117073842B (en)* | 2023-07-21 | 2024-03-29 | 武汉纺织大学 | Textile fabric photographic colorimetry method and system based on texture feature weighted correction |
| CN119963667A (en)* | 2025-01-14 | 2025-05-09 | 武汉纺织大学 | A fabric high-fidelity color-changing soft proofing method and system based on color mapping |
| Publication number | Publication date |
|---|---|
| CN115797260B (en) | 2023-07-07 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107507250B (en) | Surface color and tongue color image color correction method based on convolutional neural network | |
| CN101621701B (en) | Correcting method of multiple projector display wall colors of arbitrary smooth curve screens independent of geometric correction | |
| US8947549B2 (en) | Spectral synthesis for image capturing device processing | |
| CN102244757B (en) | Color calibration method of large multi-projection screen based on projector-camera system | |
| CN103402117B (en) | Based on the video image color cast detection method of Lab chrominance space | |
| CN115797260A (en) | Visual high-fidelity textile fabric color changing method and system | |
| CN106531060B (en) | The bearing calibration of LED display bright chroma and device | |
| RU2450476C2 (en) | Device and method to determine optimal backlighting | |
| CN115855809B (en) | Automatic textile color fastness rating method based on spectrum reconstruction | |
| CN106204662B (en) | A kind of color of image constancy method under multiple light courcess environment | |
| CN106485288B (en) | An automatic identification method for colored fabric tissue | |
| CN105787508A (en) | Textile color identification method and system | |
| CN107886549B (en) | A fabric pattern color transfer method based on weaving texture detail enhancement | |
| CN114235153B (en) | A digital camera-based fabric color measurement method | |
| Wang et al. | Measuring perceptual color differences of smartphone photographs | |
| CN111896109A (en) | A Spectral Reconstruction Method Based on the Raw Response Values of Digital Cameras | |
| CN109671113B (en) | A method of measuring color matching of color-spun fabrics based on image technology | |
| CN111311695A (en) | A method for analyzing color difference of fair-faced concrete surface based on convolutional neural network | |
| CN117456014A (en) | Silk interweaving color mixing color prediction method based on deep learning method | |
| CN117132544A (en) | An image color cast detection method based on deep learning and color space transformation | |
| CN117073842A (en) | Textile fabric photographing and color measuring method and system based on texture feature weighting correction | |
| Su et al. | Developing a digital archive system for imperial Chinese robe in the Qing Dynasty | |
| CN109671044B (en) | A kind of more exposure image fusion methods decomposed based on variable image | |
| CN101959072A (en) | A color reproduction method for color surface projection display | |
| CN105072427B (en) | Automatic color balancing method among multiple projectors |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |