Intelligent construction system for converting two-dimensional image of sugar painting into three-dimensional model based on AI large model
Patent Information
- Application Number
- CN202610906667.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-27
AI Technical Summary
现有的AI图像生成模型通常缺乏针对糖画的专门优化,无法准确捕捉到糖画传统的走线规律和工艺特征,导致生成的三维模型难以适应糖画的特殊成型要求
首先,本发明通过AI大模型和遗传算法实现糖画二维图像到三维模型的自动化转换,大幅提高了效率,减少了人工成本和错误率。
Smart Images

Figure CN122990003A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and 3D modeling technology, and in particular to an intelligent construction system for converting 2D sugar painting images into 3D models based on AI large-scale models. Background Technology
[0002] With the development of digital technology, the production of traditional handicrafts is gradually moving towards automation and intelligence. Sugar painting, as an intangible cultural heritage, has a complex and labor-intensive production process that relies heavily on highly skilled artisans. Currently, traditional sugar painting techniques largely depend on manual drawing and operation. The conversion from two-dimensional images to three-dimensional models is still done manually, resulting in low efficiency and poor accuracy. Manual modeling not only consumes a significant amount of time and manpower but also makes it difficult to ensure the stability and consistency of each piece, hindering personalized customization. Furthermore, due to the complex and varied lines inherent in sugar painting, traditional modeling methods cannot guarantee the continuity of the pattern and its adherence to the craftsmanship requirements. This leads to problems such as broken lines, overlapping lines, or shape distortion in the generated three-dimensional models, failing to meet the demands of producing high-quality sugar painting works.
[0003] Currently, although some AI-based image processing technologies are applied to other fields, the technology for automatically generating 3D models from sugar painting images is still immature. Existing AI image generation models typically lack specific optimization for sugar painting, failing to accurately capture the traditional line patterns and craft characteristics of sugar painting, resulting in 3D models that are difficult to adapt to the special forming requirements of sugar painting. Some existing technologies use general model generation methods that do not consider the structural requirements of sugar painting patterns, and the generated 3D models are prone to unstable and discontinuous lines during printing, failing to meet the traditional artistic requirements of sugar painting.
[0004] Therefore, how to provide an intelligent construction system for converting two-dimensional sugar painting images into three-dimensional models based on AI large models is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose an intelligent construction system for converting two-dimensional images of sugar painting into three-dimensional models based on AI large-scale models. This invention fully utilizes technologies such as AI large-scale models, convolutional neural networks, decision tree algorithms, and genetic algorithms, and describes in detail a method for automatically generating three-dimensional models that meet the requirements of sugar painting techniques from two-dimensional images of sugar painting. It has the advantages of high automation, high model accuracy, compliance with traditional process requirements, and strong personalization capabilities.
[0006] According to an embodiment of the present invention, a smart construction system for converting 2D sugar painting images into 3D models based on AI large models includes: The image input module is used to receive and acquire two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns; The AI large model feature extraction module is used to preprocess two-dimensional image data and extract key feature points of sugar painting using twin modeling method. It also uses support vector machine to classify, filter and label contour lines, detail areas and structural nodes in the image. The sugar painting process ordered connection module is used to sort the key feature points according to the traditional forming rules of intangible cultural heritage sugar painting, and use the decision tree algorithm to automatically analyze the connection relationship between key feature points to generate continuous and unbroken lines that conform to the sugar painting line pattern. It also ensures the ordered connection between each key feature point and adjacent key feature points according to the requirements of traditional process. The automatic 3D model generation module is used to generate 3D models based on ordered and connected continuous lines. By converting 2D lines into 3D solid structures, it ensures that the 3D models can be adapted to the molding requirements of sugar painting printing equipment. The printing equipment adapter output module is used to convert the 3D model into a standardized file that conforms to the input format of the sugar painting printing equipment, and optimize the model size, line thickness and spacing according to the process requirements of the printing equipment.
[0007] Optionally, the image input module acquires two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns through a high-resolution camera or scanner. The two-dimensional image data is transmitted to the computing processing unit for subsequent processing via a wired or wireless interface, ensuring uniform illumination and stable image quality during the image acquisition process. The image acquisition device and the computing processing unit transmit data in real time through a standardized data protocol, ensuring that there is no packet loss or distortion during data transmission.
[0008] Optionally, the AI large model feature extraction module specifically includes: Two-dimensional image data is converted to grayscale, which reduces computational complexity and highlights the basic contour information of the image. The Gaussian filtering algorithm is used to smooth the image, remove noise, and preserve the basic structure of the image at the edges; The Sobel operator is used for edge detection to extract edge information from the image. For each contour line in the image, the dilation and erosion methods in morphological operations are used to further correct the continuity of the lines, fill the breakpoints and connect the broken lines, thereby ensuring the integrity of the sugar painting lines. Convolutional neural networks are used to extract multi-level features from images. In each convolutional operation, low-level features, including edges and corners, as well as high-level features, including structure and texture, are extracted. The ReLU activation function is used to increase the non-linear expressive power of the network model. After feature extraction, the feature points in the image are mapped to a high-dimensional space through a Siamese network structure. The contrastive loss function is used to measure the similarity between key feature points in the image, ensuring that the key feature points of sugar painting can match the traditional sugar painting line patterns. Support vector machines are used to classify the extracted features, identify the effective contour lines, detail regions and structural nodes in the image, and K-means clustering algorithm is used to cluster the classified feature points to obtain the structural features of the sugar painting. An adaptive thresholding algorithm is used to accurately label the classified feature points, ensuring the accuracy of the location of each key feature point in the image space.
[0009] Optionally, the sugar painting process orderly connection module specifically includes: After receiving the key feature points, according to the sugar painting forming rules, all key feature points are initially classified according to their inner and outer layers and their thickness. The KD-tree algorithm based on spatial distance and geometric relationship is used to spatially sort the key feature points and construct an undirected graph with the key feature points as nodes, where each edge represents a potential connection relationship. The decision tree algorithm is used to analyze the connection relationship between each pair of key feature points. By learning the traditional line pattern of sugar painting, the decision tree automatically determines whether two points should be connected and assigns priority to each edge according to the connection order. All connections are recorded after the output of the decision tree, and a candidate connection path is generated by a depth-first search algorithm. Genetic algorithms are used to optimize candidate paths and select the optimal path to ensure that the connection between each key feature point and its adjacent key feature points meets the requirements of sugar painting process and avoids breakpoints or overlaps. Bezier curve fitting technology is used to smooth all connecting lines, ensuring that the connecting lines are smooth and meet actual printing requirements; The generated lines are optimized using the least squares method, and the relative position of each connection point and the curvature of the lines are further adjusted to ensure that the final generated line structure can be stably formed during printing and meets the aesthetic requirements of sugar painting art.
[0010] Optionally, the construction and sorting process of the KD-tree algorithm specifically includes: Using the coordinate data of all key feature points as input, a K-dimensional spatial tree, namely a KD tree, is constructed. Recursive partitioning is performed at each level of the tree, selecting one dimension for data partitioning each time, ensuring that point lookup and neighbor point search can be performed quickly in each dimension. During the construction of the KD tree, the splitting dimension of each node is selected as the median of the current point set to balance the depth of the tree and query efficiency. Spatial sorting is performed on the KD-tree by recursively traversing each branch, calculating the spatial coordinates of each key feature point and its distance from other neighboring points, and dynamically adjusting the branch sorting based on the geometric relationships between points to ensure that the final tree structure can provide optimal spatial query efficiency. Specifically, this includes: By recursively traversing each node of the KD tree, starting from the root node, we sequentially determine whether the current node is a key feature point in the target point set. If so, calculate the spatial distance between the node and its neighbors using the Euclidean distance formula, and record the distance value between each key feature point and its neighbors. To ensure the efficiency of spatial sorting, a heap structure is used to store the nearest neighbor with the shortest distance in each recursive process, and the nodes are accessed according to the principle of shortest distance first. Recursively traverse the left and right subtrees of the tree, and in each recursion, adjust the visiting order of the left and right subtrees based on the partitioning principle of the current node's dimension and median, to ensure that the depth of the tree can be well balanced after each level of partitioning. For each node, determine whether it is within the current search range. If it is, continue to search for the nearest point in the current subtree and update the minimum distance record. By recursively sorting all nodes in space, the sorting result of each key feature point is obtained, ensuring that the entire point set can be optimized and sorted according to its spatial location. When sorting points using a KD-tree, an adaptive threshold algorithm is used to dynamically adjust the distance tolerance between points. Appropriate distance standards are set according to the shape characteristics of sugar painting to ensure that the connected points meet the requirements of smooth sugar painting lines.
[0011] Optionally, the automatic 3D model generation module specifically includes: After receiving the ordered and connected continuous lines, the geometric attributes of each line are extracted, the initial direction of the line is determined by the endpoint coordinates and tangent direction of each line, and the normal vector and tangent vector are calculated for each line. The B-spline curve fitting method is used to fit the lines in three dimensions. The lines are parameterized according to their geometric characteristics so that the spatial curvature of each line matches the requirements of the sugar painting process. The spline function is used to smoothly transition the connection between each point. The two-dimensional coordinates of the line are mapped to three-dimensional space using Lagrange interpolation, and a Z-axis coordinate value is assigned to each connection point to construct a continuous three-dimensional line composed of a series of three-dimensional coordinate points. Dijkstra's algorithm is used for topology optimization to ensure that each 3D line can be seamlessly connected to its adjacent lines, avoiding breakpoints or intersections. The three-dimensional lines are converted into discrete voxel meshes using the voxelization method. The Marching Cubes algorithm is then used to reconstruct the meshes, and the resulting three-dimensional surface is smoothed to eliminate surface defects and optimize edges. Based on the specifications and printing accuracy requirements of the sugar painting printing equipment, geometric transformation and scaling methods are used to ensure that the 3D model is adapted to the process requirements of the printing equipment.
[0012] Optionally, the B-spline curve fitting method specifically includes: For each two-dimensional line, the control point set of each line is initialized by calculating the tangent direction of its endpoints and the spatial position of adjacent points. Select a 3rd or 4th order B-spline to construct the spline curve, and assign several control points to each line. Determine the smoothness and shape of the curve based on the position of the control points and the geometric characteristics of the line. Parameterization is performed using uniform B-spline or non-uniform B-spline algorithms to ensure that the spatial representation of each line can be flexibly adjusted by changing the control points; During the fitting process, the least squares optimization algorithm is applied to perform reverse optimization on the control points to minimize the fitting error, so that the curve transitions smoothly between each connection point and meets the structural requirements of sugar painting. By solving the interpolation function of each line in three-dimensional space, the position of each segment control point is calculated, and the connection transition between control points is upgraded from low-order polynomial interpolation to high-order smooth curve. To avoid discontinuous changes in the curves, a weighted average method is used to adjust the tension and softness of the curves, so that each curve can maintain the original shape characteristics of sugar painting while having a seamless connection with adjacent lines.
[0013] The beneficial effects of this invention are: First, this invention achieves automated conversion from two-dimensional sugar painting images to three-dimensional models through AI large-scale models and genetic algorithms, which greatly improves efficiency and reduces labor costs and error rates.
[0014] Secondly, this invention follows the traditional line-drawing rules of sugar painting, and optimizes the connection path through decision trees and genetic algorithms to avoid line breaks and overlaps, thus ensuring the stability and adaptability of the three-dimensional model.
[0015] Finally, this invention provides an intelligent and automated 3D modeling solution for sugar painting, which meets the needs of personalized and rapid production and promotes the digital development of the sugar painting industry. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the intelligent construction system for converting 2D images of sugar paintings into 3D models based on AI large models, as proposed in this invention. Figure 2 This is a schematic diagram of the 3D model optimization and printing process of the intelligent construction system for converting 2D images of sugar paintings into 3D models based on AI large models proposed in this invention. Figure 3 This is a module structure diagram of the intelligent construction system for converting two-dimensional sugar painting images into three-dimensional models based on AI large models proposed in this invention. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0018] refer to Figures 1-3 A smart construction system for converting 2D sugar painting images into 3D models based on AI large-scale models, including: The image input module is used to receive and acquire two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns; The AI large model feature extraction module is used to preprocess two-dimensional image data and extract key feature points of sugar painting using twin modeling method. It also uses support vector machine to classify, filter and label contour lines, detail areas and structural nodes in the image. The sugar painting process ordered connection module is used to sort the key feature points according to the traditional forming rules of intangible cultural heritage sugar painting, and use the decision tree algorithm to automatically analyze the connection relationship between key feature points to generate continuous and unbroken lines that conform to the sugar painting line pattern. It also ensures the ordered connection between each key feature point and adjacent key feature points according to the requirements of traditional process. The automatic 3D model generation module is used to generate 3D models based on ordered and connected continuous lines. By converting 2D lines into 3D solid structures, it ensures that the 3D models can be adapted to the molding requirements of sugar painting printing equipment. The printing equipment adapter output module is used to convert the 3D model into a standardized file that conforms to the input format of the sugar painting printing equipment, and optimize the model size, line thickness and spacing according to the process requirements of the printing equipment.
[0019] In this embodiment, the image input module acquires two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns through a high-resolution camera or scanner. The two-dimensional image data is transmitted to the computing processing unit for subsequent processing through a wired or wireless interface, ensuring uniform illumination and stable image quality during the image acquisition process. The image acquisition device and the computing processing unit transmit data in real time through a standardized data protocol, ensuring that there is no packet loss or distortion during data transmission.
[0020] In this embodiment, the AI large model feature extraction module specifically includes: Two-dimensional image data is converted to grayscale, which reduces computational complexity and highlights the basic contour information of the image. The Gaussian filtering algorithm is used to smooth the image, remove noise, and preserve the basic structure of the image at the edges; Edge detection is performed using the Sobel operator to extract edge information from the image, specifically including: The grayscale image data is input into the Sobel operator. By performing gradient operations on the image in the horizontal and vertical directions, the gradient values of each pixel in the x and y directions are calculated to obtain the gradient matrix of the image. The Sobel operator's convolution kernel is used to perform convolution operations on the image to calculate the gradient magnitude and gradient direction of each pixel. The gradient magnitude is used to represent the edge strength at that point, and the gradient direction represents the direction of the edge. After the calculation is completed, a threshold is set to filter out pixels with edge strength greater than the threshold as potential edge points; Non-maximum suppression is applied to all potential edge points in the image to remove noise points in non-edge regions, retaining only the most representative edge points; For each contour line in the image, the dilation and erosion methods in morphological operations are used to further correct the continuity of the lines, fill the breakpoints and connect the broken lines, thereby ensuring the integrity of the sugar painting lines. Convolutional neural networks are used to extract multi-level features from images. In each convolutional operation, low-level features, including edges and corners, as well as high-level features, including structure and texture, are extracted. The ReLU activation function is used to increase the non-linear expressive power of the network model. After feature extraction, the feature points in the image are mapped to a high-dimensional space through a Siamese network structure. The contrastive loss function is used to measure the similarity between key feature points in the image, ensuring that the key feature points of sugar painting can match the traditional sugar painting line patterns. Support vector machines are used to classify the extracted features, identify the effective contour lines, detail regions and structural nodes in the image, and K-means clustering algorithm is used to cluster the classified feature points to obtain the structural features of the sugar painting. An adaptive thresholding algorithm is used to accurately label the classified feature points, ensuring the accuracy of the location of each key feature point in the image space.
[0021] In this embodiment, the sugar painting process orderly connection module specifically includes: After receiving the key feature points, according to the sugar painting forming rules, all key feature points are initially classified according to their inner and outer layers and their thickness. The KD-tree algorithm based on spatial distance and geometric relationship is used to spatially sort the key feature points and construct an undirected graph with the key feature points as nodes, where each edge represents a potential connection relationship. The decision tree algorithm is used to analyze the connection relationship between each pair of key feature points. By learning the traditional line pattern of sugar painting, the decision tree automatically determines whether two points should be connected and assigns priority to each edge according to the connection order. All connections are recorded after the output of the decision tree, and a candidate connection path is generated by a depth-first search algorithm. A genetic algorithm is used to optimize candidate paths, selecting the optimal path to ensure that the connections between each key feature point and its adjacent key feature points meet the requirements of sugar painting and to avoid breakpoints or overlaps. Specifically, this includes: Each candidate path is initialized, and several paths are randomly generated. Each path is composed of several key feature points connected in sequence, and each gene in the path represents a specific connection point. The fitness value of each path is calculated. The fitness function evaluates the path according to the traditional line-making rules of sugar painting, including the path's continuity, lack of breaks, shortest distance, and line smoothness that meets the requirements of sugar painting. The path with higher fitness is selected as the parent path. The roulette wheel selection algorithm or tournament selection algorithm is used to select several excellent paths from the current population for crossover operation. The crossover operation generates the offspring path by exchanging the order of some key points in the parent path. The mutation operation is used to make small-scale random adjustments to some of the child paths. By changing some connection order or the position of local points, new path candidates are generated to increase the diversity of paths and avoid local optima. Fitness is calculated for all offspring paths, and paths with higher fitness are selected to continue the next generation's breeding process. Through multiple iterations, the continuity, smoothness, and accuracy of the path are gradually optimized to meet the requirements of sugar painting techniques. The optimal path output by the genetic algorithm will be used as the final path connecting key feature points, ensuring that the generated sugar painting path meets the process requirements. Bezier curve fitting technology is used to smooth all connecting lines, ensuring that the connecting lines are smooth and meet actual printing requirements; The generated lines are optimized using the least squares method, and the relative position of each connection point and the curvature of the lines are further adjusted to ensure that the final generated line structure can be stably formed during printing and meets the aesthetic requirements of sugar painting art.
[0022] In this embodiment, the construction and sorting process of the KD-tree algorithm specifically includes: Using the coordinate data of all key feature points as input, a K-dimensional spatial tree, namely a KD tree, is constructed. Recursive partitioning is performed at each level of the tree, selecting one dimension for data partitioning each time, ensuring that point lookup and neighbor point search can be performed quickly in each dimension. During the construction of the KD tree, the splitting dimension of each node is selected as the median of the current point set to balance the depth of the tree and query efficiency. Spatial sorting is performed on the KD-tree by recursively traversing each branch, calculating the spatial coordinates of each key feature point and its distance from other neighboring points, and dynamically adjusting the branch sorting based on the geometric relationships between points to ensure that the final tree structure can provide optimal spatial query efficiency. Specifically, this includes: By recursively traversing each node of the KD tree, starting from the root node, we sequentially determine whether the current node is a key feature point in the target point set. If so, calculate the spatial distance between the node and its neighbors using the Euclidean distance formula, and record the distance value between each key feature point and its neighbors. To ensure the efficiency of spatial sorting, a heap structure is used to store the nearest neighbor with the shortest distance in each recursive process, and the nodes are accessed according to the principle of shortest distance first. Recursively traverse the left and right subtrees of the tree, and in each recursion, adjust the visiting order of the left and right subtrees based on the partitioning principle of the current node's dimension and median, to ensure that the depth of the tree can be well balanced after each level of partitioning. For each node, determine whether it is within the current search range. If it is, continue to search for the nearest point in the current subtree and update the minimum distance record. By recursively sorting all nodes in space, the sorting result of each key feature point is obtained, ensuring that the entire point set can be optimized and sorted according to its spatial location. When sorting points using a KD-tree, an adaptive threshold algorithm is used to dynamically adjust the distance tolerance between points. Appropriate distance standards are set according to the shape characteristics of sugar painting to ensure that the connected points meet the requirements of smooth sugar painting lines.
[0023] In this embodiment, the automatic 3D model generation module specifically includes: After receiving the ordered and connected continuous lines, the geometric attributes of each line are extracted, the initial direction of the line is determined by the endpoint coordinates and tangent direction of each line, and the normal vector and tangent vector are calculated for each line. The B-spline curve fitting method is used to fit the lines in three dimensions. The lines are parameterized according to their geometric characteristics so that the spatial curvature of each line matches the requirements of the sugar painting process. The spline function is used to smoothly transition the connection between each point. The two-dimensional coordinates of the line are mapped to three-dimensional space using Lagrange interpolation, and a Z-axis coordinate value is assigned to each connection point to construct a continuous three-dimensional line composed of a series of three-dimensional coordinate points. Dijkstra's algorithm is used for topology optimization to ensure that each 3D line can be seamlessly connected to its adjacent lines, avoiding breakpoints or intersections. The three-dimensional lines are converted into discrete voxel meshes using the voxelization method. The Marching Cubes algorithm is then used to reconstruct the meshes, and the resulting three-dimensional surface is smoothed to eliminate surface defects and optimize edges. Based on the specifications and printing accuracy requirements of the sugar painting printing equipment, geometric transformation and scaling methods are used to ensure that the 3D model is adapted to the process requirements of the printing equipment.
[0024] In this embodiment, the B-spline curve fitting method specifically includes: For each two-dimensional line, the control point set of each line is initialized by calculating the tangent direction of its endpoints and the spatial position of adjacent points. Select a 3rd or 4th order B-spline to construct the spline curve, and assign several control points to each line. Determine the smoothness and shape of the curve based on the position of the control points and the geometric characteristics of the line. Parameterization is performed using uniform B-spline or non-uniform B-spline algorithms to ensure that the spatial representation of each line can be flexibly adjusted by changing the control points; During the fitting process, the least squares optimization algorithm is applied to perform reverse optimization on the control points to minimize the fitting error, so that the curve transitions smoothly between each connection point and meets the structural requirements of sugar painting. By solving the interpolation function of each line in three-dimensional space, the position of each segment control point is calculated, and the connection transition between control points is upgraded from low-order polynomial interpolation to high-order smooth curve. To avoid discontinuous changes in the curves, a weighted average method is used to adjust the tension and softness of the curves, so that each curve can maintain the original shape characteristics of sugar painting while having a seamless connection with adjacent lines.
[0025] Example 1: To verify the feasibility of this invention in practice, it was applied to the intelligent generation process of sugar painting production. This aims to improve the conversion efficiency of sugar painting from two-dimensional images to three-dimensional models and solve the problems existing in traditional manual modeling, such as long processing time, large human error, and lack of consistency. The scenario is set as a sugar painting production enterprise that needs to quickly generate a three-dimensional model that meets the requirements of traditional sugar painting techniques based on images provided by customers (such as cultural patterns, company logos, etc.) and then produce the model using sugar painting printing equipment.
[0026] Specifically, upon receiving a customer's order, the system first obtains the two-dimensional sugar painting pattern provided by the customer. These patterns are mostly image files in JPEG or PNG format. Using the image input module of this invention, the image is converted to grayscale, then noise is removed using Gaussian filtering, and image edges are extracted using the Sobel operator. Subsequently, the system extracts feature points and edge information from the image using a convolutional neural network, maps key feature points using a Siamese network structure, and finally performs classification using a support vector machine to identify and label the effective contour lines, detail regions, and structural nodes in the sugar painting pattern.
[0027] Next, under the guidance of the ordered connection module in sugar painting, the system performs ordered topological sorting on these key feature points. Using a KD-tree algorithm based on spatial distance and geometric relationships, the system spatially sorts these key points and connects them according to the traditional line-making rules of sugar painting, ensuring that the generated lines meet both the artistic requirements of sugar painting and can be stably formed. At this point, a genetic algorithm is used to optimize the candidate paths, ensuring that each connection path is uninterrupted and meets the process requirements, avoiding breaks or discontinuities. Finally, Bezier curve fitting technology is used to smooth all connecting lines, further optimizing the line details to better meet actual printing requirements.
[0028] Before printing, the generated 3D model undergoes least squares optimization to ensure precise control over the relative positions of each key point and its adjacent points, as well as the curvature of the lines. After adjustment, the system automatically outputs a standardized 3D model format that meets the requirements of sugar painting printing equipment. The generated model has high printing stability, avoiding problems such as breakage or shape distortion during printing.
[0029] To verify the feasibility of the method of this invention in practical applications, we conducted a series of data verifications, comparing the differences between traditional manual modeling methods and the method of this invention in the process of generating 3D models of sugar paintings. Sugar painting patterns of varying difficulty were selected in the experiment, including simple line patterns, complex cultural theme patterns, and corporate logos. The following data were obtained through comparative analysis as shown in Table 1: In traditional manual modeling, completing a complex 3D model of sugar painting takes an average of 12 hours, and the large human error often leads to problems such as shape distortion and breakpoints during printing. However, with the method of this invention, the system can generate a 3D model of a complex pattern within 2 hours, and the generated model has high accuracy, significantly improved printing stability, an average error of less than 0.5 mm, no breakpoints or overlaps at the model joints, and the 3D model generated each time is consistent with the expectation.
[0030] Table 1 Comparison of 3D model generation efficiency for sugar painting Simple line patterns 5 0.5 0.2 No breakpoints 0-0.3 Medium-complex patterns 8 1 0.3 No breakpoints 0-0.4 Complex cultural patterns 12 2 0.5 No overlap 0-0.6 Company logo 6 0.8 0.1 No breakpoints 0-0.2 Table 1 shows a comparison of the traditional manual modeling time and the generation time of the system of this invention for different types of sugar painting patterns. These data demonstrate that the method of this invention significantly improves the efficiency of 3D model generation, especially when dealing with complex patterns, saving considerable time. Furthermore, the 3D models generated by the system have smaller errors, meeting the requirements for sugar painting printing, and exhibit significantly improved stability during the printing process. This invention not only improves the efficiency of 3D model generation for sugar painting but also solves the error problem in traditional manual modeling, ensuring high accuracy and high adaptability of the generated models.
[0031] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. An intelligent construction system for converting 2D sugar painting images into 3D models based on AI large-scale models, characterized in that: include: The image input module is used to receive and acquire two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns; The AI large model feature extraction module is used to preprocess two-dimensional image data and extract key feature points of sugar painting using twin modeling method. It also uses support vector machine to classify, filter and label contour lines, detail areas and structural nodes in the image. The sugar painting process ordered connection module is used to sort the key feature points according to the traditional forming rules of intangible cultural heritage sugar painting, and use the decision tree algorithm to automatically analyze the connection relationship between key feature points to generate continuous and unbroken lines that conform to the sugar painting line pattern. It also ensures the ordered connection between each key feature point and adjacent key feature points according to the requirements of traditional process. The automatic 3D model generation module is used to generate 3D models based on ordered and connected continuous lines. By converting 2D lines into 3D solid structures, it ensures that the 3D models can be adapted to the molding requirements of sugar painting printing equipment. The printing equipment adapter output module is used to convert the 3D model into a standardized file that conforms to the input format of the sugar painting printing equipment, and optimize the model size, line thickness and spacing according to the process requirements of the printing equipment.
2. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 1, characterized in that, The image input module acquires two-dimensional image data containing sugar painting shapes, corporate logos, or cultural patterns through a high-resolution camera or scanner. The two-dimensional image data is transmitted to the computing processing unit for subsequent processing via a wired or wireless interface, ensuring uniform illumination and stable image quality during the image acquisition process. The image acquisition device and the computing processing unit transmit data in real time through a standardized data protocol, ensuring that there is no packet loss or distortion during data transmission.
3. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 1, characterized in that, The AI large-scale model feature extraction module specifically includes: Two-dimensional image data is converted to grayscale, which reduces computational complexity and highlights the basic contour information of the image. The Gaussian filtering algorithm is used to smooth the image, remove noise, and preserve the basic structure of the image at the edges; The Sobel operator is used for edge detection to extract edge information from the image. For each contour line in the image, the dilation and erosion methods in morphological operations are used to further correct the continuity of the lines, fill the breakpoints and connect the broken lines, thereby ensuring the integrity of the sugar painting lines. Convolutional neural networks are used to extract multi-level features from images. In each convolutional operation, low-level features, including edges and corners, as well as high-level features, including structure and texture, are extracted. The ReLU activation function is used to increase the non-linear expressive power of the network model. After feature extraction, the feature points in the image are mapped to a high-dimensional space through a Siamese network structure. The contrastive loss function is used to measure the similarity between key feature points in the image, ensuring that the key feature points of sugar painting can match the traditional sugar painting line patterns. Support vector machines are used to classify the extracted features, identify the effective contour lines, detail regions and structural nodes in the image, and K-means clustering algorithm is used to cluster the classified feature points to obtain the structural features of the sugar painting. An adaptive thresholding algorithm is used to accurately label the classified feature points, ensuring the accuracy of the location of each key feature point in the image space.
4. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 1, characterized in that, The sugar painting process orderly connection module specifically includes: After receiving the key feature points, according to the sugar painting forming rules, all key feature points are initially classified according to their inner and outer layers and their thickness. The KD-tree algorithm based on spatial distance and geometric relationship is used to spatially sort the key feature points and construct an undirected graph with the key feature points as nodes, where each edge represents a potential connection relationship. The decision tree algorithm is used to analyze the connection relationship between each pair of key feature points. By learning the traditional line pattern of sugar painting, the decision tree automatically determines whether two points should be connected and assigns priority to each edge according to the connection order. All connections are recorded after the output of the decision tree, and a candidate connection path is generated by a depth-first search algorithm. Genetic algorithms are used to optimize candidate paths and select the optimal path to ensure that the connection between each key feature point and its adjacent key feature points meets the requirements of sugar painting process and avoids breakpoints or overlaps. Bezier curve fitting technology is used to smooth all connecting lines, ensuring that the connecting lines are smooth and meet actual printing requirements; The generated lines are optimized using the least squares method, and the relative position of each connection point and the curvature of the lines are further adjusted to ensure that the final generated line structure can be stably formed during printing and meets the aesthetic requirements of sugar painting art.
5. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 4, characterized in that, The construction and sorting process of the KD-tree algorithm specifically includes: Using the coordinate data of all key feature points as input, a K-dimensional spatial tree, namely a KD tree, is constructed. Recursive partitioning is performed at each level of the tree, selecting one dimension for data partitioning each time, ensuring that point lookup and neighbor point search can be performed quickly in each dimension. During the construction of the KD tree, the splitting dimension of each node is selected as the median of the current point set to balance the depth of the tree and query efficiency. Spatial sorting is performed on the KD-tree by recursively traversing each branch, calculating the spatial coordinates of each key feature point and its distance from other neighboring points, and dynamically adjusting the branch sorting based on the geometric relationships between points to ensure that the final tree structure can provide optimal spatial query efficiency. Specifically, this includes: By recursively traversing each node of the KD tree, starting from the root node, we sequentially determine whether the current node is a key feature point in the target point set. If so, calculate the spatial distance between the node and its neighbors using the Euclidean distance formula, and record the distance value between each key feature point and its neighbors. To ensure the efficiency of spatial sorting, a heap structure is used to store the nearest neighbor with the shortest distance in each recursive process, and the nodes are accessed according to the principle of shortest distance first. Recursively traverse the left and right subtrees of the tree, and in each recursion, adjust the visiting order of the left and right subtrees based on the partitioning principle of the current node's dimension and median, to ensure that the depth of the tree can be well balanced after each level of partitioning. For each node, determine whether it is within the current search range. If it is, continue to search for the nearest point in the current subtree and update the minimum distance record. By recursively sorting all nodes in space, the sorting result of each key feature point is obtained, ensuring that the entire point set can be optimized and sorted according to its spatial location. When sorting points using a KD-tree, an adaptive threshold algorithm is used to dynamically adjust the distance tolerance between points. Appropriate distance standards are set according to the shape characteristics of sugar painting to ensure that the connected points meet the requirements of smooth sugar painting lines.
6. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 1, characterized in that, The automatic 3D model generation module specifically includes: After receiving the ordered and connected continuous lines, the geometric attributes of each line are extracted, the initial direction of the line is determined by the endpoint coordinates and tangent direction of each line, and the normal vector and tangent vector are calculated for each line. The B-spline curve fitting method is used to fit the lines in three dimensions. The lines are parameterized according to their geometric characteristics so that the spatial curvature of each line matches the requirements of the sugar painting process. The spline function is used to smoothly transition the connection between each point. The two-dimensional coordinates of the line are mapped to three-dimensional space using Lagrange interpolation, and a Z-axis coordinate value is assigned to each connection point to construct a continuous three-dimensional line composed of a series of three-dimensional coordinate points. Dijkstra's algorithm is used for topology optimization to ensure that each 3D line can be seamlessly connected to its adjacent lines, avoiding breakpoints or intersections. The three-dimensional lines are converted into discrete voxel meshes using the voxelization method. The Marching Cubes algorithm is then used to reconstruct the meshes, and the resulting three-dimensional surface is smoothed to eliminate surface defects and optimize edges. Based on the specifications and printing accuracy requirements of the sugar painting printing equipment, geometric transformation and scaling methods are used to ensure that the 3D model is adapted to the process requirements of the printing equipment.
7. The intelligent construction system for converting 2D sugar painting images to 3D models based on AI large-scale models according to claim 6, characterized in that, The B-spline curve fitting method specifically includes: For each two-dimensional line, the control point set of each line is initialized by calculating the tangent direction of its endpoints and the spatial position of adjacent points. Select a 3rd or 4th order B-spline to construct the spline curve, and assign several control points to each line. Determine the smoothness and shape of the curve based on the position of the control points and the geometric characteristics of the line. Parameterization is performed using uniform B-spline or non-uniform B-spline algorithms to ensure that the spatial representation of each line can be flexibly adjusted by changing the control points; During the fitting process, the least squares optimization algorithm is applied to perform reverse optimization on the control points to minimize the fitting error, so that the curve transitions smoothly between each connection point and meets the structural requirements of sugar painting. By solving the interpolation function of each line in three-dimensional space, the position of each segment control point is calculated, and the connection transition between control points is upgraded from low-order polynomial interpolation to high-order smooth curve. To avoid discontinuous changes in the curves, a weighted average method is used to adjust the tension and softness of the curves, so that each curve can maintain the original shape characteristics of sugar painting while having a seamless connection with adjacent lines.