Three-dimensional reconstruction method and device, equipment, storage medium and product

By stretching and expanding on two-dimensional graphics and using implicit surface functions and operators for smooth processing, the automatic conversion of two-dimensional graphics to three-dimensional models is realized, solving the technical problem of converting two-dimensional graphics to three-dimensional models. , enhances visual experience and immersion.

CN119091081APending Publication Date: 2024-12-06HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411089350.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The prior art is difficult to automatically convert two-dimensional graphics into three-dimensional models, and there is a lack of effective methods to enhance visual experience and immersion.

Method used

By obtaining pre-designed two-dimensional graphics, processing according to the target stretch thickness and expansion height, the sides and surface parts of the three-dimensional model are generated, and the grid is extracted using implicit surface functions and Dua l-contour algorithm, combined with Bi-Lapl ac i The an operator performs smooth processing to realize automatic conversion of two-dimensional graphics to three-dimensional models.

Benefits of technology

Automatically converting two-dimensional graphics into three-dimensional models is realized, enhancing visual experience and immersion. The generated three-dimensional model surface presents symmetry and natural expansion effects, and the smoothly processed surface is consistent with the original shape.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091081A_ABST
    Figure CN119091081A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional reconstruction method and apparatus, a device, a storage medium and a product. The method comprises the steps of obtaining a pre-designed initial two-dimensional graph; the initial two-dimensional graph is stretched to a preset plane in the normal direction of the initial two-dimensional graph according to the target stretching thickness, a side face part of the three-dimensional model is obtained, and the side face part is parallel to the normal direction; according to a target expansion height, expansion processing is carried out on the two-dimensional graph located on the preset plane, a curved surface part of the three-dimensional model is generated, and the three-dimensional model is marked as an initial three-dimensional model; and determining a target three-dimensional model expressed by the initial two-dimensional graph according to the initial three-dimensional model. According to the embodiment of the invention, the two-dimensional graph is automatically converted into the three-dimensional model expressed by the two-dimensional graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of three-dimensional reconstruction technology, and in particular to a three-dimensional reconstruction method, device, equipment, storage medium and product. Background Art

[0002] Artists use advanced 2D graphic design software to create a large number of exquisite 2D graphic designs. From simple graphic designs to complex cartoon image designs, all of them demonstrate the artists' unique perspectives and superb skills.

[0003] However, with the rapid development of digital technology, the audience's requirements for visual experience are increasing day by day. Three-dimensional models can give works more three-dimensional and vivid visual effects, allowing the audience to more intuitively feel the sense of space and depth behind the design, thereby enhancing the appeal and immersion of the work. Therefore, the need to convert two-dimensional graphics into the three-dimensional models they express naturally arises. Summary of the invention

[0004] The present invention provides a three-dimensional reconstruction method, device, equipment, storage medium and product, which can automatically convert a two-dimensional graphic into a three-dimensional model it expresses.

[0005] In a first aspect, an embodiment of the present invention provides a three-dimensional reconstruction method, the method comprising:

[0006] Obtaining a pre-designed initial two-dimensional graphic;

[0007] Stretching the initial two-dimensional figure along its normal direction to a preset plane according to a target stretching thickness to obtain a side portion of a three-dimensional model, wherein the side portion is parallel to the normal direction;

[0008] According to the target expansion height, the two-dimensional figure located on the preset plane is expanded to generate the curved surface part of the three-dimensional model, and the three-dimensional model is recorded as the initial three-dimensional model;

[0009] A target three-dimensional model expressed by the initial two-dimensional graphic is determined according to the initial three-dimensional model.

[0010] Furthermore, the generation of the initial three-dimensional model includes:

[0011] A three-dimensional space coordinate system is established with the center point of the initial two-dimensional figure as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis;

[0012] Calculate p xy The signed distance d to the boundary of the initial two-dimensional figure, and the maximum distance d from the coordinate point inside the initial two-dimensional figure to the boundary of the initial two-dimensional figure m , where p xyDenote the projection point of the coordinate point p in three-dimensional space on the xy plane;

[0013] According to the target stretching thickness, the target expansion height, d and d m , generate the side part and the curved surface part of the initial three-dimensional model.

[0014] Further, the generating the side part and the curved surface part of the initial three-dimensional model according to the target stretching thickness, the target expansion height, d and d m , includes:

[0015] Substitute d and d m into the implicit surface function F(p), let F(p)=0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions. The three-dimensional coordinate points constitute the side part and the curved surface part of the initial three-dimensional model, where the implicit surface function defines the curved surface part of the three-dimensional model based on the logic of the two-dimensional ellipse equation;

[0016] The F(p) is:

[0017]

[0018] where, p.z represents the z coordinate of the p point, h represents the target stretching thickness, v represents the target expansion height, -h < p.z < h represents the side part of the initial three-dimensional model, and p.z ≤ -h or p.z ≥ h represents the curved surface part of the initial three-dimensional model.

[0019] Further, the calculating the signed distance d from p xy to the boundary of the initial two-dimensional graph includes:

[0020] Calculate the unsigned distance value closest to the boundary of the initial two-dimensional graph from p xy , denoted as D;

[0021] If p xy is inside the initial two-dimensional graph, then d = -D; if p xy is outside the initial two-dimensional graph, then d = D.

[0022] Further, the determining the target three-dimensional model expressed by the initial two-dimensional graph according to the initial three-dimensional model includes:

[0023] Based on the Dual-contour algorithm, extract the surface mesh of the initial three-dimensional model to obtain a meshed three-dimensional model, denoted as the transitional three-dimensional model;

[0024] The curved surface of the transition three-dimensional model is smoothed based on the Bi-Lapl acian operator to obtain a final target three-dimensional model, wherein the curved surface of the target three-dimensional model is smooth and consistent with the shape of the curved surface of the transition three-dimensional model.

[0025] Furthermore, the mesh of the surface is extracted based on the Dual-contour algorithm to obtain a meshed three-dimensional model, including:

[0026] Divide the space inside the curved surface of the 3D model into multiple cubes according to the set resolution;

[0027] Calculate the values ​​of the implicit surface function of the 8 vertices of the cube. If some of the calculated 8 values ​​are greater than 0 and some are less than 0, it is determined that the surface intersects the cube.

[0028] Determine the edge of the cube to which the intersection point belongs, calculate the minimum projection point of the four cubes that share the edge, connect the minimum projection points of each cube to form a patch, and all the patches constitute a discrete grid of the surface, that is, a gridded three-dimensional model.

[0029] Further, the smoothing of the surface part in the transition three-dimensional surface model based on the Bi-Laplacian operator to obtain the final target three-dimensional model, wherein the surface of the target three-dimensional model is smooth and consistent with the shape of the transition three-dimensional model surface, includes:

[0030] Substitute the coordinates of the points in the surface portion where pz>h and / or the surface portion where pz<-h into the following equations:

[0031]

[0032] Where d is the offset of each point, △ is the Laplacian operator, div is the divergence operator, is the gradient operator;

[0033] Solve the linear equations to obtain the target three-dimensional model.

[0034] In a second aspect, an embodiment of the present invention further provides a three-dimensional reconstruction device, the device comprising:

[0035] A graphics acquisition module, used to acquire a pre-designed initial two-dimensional graphics;

[0036] An initial generation module, configured to stretch the initial two-dimensional graph along its normal direction to a preset plane according to a target stretching thickness, to obtain a side part of a three-dimensional model, where the side part is parallel to the normal direction; and perform an inflation process on the two-dimensional graph located on the preset plane according to a target inflation height, to generate a curved surface part of the three-dimensional model, and the three-dimensional model is denoted as an initial three-dimensional model;

[0037] A target generation module, configured to determine a target three-dimensional model expressed by the initial two-dimensional graph according to the initial three-dimensional model.

[0038] Further, the initial generation module includes:

[0039] A coordinate establishment unit, configured to establish a three-dimensional space coordinate system with the center point of the initial two-dimensional graph as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis;

[0040] A distance calculation unit, configured to calculate the signed distance d from p xy to the boundary of the initial two-dimensional graph, and the maximum distance d from the coordinate point inside the initial two-dimensional graph to the boundary of the initial two-dimensional graph m where p xy represents the projection point of the coordinate point p in the three-dimensional space on the xy plane;

[0041] A model generation unit, configured to generate the side part and the curved surface part of the initial three-dimensional model according to the target stretching thickness, the target inflation height, d, and d m .

[0042] Further, the model generation unit is configured to:

[0043] Substitute d and d m into the implicit surface function F(p), set F(p)=0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions, and the three-dimensional coordinate points constitute the side part and the curved surface part of the initial three-dimensional model, where the implicit surface function defines the curved surface part of the three-dimensional model based on the logic of the two-dimensional ellipse equation;

[0044] The F(p) is:

[0045]

[0046] where p.z represents the z coordinate of the p point, h represents the target stretching thickness, v represents the target inflation height, -h < p.z < h represents the side part of the initial three-dimensional model, and p.z ≤ -h or p.z ≥ h represents the curved surface part of the initial three-dimensional model.

[0047] Further, the distance calculation unit is configured to:

[0048] Calculate p xy The closest unsigned distance value to the boundary of the initial two-dimensional figure is denoted as D;

[0049] If p xy Inside the initial two-dimensional figure, then d = -D, if p xy Outside the initial two-dimensional figure, then d=D.

[0050] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0051] at least one processor; and

[0052] a memory communicatively connected to the at least one processor; wherein,

[0053] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods in the embodiments of the present invention.

[0054] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the methods described in the embodiments of the present invention.

[0055] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which implements any one of the methods according to the embodiments of the present invention when executed by a processor.

[0056] The technical solution provided by the embodiment of the present invention generates the side part of the three-dimensional model by stretching the designed initial two-dimensional graphic to a preset plane according to the target stretching thickness, and expands the two-dimensional graphic located in the preset plane according to the target expansion height to generate the curved surface part of the three-dimensional model; then, the target three-dimensional model is obtained according to the generated three-dimensional model, thereby automatically converting the two-dimensional graphic into the three-dimensional model it expresses according to the user's needs, and the user can set the target stretching thickness and target expansion height as needed.

[0057] A three-dimensional space coordinate system is established according to the two-dimensional graphics, and then based on the set implicit surface function, the side and surface parts of the three-dimensional model corresponding to the initial two-dimensional graphics are generated according to the signed distance of the boundary of the initial two-dimensional graphics, the maximum distance from the coordinate point inside the initial two-dimensional graphics to the polygon, the target stretching thickness and the target expansion height. Finally, the final three-dimensional surface model of the initial two-dimensional graphics is determined according to the side and surface parts of the three-dimensional model, thereby realizing the automatic conversion of the two-dimensional graphics into the three-dimensional model it expresses.

[0058] In addition, the implicit surface function in the embodiment of the present invention defines the surface part of the three-dimensional model based on the logic of the two-dimensional ellipse equation, so that the surface of the generated three-dimensional model is parallel to the base plane at the highest point and perpendicular to the base plane at the intersection with the base plane, and the surface also presents a certain symmetry as a whole. This symmetry reflects the symmetry of the two-dimensional plane figure itself, and also reflects the symmetry from the boundary to the center in the expansion height.

[0059] In the process of extracting the mesh of the surface based on the Dual-contour algorithm, by determining the edge to which the intersection point belongs in the cube, calculating the minimum projection point of the four cubes that share the edge, and connecting the minimum projection points of each cube to form a patch, rather than directly using the center points of each cube to generate a patch, the embodiment method of this solution can make the extracted surface mesh closer to the actual shape of the polygon.

[0060] The technical solution of the embodiment of the present invention applies the Bi-Lap l ac i an operator to smooth the surface part, because the Bi-Lap l ac i an operator has a better ability to maintain the high-order geometric features of the surface and is sensitive to curvature changes, so that the smoothed surface is as consistent as possible with the shape of the original surface. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0062] Figure 1 is a flow chart of a three-dimensional reconstruction method provided by an embodiment of the present invention;

[0063] Figure 2 is a schematic diagram of a three-dimensional reconstruction effect provided by an embodiment of the present invention;

[0064] Figure 3 is a flow chart of another three-dimensional reconstruction method provided by an embodiment of the present invention;

[0065] Figure 4 is a schematic diagram of an initial two-dimensional graphic provided by an embodiment of the present invention;

[0066] Figure 5 is a schematic diagram of an initial three-dimensional model provided by an embodiment of the present invention;

[0067] Figure 6 is a schematic diagram of a local surface vertex provided by an embodiment of the present invention;

[0068] Figure 7 is a schematic diagram of a target three-dimensional model provided by an embodiment of the present invention;

[0069] Figure 8 is a schematic structural diagram of a three-dimensional reconstruction device provided by an embodiment of the present invention;

[0070] Fig. 9 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0072] Figure 1 is a flow chart of a three-dimensional reconstruction method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the case of performing three-dimensional reconstruction on a two-dimensional graphic. Figure 1 , the three-dimensional reconstruction method provided by the embodiment of the present invention includes:

[0073] S110, obtaining a pre-designed initial two-dimensional graphic.

[0074] The initial two-dimensional graphic is a closed two-dimensional graphic, which may or may not have holes, and multiple layers may be nested.

[0075] Optionally, the initial two-dimensional graphic may be a two-dimensional graphic design created by two-dimensional graphic design software, or may be a two-dimensional graphic drawn manually. This embodiment does not limit the creation process of the initial two-dimensional graphic.

[0076] S120, stretching the initial two-dimensional figure along its normal direction to a preset plane according to a target stretching thickness to obtain a side portion of a three-dimensional model, wherein the side portion is parallel to the normal direction.

[0077] The target stretching thickness is the height of the initial two-dimensional figure when the initial two-dimensional figure is stretched along the normal direction, that is, the distance between the plane to which the initial two-dimensional figure belongs and the pre-examination plane.

[0078] The specific target stretching thickness can be set as needed.

[0079] The side part is the part stretched out from the overall plane, which includes the initial two-dimensional figure and a new two-dimensional figure formed in the preset plane after stretching. The new two-dimensional figure is parallel to the initial two-dimensional figure and has the same figure. The distance between the new two-dimensional figure and the initial two-dimensional figure is the target stretching thickness.

[0080] S130, expanding the two-dimensional figure located on the preset plane according to the target expansion height to generate a curved surface portion of the three-dimensional model, and the three-dimensional model is recorded as an initial three-dimensional model.

[0081] The target expansion height is the height of the curved surface after expansion based on the preset plane, that is, the distance between the curved surface and the preset plane.

[0082] The specific target expansion height can be set as needed.

[0083] The curved surface part is the part that expands based on the new two-dimensional figure in the preset plane.

[0084] See also Figure 2 Taking the initial two-dimensional figure being a five-pointed star as an example, the figure shows a three-dimensional model corresponding to the initial two-dimensional figure. The three-dimensional model is composed of a side part 210 and a curved part 220 along the horizontal division.

[0085] S140: Determine a target three-dimensional model expressed by the initial two-dimensional graphic according to the initial three-dimensional model.

[0086] Specifically, the initial three-dimensional model may be directly determined as the target three-dimensional model expressed by the initial two-dimensional graphic.

[0087] To improve the smoothness of the three-dimensional model, determining the target three-dimensional model expressed by the initial two-dimensional graphic according to the initial three-dimensional model includes:

[0088] Extracting the surface mesh of the initial three-dimensional model based on the Dual-contour algorithm to obtain a meshed three-dimensional model, which is recorded as a transitional three-dimensional model;

[0089] The curved surface of the transition three-dimensional model is smoothed based on a Bi-Laplacian operator to obtain a final target three-dimensional model, wherein the curved surface of the target three-dimensional model is smooth and consistent in shape with the curved surface of the transition three-dimensional model.

[0090] The technical solution provided by the embodiment of the present invention generates the side part of the three-dimensional model by stretching the designed initial two-dimensional graphic to a preset plane according to the target stretching thickness, and expands the two-dimensional graphic located in the preset plane according to the target expansion height to generate the curved surface part of the three-dimensional model; then, the target three-dimensional model is obtained according to the generated three-dimensional model, thereby realizing the automatic conversion of the two-dimensional graphic into the three-dimensional model it expresses.

[0091] In order to improve the accuracy of mesh extraction, the initial three-dimensional model is extracted from the surface mesh based on the Dual-contour algorithm to obtain a meshed three-dimensional model, including:

[0092] Divide the space inside the curved surface of the 3D model into multiple cubes according to the set resolution;

[0093] Calculate the values ​​of the implicit surface function of the 8 vertices of the cube. If some of the calculated 8 values ​​are greater than 0 and some are less than 0, it is determined that the surface intersects the cube.

[0094] Determine the edge of the cube to which the intersection point belongs, calculate the minimum projection point of the four cubes that share the edge, connect the minimum projection points of each cube to form a patch, and all the patches constitute a discrete grid of the surface, that is, a gridded three-dimensional model.

[0095] Among them, the minimum projection point is the point where the projection and the minimum point on the normal of the edge with the intersection point are, that is, if the intersection point of all edges on a cube is p i , the normal of the surface at this point is n i , then the point p that makes the energy smallest is the center point of the cube, which is also the minimum projection point. The energy formula is as follows:

[0096]

[0097] See also Figure 3 Taking the bear head as an example, the embodiment of the present invention can be described as follows in practical application:

[0098] S210, obtaining a pre-designed initial two-dimensional graphic.

[0099] S220, see Figure 4 , establish a three-dimensional space coordinate system with the center point of the initial two-dimensional figure as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis.

[0100] S230, calculate p xy The signed distance d to the boundary of the initial two-dimensional figure, and the maximum distance d from the coordinate point inside the initial two-dimensional figure to the boundary of the initial two-dimensional figure m , where p xy Represents the projection point of the coordinate point p in three-dimensional space on the xy plane.

[0101] Specifically, the calculation p xy The signed distance d to the boundary of the initial 2D figure, included:

[0102] Calculate p xy The closest unsigned distance value to the boundary of the initial two-dimensional figure is denoted as D;

[0103] If p xy Inside the initial two-dimensional figure, then d = -D, if p xyIf it is outside the initial two-dimensional graphic, then d = D.

[0104] S240. Substitute d and d m into the implicit surface function F(p), set F(p) = 0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions. See Figure 5 The three-dimensional coordinate points form the side part and the surface part of the initial three-dimensional model, where the implicit surface function defines the surface part of the three-dimensional model based on the logic of the two-dimensional ellipse equation;

[0105] The F(p) is as follows:

[0106]

[0107] where p.z represents the z coordinate of point p, h represents the target stretching thickness, v represents the target expansion height, -h < p.z < h represents the side part of the initial three-dimensional model, and p.z ≤ -h or p.z ≥ h represents the surface part of the initial three-dimensional model.

[0108] S250. Extract the surface mesh of the initial three-dimensional model based on the Dual - contour algorithm to obtain a meshed three-dimensional model, denoted as the transitional three-dimensional model.

[0109] S260. Smooth the surface of the transitional three-dimensional model based on the Bi - Laplacian operator to obtain the final target three-dimensional model, where the surface of the target three-dimensional model is smooth and has the same shape as the surface of the transitional three-dimensional model.

[0110] Smoothing the surface part in the transitional three-dimensional surface model based on the Bi - Laplacian operator to obtain the final target three-dimensional model, where the surface of the target three-dimensional model is smooth and has the same shape as the surface of the transitional three-dimensional model, includes:

[0111] Substitute the coordinate points in the surface part where p.z > h and / or p.z < -h into the following equation:

[0112]

[0113] where d is the offset of each point, where △ is the Laplacian operator, div is the divergence operator, is the gradient operator;

[0114] For the mesh, the discrete form of the Laplacian operator is:

[0115]

[0116] See also Figure 6 ,f(v i ) represents the vertex v i The initial position, w i =1 / A i , here A i Represents vertex v i The area of ​​the Voronoi Voronoi diagram is shown in 601; N(v i ) indicates v i The neighborhood of w is all the adjacent vertices around it; ij =(cotα ij +cotβ ij ) / 2, where α ij and β ij Represents the edge (v i ,v j ) two opposite angles.

[0117] It can be seen from this that the partial differential equation The discrete form of is a linear equation system, so fix the points in the model that do not belong to S1 and S2, and solve the linear equation system To achieve a smooth surface, see Figure 7 Get the target three-dimensional model.

[0118] The expansion effect in the embodiment of the present invention is achieved by establishing a mathematical model of an implicit surface. The mathematical model includes two parameters: target stretching thickness and target expansion height. These two parameters can be set according to product requirements to achieve control of the expansion effect. The implicit surface function defines the surface part of the three-dimensional model based on the logic of the two-dimensional elliptic equation, so that the generated three-dimensional model expands more naturally, the surface is smooth as a whole, and is parallel to the pre-examination plane at the highest point, and is perpendicular to the preset plane at the intersection with the preset plane. In addition, this implicit surface also presents a certain symmetry as a whole. This symmetry not only reflects the symmetry of the two-dimensional plane figure itself, but also reflects the symmetry from the boundary to the center in terms of the expansion height.

[0119] Based on the Bi-Lap l ac i an operator, the purpose of smoothing the surface is achieved by solving a group of linear equations. Because the Bi-Lap l ac i an operator has a better ability to preserve the high-order geometric features of the surface and is sensitive to changes in curvature, the smoothed surface is as consistent as possible with the shape of the original surface.

[0120] Figure 8 is a schematic diagram of the structure of a three-dimensional reconstruction device provided by an embodiment of the present invention. Figure 8 , the three-dimensional reconstruction device provided by the embodiment of the present invention includes:

[0121] A graphics acquisition module 310 is used to acquire a pre-designed initial two-dimensional graphics;

[0122] The initial generation module 320 is used to stretch the initial two-dimensional figure along its normal direction to a preset plane according to a target stretching thickness to obtain a side portion of a three-dimensional model, wherein the side portion is parallel to the normal direction; and to expand the two-dimensional figure located on the preset plane according to a target expansion height to generate a curved surface portion of the three-dimensional model, wherein the three-dimensional model is recorded as an initial three-dimensional model;

[0123] The target generation module 330 is used to determine a target three-dimensional model expressed by the initial two-dimensional graphic according to the initial three-dimensional model.

[0124] The technical solution provided by the embodiment of the present invention generates the side part of the three-dimensional model by stretching the designed initial two-dimensional graphic to a preset plane according to the target stretching thickness, and expands the two-dimensional graphic located in the preset plane according to the target expansion height to generate the curved surface part of the three-dimensional model; then, the target three-dimensional model is obtained according to the generated three-dimensional model, thereby realizing the automatic conversion of the two-dimensional graphic into the three-dimensional model it expresses.

[0125] Furthermore, the initial generation module includes:

[0126] A coordinate establishing unit, used to establish a three-dimensional space coordinate system with the center point of the initial two-dimensional figure as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis;

[0127] Distance calculation unit, used to calculate p xy The signed distance d to the boundary of the initial two-dimensional figure, and the maximum distance d from the coordinate point inside the initial two-dimensional figure to the boundary of the initial two-dimensional figure m , where p xy Represents the projection point of the coordinate point p in the three-dimensional space on the xy plane;

[0128] A model generation unit is used to generate a model according to the target stretching thickness, the target expansion height, d and d m , generating the side surface part and the curved surface part of the initial three-dimensional model.

[0129] Furthermore, the model generation unit is used to:

[0130] D and D m Substitute into the implicit surface function F(p), set F(p)=0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions, the three-dimensional coordinate points constitute the side part and the surface part of the initial three-dimensional model, wherein the implicit surface function defines the surface part of the three-dimensional model based on the two-dimensional ellipse equation logic;

[0131] The F(p) is as follows:

[0132]

[0133] Where p.z represents the z - coordinate of point p, h represents the target stretching thickness, v represents the target expansion height, -h < p.z < h represents the side part of the initial three - dimensional model, and p.z ≤ -h or p.z ≥ h represents the curved surface part of the initial three - dimensional model.

[0134] Furthermore, the distance calculation unit is used for:

[0135] Calculating the unsigned distance value from p xy to the nearest boundary of the initial two - dimensional graph, denoted as D;

[0136] If p xy is inside the initial two - dimensional graph, then d = -D; if p xy is outside the initial two - dimensional graph, then d = D.

[0137] Furthermore, the target generation module includes:

[0138] A mesh extraction unit, which is used to extract the surface mesh of the initial three - dimensional model based on Dual - contour to obtain a meshed three - dimensional model, denoted as the transitional three - dimensional model;

[0139] A smoothing processing unit, which is used to smooth the surface of the transitional three - dimensional model based on Bi - Laplacian to obtain the final target three - dimensional model, where the surface of the target three - dimensional model is smooth and has the same shape as the surface of the transitional three - dimensional model.

[0140] Furthermore, the mesh extraction unit is used for:

[0141] Dividing the inner space of the surface of the three - dimensional model into multiple cubes according to the set resolution;

[0142] Calculating the values of the implicit surface function for the 8 vertices of the cube. If there are both values greater than 0 and values less than 0 among the 8 calculated values, it is determined that the surface intersects with the cube;

[0143] Determining the edges in the cube to which the intersection points belong, calculating the projection minimum points of the 4 cubes sharing the edge, and connecting the projection minimum points of each cube to form a patch. All the patches constitute the discrete mesh of the surface, that is, the meshed three - dimensional model.

[0144] Furthermore, the smoothing processing unit is used for:

[0145] Substitute the coordinates of the points in the surface portion where pz>h and / or the surface portion where pz<-h into the following equations:

[0146]

[0147] Where d is the offset of each point, △ is the Laplacian operator, div is the divergence operator, is the gradient operator;

[0148] Solve the linear equations to obtain the target three-dimensional model.

[0149] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0150] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0151] Fig. 9 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0152] like Fig. 9 As shown, the device 400 includes a computing unit 410, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 420 or a computer program loaded from a storage unit 480 into a random access memory (RAM) 430. In the RAM 430, various programs and data required for the operation of the device 400 can also be stored. The computing unit 410, the ROM 420, and the RAM 430 are connected to each other via a bus 440. An input / output (I / O) interface 450 is also connected to the bus 440.

[0153] A number of components in the device 400 are connected to the I / O interface 450, including: an input unit 460, such as a keyboard, a mouse, etc.; an output unit 470, such as various types of displays, speakers, etc.; a storage unit 480, such as a disk, an optical disk, etc.; and a communication unit 490, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 490 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0154] The computing unit 410 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 410 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 410 performs the various methods and processes described above, such as the method object selection method. For example, in some embodiments, the method object selection may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 480. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 420 and / or the communication unit 490. When the computer program is loaded into the RAM 430 and executed by the computing unit 410, one or more steps of the method object selection method described above may be performed. Alternatively, in other embodiments, the computing unit 410 may be configured to perform the method object selection method by any other appropriate means (e.g., by means of firmware).

[0155] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0156] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0157] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0159] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0160] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0161] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0162] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A three-dimensional reconstruction method, characterized in that: The method includes: Obtaining a pre-designed initial two-dimensional graph; Stretching the initial two-dimensional graph along its normal direction to a preset plane according to a target stretching thickness to obtain a side part of the three-dimensional model, where the side part is parallel to the normal direction; Performing an inflation process on the two-dimensional graph located on the preset plane according to a target inflation height to generate a curved surface part of the three-dimensional model, and the three-dimensional model is denoted as the initial three-dimensional model; Determining the target three-dimensional model expressed by the initial two-dimensional graph according to the initial three-dimensional model.

2. The method according to claim 1, characterized in that The generation of the initial three-dimensional model includes: Taking the center point of the initial two-dimensional graph as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis to establish a three-dimensional space coordinate system; Calculate p xy The signed distance d to the boundary of the initial two-dimensional figure, and the maximum distance d from the coordinate point inside the initial two-dimensional figure to the boundary of the initial two-dimensional figure x , where p xy Represents the projection point of the coordinate point p in the three-dimensional space on the xy plane; According to the target stretched thickness, the target expansion height, d and d m , generating the side surface part and the curved surface part of the initial three-dimensional model.

3. The method according to claim 2, characterized in that The target stretch thickness, the target expansion height, d and d m , generating the side surface part and the curved surface part of the initial three-dimensional model, including: D and D m Substitute into the implicit surface function F(p), set F(p)=0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions, the three-dimensional coordinate points constitute the side part and the surface part of the initial three-dimensional model, wherein the implicit surface function defines the surface part of the three-dimensional model based on the two-dimensional ellipse equation logic; The F(p) is: where p.z represents the z coordinate of point p, h represents the target stretching thickness, v represents the target inflation height, -h < p.z < h represents the side part of the initial three-dimensional model, and p.z ≤ -h or p.z ≥ h represents the curved surface part of the initial three-dimensional model.

4. The method according to claim 2, characterized in that: The calculation p xy The signed distance d to the boundary of the initial 2D figure, included: Calculate p xy The closest unsigned distance value to the boundary of the initial two-dimensional figure is denoted as D; If p xy Inside the initial two-dimensional figure, then d = -D, if p xy Outside the initial two-dimensional figure, then d=D.

5. The method according to claim 1, characterized in that: The determining the target three-dimensional model expressed by the initial two-dimensional graph according to the initial three-dimensional model includes: Extracting a curved surface mesh of the initial three-dimensional model based on the Dual-contour dual contour algorithm to obtain a meshed three-dimensional model, denoted as the transitional three-dimensional model; Smoothing the curved surface of the transitional three-dimensional model based on the Bi-Laplacian second-order Laplacian operator to obtain the final target three-dimensional model, where the curved surface of the target three-dimensional model is smooth and has the same shape as the curved surface of the transitional three-dimensional model.

6. The method according to claim 5, characterized in that The extracting a curved surface mesh of the initial three-dimensional model based on the Dual-contour algorithm to obtain a meshed three-dimensional model includes: Dividing the inner space of the curved surface of the three-dimensional model into multiple cubes according to a set resolution; Calculating the values of the implicit surface function for the 8 vertices of the cube, and if there are both values greater than 0 and values less than 0 among the 8 calculated values, it is determined that the curved surface intersects with the cube; Determining the edges in the cube to which the intersection points belong, calculating the projection minimum points of the 4 cubes sharing the edge, and connecting the projection minimum points of each cube to form a patch, and all the patches constitute the discrete mesh of the curved surface, that is, the meshed three-dimensional model.

7. The method according to claim 5, characterized in that The smoothing the curved surface part in the transitional three-dimensional surface model based on the Bi-Laplacian operator to obtain the final target three-dimensional model, where the curved surface of the target three-dimensional model is smooth and has the same shape as the curved surface of the transitional three-dimensional model, includes: Substituting the coordinate points in the curved surface part where p.z > h and / or p.z < -h into the following equation: Where d is the offset of each point, △ is the Laplacian operator, div is the divergence operator, is the gradient operator; Solving the linear equation system to obtain the target three-dimensional model.

8. A three-dimensional reconstruction device, characterized in that: The device includes: A graph acquisition module for obtaining a pre-designed initial two-dimensional graph; An initial generation module, configured to stretch the initial two-dimensional graph along its normal direction to a preset plane according to a target stretching thickness, to obtain a side portion of the three-dimensional model, the side portion being parallel to the normal direction; and perform an inflation process on the two-dimensional graph located on the preset plane according to a target inflation height, to generate a curved surface portion of the three-dimensional model, and the three-dimensional model is denoted as an initial three-dimensional model; A target generation module, configured to determine a target three-dimensional model represented by the initial two-dimensional graph according to the initial three-dimensional model.

9. The device according to claim 8, characterized in that The initial generation module includes: A coordinate establishment unit, configured to establish a three-dimensional space coordinate system with the center point of the initial two-dimensional graph as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the normal direction as the z-axis; Distance calculation unit, used to calculate p xy The signed distance d to the boundary of the initial two-dimensional figure, and the maximum distance d from the coordinate point inside the initial two-dimensional figure to the boundary of the initial two-dimensional figure m , where p xy Represents the projection point of the coordinate point p in the three-dimensional space on the xy plane; A model generation unit is used to generate a model according to the target stretching thickness, the target expansion height, d and d m , generating the side surface part and the curved surface part of the initial three-dimensional model.

10. The device according to claim 9, characterized in that The model generation unit is configured to: D and D m Substitute into the implicit surface function F(p), set F(p)=0, solve the equation, and obtain the three-dimensional coordinate points that meet the conditions, the three-dimensional coordinate points constitute the side part and the surface part of the initial three-dimensional model, wherein the implicit surface function defines the surface part of the three-dimensional model based on the two-dimensional ellipse equation logic; The F(p) is: wherein, p.z represents the z coordinate of point p, h represents the target stretching thickness, v represents the target inflation height, -h < p.z < h represents the side portion of the initial three-dimensional model, and p.z ≤ -h or p.z ≥ h represents the curved surface portion of the initial three-dimensional model.

11. The device according to claim 9, characterized in that The distance calculation unit is configured to: Calculate p xy The closest unsigned distance value to the boundary of the initial two-dimensional figure is denoted as D; If p xy Inside the initial two-dimensional figure, then d = -D, if p xy Outside the initial two-dimensional figure, then d=D.

12. An electronic device comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method according to any one of claims 1-7.

13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

14. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.