Colorimetric method for cloth and stitches
By using multiple color extraction algorithms and weighted similarity values calculated based on weight information, the system automatically selects the suture color number that is most similar to the fabric color. This solves the problems of low suture selection efficiency and individual differences in existing technologies, and enables intelligent color matching and improved product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JACK SEWING MASCH CO LTD
- Filing Date
- 2024-10-29
- Publication Date
- 2026-05-01
AI Technical Summary
In large and medium-sized pattern rooms, sewing workers and sewing managers need to compare the sample fabric and sewing thread colors based on experience, which leads to low sewing efficiency and differences in the sewing thread colors chosen by different people, making it difficult to accurately find sewing threads of similar colors.
Multiple color extraction algorithms are used to extract color values from fabric images. Color difference is calculated by combining the sewing database. Weighted similarity values are calculated using weight information, and the sewing color number that is most similar to the fabric color is automatically selected.
It enables intelligent color matching of fabric and thread, reducing the time spent manually finding threads, improving production efficiency, standardizing thread selection criteria, reducing individual differences, and improving product quality.
Smart Images

Figure CN121961968A_ABST
Abstract
Description
A method for color matching fabric and thread Technical Field
[0001] This invention relates to the field of garment sewing technology, and more particularly to a method for color matching of fabric and sewing thread. Background Technology
[0002] In large and medium-sized pattern-making workshops, sewing workers and thread supervisors rely on experience to compare the colors of sample fabrics and threads, a time-consuming and laborious process that impacts sewing efficiency. Furthermore, due to the wide variety of thread types, colors, and similar colors, sewing workers and thread supervisors need to compare hundreds or even thousands of threads with the fabric during actual sewing, resulting in very low efficiency. Additionally, due to individual differences in color sensitivity, different people may choose different thread colors for the same sample fabric, further complicating the selection of accurate threads. Summary of the Invention
[0003] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is to provide a method for color matching of fabric and sewing thread, which can realize intelligent color matching operation and reduce the time and difference of manually finding the nearest colored sewing thread.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0005] This invention provides a method for color matching between fabric and seam thread. The method involves acquiring a fabric image, extracting the fabric color from the image using multiple color extraction algorithms, and obtaining the fabric color value corresponding to each algorithm. It also involves acquiring seam thread data from a seam thread database, including seam thread color values for different colors and their corresponding color codes. The method calculates the color difference between the fabric color value corresponding to each color extraction algorithm and the seam thread color value from the seam thread data to obtain a similarity value. Furthermore, it acquires preset weight information for each color extraction algorithm, calculates a weighted similarity value based on the weight information and multiple similarity values, and finally obtains the seam thread color code with the highest similarity based on the weighted similarity value.
[0006] Preferably, the weighted similarity value is calculated based on weight information and multiple sets of similarity values, including: the weight information includes a preset weight coefficient for each color extraction algorithm, and the weighted similarity value is obtained by multiplying the similarity value of each color extraction algorithm by the weight coefficient.
[0007] Preferably, obtaining the suture color number with the highest similarity based on the weighted similarity value includes: sorting each color extraction algorithm from high to low according to the weighted similarity value and taking the suture color number corresponding to the first preset number of weighted similarity values, and taking the suture color number with the highest weighted similarity value among all the suture color numbers taken by the color extraction algorithms.
[0008] Preferably, selecting the stitch color number with the highest weighted similarity value among all stitch color numbers obtained by all color extraction algorithms includes: classifying all stitch color numbers obtained by all color extraction algorithms, accumulating the weighted similarity values of the same stitch color number obtained by different color extraction algorithms, and selecting the stitch color number with the highest accumulated weighted similarity value.
[0009] Preferably, the preset number of stitch color codes obtained by each color extraction algorithm is 3-6.
[0010] Preferably, the multiple color extraction algorithms include at least two of the following: statistical algorithms, clustering algorithms, and octree-based algorithms.
[0011] Preferably, the multiple color extraction algorithms include at least two of the following: statistical algorithms, clustering algorithms, octree-based algorithms, principal component analysis-based algorithms, and wavelet transform-based algorithms.
[0012] Preferably, the multiple color extraction algorithms include statistical algorithms, clustering algorithms, and octree-based algorithms, and the weight coefficient of each preset color extraction algorithm is 1 / 3.
[0013] Compared with the prior art, the present invention has significant progress:
[0014] The fabric and seam color matching method of this invention statistically analyzes the fabric color values of the collected fabric images using multiple color extraction algorithms, and combines the weight information of each color extraction algorithm to give a weighted similarity value after weighting the fabric and seam color similarity values. Based on the weighted similarity value, the seam color number with the highest similarity is obtained. This method can automatically and accurately obtain the seam color number with the highest similarity to the fabric color, realizing intelligent automatic color matching operation. It can significantly reduce the time spent manually finding the nearest colored seam, thereby improving production efficiency. At the same time, it standardizes the standard for finding seams in fabric, reduces the differences in the same fabric due to different people finding seams, and thus improves product quality. Attached Figure Description
[0015] Figure 1 is a schematic flowchart of the fabric and sewing thread color matching method according to an embodiment of the present invention.
[0016] Figure 2 is a schematic diagram of the image acquisition system of the fabric and seam color matching method according to an embodiment of the present invention.
[0017] Figure 3 is a schematic diagram of the fabric and sewing thread color matching method for acquiring sewing thread images according to an embodiment of the present invention.
[0018] Figure 4 is a schematic diagram of the fabric image acquisition method of the fabric and seam color matching method according to an embodiment of the present invention.
[0019] The reference numerals in the attached figures are explained as follows:
[0020] 1 Controller
[0021] 10 Human-Computer Interaction Interface
[0022] 2. Enclosure
[0023] 20 Cavity
[0024] 21. Top Slab
[0025] 22 base plate
[0026] 23 Receptacle
[0027] 3. Photo Components
[0028] 4. Seam loops
[0029] 5. Cover plate
[0030] 6. Fabric Detailed Implementation
[0031] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. These embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.
[0032] In the description of this invention, it should be noted that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0033] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0034] Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0035] Figures 1 to 4 show an embodiment of the color matching method for fabric and seam thread provided by the present invention.
[0036] Referring to Figures 1 and 2, the fabric and seam color matching method of this embodiment includes the following steps.
[0037] A fabric image is acquired, and the fabric color is extracted from the image using multiple color extraction algorithms, obtaining the fabric color value corresponding to each algorithm. For fabrics where corresponding seams need to be located, a fabric image is acquired and output to controller 1. Controller 1 receives the fabric image and performs color extraction analysis on it. Controller 1 extracts colors from the fabric image using multiple color extraction algorithms. The corresponding fabric color value obtained by each color extraction algorithm is the fabric color value analyzed by that algorithm.
[0038] The system retrieves suture data from a suture database. This data includes the color values of different suture colors and their corresponding color codes; that is, one suture color code corresponds to one suture color value. The color values of different suture colors can be obtained through image acquisition and color extraction analysis of the sutures, thus establishing a suture database. The suture database is stored in controller 1.
[0039] The similarity value is obtained by calculating the color difference between the fabric color value corresponding to each color extraction algorithm and the seam color value in the seam data. The color difference is then calculated between the fabric color value obtained by each color extraction algorithm and the seam data in the seam database using the color difference formula in the color comparison module. This yields the color comparison result between the fabric color value obtained by each color extraction algorithm and the seam color value in the seam data, i.e., the similarity value.
[0040] The weight information of each preset color extraction algorithm is obtained, and a weighted similarity value is calculated based on the weight information and multiple sets of similarity values. Preferably, the calculation of the weighted similarity value based on the weight information and multiple sets of similarity values includes: the weight information includes the weight coefficient of each preset color extraction algorithm, and the similarity value of each color extraction algorithm is multiplied by the weight coefficient to obtain the weighted similarity value. This weighted calculation is then applied to all color comparison results.
[0041] The stitch color number with the highest similarity is obtained based on a weighted similarity value. Preferably, obtaining the stitch color number with the highest similarity based on a weighted similarity value includes: sorting each color extraction algorithm by weighted similarity value from high to low, selecting the stitch color number corresponding to the first preset number of weighted similarity values, and selecting the stitch color number with the highest weighted similarity value from all stitch color numbers selected by all color extraction algorithms, thus obtaining the stitch color number with the highest similarity, which is output as the final result. More preferably, selecting the stitch color number with the highest weighted similarity value from all stitch color numbers selected by all color extraction algorithms includes: classifying the stitch color numbers selected by all color extraction algorithms, accumulating the weighted similarity values of the same stitch color number selected by different color extraction algorithms, and selecting the stitch color number with the highest accumulated weighted similarity value, thus obtaining the stitch color number with the highest similarity, which is output as the final result. Preferably, the preset number of suture color numbers taken by each color extraction algorithm is 3-6. For example, each color extraction algorithm sorts the suture color numbers corresponding to the first 5 weighted similarity values from high to low according to the weighted similarity value.
[0042] The fabric and seam color matching method in this embodiment uses multiple color extraction algorithms to statistically analyze the fabric color values of the collected fabric images. It then combines the weight information of each color extraction algorithm to provide a weighted similarity value, which is a weighted average of the fabric and seam color similarity values. Based on this weighted similarity value, the seam color number with the highest similarity is obtained. This method can automatically and accurately obtain the seam color number with the highest similarity to the fabric color, achieving intelligent and automatic color matching. This significantly reduces the time spent manually finding the nearest colored seam, thereby improving production efficiency. Simultaneously, it standardizes the process of finding seams in fabric, reducing the differences in seam selection for the same type of fabric due to different people finding the right seam, thus improving product quality.
[0043] Referring to Figures 3 and 4, to implement the fabric and stitch color matching method of this embodiment, a box 2 with a hollow interior forming a cavity 20 can be provided. An imaging component 3 for acquiring stitch or fabric images is installed on the top plate 21 of the box 2. The top plate 21 has a through mounting hole, and the imaging component 3 is installed in this mounting hole. The imaging component 3 preferably includes an industrial camera and a ring light source, with the ring light source fixed to the outer ring of the industrial camera. A receiving cavity 23 is formed by hollowing out the bottom plate 22 of the box 2. The receiving cavity 23 is used to receive the stitch coil 4 and is located directly below the imaging component 3. Referring to Figure 3, when acquiring stitch images, the stitch coil 4 is placed inside the receiving cavity 23, so that the imaging component 3, located directly above the receiving cavity 23, can take a picture of the stitch coil 4, thereby acquiring the stitch image. Referring to Figure 4, when acquiring fabric images, the upper end of the receiving cavity 23 is covered with the cover plate 5, and the fabric 6 is placed on the cover plate 5. The fabric 6 is then positioned directly below the photographing component 3, allowing the photographing component 3 to take a picture of the fabric 6, thus acquiring the fabric image. The photographing component 3 is communicatively connected to the controller 1, so the stitch images or fabric images acquired by the photographing component 3 can be transmitted to the controller 1. The controller 1 is communicatively connected to the human-machine interface 10, which allows operators to manually input setting parameters, trigger control programs, and query analysis results. The controller 1 is an existing conventional control processor, such as a PLC controller or a microcontroller.
[0044] In a preferred embodiment, the dimensions of housing 1 are 25cm*25cm*45cm. The mounting hole on the top plate 21 of housing 2 is a circular hole with a diameter of 6cm. The industrial camera in the imaging assembly 3 is fixed at the center of the mounting hole, and a ring light source with an outer diameter of 9.2cm and an inner diameter of 6cm is fixed on the outer ring of the industrial camera. The industrial camera is a Basler camera with a fixed 8mm 5-megapixel lens, and the color temperature of the ring light source is 6500K. The cavity 23 on the bottom plate 22 of housing 2 has a cross-section of 13cm*13cm square for placing the stitching coil 4. The industrial camera parameters are set as follows: image size is 1800*1800; gamma enhancement is used with a coefficient of 0.45; black balance parameter is set to 0; light source is selected as artificial daylight (Daylight 6500K); automatic white balance is turned off; red channel parameter is set to 90, green channel parameter is set to 59, and blue channel parameter is set to 64. By setting the industrial camera parameters as described above, the captured images can be free of significant color differences, thus obtaining images that better match the human eye's perception.
[0045] In the fabric and thread color matching method of this embodiment, the establishment of the thread database is achieved through image acquisition and color extraction analysis of various colored threads. To acquire thread images, the thread coil 4 can be placed in the receiving cavity 23 on the bottom plate 22 of the housing 2. First, the thread color number to be created is manually input on the human-machine interface 10. Then, the industrial camera is triggered by software to capture an image. Subsequently, edge detection is performed on the captured image using an open-source computer vision library to obtain an initial color extraction region. Next, the threshold function built into the open-source vision library is used for image binarization, followed by edge extraction using an erosion and dilation algorithm, finally obtaining the region to be color extracted. The thread color extraction algorithm uses an octree-based algorithm. The entire process uses an octree data structure to store color values. Color quantization is achieved through three steps: building the octree, generating a color palette, and generating a quantization file. Since the thread color is basically a pure color, the number of colors to be extracted is set to 8. To illustrate the generation process of a single pixel: Assume a pixel in an image has an RGB value of (50, 180, 99), its corresponding binary value is (00110010, 10110100, 01100011). Combining these values from left to right, we get (010, 001, 111, 110, 000, 010, 101, 001). This color value, when converted to decimal from level 0 to level 7 in the octree, is (2, 1, 7, 6, 0, 2, 5, 1). This process is repeated for each pixel in the image. If the same color value appears, its count is accumulated in the final child node. Finally, the child nodes of the generated tree are merged until the desired number of extracted colors is obtained. After obtaining the RGB values of eight colors and their corresponding frequencies through the above process, the ratio of the frequency of occurrence to the total number of pixels is used as the weight. The RGB values of each color are multiplied by their respective weights and then added together to obtain the stitch color value. This result, along with the input stitch color number, is stored in the stitch database for subsequent fabric stitch matching.
[0046] During the fabric seam finding process, an image of the fabric is first acquired. The upper end of the accommodating cavity 23 on the bottom plate 22 of the housing 2 is covered with a cover plate 5, and the fabric 6 is placed directly below the photographing component 3 on the cover plate 5. Then, the industrial camera is triggered by software to capture an image. Subsequently, the captured image is cropped using an open-source computer vision library to obtain an image of 800*800 pixels. Due to the complexity and diversity of fabric colors, multiple color extraction algorithms are used for statistical analysis. The multiple color extraction algorithms are not limited; preferably, they can include at least two of the following: statistical algorithms, clustering algorithms, and octree-based algorithms. Alternatively, they can include at least two of the following: statistical algorithms, clustering algorithms, octree-based algorithms, principal component analysis algorithms, and wavelet transform algorithms. Taking the statistical analysis of three color extraction algorithms—statistical, clustering, and octree-based—as an example, the statistical algorithm calculates the frequency of each pixel in the image and then extracts the top K color values (K being a positive integer) from highest to lowest frequency. The clustering algorithm randomly initializes K cluster centers, iterates through pixel values, assigns each pixel to its nearest cluster center, and updates the cluster center of each cluster to the average of all colors in that cluster, continuing until the cluster centers no longer change significantly. The final K cluster centers are the color values to be extracted. The octree-based algorithm is consistent with all octree-based algorithms used in the aforementioned seam color extraction algorithm. The fabric color values obtained by each color extraction algorithm are compared with the seam data in the seam database using the CIE DE2000 color difference formula, resulting in a color comparison between the fabric color values from each algorithm and the seam color values in the seam data—that is, a similarity value. Since the three color extraction algorithms—statistical, clustering, and octree-based—are independent and unaffected by environmental or other factors, each algorithm has a pre-defined weight coefficient of 1 / 3. The similarity value of each algorithm is multiplied by its weight coefficient to obtain a weighted similarity value. The top 5 stitching colors corresponding to the highest weighted similarity values from each algorithm are then selected. Finally, the stitching color with the highest weighted similarity value among the 15 stitching colors selected by all algorithms is chosen. Specifically, the 15 stitching colors selected by all algorithms are categorized, and the weighted similarity values of the same stitching color selected by different algorithms are summed. The stitching color with the highest summed weighted similarity value is then output as the final result.
[0047] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present invention.
Claims
1. A method for color matching of fabric and seam thread, characterized in that, A fabric image is acquired, and the fabric color is extracted from the fabric image based on multiple color extraction algorithms to obtain the fabric color value corresponding to each color extraction algorithm; sewing data is acquired from the sewing database, the sewing data including the color values of different colors of sewing threads and the corresponding sewing thread color numbers; the fabric color value corresponding to each color extraction algorithm is compared with the sewing color value of the sewing data to obtain a similarity value by color difference calculation; Obtain the weight information of each preset color extraction algorithm, calculate the weighted similarity value based on the weight information and multiple sets of similarity values, and obtain the suture color number with the highest similarity based on the weighted similarity value.
2. The method for color matching fabric and thread according to claim 1, characterized in that, The weighted similarity value is calculated based on weight information and multiple sets of similarity values. The weight information includes a preset weight coefficient for each color extraction algorithm. The weighted similarity value is obtained by multiplying the similarity value of each color extraction algorithm by the weight coefficient.
3. The method for color matching fabric and thread according to claim 1, characterized in that, Obtaining the suture color number with the highest similarity based on weighted similarity value includes: sorting each color extraction algorithm by weighted similarity value from high to low and taking the suture color number corresponding to the first preset number of weighted similarity values; and taking the suture color number with the highest weighted similarity value from all the suture color numbers taken by the color extraction algorithms.
4. The method for color matching fabric and thread according to claim 3, characterized in that, The method for selecting the stitch color with the highest weighted similarity value among all stitch color numbers obtained by color extraction algorithms includes: classifying all stitch color numbers obtained by all color extraction algorithms, accumulating the weighted similarity values of the same stitch color number obtained by different color extraction algorithms, and selecting the stitch color number with the highest accumulated weighted similarity value.
5. The method for color matching fabric and thread according to claim 3, characterized in that, Each color extraction algorithm selects 3-6 suture color codes as presets.
6. The method for color matching fabric and thread according to claim 1, characterized in that, Multiple color extraction algorithms include at least two of the following: statistical algorithms, clustering algorithms, and octree-based algorithms.
7. The method for color matching fabric and thread according to claim 1, characterized in that, Multiple color extraction algorithms include at least two of the following: statistical algorithms, clustering algorithms, octree-based algorithms, principal component analysis-based algorithms, and wavelet transform-based algorithms.
8. The method for color matching fabric and thread according to claim 6 or 7, characterized in that, Multiple color extraction algorithms are included, including statistical algorithms, clustering algorithms, and octree-based algorithms. The weight coefficient of each color extraction algorithm is preset to be 1 / 3.