Thread matching method and device, computer device and medium
By obtaining the embroidery information of the embroidery pattern and calculating the candidate embroidery thread length and color matching, the problem of multiple thread splicing in the selection of embroidery thread in embroidery machines is solved, which improves embroidery efficiency and color accuracy and reduces workload.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN SIJIU TECH CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-16
AI Technical Summary
In the current embroidery machine process, the selection of embroidery thread only considers the length matching, which requires multiple thread splicing, increases the workload, and the color matching is inaccurate, affecting the embroidery efficiency.
By acquiring the embroidery information of the embroidery pattern, calculating the length and color matching of candidate embroidery threads, and using formulas and preset conditions to determine the target embroidery thread, it is ensured that no embroidery thread needs to be changed during the embroidery process, reducing work steps, and accurately matching the color and material information of the actual embroidery threads in the embroidery thread library.
This reduces the number of thread changes during the embroidery process, improves embroidery efficiency, ensures color consistency in the embroidery pattern, and reduces workload and color discrepancies.
Smart Images

Figure CN122221458A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computerized embroidery machine technology, and in particular to a method, apparatus, computer equipment, and medium for matching embroidery threads. Background Technology
[0002] When using an embroidery machine, users need to prepare embroidery thread in advance and select appropriate thread according to the embroidery pattern. However, there are many colors of embroidery thread, and users may have different brands and color codes of embroidery thread, so they will consider many factors when selecting embroidery thread.
[0003] Currently, existing technologies only consider whether the length of the embroidery thread matches the desired length when selecting embroidery thread. This leads to the need for multiple thread connections to complete an area, increasing the workload. For example, patent application CN119640513A only considers whether the color of the embroidery thread matches the color of the pattern on the embroidery stencil, which also easily results in the need for multiple thread connections to complete an area, further increasing the workload. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, and medium for matching embroidery threads that can reduce workload in addressing the aforementioned technical problems.
[0005] A method for matching embroidery threads, the method comprising:
[0006] S1. Obtain the embroidery information of the embroidery pattern, wherein the embroidery information includes the first color of the embroidery thread used to embroider each embroidery area of the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color.
[0007] S2. According to the embroidery thread matching order, determine the current color to be matched from each of the first colors, and according to the colors of each actual embroidery thread in the embroidery thread library, determine the candidate embroidery thread that matches the current color to be matched from each of the actual embroidery threads, and calculate the second embroidery thread length of the candidate embroidery thread;
[0008] S3. Based on the result that the length of the second embroidery thread is greater than the current product, the candidate embroidery thread is determined to be the target embroidery thread for embroidering the target area. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple.
[0009] The calculation of the second embroidery thread length of the candidate embroidery thread includes:
[0010] Use formula Calculate the second thread length L of the candidate embroidery thread, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides.
[0011] In this application, by obtaining the embroidery information of the embroidery pattern, including the first color of the embroidery thread used to embroider each embroidery area, the first thread length corresponding to each first color, and the matching order of each first color, the current color to be matched is determined from each first color according to the matching order. Then, based on the colors of each actual embroidery thread in the thread library, candidate embroidery threads matching the current color to be matched are determined from each actual embroidery thread. The second thread length of the candidate embroidery thread is calculated. Based on the result that the second thread length is greater than the current product, the candidate embroidery thread is determined as the target embroidery thread for the target area. This ensures that no thread changes are needed when embroidering a certain area, thereby reducing the steps and workload of thread embroidery. Furthermore, by using formulas… Calculating the second embroidery thread length of the candidate embroidery thread can also yield a more accurate second embroidery thread length.
[0012] In one embodiment, calculating the second embroidery thread length of the candidate embroidery thread in step S2 includes:
[0013] The actual winding method of the candidate embroidery thread on the outer edge of the embroidery thread pod, the actual material of the candidate embroidery thread, and a preset correction coefficient mapping table are obtained. The correction coefficient mapping table includes a first correction coefficient corresponding to various embroidery thread materials and a second correction coefficient for each embroidery thread material under various winding methods.
[0014] Determine a target embroidery thread material that matches the actual material from among the described embroidery thread materials;
[0015] Obtain the first correction coefficient corresponding to the target embroidery thread material and the second correction coefficient of the target embroidery thread material under the actual winding method;
[0016] Through formula Calculate the second embroidery thread length of the candidate embroidery thread;
[0017] Where k1 is the first correction coefficient, k2 is the second correction coefficient, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel.d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides.
[0018] In this application, the formula is used. Calculate the second embroidery thread length of the candidate embroidery thread. This allows us to take into account the influence of the embroidery thread material and winding method on the embroidery thread length, thus obtaining an accurate second embroidery thread length.
[0019] In one embodiment, the process of determining the candidate embroidery thread in step S2 includes:
[0020] Calculate the color difference between the RGB value of each actual embroidery thread in the embroidery thread library and the RGB value of the current color to be matched;
[0021] From the various color difference values, a target color difference value that is smaller than a preset color difference value is determined, and the actual embroidery thread corresponding to the target color difference value is determined as the candidate embroidery thread;
[0022] Among them, color difference value The calculation formula is: (R1, G1, B1) are the RGB values of the actual embroidery thread, and (R2, G2, B2) are the RGB values of the current color to be matched.
[0023] In this application, the color difference between the RGB value of each actual embroidery thread in the embroidery thread library and the RGB value of the current color to be matched is calculated. A target color difference value that is less than the preset color difference value is determined from each color difference value, and the actual embroidery thread corresponding to the target color difference value is determined as the candidate embroidery thread. In this way, it can be ensured that the color of the embroidery thread used is consistent with or basically consistent with the desired color during the actual embroidery process.
[0024] In one embodiment, the method further includes:
[0025] Based on the result that there is no target color difference value less than the preset color difference value among the color difference values, first information is output; the first information includes a first recommended embroidery thread, which is the actual embroidery thread corresponding to the smallest color difference value among the color difference values.
[0026] In response to the recommended embroidery thread selection operation, the first recommended embroidery thread is selected as the candidate embroidery thread.
[0027] In this application, based on the result that there is no target color difference value less than a preset color difference value among the various color difference values, the first information is output. The first information includes a first recommended embroidery thread. The first recommended embroidery thread is the actual embroidery thread corresponding to the smallest color difference value among the various color difference values. In response to the recommended embroidery thread selection operation, the first recommended embroidery thread is used as the candidate embroidery thread. This can ensure that the embroidery pattern can be completed and that the color of the finished embroidery pattern is small compared with the desired color.
[0028] In one embodiment, the method further includes:
[0029] Based on the result that the length of the second embroidery thread is less than the current product, second information is output, which includes a prompt to the user to add more embroidery thread.
[0030] In this application, second information is output based on the result that the length of the second embroidery thread is less than the current product. The second information includes a prompt to the user to replenish the embroidery thread, so that the user can replenish the embroidery thread in a timely manner.
[0031] In one embodiment, the method further includes:
[0032] Based on the result that the length of the second embroidery thread is less than the current product, a selection control is displayed;
[0033] In response to a trigger operation on the selection control, the candidate embroidery thread is determined to be the target embroidery thread for the target area, and a preset usage ratio is obtained, wherein the usage ratio is less than one.
[0034] The allowable length of the candidate embroidery thread is obtained by multiplying the second embroidery thread length of the candidate embroidery thread with the preset ratio.
[0035] A second recommended embroidery thread is determined from the actual embroidery threads, and the second recommended embroidery thread is determined as the target embroidery thread for embroidering the target area. The second recommended embroidery thread is an actual embroidery thread with a color difference value less than a preset color difference value and a length greater than a length difference value. The length difference value is the result of subtracting the allowed length from the length of the first embroidery thread of the current color to be matched.
[0036] In this application, a selection control is displayed based on the result that the length of the second embroidery thread is less than the current product. In response to the trigger operation of the selection control, the candidate embroidery thread is determined as the target embroidery thread for embroidering the target area, and a preset usage ratio is obtained. Based on the product between the second embroidery thread length of the candidate embroidery thread and the preset ratio, the allowable usage length of the candidate embroidery thread is obtained. A second recommended embroidery thread is determined from each actual embroidery thread, and the second recommended embroidery thread is determined as the target embroidery thread for embroidering the target area. This ensures that the embroidery pattern can be successfully completed when the user cannot replenish the embroidery thread in time, while also ensuring that the color of the embroidery pattern has a small difference from the expected color.
[0037] In one embodiment, the method further includes:
[0038] Based on the color of the target embroidery thread corresponding to each embroidery area, a first embroidery pattern preview image is generated, and at least one color set of the user is obtained, the color set including the user's preferred colors and / or favorite colors;
[0039] In response to a color selection operation for each of the color sets, a selected color combination is obtained for each of the color sets, the selected color combination including a second color associated with each of the first colors;
[0040] Based on each of the second colors in each of the color sets, generate a second embroidery pattern preview image corresponding to each of the color sets;
[0041] Display the first embroidery pattern preview and each of the second embroidery pattern previews.
[0042] In this application, by displaying a first embroidery pattern preview and various second embroidery pattern previews, users can intuitively see which color combination will achieve the desired embroidery effect.
[0043] A thread matching device, the device comprising:
[0044] The information acquisition module is used to acquire the embroidery information of the embroidery pattern. The embroidery information includes the first color of the embroidery thread used to embroider each embroidery area of the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color.
[0045] The color matching module is used to determine the current color to be matched from each of the first colors according to the embroidery thread matching order, and to determine candidate embroidery threads that match the current color to be matched from each of the actual embroidery threads in the embroidery thread library according to the colors of each of the actual embroidery threads, and to calculate the second embroidery thread length of the candidate embroidery thread; wherein, calculating the second embroidery thread length of the candidate embroidery thread includes: using the formula Calculate the second thread length L of the candidate embroidery thread, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides;
[0046] The length matching module is used to determine the candidate embroidery thread as the target embroidery thread for embroidering the target area based on the result that the length of the second embroidery thread is greater than the current product. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple.
[0047] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0048] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0049] The aforementioned embroidery thread matching device, computer equipment, and medium acquire embroidery information from the embroidery pattern. This information includes the first color of the embroidery thread used to embroider each area of the pattern, the first thread length corresponding to each first color, and the matching order of each first color. Based on the matching order, the current color to be matched is determined from the first colors. Then, based on the colors of the actual embroidery threads in the thread library, a candidate thread matching the current color is determined from the actual embroidery threads. The second thread length of the candidate thread is calculated. Based on the result that the second thread length is greater than the current product, the candidate thread is determined as the target embroidery thread for the target area. This ensures that no thread changes are needed when embroidering a certain area, thereby reducing the steps and workload of the embroidery thread work. Furthermore, by using formulas… Calculating the second embroidery thread length of the candidate embroidery thread can also yield a more accurate second embroidery thread length. Attached Figure Description
[0050] Figure 1 This is a diagram illustrating the application environment of a thread matching method in one embodiment.
[0051] Figure 2 This is a flowchart illustrating a thread matching method in one embodiment;
[0052] Figure 3 This is a schematic diagram of the overall process of the embroidery thread matching method in one embodiment;
[0053] Figure 4 This is a schematic diagram of the overall process of the embroidery thread matching method in another embodiment;
[0054] Figure 5 This is a structural block diagram of a thread matching device in one embodiment;
[0055] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0057] The thread matching method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown is as follows. The server connects to the embroidery machine and scanning device via wired / wireless channels respectively. The data storage system stores the data the server needs to process. The scanning device scans the embroidery pattern and the actual embroidery threads in the thread spool to obtain embroidery information and the color of the actual threads, and then sends this information to the server. The embroidery machine embroiders the pattern according to the target threads matched by the server. The server obtains the embroidery information of the embroidery pattern, including the first color of the embroidery thread used for each embroidery area, the first thread length corresponding to each first color, and the matching order of the embroidery threads for each first color. Based on the thread matching order, the server determines the current color to be matched from the first colors, and based on the colors of the actual embroidery threads in the thread library, determines candidate embroidery threads that match the current color to be matched from the actual embroidery threads, and calculates the second thread length of the candidate embroidery threads. Based on the result that the second thread length is greater than the current product, the server determines the candidate embroidery thread as the target embroidery thread for the target area, where the target area is the embroidery area corresponding to the current color to be matched, and the current product is the result of multiplying the first thread length of the current color to be matched by a preset multiple. The calculation of the second thread length of the candidate embroidery thread includes: using the formula... Calculate the second thread length L of the candidate embroidery thread, where h is the height of the embroidery thread spool holding the candidate embroidery thread, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread tube. d R is the diameter of the bottom of the embroidery thread spool. The candidate embroidery thread is wound around the outer edge of the embroidery thread spool. t R is the sum of the diameter of the top of the embroidery spool and the thickness of the candidate embroidery threads wrapped around its two outer edges. d This is the sum of the diameter of the bottom of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. A server can be a single server, a server cluster consisting of multiple servers, or a cloud computing center consisting of multiple servers.
[0058] In one embodiment, such as Figure 2 As shown, a method for matching embroidery threads is provided, which is applied to... Figure 1 Taking the server in the example, the following steps are included:
[0059] S1. Obtain the embroidery information of the embroidery pattern. The embroidery information includes the first color of the embroidery thread used for each embroidery area in the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color.
[0060] Among them, the embroidery pattern is the embroidery pattern that is expected to be embroidered by the embroidery machine. The embroidery pattern includes multiple embroidery areas, and the first color of the embroidery thread required for each embroidery area may be the same or different.
[0061] The first color refers to the desired color of the embroidery thread for a specific embroidery area. The first thread length corresponding to the first color refers to the length of the embroidery thread used to embroider the area corresponding to the first color. The thread matching order can be understood as the order in which the target embroidery thread is matched to each embroidery area corresponding to the first color.
[0062] S2. According to the embroidery thread matching order, determine the current color to be matched from each of the first colors, and according to the colors of each actual embroidery thread in the embroidery thread library, determine the candidate embroidery thread that matches the current color to be matched from each actual embroidery thread, and calculate the second embroidery thread length of the candidate embroidery thread.
[0063] Among them, the color of the candidate embroidery thread must match the current color to be matched. The candidate embroidery thread can be determined based on the Lab color space, HSV (Hue-Saturation-Value), HSL (Hue-Saturation-Lightness), grayscale, brightness, and RGB (Red-Green-Blue).
[0064] The second thread length of the candidate embroidery thread refers to the length of the candidate embroidery thread. Calculating the second thread length of the candidate embroidery thread involves using the formula... Calculate the second thread length L of the candidate embroidery thread, where h is the height of the embroidery thread spool holding the candidate embroidery thread, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread tube. d R is the diameter of the bottom of the embroidery thread spool. The candidate embroidery thread is wound around the outer edge of the embroidery thread spool. t R is the sum of the diameter of the top of the embroidery spool and the thickness of the candidate embroidery threads wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery spool and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides.
[0065] Furthermore, the first color of the previous matching target embroidery thread is determined. Based on the first color of the previous matching target embroidery thread and the embroidery thread matching order, the first color of the next target embroidery thread to be matched is determined, and the first color of the next target embroidery thread to be matched is set as the current target color to be matched.
[0066] Furthermore, the height of the embroidery spool, the diameter of the candidate embroidery thread, the diameter of the top of the embroidery spool, the diameter of the bottom of the embroidery spool, the sum of the diameter of the top of the embroidery spool and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides, and the sum of the diameter of the bottom of the embroidery spool and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides are collected by optical sensors.
[0067] Furthermore, the shape of the embroidery thread tube can be either frustum or cylindrical.
[0068] S3. Based on the result that the length of the second embroidery thread is greater than the current product, the candidate embroidery thread is determined as the target embroidery thread for the target area. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple.
[0069] The embroidery area corresponding to the color to be matched refers to the embroidery area embroidered with the embroidery thread of the color to be matched. For example, if the color to be matched is red, and the first color of the embroidery thread used to embroider area A in the embroidery pattern is red, then area A is the embroidery area corresponding to the color to be matched.
[0070] Furthermore, based on the result that the length of the second embroidery thread is equal to the current product, the candidate embroidery thread is determined as the target embroidery thread for embroidering the target area.
[0071] In the aforementioned thread matching method, the embroidery information of the embroidery pattern is obtained. This information includes the first color of the thread used to embroider each area of the pattern, the first thread length corresponding to each first color, and the thread matching order for each first color. Based on the thread matching order, the current color to be matched is determined from the first colors. Then, based on the colors of the actual threads in the thread library, candidate threads matching the current color are determined from the actual threads. The second thread length of the candidate thread is calculated. Based on the result that the second thread length is greater than the current product, the candidate thread is determined as the target thread for embroidering the target area. This ensures that no thread changes are needed when embroidering a certain area, thus reducing the steps and workload of thread work. Furthermore, by using formulas… Calculating the second embroidery thread length of the candidate embroidery thread can also yield a more accurate second embroidery thread length.
[0072] In one embodiment, calculating the second embroidery thread length of the candidate embroidery thread in step S2 includes:
[0073] Obtain the actual winding method of the candidate embroidery thread on the outer edge of the embroidery thread hopper, the actual material of the candidate embroidery thread, and the preset correction coefficient mapping table. The correction coefficient mapping table includes the first correction coefficient corresponding to various embroidery thread materials and the second correction coefficient of each embroidery thread material under various winding methods.
[0074] Select a target embroidery thread material that matches the actual material from among the various embroidery thread materials;
[0075] Obtain the first correction coefficient corresponding to the target embroidery thread material and the second correction coefficient of the target embroidery thread material under the actual winding method;
[0076] Through formula Calculate the second embroidery thread length of the candidate embroidery thread;
[0077] Where k1 is the first correction coefficient, k2 is the second correction coefficient, h is the height of the embroidery thread hopper, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread tube. d R is the diameter of the bottom of the embroidery thread spool. The candidate embroidery thread is wound around the outer edge of the embroidery thread spool. t R is the sum of the diameter of the top of the embroidery spool and the thickness of the candidate embroidery threads wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery spool and the thickness of the candidate embroidery threads wrapped around the outer edges on both sides.
[0078] The winding method directly affects the density and spacing of the embroidery thread, thus altering the actual winding length. Therefore, the impact of the winding method on the thread length must be considered. Similarly, the thread material also affects the density and spacing of the thread, thereby changing the actual winding length. Winding methods include, but are not limited to, parallel winding, cross winding, spiral winding, and random winding.
[0079] Parallel winding: The embroidery threads are arranged parallel to the axis of the embroidery spool, with each layer of threads following a basically parallel trajectory, and the gaps between each layer are uniform and small. Parallel winding is mainly used for short-fiber embroidery threads, such as fine pure cotton thread. Characteristics for identifying parallel winding: When viewed from the side of the embroidery spool, the thread texture appears straight and perpendicular to the top and bottom edges.
[0080] Cross-wrapping (diamond wrapping): Embroidery threads are arranged in a cross pattern at a certain angle, forming a diamond-shaped grid texture with diamond-shaped gaps, resulting in good stability. Cross-wrapping is suitable for medium-length fiber embroidery threads, such as polyester and cotton-polyester blends. Characteristics for identifying cross-wrapping: Clear cross-patterns are visible from the side, and the cross angle between adjacent layers of embroidery threads is approximately 30-60°.
[0081] Spiral winding: The embroidery thread is arranged in a single direction, spiraling upwards along the embroidery thread barrel. Each layer of thread follows a continuous spiral pattern, with the gaps varying depending on the spiral angle. Spiral winding is commonly used for long-fiber and elastic embroidery threads, such as silk and elastic yarn. Characteristics for identifying spiral winding: A continuous spiral pattern is visible from the side, with no obvious intersections, and the spiral angle (the angle between the embroidery thread and the axis) is approximately 15-45°.
[0082] Random winding: The embroidery threads are arranged without a fixed pattern, and the gaps are of varying sizes. Random winding is mostly seen in embroidery thread spools wound by hand or with simple equipment. Characteristics of random winding: The embroidery thread texture is messy, without a uniform direction of arrangement, and there may be overlapping or loose areas in some places.
[0083] Embroidery thread materials include, but are not limited to, pure cotton, polyester (chemical fiber), silk, and cotton-polyester blends.
[0084] The actual winding method of the candidate embroidery thread can be determined based on the judgment characteristics of various winding methods. Specifically, the user determines the actual winding method of the candidate embroidery thread based on the judgment characteristics of various winding methods and inputs the actual winding method into the server, so that the server can obtain the actual winding method of the candidate embroidery thread. The actual material of the candidate embroidery thread can be manually judged by the user, and then the judgment result is input into the server.
[0085] When embroidery threads of the same material are wound in different ways, the corresponding second correction factor is generally different.
[0086] In a specific application, the correction coefficient mapping table is shown in Table 1.
[0087]
[0088] In this embodiment, the formula is used. Calculate the second embroidery thread length of the candidate embroidery thread. This allows us to take into account the influence of the embroidery thread material and winding method on the embroidery thread length, thus obtaining an accurate second embroidery thread length.
[0089] In one embodiment, the temperature and humidity of the current environment of the embroidery thread hopper are obtained, along with the sensor errors for the height of the embroidery thread hopper, the diameter of the candidate embroidery thread, the diameter of the top of the embroidery thread hopper, the diameter of the bottom of the embroidery thread hopper, the sum of the diameter of the top of the embroidery thread hopper and the thickness of the candidate embroidery thread wrapped around the outer edges of both sides, and the sum of the diameter of the bottom of the embroidery thread hopper and the thickness of the candidate embroidery thread wrapped around the outer edges of both sides. Based on the sensor errors for temperature and humidity, the first and second correction coefficients in the correction coefficient mapping table are adjusted to obtain the adjusted first and second correction coefficients, which are then used to calculate the second embroidery thread length of the candidate embroidery thread.
[0090] In one embodiment, the process of determining candidate embroidery threads in step S2 includes:
[0091] Calculate the color difference between the RGB value of each actual embroidery thread in the embroidery thread library and the RGB value of the current color to be matched;
[0092] Determine the target color difference value that is smaller than the preset color difference value from the various color difference values, and determine the actual embroidery thread corresponding to the target color difference value as the candidate embroidery thread.
[0093] Among them, color difference value The calculation formula is: (R1, G1, B1) are the RGB values of the actual embroidery thread, and (R2, G2, B2) are the RGB values of the current color to be matched.
[0094] The preset color difference value is a manually set threshold. The actual embroidery thread corresponding to the target color difference value refers to the actual embroidery thread whose RGB value corresponds to the target color difference value. For example, if the color difference between the RGB value of actual embroidery thread A and the RGB value of the current color to be matched is the target color difference value, then actual embroidery thread A is the actual embroidery thread corresponding to the target color difference value. Based on the result that the target color difference value is less than the preset color difference value, the color of the actual embroidery thread corresponding to the target color difference value is determined to be consistent with the current color to be matched.
[0095] Furthermore, if there are multiple target color difference values, the actual embroidery thread corresponding to the minimum value among the multiple target color difference values is determined as the candidate embroidery thread.
[0096] In this embodiment, by calculating the color difference between the RGB value of each actual embroidery thread in the embroidery thread library and the RGB value of the current color to be matched, a target color difference value smaller than the preset color difference value is determined from each color difference value, and the actual embroidery thread corresponding to the target color difference value is determined as the candidate embroidery thread. In this way, it can be ensured that the color of the embroidery thread used is consistent with or basically consistent with the desired color during the actual embroidery process.
[0097] In one embodiment, the method further includes:
[0098] Based on the result that there is no target color difference value less than the preset color difference value among the color difference values, the first information is output; the first information includes the first recommended embroidery thread, which is the actual embroidery thread corresponding to the smallest color difference value among the color difference values.
[0099] In response to the recommended embroidery thread selection action, the first recommended embroidery thread is selected as the candidate embroidery thread.
[0100] The actual embroidery thread corresponding to the minimum color difference value refers to the actual embroidery thread whose RGB value corresponds to the minimum color difference value. For example, if the color difference between the RGB value of actual embroidery thread B and the RGB value of the color to be matched is the minimum color difference value among all color difference values, then actual embroidery thread B is the actual embroidery thread corresponding to the minimum color difference value.
[0101] The recommended embroidery thread selection action is triggered by the user through the server's human-computer interaction interface. Responding to this action indicates that the user agrees to select the first recommended embroidery thread as a candidate thread.
[0102] Furthermore, the first information also includes a prompt to the user to replenish the embroidery thread, and the color difference between the RGB value of the replenished embroidery thread and the RGB value of the current color to be matched should be less than the preset color difference value.
[0103] In this embodiment, based on the result that there is no target color difference value less than a preset color difference value among the color difference values, the first information is output. The first information includes a first recommended embroidery thread. The first recommended embroidery thread is the actual embroidery thread corresponding to the smallest color difference value among the color difference values. In response to the recommended embroidery thread selection operation, the first recommended embroidery thread is used as the candidate embroidery thread. This can ensure that the embroidery pattern can be completed and that the color of the finished embroidery pattern is small compared with the desired color.
[0104] In one embodiment, the method further includes:
[0105] Based on the result that the length of the second embroidery thread is less than the current product, output the second information, which includes a prompt for the user to add more embroidery thread.
[0106] In this embodiment, based on the result that the second embroidery thread length is less than the current product, second information is output. The second information includes a prompt to the user to replenish the embroidery thread, so that the user can replenish the embroidery thread in a timely manner.
[0107] In one embodiment, the method further includes:
[0108] Display the selection control based on the result that the length of the second embroidery thread is less than the current product;
[0109] In response to a trigger operation on the selection control, the candidate embroidery thread is determined to be the target embroidery thread for the target area, and a preset usage ratio is obtained, which is less than one.
[0110] The allowable length of the candidate embroidery thread is obtained by multiplying the second embroidery thread length of the candidate embroidery thread with the preset ratio.
[0111] The second recommended embroidery thread is determined from the actual embroidery threads and is set as the target embroidery thread for the target area. The second recommended embroidery thread is the actual embroidery thread whose color difference value is less than the preset color difference value and whose length is greater than the length difference value. The length difference value is the result of subtracting the allowed length from the length of the first embroidery thread of the color to be matched.
[0112] In this context, responding to a trigger operation on the selection control indicates that the user has selected the candidate embroidery thread as the target embroidery thread for the target area.
[0113] The usage ratio is a user-defined ratio value. The allowed length is the length of candidate thread that can be consumed or used when embroidering the target area. For example, if the usage ratio is 0.5, the second recommended thread length of the candidate thread is 1m, and the allowed length of the candidate thread is 0.5m, if 0.5m of the candidate thread has been used while embroidering the target area, the candidate thread will not be used to continue embroidering; instead, the second recommended thread will be used to continue embroidering the remaining part of the target area.
[0114] Furthermore, when actually using candidate embroidery threads and the second recommended embroidery thread to embroider the target area, you can either use the candidate embroidery thread first or use the second recommended embroidery thread first.
[0115] Furthermore, the second recommended embroidery thread is an actual embroidery thread with a color difference value less than the preset color difference value and a length greater than or equal to the length difference value.
[0116] In this embodiment, a selection control is displayed based on the result that the second embroidery thread length is less than the current product. In response to the trigger operation of the selection control, the candidate embroidery thread is determined as the target embroidery thread for embroidering the target area, and a preset usage ratio is obtained. Based on the product between the second embroidery thread length of the candidate embroidery thread and the preset ratio, the allowable usage length of the candidate embroidery thread is obtained. A second recommended embroidery thread is determined from each actual embroidery thread, and the second recommended embroidery thread is determined as the target embroidery thread for embroidering the target area. In this way, when the user cannot replenish the embroidery thread in time, it can be ensured that the embroidery pattern can be successfully completed, while ensuring that the color of the embroidery pattern is close to the expected color.
[0117] In one embodiment, the method further includes:
[0118] Based on the color of the target embroidery thread corresponding to each embroidery area, generate a first embroidery pattern preview image and obtain at least one color set of the user, including the user's preferred colors and / or favorite colors;
[0119] In response to a color selection operation for each color set, a selected color combination is obtained for each color set, the selected color combination including a second color associated with each first color;
[0120] Based on each second color in each color set, generate a preview image of the second embroidery pattern corresponding to each color set;
[0121] Displays a preview image of the first embroidery pattern and preview images of each of the second embroidery patterns.
[0122] The target embroidery thread corresponding to each embroidery area refers to the target embroidery thread of each embroidery area obtained according to steps S2 and S3.
[0123] Different color sets for different users could be created on different dates or have different color schemes.
[0124] The user's preferred colors are those colors that the user uses most frequently. Favorite colors refer to colors that the user actively saves and adds to their color collection.
[0125] Each selected color combination includes a second color associated with each first color. The second color associated with the first color refers to the color of the embroidery thread used to embroider the area corresponding to the first color.
[0126] Each color combination selected from each color set can generate a second embroidery pattern preview.
[0127] In this embodiment, by displaying a first embroidery pattern preview and various second embroidery pattern previews, users can intuitively see which color combination will achieve the desired embroidery effect.
[0128] Furthermore, the color difference value between the second color and each actual embroidery thread is calculated. Based on the result that there is no color difference value less than the preset color difference value among the color difference values, the user is prompted to add embroidery thread.
[0129] Furthermore, it determines whether the length of the second-colored embroidery thread in the embroidery thread library is greater than the length of the first-colored embroidery thread associated with it; based on the result that the length of the second-colored embroidery thread is less than the length of the first-colored embroidery thread associated with it, it prompts the user to replenish the embroidery thread.
[0130] Furthermore, in response to a thread change operation triggered in the first or second embroidery pattern preview image, the embroidery thread is changed, and a preview image after the thread change is displayed.
[0131] In one specific embodiment, the embroidery thread matching method includes: designing an embroidery pattern and obtaining embroidery information for the pattern, including the first color of the embroidery thread used to embroider each embroidery area of the pattern, the first thread length corresponding to each first color, and the matching order of each first color. The embroidery thread length and RGB values of each actual embroidery thread in the thread library are collected using sensors. Based on the thread matching order, the current color to be matched is determined from the first colors, and candidate embroidery threads matching the current color to be matched are determined from each actual embroidery thread in the thread library. It is then determined whether the second thread length of the candidate embroidery thread is greater than or equal to the current product, where the current product is the result of multiplying the first thread length of the current color to be matched by a preset multiple. Based on the result that the second thread length is greater than or equal to the current product, the candidate embroidery thread is determined as the target embroidery thread for the target area. Based on the result that there is no target color difference value less than a preset color difference value among the color difference values, a first recommended embroidery thread and a prompt to the user to supplement the embroidery thread are output. Based on the result that the second embroidery thread length is less than the current product, the system outputs a second piece of information prompting the user to add more embroidery thread. The current product is the result of multiplying the length of the first embroidery thread of the currently matched color by a preset multiple. The overall flowchart is as follows: Figure 3 As shown.
[0132] In one specific embodiment, an embroidery pattern is designed, and embroidery information is acquired. This information includes the first color of the embroidery thread used to embroider each embroidery area, the first thread length corresponding to each first color, and the matching order of the first colors. The thread length and RGB values of each actual embroidery thread in the thread library are collected using sensors. Based on the thread matching order, the current color to be matched is determined from the first colors. Then, based on the colors of each actual embroidery thread in the thread library, candidate embroidery threads matching the current color to be matched are determined from each actual embroidery thread. It is then determined whether the second thread length of the candidate embroidery thread is greater than or equal to the current product, where the current product is the result of multiplying the first thread length of the current color to be matched by a preset multiple. Based on the result that the second thread length is greater than or equal to the current product, the candidate embroidery thread is determined as the target embroidery thread for the target area. Based on the result that no target color difference value less than a preset color difference value exists among the color difference values, first information is output; the first information includes a first recommended embroidery thread and a prompt for the user to replenish the embroidery thread. Based on the result that the second thread length is less than the current product, a second recommended embroidery thread and a prompt for the user to replenish the embroidery thread are output. The overall flowchart is as follows: Figure 4 As shown.
[0133] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0134] Based on the same inventive concept, this application also provides a thread matching device for implementing the thread matching method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more thread matching device embodiments provided below can be found in the limitations of the thread matching method described above, and will not be repeated here.
[0135] In one embodiment, such as Figure 5 As shown, a thread matching device for embroidery is provided, comprising:
[0136] The information acquisition module is used to acquire the embroidery information of the embroidery pattern. The embroidery information includes the first color of the embroidery thread used to embroider each embroidery area of the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color.
[0137] The color matching module is used to determine the current color to be matched from each of the first colors according to the embroidery thread matching order, and to determine candidate embroidery threads that match the current color to be matched from each of the actual embroidery threads in the embroidery thread library according to the colors of each of the actual embroidery threads, and to calculate the second embroidery thread length of the candidate embroidery thread; wherein, calculating the second embroidery thread length of the candidate embroidery thread includes: using the formula Calculate the second thread length L of the candidate embroidery thread, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides;
[0138] The length matching module is used to determine the candidate embroidery thread as the target embroidery thread for embroidering the target area based on the result that the length of the second embroidery thread is greater than the current product. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple.
[0139] Each module in the aforementioned embroidery thread matching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0140] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores various types of data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a thread matching method.
[0141] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0142] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0143] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0144] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0145] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0146] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0147] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for matching embroidery threads, characterized in that, The method includes: S1. Obtain the embroidery information of the embroidery pattern, wherein the embroidery information includes the first color of the embroidery thread used to embroider each embroidery area of the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color. S2. According to the embroidery thread matching order, determine the current color to be matched from each of the first colors, and according to the colors of each actual embroidery thread in the embroidery thread library, determine the candidate embroidery thread that matches the current color to be matched from each of the actual embroidery threads, and calculate the second embroidery thread length of the candidate embroidery thread; S3. Based on the result that the length of the second embroidery thread is greater than the current product, the candidate embroidery thread is determined to be the target embroidery thread for embroidering the target area. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple. The calculation of the second embroidery thread length of the candidate embroidery thread includes: Use formula Calculate the second thread length L of the candidate embroidery thread, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides.
2. The method according to claim 1, characterized in that, Step S2, which involves calculating the second embroidery thread length of the candidate embroidery thread, includes: The actual winding method of the candidate embroidery thread on the outer edge of the embroidery thread pod, the actual material of the candidate embroidery thread, and a preset correction coefficient mapping table are obtained. The correction coefficient mapping table includes a first correction coefficient corresponding to various embroidery thread materials and a second correction coefficient for each embroidery thread material under various winding methods. Determine a target embroidery thread material that matches the actual material from among the described embroidery thread materials; Obtain the first correction coefficient corresponding to the target embroidery thread material and the second correction coefficient of the target embroidery thread material under the actual winding method; Through formula Calculate the second embroidery thread length of the candidate embroidery thread; Where k1 is the first correction coefficient, k2 is the second correction coefficient, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides.
3. The method according to claim 1, characterized in that, The process of determining candidate embroidery threads in step S2 includes: Calculate the color difference between the RGB value of each actual embroidery thread in the embroidery thread library and the RGB value of the current color to be matched; From the various color difference values, a target color difference value that is smaller than a preset color difference value is determined, and the actual embroidery thread corresponding to the target color difference value is determined as the candidate embroidery thread; Among them, color difference value The calculation formula is: (R1, G1, B1) are the RGB values of the actual embroidery thread, and (R2, G2, B2) are the RGB values of the current color to be matched.
4. The method according to claim 3, characterized in that, The method further includes: Based on the result that there is no target color difference value less than the preset color difference value among the color difference values, first information is output; the first information includes a first recommended embroidery thread, which is the actual embroidery thread corresponding to the smallest color difference value among the color difference values. In response to the recommended embroidery thread selection operation, the first recommended embroidery thread is selected as the candidate embroidery thread.
5. The method according to claim 1, characterized in that, The method further includes: Based on the result that the length of the second embroidery thread is less than the current product, second information is output, which includes a prompt to the user to add more embroidery thread.
6. The method according to claim 1, characterized in that, The method further includes: Based on the result that the length of the second embroidery thread is less than the current product, a selection control is displayed; In response to a trigger operation on the selection control, the candidate embroidery thread is determined to be the target embroidery thread for the target area, and a preset usage ratio is obtained, wherein the usage ratio is less than one. The allowable length of the candidate embroidery thread is obtained by multiplying the second embroidery thread length of the candidate embroidery thread with the preset ratio. A second recommended embroidery thread is determined from the actual embroidery threads, and the second recommended embroidery thread is determined as the target embroidery thread for embroidering the target area. The second recommended embroidery thread is an actual embroidery thread with a color difference value less than a preset color difference value and a length greater than a length difference value. The length difference value is the result of subtracting the allowed length from the length of the first embroidery thread of the current color to be matched.
7. The method according to claim 1, characterized in that, The method further includes: Based on the color of the target embroidery thread corresponding to each embroidery area, a first embroidery pattern preview image is generated, and at least one color set of the user is obtained, the color set including the user's preferred colors and / or favorite colors; In response to a color selection operation for each of the color sets, a selected color combination is obtained for each of the color sets, the selected color combination including a second color associated with each of the first colors; Based on each of the second colors in each of the color sets, generate a second embroidery pattern preview image corresponding to each of the color sets; Display the first embroidery pattern preview and each of the second embroidery pattern previews.
8. A thread matching device, characterized in that, The device includes: The information acquisition module is used to acquire the embroidery information of the embroidery pattern. The embroidery information includes the first color of the embroidery thread used to embroider each embroidery area of the embroidery pattern, the first embroidery thread length corresponding to each first color, and the matching order of the embroidery threads of each first color. The color matching module is used to determine the current color to be matched from each of the first colors according to the embroidery thread matching order, and to determine candidate embroidery threads that match the current color to be matched from each of the actual embroidery threads in the embroidery thread library according to the colors of each of the actual embroidery threads, and to calculate the second embroidery thread length of the candidate embroidery thread; wherein, calculating the second embroidery thread length of the candidate embroidery thread includes: using the formula Calculate the second thread length L of the candidate embroidery thread, h is the height of the embroidery thread cassette where the candidate embroidery thread is placed, and r is the diameter of the candidate embroidery thread. t r is the diameter of the top of the embroidery thread barrel. d R is the diameter of the bottom of the embroidery thread hopper, and the candidate embroidery thread is wound around the outer edge of the embroidery thread hopper. t R is the sum of the diameter of the top of the embroidery thread spool and the thickness of the candidate embroidery thread wrapped around its two outer edges. d It is the sum of the diameter of the bottom of the embroidery thread barrel and the thickness of the candidate embroidery thread wrapped around the outer edges on both sides; The length matching module is used to determine the candidate embroidery thread as the target embroidery thread for embroidering the target area based on the result that the length of the second embroidery thread is greater than the current product. The target area is the embroidery area corresponding to the current color to be matched. The current product is the result of multiplying the length of the first embroidery thread of the current color to be matched by a preset multiple.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.