Appearance simulation of section-dyed yarn knitted fabrics based on the B-spline coil model
The section-dyed yarn,characterized by unique colors and textures,is widely utilized in the field of fashion textiles.Fabrics made from section-dyed yarns are highly favored for their vibrant and diverse color appearances.To address the randomness and energy consumption issues during the production and sampling process of section-dyed yarns,as well as the low fidelity in simulating fabric authenticity,this paper proposed a simulation method for section-dyed yarn knitted fabrics based on the B-spline coil model.Initially,in order to extract the main surface texture information of the yarn from the original images,image processing techniques,including threshold segmentation Otsu algorithm and morphological open and close operations,were applied to preprocess the collected section-dyed yarn images.Subsequently,to map the extracted main yarn texture into coil shapes,data points were extracted along the course of the knitting loops from the real fabric image.Afterwards,the B-spline coil curve was constructed by using the least square fitting technique.During the mapping process based on these curves,appropriate pixel offsets were needed according to the B-spline normals to achieve the curved effect.The collected yarn texture was linear,resulting in blank pixels at curved sections of the knitted loop after mapping,so nearest-neighbor interpolation was employed to fill these gaps and ensure the integrity of the mapped coils.Ultimately,a method of arranging coil images horizontally and vertically was used to simulate the fabric.The paper viewed fabric weaving as a process in which coil images increased from left to right and from bottom to top,with a start from the lower-left corner.To establish the interlocking relationship between coils,a Boolean matrix was utilized to eliminate pixel overlap positions in intertwined coils based on the simulated fabric organization.Under certain lighting conditions,different positions of the coils exhibited varying brightness effects on the fabric surface.To enhance the realism of the fabric,this study adjusted the grayscale ratios of the coils to create brightness variations.Linear interpolation was employed to achieve a smooth transition between shaded and unshaded areas for a natural gradient effect.Moreover,the proposed simulation method,after obtaining yarn texture and color parameters,enabled the rapid display of serialized products by changing yarn colors and arrangement cycles.The research results demonstrate that the simulated fabric is generally consistent with real fabric in terms of appearance and color arrangement.The simulation method,based on the real section-dyed yarn texture,allows for the rapid change of yarn colors and the display of the fabric's color,texture,and pattern effects.This method effectively enhances the authenticity of simulating section-dyed yarn fabrics and reduces the difficulty and cost of sample production for businesses.