Embroidery needle path generation method and system based on image processing
Through the image processing-based embroidery needle generation method, combined with three-dimensional spatial model, genetic algorithm, virtual reality technology and blockchain technology, the problem of inability to accurately reflect the details of complex patterns in the existing technology is solved, efficient, accurate and personalized embroidery effects are achieved, and unique identity authentication is provided.
Patent Information
- Application Number
- CN202510254142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot accurately reflect the details changes in multi-layer composite patterns, and it is even more difficult to cope with the challenges of color transitions and texture characteristics in complex patterns.
The embroidery needle path generation method based on image processing is adopted, and the embroidery pattern images uploaded by the user are layered and analyzed, a three-dimensional spatial model is constructed, and the embroidery path is optimized using genetic algorithms, and real-time correction and data recording are carried out in combination with virtual reality technology and blockchain technology.
It improves the precision and artistic expression of embroidery works, reduces unnecessary line changes and embroidery time, enhances user's sense of participation, and provides unique identity authentication for each embroidery work, which facilitates subsequent maintenance and copyright protection.
Smart Images

Figure CN120124478A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of embroidery stitch paths, and in particular, to a method for generating embroidery stitch paths based on image processing. Background Art
[0002] With the increasing demands for personalized customization and artistic creation, embroidery, as a traditional craft, has found new application scenarios in modern design. From high-end fashion to home decoration, the diversity and complexity of embroidery patterns are constantly increasing. Users hope to utilize modern technology to achieve more efficient, accurate, and personalized embroidery works while retaining the essence of traditional techniques; Currently, the existing embroidery stitch path generation methods on the market mainly rely on predefined templates or simple image conversion algorithms to guide the machine in embroidery work. These methods generally include receiving the embroidery pattern image uploaded by the user, preliminarily analyzing the image through basic color recognition and edge detection, and then generating embroidery paths according to fixed rules. However, this method lacks an understanding of the deep structure of the pattern and cannot accurately reflect the detail changes in multi-layer composite patterns, let alone cope with the challenges of color transitions and texture characteristics in complex patterns. Summary of the Invention
[0003] The embodiments of the present invention provide a method and system for generating embroidery stitch paths based on image processing to solve the problems in the prior art that cannot accurately reflect the detail changes in multi-layer composite patterns and are even more difficult to cope with the challenges of color transitions and texture characteristics in complex patterns.
[0004] In a first aspect, the embodiments of the present invention provide a method for generating embroidery stitch paths based on image processing, including: Receiving the embroidery pattern image uploaded by the user, performing hierarchical parsing on the embroidery pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element, where the embroidery parameters include: embroidery priority, stitch type, and color information; Constructing a three-dimensional space model according to the design element and the initial embroidery parameters corresponding to the design element, and defining the embroidery path corresponding to each design element by using the three-dimensional space model; Optimizing the embroidery path and the embroidery parameters corresponding to the embroidery path by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; Performing real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path by using virtual reality technology to obtain a target embroidery parameter configuration; According to the configured target embroidery parameters, use blockchain technology to record each embroidery instruction and the operation parameters corresponding to each embroidery instruction to generate an embroidery process chain, where the embroidery instructions include: needle entry, needle exit, and thread change, and the operation parameters include: position coordinates, thread color, and tension adjustment.
[0005] Optionally, according to the design elements and the embroidery parameters corresponding to the design elements, construct a three-dimensional space model, and use the three-dimensional space model to define the embroidery path corresponding to each design element, including: Use the design elements and the embroidery parameters corresponding to the design elements to perform information analysis and surface texture recognition on each design element to obtain the position, thickness, and surface texture characteristics of the design element in three-dimensional space; According to the position, thickness, and surface texture characteristic information, establish a three-dimensional coordinate system, and position each design element in the three-dimensional coordinate system, assign corresponding material properties to each design element, and generate an initial three-dimensional space layout; Based on the initial three-dimensional space layout and material properties, combined with the color information of the design elements, determine the thread stacking order and color transition strategy, and generate an optimized three-dimensional space layout; Based on the optimized three-dimensional space layout, use a topology optimization algorithm to adjust the relative positions between the design elements to obtain a target three-dimensional space layout; Based on the target three-dimensional space layout and the thread stacking order, define the embroidery path for each design element, and the embroidery path is used to reflect the orientation and distribution of the design element in three-dimensional space.
[0006] Optionally, according to the position, thickness, and surface texture characteristic information, establish a three-dimensional coordinate system, and position each design element in the three-dimensional coordinate system, assign corresponding material properties to each design element, and generate an initial three-dimensional space layout, including: Use the position, thickness, and surface texture characteristic information to construct a three-dimensional coordinate system in a virtual environment; Based on the three-dimensional coordinate system, perform position positioning on each design element, and record the position parameters of each design element to obtain the positioned design elements; According to the positioned design elements and the color information corresponding to the positioned design elements, assign material properties to each positioned design element to generate design elements with material properties, and the material properties include: thread type, color, reflection characteristics, and transparency and glossiness; Apply physical simulation technology to adjust the relative distances and angles between the design elements with material properties to make the thread fluidity and stacking order during the embroidery process reasonable, so as to obtain an optimized position relationship; Based on the optimized positional relationship, use the lighting model to simulate the visual effects of design elements with material properties under different light sources, verify and optimize the performance of design elements with material properties, in order to generate an initial three-dimensional spatial layout.
[0007] Optionally, receive the embroidered pattern image uploaded by the user, perform hierarchical parsing on the embroidered pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element. The embroidery parameters include: embroidery priority, stitch type, and color information, including: Receive the embroidered pattern image uploaded by the user, apply multi-scale analysis technology to perform multi-layer parsing processing on the embroidered pattern image, separate multiple layers including foreground and background, and record the transparency and overlapping relationship of each layer to obtain an initial layer; Based on the initial layer, combine edge detection algorithms to identify and extract each independent design element in each layer, and generate the position information of each independent design element; Use color analysis and texture recognition technology to analyze the color information, texture characteristics, and distribution of each independent design element, and generate a design element attribute description table; According to the design element attribute description table, use an intelligent matching algorithm to assign corresponding embroidery parameters to each design element. Among them, the embroidery parameters include: embroidery priority, stitch type, and color information.
[0008] Optionally, use virtual reality technology to perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path to obtain a target embroidery parameter configuration, including: Use a virtual reality environment to visually display the optimized embroidery path and optimized embroidery parameters, and introduce a multi-view display mode to generate an embroidery path model; Use the embroidery path model to provide a user interface, allowing the user to adjust the position, angle, and thread density of the optimized embroidery path through a controller, and combine a haptic feedback device to provide the adjustment result to obtain an adjusted optimized embroidery path; According to the adjusted optimized embroidery path, update the optimized embroidery parameters in real time, and integrate an intelligent recommendation system to provide adjustment suggestions for the user and immediately feedback to the user to obtain an initial embroidery parameter configuration; Use the initial embroidery parameter configuration to apply a lighting model in a virtual environment to simulate the actual embroidery effect, so that the adjusted optimized embroidery path and the initial embroidery parameter configuration have visual consistency under different lighting conditions to generate a simulated embroidery effect; According to the simulated embroidery effect, collect the adjustment results confirmed by the user, and analyze the user preferences through machine learning algorithms to optimize the initial embroidery parameter configuration and generate a target embroidery parameter configuration.
[0009] Optionally, a genetic algorithm is used to optimize the embroidery path and the embroidery parameters corresponding to the embroidery path, and an optimized embroidery path and optimized embroidery parameters corresponding to the optimized embroidery path are obtained, including: Based on the three-dimensional space model, the initial embroidery paths of each design element are encoded to obtain the chromosome representation form in the genetic algorithm; Using the chromosome representation form, a selection operation is performed on the set of initial embroidery paths, and multiple initial embroidery paths are randomly selected as parent individuals to generate an evolutionary population; Based on the evolutionary population, a crossover operation is applied to pair the selected parent individuals and exchange path information to generate offspring individuals; According to the offspring individuals, a mutation operation is performed to adjust the initial embroidery path and the embroidery parameters corresponding to the embroidery path, and the adjusted offspring individuals are generated; The performances of the parent individuals and the adjusted offspring individuals are evaluated through a preset fitness function to obtain an optimized embroidery path and optimized embroidery parameters corresponding to the optimized embroidery path.
[0010] Optionally, according to the target embroidery parameter configuration, blockchain technology is used to record each embroidery instruction and the operation parameters corresponding to each embroidery instruction to generate an embroidery process chain, including: Based on the target embroidery parameter configuration, each embroidery instruction is parsed to extract operation instructions, and the operation parameters corresponding to each operation instruction are determined to obtain the parsed operation instructions and the operation parameters corresponding to each operation instruction; According to the parsed operation instructions and the operation parameters corresponding to each operation instruction, an embroidery instruction data structure including a time stamp is constructed to generate a preliminary embroidery instruction sequence with time information; Using blockchain technology, a data block is created for each embroidery instruction in the preliminary embroidery instruction sequence with time information, and a hash value is added to generate a hash value data block; The hash value data blocks are linked in sequence to form a chain to obtain an initial embroidery process chain. Through a smart contract mechanism, each hash value data block in the initial embroidery process chain is verified and executed, and the result of each execution is recorded to complete the construction of the target embroidery process chain. In a second aspect, an embroidery stitch path generation system based on image processing according to an embodiment of the present invention includes: A receiving module, configured to receive an embroidery pattern image uploaded by a user, perform hierarchical parsing on the embroidery pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element, where the embroidery parameters include: embroidery priority, stitch type, and color information; A building module for constructing a three-dimensional space model according to the design elements and the initial embroidery parameters corresponding to the design elements, and defining the embroidery path corresponding to each design element by using the three-dimensional space model; An optimization module for optimizing the embroidery path and the embroidery parameters corresponding to the embroidery path by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; A correction module for performing real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path by using virtual reality technology to obtain a target embroidery parameter configuration; A generation module for recording each embroidery instruction and the operation parameters corresponding to each embroidery instruction by using blockchain technology according to the target embroidery parameter configuration to generate an embroidery process chain, wherein the embroidery instructions include: needle entry, needle exit, and thread change, and the operation parameters include: position coordinates, thread color, and tension adjustment. In a third aspect, an embodiment of the present invention provides a computing device, including a processor and a memory, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method according to any one of the first aspects.
[0011] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of the first aspects is implemented.
[0012] In an embodiment of the present invention, an embroidery pattern image uploaded by a user is received, and the embroidery pattern image is hierarchically analyzed to obtain each independent design element and the embroidery parameters corresponding to the design element; a three-dimensional space model is constructed according to the design element and the initial embroidery parameters corresponding to the design element, and the embroidery path corresponding to each design element is defined by using the three-dimensional space model; the embroidery path and the embroidery parameters corresponding to the embroidery path are optimized by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path are subjected to real-time interactive correction by using virtual reality technology to obtain a target embroidery parameter configuration; according to the target embroidery parameter configuration, each embroidery instruction and the operation parameters corresponding to each embroidery instruction are recorded by using blockchain technology to generate an embroidery process chain; the technical solution provided by the present invention improves the fineness and artistic expressiveness of the final embroidery work, reduces unnecessary thread change times and embroidery time, enhances the user's sense of participation, makes personalized customization possible, and also provides a unique identity authentication for each embroidery work, facilitating subsequent maintenance and copyright protection; Furthermore, by analyzing the information and identifying the surface textures of each design element, their positions, thicknesses, and surface texture features in three-dimensional space are obtained, increasing the level of understanding of the pattern and helping to more realistically simulate the actual embroidery effect. After establishing a three-dimensional coordinate system, each design element is positioned and assigned corresponding material properties therein, thereby generating an initial three-dimensional space layout containing all design elements and their material properties, enhancing the realism of the pattern and making the finished product closer to the original intention of the designer. Combining the color information of the design elements, the thread stacking order and color transition strategy are determined to generate an optimized three-dimensional space layout, ensuring natural and smooth color transition and enhancing the artistic beauty of the embroidery work. The relative positions between design elements are adjusted using a topology optimization algorithm to obtain a target three-dimensional space layout, ensuring the overall coherence and aesthetics of the pattern, while also considering the fluidity and stability of the thread during the embroidery process. Based on the target three-dimensional space layout and the thread stacking order, the embroidery path for each design element is defined to ensure that the path can accurately reflect the orientation and distribution of the design element in three-dimensional space, improving the accuracy of the embroidery path and reducing the possibility of embroidery errors; Furthermore, by introducing a multi-view display mode, an embroidery path model is generated, allowing users to view the embroidery path from different angles, helping them better understand the pattern structure and improving the accuracy of adjustment. Combined with a haptic feedback device, users can experience a real sense of adjustment, making it feel like operating a physical object when adjusting the embroidery path in a virtual environment, enhancing the realism and immersion of the interaction. An intelligent recommendation system is integrated to provide adjustment suggestions to users and give instant feedback, helping to quickly find the optimal configuration. This not only simplifies the user operation process but also guides the creation of better embroidery effects. The lighting model is applied to simulate the actual embroidery effect, ensuring the visual consistency of the optimized embroidery path after adjustment under different lighting conditions, helping users preview the appearance of the finished product in advance and reducing the uncertainty caused by changes in ambient light. By analyzing user preferences using machine learning algorithms, the embroidery parameter configuration is automatically optimized to generate a target embroidery parameter configuration that meets user expectations, not only improving work efficiency but also promoting the development of personalized services, enabling each embroidery to achieve a satisfactory effect for users.
[0013] These aspects or other aspects of the present invention will become more apparent and understandable in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0015] Figure 1 A flowchart of an embroidery stitch path generation method based on image processing provided by an embodiment of the present invention; Figure 2 A schematic structural diagram of an embroidery stitch path generation system based on image processing provided by an embodiment of the present invention; Figure 3 A schematic structural diagram of a computing device provided by an embodiment of the present invention. Detailed implementation manners
[0016] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0017] In some processes described in the specification and claims of the present invention and the above-mentioned drawings, a plurality of operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear herein or may be executed in parallel. The operation numbers such as 101 and 102 are only used to distinguish different operations, and the numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0019] Figure 1 A flowchart of an embroidery stitch path generation method based on image processing provided by an embodiment of the present invention is as Figure 1 shown, and the method includes: Step 101: Receive the embroidery pattern image uploaded by the user, perform hierarchical parsing on the embroidery pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element. The embroidery parameters include: embroidery priority, stitch type, and color information; In this step, the embroidered pattern image refers to an image file uploaded digitally to the platform, which can be a hand-drawn sketch, a photographic photo, or a computer-generated artwork, etc. Layered parsing means identifying and separating different layers in the image through algorithms, such as foreground and background, so as to extract each design element. Each design element not only contains visual graphic information but also includes embroidery parameters related to it. For example, the embroidery priority determines the embroidery order; the stitch type specifies the specific embroidery technique; the color information ensures that the thread selection matches the color of the original pattern; First, apply image processing techniques to identify and separate each layer in the image, and then use edge detection and color analysis algorithms to further refine the structural features within each layer. Subsequently, automatically assign embroidery parameters according to factors such as the color distribution and texture characteristics of the design elements, considering the overall layout and artistic style of the pattern to ensure that the generated embroidery path is both beautiful and practical; For example, the designer uploads an image containing a multi-layer composite pattern, which has both complex flower patterns and simple geometric shapes. The image is successfully divided into multiple layers, and appropriate embroidery parameters are assigned to the design elements in each layer, such as flower petals, leaves, and geometric lines. Next, this information will be used to construct a three-dimensional space model to more precisely define the embroidery path.
[0020] Step 102: Construct a three-dimensional space model based on the design elements and the initial embroidery parameters corresponding to the design elements, and use the three-dimensional space model to define the embroidery path corresponding to each design element; In this step, the three-dimensional space model is a virtual environment that not only represents the planar coordinates x, y but also introduces the depth coordinate z to describe the spatial position and thickness of the design elements. The position, thickness, and surface texture characteristics of the design elements are accurately located in the three-dimensional space. At the same time, assign material properties to each design element, including but not limited to thread type, color, reflection characteristics, transparency, and glossiness. Based on this model, the embroidery path of each design element can be defined, that is, the specific route for performing the embroidery operation; Based on the design elements and their initial embroidery parameters, locate each element in the three-dimensional coordinate system and assign material properties to form a preliminary three-dimensional space layout. Then, combine the color information of the design elements to determine the thread stacking order and color transition strategy to optimize the three-dimensional space layout. Finally, use a topology optimization algorithm to adjust the relative positions between the design elements to obtain the target three-dimensional space layout, and then define the embroidery path of each design element; Continuing with the example of the previous step, now place the floral pattern and geometric shapes in a three-dimensional space. Considering the curvature of the petals, the thickness of the leaves, and the overlapping of geometric shapes, through the optimized three-dimensional space layout, the embroidery paths of each petal, each vein, and each geometric line are accurately defined, ensuring that the final embroidery effect is natural, smooth, and full of layers.
[0021] Step 103: Use a genetic algorithm to optimize the embroidery path and the embroidery parameters corresponding to the embroidery path to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; In this step, the genetic algorithm is a search heuristic algorithm that simulates the biological evolution process in nature. It explores the optimal solution through selection, crossover, and mutation operations. The embroidery path refers to the specific route during the embroidery operation, and the embroidery parameters cover information such as the position coordinates of the needle entry and exit, thread color, and tension adjustment. The purpose of this step is to reduce unnecessary thread change times, improve embroidery efficiency, and maintain or enhance embroidery quality by optimizing the embroidery path and its parameters; Use the selection operation of the genetic algorithm to randomly select several paths from the initial embroidery path set as parent individuals to form an evolutionary population. Then, apply the crossover operation to pair the selected parent individuals and exchange partial path information to generate offspring individuals with hybrid characteristics. Next, perform the mutation operation to randomly adjust some paths or parameters, introducing new possibilities for embroidery paths and parameters. Finally, evaluate the performance of all individuals through the fitness function and select the optimized embroidery path and its corresponding embroidery parameters; Continuing with the above embodiment, the genetic algorithm is used to optimize the previously defined embroidery path. After multiple rounds of iteration, an optimal path that can reduce the thread change times and ensure the embroidery effect is found. For example, the originally complex and intertwined petal path is simplified into a smoother curve, enabling the task to be completed faster without sacrificing details.
[0022] Step 104: Use virtual reality technology to perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path to obtain the target embroidery parameter configuration; In this step, virtual reality technology allows users to interact with objects in a virtual environment, providing an immersive experience. The optimized embroidery path refers to the embroidery path optimized by the genetic algorithm, and the optimized embroidery parameters refer to the corresponding parameter settings, such as position coordinates, thread color, and tension adjustment. This step enables users to directly participate in the design process of the embroidery path through virtual reality technology, making real-time adjustments and corrections until they are satisfied; Visualize the optimized embroidery path and optimized embroidery parameters in a virtual environment, introduce a multi-perspective display mode, and generate an embroidery path model. Users can adjust the position, angle, and thread density of the optimized embroidery path through a controller, and combine with a haptic feedback device to obtain a realistic adjustment experience. Update the embroidery parameters in real time, and integrate an intelligent recommendation system to provide adjustment suggestions for users, and immediately feedback to users, and finally generate the target embroidery parameter configuration; The designer puts on the VR headset and enters the virtual environment, sees the previously optimized embroidery path, uses the controller to adjust the angles of some petals, and feels the effect of the adjustment through haptic feedback. Whenever a change is made, the parameters are immediately updated, and optimization suggestions are given. After the designer confirms satisfaction, these adjustment results are recorded to form the final target embroidery parameter configuration.
[0023] Step 105: According to the target embroidery parameter configuration, use blockchain technology to record each embroidery instruction and the operation parameters corresponding to each embroidery instruction to generate an embroidery process chain, where the embroidery instructions include: needle entry, needle exit, and thread change, and the operation parameters include: position coordinates, thread color, and tension adjustment; In this step, blockchain technology is a distributed ledger technology that can create immutable data records to ensure the security and transparency of data. Embroidery instructions include specific operations such as needle entry, needle exit, and thread change, while operation parameters cover information such as position coordinates, thread color, and tension adjustment. This step records every operation in the embroidery process through blockchain technology to form a complete embroidery process chain, which not only ensures the security of data but also provides a unique identity authentication for each embroidery work; According to the target embroidery parameter configuration, use blockchain technology to create an immutable data block for each embroidery instruction, recording the instruction and all its related operation parameters. These data blocks are linked in sequence to form a chain to form a complete embroidery process chain. In addition, through the smart contract mechanism, each data block in the embroidery process chain is automatically verified and executed to ensure that the embroidery process proceeds accurately according to the preset target embroidery parameter configuration; For example, the work now enters the actual embroidery stage, and every needle entry, needle exit, or thread change operation is faithfully recorded by blockchain technology to form an immutable embroidery process chain, which not only ensures the traceability of the embroidery process but also provides a unique identity for the finished product. If there are any future copyright issues, this process chain can be used as strong evidence.
[0024] In summary, through the above key steps, the full - process automation from the user uploading the embroidery pattern image to the final generation of the embroidery process chain is achieved. First, complex patterns can be accurately parsed, and design elements and their embroidery parameters are extracted, laying a solid foundation for subsequent steps. Second, by constructing a three - dimensional space model and defining the embroidery path, the accuracy and beauty of the embroidery process are ensured. Third, the application of the genetic algorithm significantly improves the embroidery efficiency and reduces unnecessary thread - changing times. Fourth, the real - time interactive correction function provided by virtual reality technology greatly enhances the user experience and makes personalized customization possible. Finally, the introduction of blockchain technology not only guarantees data security but also endows each embroidery work with a unique identity authentication, promoting copyright protection and the improvement of technological credibility. The entire process is interlocked, and each step is closely connected, jointly constituting an efficient, precise, and personalized embroidery solution.
[0025] To solve the quality problems of high complexity of embroidery patterns, low efficiency of traditional manual path planning, and difficulty in ensuring consistency in the prior art, in some embodiments, as described in step 102, according to the design elements and the embroidery parameters corresponding to the design elements, a three - dimensional space model is constructed, and the embroidery path corresponding to each design element is defined by using the three - dimensional space model. Specifically, it includes: In this embodiment, information analysis and surface texture recognition refer to the in - depth parsing of the extracted design elements through algorithms. These design elements are independent parts obtained after image hierarchical parsing, such as petals, leaves, or geometric shapes in the pattern. Surface texture features refer to the visual characteristics of the element surface, such as smoothness, roughness, glossiness, etc. These data are used to determine the arrangement and density of the threads during embroidery. In the embodiments of the present application, first, information analysis and surface texture recognition are performed on each design element to obtain its position (i.e., x, y, z coordinates), thickness, and surface texture features in the three - dimensional space. Then, each design element is located in the three - dimensional coordinate system, and a material property is assigned to it, such as thread type, color, reflection characteristics, transparency, and glossiness, to form an initial three - dimensional space layout. Next, in combination with color information, the thread stacking order and color transition strategy are determined to optimize the three - dimensional space layout. Finally, a topological optimization algorithm is used to adjust the relative positions of the design elements to ensure that the final space layout is both beautiful and practical, and based on this, the embroidery path of each design element is defined. These paths accurately reflect the orientation and distribution of the design elements in the three - dimensional space; For example, consider a complex flower pattern embroidery project that includes multiple layers of overlapping petals and leaves of different colors. First, the position, thickness, and surface texture of each petal will be analyzed, and then a three-dimensional coordinate system will be established to accurately place each petal. Then, based on the color information of the petals, the stacking order of the threads will be determined so that the colors transition naturally from the bottom to the top, simulating the effect of a real flower. After that, the relative positions of the petals will be adjusted through topological optimization to ensure that there are no unnecessary intersections or occlusions. The resulting target three-dimensional space layout can guide the machine to embroider along the optimal path, ensuring the quality and efficiency of the work.
[0026] To improve the accuracy and visual effect of the embroidery pattern, as described in the previous embodiment, a three-dimensional coordinate system is constructed in a virtual environment using the position, thickness, and surface texture feature information, specifically including: Using the position, thickness, and surface texture feature information, a three-dimensional coordinate system is constructed in a virtual environment. Based on the three-dimensional coordinate system, the positions of each design element are located, and the position parameters of each design element are recorded to obtain the located design elements. According to the located design elements and the color information corresponding to the located design elements, a material property is assigned to each located design element to generate design elements with material properties. The material properties include: thread type, color, reflection characteristics, and transparency and glossiness. Physical simulation technology is applied to adjust the relative distances and angles between the design elements with material properties to make the thread fluidity and stacking order during the embroidery process reasonable, so as to obtain an optimized position relationship. Based on the optimized position relationship, a lighting model is used to simulate the visual effects of the design elements with material properties under different light sources, verify and optimize the performance of the design elements with material properties, and generate an initial three-dimensional space layout; In this embodiment, the virtual environment refers to a computer-generated space in which the physical laws of the real world can be simulated; by constructing a three-dimensional coordinate system, that is, a system composed of the x, y, and z axes, the spatial positions of the design elements can be accurately represented; the position parameters refer to the specific coordinate values used to describe the design elements in the three-dimensional coordinate system to ensure that each element can be accurately located; the material properties are not limited to the thread type and color, but also include reflection characteristics, transparency, and glossiness, etc. These properties determine the texture and appearance of the final embroidery work; physical simulation technology is a technology used to simulate the physical phenomena of the real world, such as collision detection between objects, gravity effects, etc. Here, it is used to ensure that the threads are arranged naturally and smoothly during the embroidery process; the lighting model is a method for simulating how light interacts with the surface of an object to evaluate the visual effects under different light source conditions; In the embodiments of the present application, first, a three-dimensional coordinate system is constructed in a virtual environment to more precisely process complex patterns. Then, according to the position, thickness, and surface texture characteristics of the design elements, they are positioned in the three-dimensional coordinate system, and the position parameters are recorded. Next, combined with the color information of the design elements, material properties such as thread type, color, reflection characteristics, transparency, and glossiness are assigned to each design element to generate design elements with material properties. Subsequently, physical simulation technology is applied to adjust the relative distance and angle between the design elements to ensure reasonable thread fluidity and stacking order during the embroidery process. Finally, a lighting model is used to simulate the visual effects of the design elements under different light source conditions to further verify and optimize their performance, thereby generating an initial three-dimensional spatial layout. For example, in a complex flower embroidery project, the designer hopes to achieve the effect of the petals gradually fading from the bottom to the top. First, a three-dimensional coordinate system is constructed in a virtual environment, and each petal is placed in its correct position, and their specific coordinates are recorded. Then, according to the color gradient of the petals, appropriate material properties including thread type, color, reflection characteristics, transparency, and glossiness are assigned to each petal. After that, physical simulation technology is used to adjust the relative distance and angle between the petals to ensure that the threads can flow naturally during embroidery without unreasonable intersections or accumulations. Finally, different light source conditions are simulated through the lighting model to check whether the color transition of the petals is natural, and fine-tuning is performed if necessary to ensure that the final embroidery work is both beautiful and realistic.
[0027] To solve the problems in the prior art that the embroidery pattern parsing is not fine enough and it is difficult to handle multi-level and complex structures, as another embodiment, according to what is described in step 101, an embroidery pattern image uploaded by the user is received, and the embroidery pattern image is subjected to hierarchical parsing to obtain each independent design element and the embroidery parameters corresponding to the design element, specifically including: An embroidery pattern image uploaded by the user is received, and the embroidery pattern image is subjected to multi-scale analysis technology for multi-layer parsing processing to separate multiple layers including the foreground and background, and the transparency and overlapping relationship of each layer are recorded to obtain an initial layer. Based on the initial layer, edge detection algorithms are combined to identify and extract each independent design element in each layer, and the position information of each independent design element is generated. The color information, texture characteristics, and distribution of each independent design element are analyzed by using color analysis and texture recognition technology to generate a design element attribute description table. According to the design element attribute description table, corresponding embroidery parameters are assigned to each design element through an intelligent matching algorithm. In this embodiment, the multi-scale analysis technology is an image processing method that can analyze image features at different resolution levels, helping to identify different layers such as the foreground and background in the image; transparency refers to the degree of opacity of a layer, which determines how layers are superimposed and displayed on each other; the overlapping relationship describes the relative positions and coverage of different layers; the initial layer is the basic layer separated by multi-scale analysis for subsequent further processing; the edge detection algorithm is an image processing technology that can identify the boundaries of objects in an image, helping to accurately extract design elements; the position information refers to the coordinates of each design element in the image, ensuring that these elements can be accurately located in subsequent steps; the color analysis and texture recognition technology are used in combination, considering not only the color distribution but also the texture characteristics to more comprehensively describe the visual attributes of design elements; the design element attribute description table summarizes the relevant information of all extracted design elements, such as color, texture, position, etc., providing a basis for allocating embroidery parameters in the next step; the intelligent matching algorithm automatically selects the most suitable embroidery parameters according to the information in the design element attribute description table, including embroidery priority, stitch type, and color information; In the embodiment of this application, first, the multi-scale analysis technology is applied to perform multi-layer parsing processing on the embroidery pattern image uploaded by the user, separating multiple layers including the foreground and background, and recording the transparency and overlapping relationship of each layer to obtain the initial layer; then, based on the initial layer, the edge detection algorithm is combined to identify and extract each independent design element in each layer, and generate the position information of each independent design element; then, the color analysis and texture recognition technology are used to analyze the color information, texture characteristics, and distribution of each independent design element, generating a design element attribute description table; finally, according to the design element attribute description table, the intelligent matching algorithm allocates corresponding embroidery parameters for each design element, where the embroidery parameters include embroidery priority, stitch type, and color information, ensuring that each design element can be embroidered in the most appropriate way; For example, when processing a complex embroidery pattern, the designer uploads an image of a flower pattern with a multi-level structure. The system first applies the multi-scale analysis technology to decompose the image into multiple layers, respectively representing different parts of the flower (such as petals, leaves) and the background. Next, the system uses the edge detection algorithm to identify and extract the independent design elements in each layer, and at the same time determines their position information. Subsequently, the color analysis and texture recognition technology are used to detail the color and texture characteristics of each design element, forming a design element attribute description table. Finally, the intelligent matching algorithm selects appropriate embroidery parameters for each design element according to these attributes, such as priority, stitch type, and color, ensuring that the final embroidery work is both faithful to the original pattern and can achieve the best effect in the actual embroidery process.
[0028] To solve the problem of the lack of intuitiveness and real-time feedback in the embroidery path correction process in the prior art, as another embodiment, according to step 104, the virtual reality technology is used to perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path to obtain the target embroidery parameter configuration, which specifically includes: Using a virtual reality environment, visually display the optimized embroidery path and the optimized embroidery parameters, introduce a multi-view display mode, and generate an embroidery path model. Using the embroidery path model, provide a user interface that allows the user to adjust the position, angle, and thread density of the optimized embroidery path through a controller, and combine a haptic feedback device to provide the adjustment result to obtain the adjusted optimized embroidery path. According to the adjusted optimized embroidery path, update the optimized embroidery parameters in real time, and integrate an intelligent recommendation system to provide adjustment suggestions for the user and immediately feedback to the user to obtain the initial embroidery parameter configuration. Using the initial embroidery parameter configuration, apply a lighting model in the virtual environment to simulate the actual embroidery effect, so that the adjusted optimized embroidery path and the initial embroidery parameter configuration have visual consistency under different lighting conditions to generate a simulated embroidery effect. According to the simulated embroidery effect, collect the adjustment results confirmed by the user, and analyze the user preferences through a machine learning algorithm to optimize the initial embroidery parameter configuration and generate the target embroidery parameter configuration; In this embodiment, the virtual reality environment refers to a three-dimensional space generated by a computer, in which the user can interact with virtual objects; the multi-view display mode allows the user to view the embroidery path model from different angles to ensure a comprehensive understanding of the spatial layout of the design elements; the embroidery path model is a three-dimensional visual representation constructed based on the optimized embroidery path and parameters, used to display the thread orientation and distribution during the embroidery process; the controller is a physical device such as a handle or a gesture recognition device, through which the user can operate the objects in the virtual environment; the haptic feedback device provides physical sensory feedback, enabling the user to feel the adjustment effect and enhancing the realism of the interaction; the intelligent recommendation system is an auxiliary tool that can provide suggestions based on the user's operations to help the user complete the correction work more efficiently; the lighting model simulates how light interacts with the object surface to evaluate the visual effects under different light source conditions; the machine learning algorithm automatically optimizes the embroidery parameter configuration by analyzing the user behavior data to make it more in line with personal preferences; In the embodiments of the present application, first, a virtual reality environment is used to visually display the optimized embroidery path and optimized embroidery parameters, and a multi - perspective display mode is introduced to generate an embroidery path model; then, based on the embroidery path model, a user - interaction interface is provided, allowing the user to adjust the position, angle, and thread density of the optimized embroidery path through a controller, and combining with a haptic feedback device to provide the adjustment result, thus obtaining the adjusted optimized embroidery path; next, according to the adjusted optimized embroidery path, the optimized embroidery parameters are updated in real - time, and an intelligent recommendation system is integrated to provide adjustment suggestions for the user and immediately feedback to the user, obtaining the initial embroidery parameter configuration; after that, a lighting model is applied in the virtual environment to simulate the actual embroidery effect, ensuring that the adjusted optimized embroidery path and the initial embroidery parameter configuration have visual consistency under different lighting conditions, generating a simulated embroidery effect; finally, according to the simulated embroidery effect, the adjustment results confirmed by the user are collected, and the user preferences are analyzed through machine - learning algorithms to optimize the initial embroidery parameter configuration, generating the final target embroidery parameter configuration; For example, when dealing with a complex floral embroidery pattern, the designer hopes to intuitively adjust the angles of the petals and the thread density in the virtual environment; first, the designer wears a VR headset to enter the virtual reality environment and sees the embroidery path model optimized by the genetic algorithm before; the designer uses the controller to adjust the angles of some petals and feels the actual effect of the adjustment through the haptic feedback device; whenever a change is made, the intelligent recommendation system immediately updates the parameters and gives optimization suggestions; after the designer confirms satisfaction, these adjustment results are recorded; next, the system applies a lighting model to simulate the embroidery effect under different light - source conditions, ensuring natural color transition of the petals and no shadow problems; finally, the designer confirms all adjustments, and the system analyzes the adjustment data through machine - learning algorithms to further optimize the embroidery parameter configuration, ensuring that a more embroidery path closer to the designer's intention can be automatically generated in the next similar project.
[0029] To solve the problem of low efficiency in embroidery path planning and difficulty in finding the optimal solution in the prior art, as another embodiment, according to what is described in step 103, the genetic algorithm is used to optimize the embroidery path and the embroidery parameters corresponding to the embroidery path, obtaining the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path, specifically including: Based on the three-dimensional space model, the initial embroidery paths of each design element are encoded into the form of chromosomes in the genetic algorithm; using these chromosome representations, multiple paths are randomly selected from the set of initial embroidery paths as parent individuals to generate an evolutionary population; then, the crossover operation is applied to pair the parent individuals and exchange path information to generate offspring individuals; subsequently, the mutation operation is performed to adjust the embroidery paths of the offspring individuals and their corresponding embroidery parameters to generate the adjusted offspring individuals; finally, the performance of the parent individuals and the adjusted offspring individuals is evaluated through a preset fitness function, and the optimal solution is selected to obtain the optimized embroidery paths and the corresponding optimized embroidery parameters; In this embodiment, the chromosome representation refers to encoding the initial embroidery path of each design element into a form that can be processed in the genetic algorithm, and this form is similar to the chromosome in biological genetics; the evolutionary population is a group composed of randomly selecting multiple paths from the set of initial embroidery paths as parent individuals through the selection operation for subsequent genetic operations; the crossover operation is to pair the selected parent individuals and exchange partial path information, simulating gene recombination in the biological reproduction process; the mutation operation is to randomly adjust some paths or parameters to introduce new possibilities, simulating the mutation phenomenon in nature; the fitness function is an evaluation mechanism used to measure the performance of individuals (i.e., embroidery paths and their parameters) to determine which individuals can enter the next generation; In the embodiment of the present application, first, based on the three-dimensional space model, encoding processing is performed on the initial embroidery paths of each design element; this process involves converting the embroidery paths into a series of digital or symbol sequences, and these sequences can represent all the characteristics of the original paths, such as the needle entry point, needle exit point, thread color, and tension adjustment, etc., to form the chromosome representation in the genetic algorithm; the encoded paths are not only convenient for computer processing but also ensure the accuracy of the genetic algorithm operations; Next, using the chromosome representation, a selection operation is performed on the set of initial embroidery paths; a certain number of paths are randomly selected from all possible embroidery paths as parent individuals, and these selected paths form the evolutionary population; the selection operation is not random but based on certain rules or criteria, such as preferentially considering those paths with higher fitness values, that is, those paths closer to the ideal embroidery effect; Then, based on the formed evolutionary population, the crossover operation is applied to pair the selected parent individuals and exchange path information; the key in this stage is to reasonably select the pairing method and crossover points to generate offspring individuals; through the crossover operation, the newly generated offspring individuals inherit the characteristics from two parent individuals, which helps to explore a wider design space while maintaining the advantages of the original paths; Perform a mutation operation based on the generated offspring individuals; the mutation operation aims to introduce randomness by slightly adjusting certain embroidery paths or their corresponding embroidery parameters, such as changing the needle insertion position, adjusting the thread color, or modifying the tension settings, to generate adjusted offspring individuals; mutation can not only prevent the algorithm from falling into local optima but also promote the emergence of new features, thereby improving the quality of the final solution. Finally, evaluate the performance of the parent individuals and the adjusted offspring individuals through a preset fitness function; the fitness function scores each individual according to preset goals, such as reducing the number of thread changes, shortening the total path length, or enhancing visual aesthetics; individuals with high scores are considered closer to the ideal embroidery path configuration and have the opportunity to be selected as parent individuals for the next generation; after multiple rounds of iteration, continuously update the evolving population, and finally select the individual with the best performance to obtain the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path. For example, when dealing with an embroidery project of a complex flower pattern, the designer hopes to reduce the number of thread changes and improve embroidery efficiency by optimizing the embroidery path; first, encode the initial embroidery path of each petal based on a three-dimensional space model to form the chromosome representation required by the genetic algorithm; then, randomly select several of these encoded paths as parent individuals to form an evolving population; subsequently, perform a crossover operation on these parent individuals to simulate gene recombination between different embroidery paths and generate new offspring individuals; then, perform a mutation operation on some of the offspring individuals, randomly adjusting certain paths or parameters, such as changing the needle insertion point or thread color, to explore more possible solutions; finally, evaluate the performance of all individuals, including the parent and the mutated offspring, through the fitness function, and select the optimal embroidery path and its parameter configuration; after multiple rounds of iteration, an optimal solution that can simplify the path and maintain the embroidery effect is found, significantly improving the embroidery efficiency and reducing unnecessary thread change operations.
[0030] To solve the problems of insecure recording and difficult traceability of the embroidery process chain in the prior art and to enhance the effect of data integrity and transparency, as another embodiment, according to step 105, record each embroidery instruction and the operation parameters corresponding to each embroidery instruction using blockchain technology based on the target embroidery parameter configuration to generate an embroidery process chain, specifically including: Based on the target embroidery parameter configuration, each embroidery instruction is parsed into specific operation instructions and their corresponding operation parameters; subsequently, according to these parsed operation instructions and parameters, an embroidery instruction data structure containing timestamps is constructed to generate a preliminary embroidery instruction sequence with time information. Using blockchain technology, a data block containing a hash value is created for each embroidery instruction in this sequence to form a hash value data block. These hash value data blocks are linked in sequence to form a chain, constituting the initial embroidery process chain. Through the smart contract mechanism, each hash value data block is verified and executed, and the result of each execution is recorded, ultimately completing the construction of a secure and tamper-proof target embroidery process chain.
[0031] In this embodiment, a timestamp is a data structure used to mark the time when an event occurs. Adding timestamps can ensure the sequential execution of embroidery instructions and increase the time dimension of the record. A hash value is a string of characters calculated through a specific algorithm and has uniqueness, which can be used to verify the integrity of data. Blockchain technology is a distributed ledger technology that can create tamper-proof data records to ensure the security and transparency of data. The smart contract mechanism is a set of automated rule sets that can automatically trigger corresponding operations when preset conditions are met; In the embodiments of the present application, first, based on the configuration of target embroidery parameters, each embroidery instruction is carefully parsed to identify and extract each embroidery action (i.e., operation instruction), and at the same time, the specific parameters of these operation instructions are determined, such as position coordinates, thread color, and tension adjustment, etc., to obtain a series of clear operation instructions and their corresponding operation parameters, ensuring that each step of embroidery can be accurately described and recorded; Next, according to the parsed operation instructions and the operation parameters corresponding to each operation instruction, an embroidery instruction data structure containing timestamps is constructed. The key to this step is to add time information to each embroidery instruction to form a preliminary embroidery instruction sequence with time information. The timestamp not only ensures the sequential execution of instructions but also enhances the credibility of the record because each operation has an exact occurrence time; Then, using blockchain technology, a data block is created for each embroidery instruction in the preliminary embroidery instruction sequence with time information. In addition to the embroidery instruction and its parameters, each data block also includes a hash value, which can ensure that even the slightest data change can be detected. After generating the hash value data blocks, these data blocks have the property of anti-tampering, guaranteeing the integrity and security of the data; Subsequently, the hash value data blocks are linked in sequence to form a chain, forming the initial embroidery process chain. This chain-like connection method makes any change to a data block affect the entire chain, thus further improving the security of the data. In addition, the embroidery process chain constructed in this way can not only track the execution of each embroidery instruction but also provide an immutable historical record; Finally, through the smart contract mechanism, each hash value data block in the initial embroidery process chain is verified and executed. The smart contract will automatically check whether each data block meets the preset conditions, such as the correct timestamp and valid hash value. Once the verification passes, the smart contract will execute the corresponding embroidery instruction and record the result of each execution. This process not only ensures the accuracy and consistency of the embroidery process chain but also realizes automated operation, reducing the possibility of human errors. After multiple rounds of verification and execution, the construction of the target embroidery process chain is finally completed; For example, when dealing with a complex flower pattern embroidery project, the designer hopes to ensure that every step of the embroidery process is accurately recorded for future query and copyright protection. First, according to the target embroidery parameter configuration, each embroidery instruction is parsed to extract specific operation instructions such as needle entry, needle exit, or thread change, and the operation parameters corresponding to these instructions, such as position coordinates, thread color, and tension adjustment, are determined. Then, an embroidery instruction data structure containing timestamps is constructed to ensure that each embroidery step has an accurate time record, generating a preliminary embroidery instruction sequence with time information. Then, using blockchain technology, a data block is created for each embroidery instruction in this sequence and a hash value is added to ensure that each instruction and its parameters cannot be tampered with. These data blocks are linked in sequence to form a chain, forming the initial embroidery process chain. Finally, through the smart contract mechanism, each hash value data block in the initial embroidery process chain is verified and executed, and the result of each execution is recorded to ensure that the entire embroidery process is transparent and traceable. Eventually, a complete and verified target embroidery process chain is obtained, which not only ensures the security of the data but also provides a unique identity authentication for the work.
[0032] Optionally, according to the method described in claim 5, characterized in that virtual reality technology is used to perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path to obtain a target embroidery parameter configuration, including: Using the initial embroidery parameter configuration, applying a lighting model in a virtual environment to simulate the actual embroidery effect, so that the adjusted optimized embroidery path and the initial embroidery parameter configuration parameters have visual consistency under different lighting conditions to generate a simulated embroidery effect; According to the simulated embroidery effect, collect the adjustment results confirmed by the user, and analyze the user preferences through machine learning algorithms to optimize the initial embroidery parameter configuration and generate a target embroidery parameter configuration.
[0033] Figure 2 The structural schematic diagram of an embroidery stitch path generation system based on image processing provided by an embodiment of the present invention is as Figure 2 shown. This system includes: A receiving module 21, configured to receive the embroidery pattern image uploaded by the user, perform hierarchical parsing on the embroidery pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element. The embroidery parameters include: embroidery priority, stitch type, and color information; A construction module 22, configured to construct a three-dimensional space model according to the design element and the initial embroidery parameters corresponding to the design element, and define the embroidery path corresponding to each design element by using the three-dimensional space model; An optimization module 23 is configured to optimize the embroidery path and the embroidery parameters corresponding to the embroidery path by using a genetic algorithm, so as to obtain an optimized embroidery path and optimized embroidery parameters corresponding to the optimized embroidery path; A calibration module 24 is configured to perform real-time interactive calibration on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path by using virtual reality technology, so as to obtain a target embroidery parameter configuration; A generation module 25 is configured to record each embroidery instruction and operation parameters corresponding to each embroidery instruction by using blockchain technology according to the target embroidery parameter configuration, so as to generate an embroidery process chain, where the embroidery instructions include: needle insertion, needle exit, and thread change, and the operation parameters include: position coordinates, thread color, and tension adjustment.
[0034] Figure 2 The described embroidery stitch path generation system based on image processing can execute Figure 1 The described embroidery stitch path generation method based on image processing in the illustrated embodiment, the implementation principle and technical effects will not be elaborated. For the embroidery stitch path generation system based on image processing in the above embodiment, the specific manners in which each module and unit perform operations have been described in detail in the embodiment related to the method, and will not be elaborated here.
[0035] In a possible design, Figure 2 The embroidery stitch path generation system based on image processing in the illustrated embodiment can be implemented as a computing device, such as Figure 3 shown, the computing device may include a storage component 31 and a processing component 32; The storage component 31 stores one or more computer instructions, where the one or more computer instructions are called and executed by the processing component 32.
[0036] The processing component 32 is configured to: receive the embroidered pattern image uploaded by the user, perform hierarchical parsing on the embroidered pattern image to obtain each independent design element and the embroidery parameters corresponding to the design element, where the embroidery parameters include: embroidery priority, stitch type, and color information; construct a three-dimensional space model according to the design element and the initial embroidery parameters corresponding to the design element, and define the embroidery path corresponding to each design element by using the three-dimensional space model; optimize the embroidery path and the embroidery parameters corresponding to the embroidery path by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path by using virtual reality technology to obtain a target embroidery parameter configuration; record each embroidery instruction and the operation parameters corresponding to each embroidery instruction by using blockchain technology according to the target embroidery parameter configuration to generate an embroidery process chain, where the embroidery instruction includes: needle entry, needle exit, and thread change, and the operation parameters include: position coordinates, thread color, and tension adjustment.
[0037] Among them, the processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for executing the above method.
[0038] The storage component 31 is configured to store various types of data to support the operation of the terminal. The storage component may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0039] Of course, the computing device may also necessarily include other components, such as an input / output interface, a display component, a communication component, etc.
[0040] The input / output interface provides an interface between the processing component and the peripheral interface module, and the above peripheral interface module may be an output device, an input device, etc.
[0041] The communication component is configured to facilitate communication between the computing device and other devices in a wired or wireless manner, etc.
[0042] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server. The above processing components, storage components, etc. can be basic server resources rented or purchased from a cloud computing platform.
[0043] An embodiment of the present invention also provides a computer storage medium storing a computer program, and when the computer program is executed by a computer, it can implement the above Figure 1 A method for generating an embroidery stitch path based on image processing shown in the embodiment.
[0044] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0045] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0046] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An embroidery needle path generation method based on image processing, characterized in that: include: Receive an embroidery pattern image uploaded by a user, perform hierarchical analysis on the embroidery pattern image, obtain each independent design element and embroidery parameters corresponding to the design element, the embroidery parameters including: embroidery priority, stitch type and color information; According to the design elements and the initial embroidery parameters corresponding to the design elements, a three-dimensional space model is constructed, and the embroidery path corresponding to each design element is defined by using the three-dimensional space model; The embroidery path and the embroidery parameters corresponding to the embroidery path are optimized by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; Using virtual reality technology to perform real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path to obtain a target embroidery parameter configuration; According to the target embroidery parameter configuration, blockchain technology is used to record each embroidery instruction and the operating parameters corresponding to each embroidery instruction to generate an embroidery process chain, wherein the embroidery instructions include: needle insertion, needle removal and thread change, and the operating parameters include: position coordinates, thread color, and tension adjustment.
2. The method according to claim 1, characterized in that: According to the design elements and the embroidery parameters corresponding to the design elements, a three-dimensional space model is constructed, and the embroidery path corresponding to each design element is defined by using the three-dimensional space model, including: Using the design elements and the embroidery parameters corresponding to the design elements, information analysis and surface texture recognition are performed on each design element to obtain the position, thickness and surface texture characteristics of the design element in three-dimensional space; According to the position, thickness and surface texture feature information, a three-dimensional coordinate system is established, each design element is located in the three-dimensional coordinate system, a corresponding material attribute is assigned to each design element, and an initial three-dimensional space layout is generated; Based on the initial three-dimensional space layout and material properties, combined with color information of design elements, thread stacking order and color transition strategy are determined to generate an optimized three-dimensional space layout; Based on the optimization of the three-dimensional space layout, the topology optimization algorithm is used to adjust the relative positions of the design elements to obtain the target three-dimensional space layout; Based on the target three-dimensional space layout and the thread stacking sequence, an embroidery path of each design element is defined, and the embroidery path is used to reflect the direction and distribution of the design element in the three-dimensional space.
3. The method according to claim 2, characterized in that According to the position, thickness and surface texture feature information, a three-dimensional coordinate system is established, each design element is positioned in the three-dimensional coordinate system, a corresponding material attribute is assigned to each design element, and an initial three-dimensional space layout is generated, including: Using the position, thickness and surface texture feature information, construct a three-dimensional coordinate system in a virtual environment; Based on the three-dimensional coordinate system, each design element is positioned, and the position parameters of each design element are recorded to obtain the positioned design element; Assigning material attributes to each located design element according to the located design elements and color information corresponding to the located design elements, generating design elements with material attributes, wherein the material attributes include: thread type, color, reflection characteristics, and transparency and glossiness; Applying physical simulation technology to adjust the relative distance and angle between the design elements with material attributes, so that the thread fluidity and stacking order in the embroidery process are reasonable, so as to obtain an optimized position relationship; Based on the optimized position relationship, the lighting model is used to simulate the visual effects of design elements with material attributes under different light sources, and the performance of design elements with material attributes is verified and optimized to generate the initial three-dimensional space layout.
4. The method according to claim 1, characterized in that: Receive an embroidery pattern image uploaded by a user, perform hierarchical analysis on the embroidery pattern image, obtain each independent design element and embroidery parameters corresponding to the design element, the embroidery parameters include: embroidery priority, stitch type and color information, including: Receive an embroidery pattern image uploaded by a user, apply multi-scale analysis technology to perform multi-layer analysis processing on the embroidery pattern image, separate multiple layers including foreground and background, and record the transparency and overlapping relationship of each layer to obtain an initial layer; Based on the initial layer, the edge detection algorithm is combined to identify and extract each independent design element in each layer, and generate position information of each independent design element; Analyze the color information, texture characteristics and distribution of each independent design element by using color analysis and texture recognition technology to generate a design element attribute description table; According to the design element attribute description table, corresponding embroidery parameters are assigned to each design element through an intelligent matching algorithm, wherein the embroidery parameters include: embroidery priority, stitch type and color information.
5. The method according to claim 1, characterized in that The optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path are corrected interactively in real time by using virtual reality technology to obtain a target embroidery parameter configuration, including: Using a virtual reality environment, the optimized embroidery path and optimized embroidery parameters are visualized, and a multi-view display mode is introduced to generate an embroidery path model; Using the embroidery path model, a user interaction interface is provided, allowing the user to adjust the position, angle and thread density of the optimized embroidery path through a controller, and providing the adjustment result in combination with a tactile feedback device to obtain an adjusted optimized embroidery path; According to the adjusted optimized embroidery path, the embroidery parameters are updated and optimized in real time, and an intelligent recommendation system is integrated to provide adjustment suggestions to the user, and feedback is given to the user in real time to obtain the initial embroidery parameter configuration; Using the initial embroidery parameter configuration, applying a lighting model in a virtual environment to simulate an actual embroidery effect, so that the adjusted optimized embroidery path and the initial embroidery parameter configuration have visual consistency under different lighting conditions, so as to generate a simulated embroidery effect; According to the simulated embroidery effect, the adjustment results confirmed by the user are collected, and the user preferences are analyzed through a machine learning algorithm to optimize the initial embroidery parameter configuration and generate a target embroidery parameter configuration.
6. The method according to claim 1, characterized in that The embroidery path and the embroidery parameters corresponding to the embroidery path are optimized by using a genetic algorithm to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path, including: Based on the three-dimensional space model, encoding is performed on the initial embroidery path of each design element to obtain a chromosome representation in a genetic algorithm; Using the chromosome representation, a selection operation is performed on the initial embroidery path set, and a plurality of initial embroidery paths are randomly selected as parent individuals to generate an evolutionary population; Based on the evolutionary population, a crossover operation is applied to pair the selected parent individuals and exchange path information to generate offspring individuals; According to the offspring individuals, a mutation operation is performed to adjust the initial embroidery path and the embroidery parameters corresponding to the embroidery path to generate adjusted offspring individuals; The performance of the parent individuals and the adjusted offspring individuals is evaluated through a preset fitness function, and the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path are obtained.
7. The method according to claim 1, characterized in that According to the target embroidery parameter configuration, each embroidery instruction and the operation parameters corresponding to each embroidery instruction are recorded using blockchain technology to generate an embroidery process chain, including: Based on the target embroidery parameter configuration, each embroidery instruction is parsed, the operation instruction is extracted, and the operation parameter corresponding to each operation instruction is determined, so as to obtain the parsed operation instruction and the operation parameter corresponding to each operation instruction; According to the parsed operation instructions and the operation parameters corresponding to each operation instruction, an embroidery instruction data structure including a timestamp is constructed to generate a preliminary embroidery instruction sequence with time information; Using blockchain technology, a data block is created for each embroidery instruction in the preliminary embroidery instruction sequence with time information, and a hash value is added to generate a hash value data block; The hash value data blocks are linked into a chain in sequence to obtain an initial embroidery process chain. Through the smart contract mechanism, each hash value data block in the initial embroidery process chain is verified and executed, and the result of each execution is recorded to complete the construction of the target embroidery process chain.
8. An embroidery needle path generation system based on image processing, characterized in that: include: A receiving module is used to receive an embroidery pattern image uploaded by a user, perform hierarchical analysis on the embroidery pattern image, obtain each independent design element and embroidery parameters corresponding to the design element, wherein the embroidery parameters include: embroidery priority, stitch type and color information; A construction module, used to construct a three-dimensional space model according to the design elements and the initial embroidery parameters corresponding to the design elements, and define an embroidery path corresponding to each design element by using the three-dimensional space model; An optimization module, used for optimizing the embroidery path and the embroidery parameters corresponding to the embroidery path by using a genetic algorithm, so as to obtain an optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path; A correction module, used for performing real-time interactive correction on the optimized embroidery path and the optimized embroidery parameters corresponding to the optimized embroidery path by using virtual reality technology to obtain a target embroidery parameter configuration; The generation module is used to record each embroidery instruction and the operating parameters corresponding to each embroidery instruction according to the target embroidery parameter configuration using blockchain technology to generate an embroidery process chain, wherein the embroidery instruction includes: needle insertion, needle removal and thread change, and the operating parameters include: position coordinates, thread color, and tension adjustment.
9. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement an embroidery needle path generation method based on image processing as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, an embroidery needle path generation method based on image processing as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Intelligent generation and auxiliary embroidering system and method for non-missing embroidery pattern
CN121505065A