Signed distance field generation method and device, three-dimensional model generation method and device

By constructing a field space and setting a binary mask, the three-dimensional model loopholes and deformation problems caused by the non-watertightness of the patch model are solved, and high-accuracy signed distance field generation is achieved.

CN117496069BActive Publication Date: 2025-01-21BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311587109.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-01-21
Estimated Expiration
2043-11-24

AI Technical Summary

Technical Problem

In traditional technology, when the patch model is converted to a signed distance field, the three-dimensional model has loopholes and serious deformation due to the non-watertightness of the patch model.

Method used

By obtaining the non-watertight patch model, a field space with multiple grids is constructed, the unsigned distance field is obtained based on the field space and the patch model, a binary mask is set, and the signed distance field is obtained based on the mask and the unsigned distance field .

Benefits of technology

This method effectively solves the loopholes and deformation problems when converting the patch model to a signed distance field, and improves the accuracy of the obtained signed distance field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117496069B_ABST
    Figure CN117496069B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for generating a signed distance field, which relates to the field of artificial intelligence technology, specifically computer vision, deep learning, large models and other technical fields, and can be applied to scenes such as artificial intelligence content generation. The specific implementation scheme is: obtaining a non-watertight patch model; constructing a field space with multiple grids; obtaining an unsigned distance field based on the field space and the non-watertight patch model; setting a binary mask based on the unsigned distance field; obtaining a signed distance field based on the binary mask and the unsigned distance field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as computer vision, deep learning, and large models, and can be applied to scenarios such as artificial intelligence content generation, and in particular to a signed distance field generation method and device, a three-dimensional model generation method and device, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] In order to realize three-dimensional generation technology, traditional technology generally uses the industry-wide signed distance field to train three-dimensional convolutional networks.

[0003] However, since most open source 3D model data is mesh model data, there are often problems in converting mesh models to signed distance fields. For example, the obtained signed distance field may cause 3D model loopholes and serious 3D model deformation due to the non-watertightness of the mesh model. Summary of the invention

[0004] Provided are a signed distance field generation method and device, a three-dimensional model generation method and device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to a first aspect, a method for generating a signed distance field is provided, the method comprising: obtaining a non-watertight patch model; constructing a field space having a plurality of grids; obtaining an unsigned distance field based on the field space and the non-watertight patch model; setting a binary mask based on the unsigned distance field; and obtaining a signed distance field based on the binary mask and the unsigned distance field.

[0006] According to a second aspect, a three-dimensional model generation method is provided, the method comprising: obtaining a signed distance field, the signed distance field being generated using a signed distance field generation method as in any implementation of the first aspect; and obtaining a three-dimensional model corresponding to the signed distance field based on the signed distance field and a pre-trained three-dimensional network.

[0007] According to a third aspect, another three-dimensional model generation method is provided, the method comprising: obtaining a signed distance field, the signed distance field being generated using a signed distance field generation method such as any implementation of the first aspect; and performing three-dimensional reconstruction based on the signed distance field using a marching cubes algorithm to obtain a three-dimensional model.

[0008] According to a fourth aspect, a signed distance field generating device is provided, the device comprising: a model acquiring unit, configured to acquire a non-watertight patch model; a constructing unit, configured to construct a field space having a plurality of grids; a first obtaining unit, configured to obtain an unsigned distance field based on the field space and the non-watertight patch model; a setting unit, configured to set a binary mask based on the unsigned distance field; and a second obtaining unit, configured to obtain a signed distance field based on the binary mask and the unsigned distance field.

[0009] According to a fifth aspect, a three-dimensional model generation device is provided, comprising: a field acquisition unit, configured to acquire a signed distance field, wherein the signed distance field is generated by a signed distance field generation device as in any implementation of the first aspect; and a training unit, configured to obtain a three-dimensional model corresponding to the signed distance field based on the signed distance field and a pre-trained three-dimensional network.

[0010] According to a sixth aspect, a three-dimensional model generating device is provided, the device comprising: a data acquisition unit, configured to acquire a signed distance field, the signed distance field being generated by a signed distance field generating device as in any implementation of the first aspect; a reconstruction unit, configured to perform three-dimensional reconstruction based on the signed distance field using a marching cubes algorithm to obtain a three-dimensional model.

[0011] According to the seventh aspect, an electronic device is provided, which includes: 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 described in any implementation of the first aspect, the second aspect, and the third aspect.

[0012] According to an eighth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect, the second aspect, or the third aspect.

[0013] According to a ninth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method described in any one of the implementation modes of the first aspect, the second aspect, and the third aspect.

[0014] The signed distance field generation method and device provided by the embodiment of the present disclosure first obtain a non-watertight patch model; secondly, construct a field space with multiple grids; thirdly, obtain an unsigned distance field based on the field space and the non-watertight patch model; thirdly, set a binary mask based on the unsigned distance field; finally, obtain a signed distance field based on the binary mask and the unsigned distance field. Thus, a method for extracting an effective signed distance field through a non-watertight patch model is provided, and the problem of converting the patch model to the signed distance field is solved through the constructed field space and binary mask, and the accuracy of the obtained signed distance field is improved.

[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 is a flowchart of an embodiment of a method for generating a signed distance field according to the present disclosure;

[0018] Figure 2 It is a structural schematic diagram of an unsigned distance field in the signed distance field generation method disclosed in the present invention;

[0019] Figure 3a It is a structural schematic diagram of a binary mask in the signed distance field generation method disclosed in the present invention;

[0020] Figure 3b It is a structural schematic diagram of a transformation mask in the signed distance field generation method disclosed in the present invention;

[0021] Figure 4 is a structural schematic diagram of a signed distance field in the signed distance field generation method disclosed in the present invention;

[0022] Figure 5 is a structural schematic diagram of an unsigned distance field processed in the signed distance field generation method disclosed in the present invention;

[0023] Figure 6 is a flow chart of an embodiment of a method for generating a three-dimensional model according to the present disclosure;

[0024] Figure 7 is a flow chart of another embodiment of the method for generating a three-dimensional model according to the present disclosure;

[0025] Figure 8 is a structural schematic diagram of an embodiment of a signed distance field generating device according to the present disclosure;

[0026] Fig. 9 is a structural schematic diagram of an embodiment of a three-dimensional model generating device according to the present disclosure;

[0027] Fig.10 is a structural schematic diagram of another embodiment of the three-dimensional model generating device according to the present disclosure;

[0028] Fig.11 It is a block diagram of an electronic device used to implement the signed distance field generation method and the three-dimensional model generation method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] 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.

[0030] In this embodiment, "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0031] 3D generation is the intersection of deep learning and computer graphics, and has wide application value in the fields of gaming entertainment, virtual reality, augmented reality, medical and biological sciences, etc. Traditional 3D modeling and rendering usually require a lot of manpower input, including 3D artists, modelers, and renderers. 3D generation technology can automatically or semi-automatically generate 3D content, thereby reducing the demand for these high-cost human resources. Traditional 3D modeling and rendering require a lot of time, while 3D generation technology can usually generate high-quality 3D content (3D models) in a shorter time, which is particularly valuable for projects that require rapid iteration and generation of large amounts of 3D content, thereby reducing costs and increasing efficiency.

[0032] The existing mesh to signed distance field conversion may cause loopholes in the 3D model and serious deformation of the 3D model due to the non-watertightness of the mesh model. Therefore, the 3D model output by the network trained based on this data is wrong, leaky and deformed.

[0033] In view of the problems existing in the conversion of a patch model to a signed distance field in the traditional technology, the present disclosure provides a signed distance field generation method, through which a signed distance field with high accuracy can be obtained. Figure 1A process 100 of an embodiment of a method for generating a signed distance field according to the present disclosure is shown. The method for generating a signed distance field comprises the following steps:

[0034] Step 101, obtaining a non-watertight patch model.

[0035] In this embodiment, the patch model is a model that combines two-dimensional graphics to form a three-dimensional geometric body. The patch model may include multiple vertices and multiple patches, and each patch is based on the connection relationship between vertices.

[0036] In this embodiment, non-watertightness is the opposite of watertightness, where watertightness refers to: a geometric property used to describe a three-dimensional model. A watertight three-dimensional model means that its surface is closed without any cracks, holes or incomplete parts, just like a sealed container that does not allow water or liquid to penetrate. A watertight three-dimensional model usually has the following characteristics: a closed surface, all surfaces of the three-dimensional model are continuous and closed, without breaks or gaps, that is, a watertight three-dimensional model does not have any holes or gaps, no internal structure is exposed, and the internal geometric structure of the model will not be exposed outside the surface of the model. The interior of a watertight three-dimensional model is completely isolated and does not interact with the external environment.

[0037] In this embodiment, a watertight 3D model is important in many applications, especially in the fields of 3D printing, computer-aided design, computer graphics, virtual reality, game development, and engineering. This is because a watertight model is generally easier to handle and manipulate, and it can ensure that no inconsistencies or errors occur when performing various calculations and simulations. In 3D generation tasks, ensuring that the generated 3D model is watertight is an important goal because it ensures that the generated model can work properly and interact with other models in subsequent applications.

[0038] In this embodiment, the non-watertight patch model is a patch model with a non-closed surface, which may have holes and incomplete parts, so all patches on the non-watertight patch model will not make the model generate a closed body. The non-watertight patch model has V (V>1) vertices and F (F>1) patches.

[0039] Step 102, constructing a field space having multiple grids.

[0040] In this embodiment, the field space is a three-dimensional space for accommodating a plurality of three-dimensional, solid grids; and the field space is a space that interfaces with the signed distance field obtained in the present disclosure, and through the field space, a signed distance field can be generated in the area where the field space is located.

[0041] Step 103: Obtain an unsigned distance field based on the field space and the non-watertight patch model.

[0042] In this embodiment, the unsigned distance field is a mathematical function. The distance function value of the unsigned distance field is always positive or zero. It represents the distance from a point to the nearest surface, but it has no sign, so it is impossible to determine whether the point is inside or outside the surface. The signed distance field has information about the inside and outside of the model, and can be directly calculated by the marching cube algorithm to obtain a three-dimensional model. However, since the unsigned distance does not have information about the inside and outside of the model, the information divergence makes it impossible to use the marching cube algorithm to obtain a three-dimensional model.

[0043] In this embodiment, a plurality of three-dimensional grids are contained in the field space, and the unsigned distance field in the field space can be obtained by calculating the distance from the grid to each surface of the non-watertight patch model. Specifically, the patch models in the actual scene are mostly non-watertight patch models, and the unsigned distance field can be directly extracted by mature methods, such as SDFGen (a command line utility program, which can generate a grid-based unsigned distance field from a triangular mesh using the code on the website) algorithm, such as Figure 2 As shown, it is an unsigned distance field of a single surface. Figure 2 In the unsigned distance field shown, W is used to represent the real surface, and the distance function value of the unsigned distance field is always a positive number + or zero.

[0044] Step 104: Setting a binary mask based on the unsigned distance field.

[0045] In this embodiment, a binary mask is a mask that uses two different values ​​to block a selected image, graphic or object to control the image processing area or processing process. The mask used to cover a specific image or object is called a binary mask.

[0046] In this embodiment, the binary mask is obtained by replacing the values ​​of each unsigned distance function in the unsigned distance field with a specific value (such as 0 or 1). Therefore, the size of the binary mask is the same as the size of the unsigned distance field, and each point on the binary mask corresponds to a point in the unsigned distance field.

[0047] Step 105: Obtain a signed distance field based on the binary mask and the unsigned distance field.

[0048] In this embodiment, a signed distance field (SDF) is an abbreviation of Signed Distance Function. SDF is a mathematical function that assigns a distance value to each point in a three-dimensional space, indicating the distance from the point to the nearest surface, and carries a sign (positive or negative) to indicate whether the point is inside or outside the surface. SDF is mainly used to describe the geometry of a three-dimensional object. In three-dimensional rendering, modeling, and computer graphics, SDF can be used to represent and manipulate three-dimensional objects, such as the shape of an object, surface normals, collision detection, etc. SDF also plays an important role in three-dimensional reconstruction, virtual reality, computer game development, and many other fields. SDF has the following characteristics: signed nature, a positive SDF value indicates that the point is outside the surface, a negative value indicates that the point is inside the surface, and a zero value indicates that the point is on the surface. Differentiability: SDF functions are usually differentiable, which means that their gradients can be calculated, which is useful for many optimization and back-propagation tasks. Spatial compactness: SDF can compactly represent the geometric information of an object in a three-dimensional space without storing the vertex data of the surface.

[0049] In 3D generation tasks, SDF is often used to generate representations of 3D objects, such as generating 3D models, volume rendering, 3D reconstruction, etc. Neural networks in generation tasks can learn to generate SDF functions to create 3D objects with complex geometries.

[0050] The signed distance field is a data structure in the form of (n, n, n) three-dimensional voxels, each of which stores the signed distance of the position. With the signed distance field, the three-dimensional model can be obtained by the marching cube algorithm. The marching cube algorithm is an important method in the field of three-dimensional reconstruction, which can only be reconstructed based on the signed distance field.

[0051] In this embodiment, the binary mask has the same size as the unsigned distance field. Since the binary mask has holes or gaps, a mask corresponding to the signed distance field can be obtained by processing the binary mask. The above step 105 includes: Figure 3a The holes within the surface of the mask are filled to obtain the transformation mask (as shown in Figure 3b shown), in Figure 3a and Figure 3b There are only two mask values ​​0 and 1. Figure 3a and Figure 3bThere are a reconstructed inner surface N, a reconstructed outer surface O and a real surface W in the transformation mask relative to the binary mask, and all mask values ​​between the reconstructed inner surface N and the reconstruction center are set to 1; the unsigned distance value from the surface of the non-watertight model to the center of the field space of the unsigned distance field is set to the negative value of the unsigned distance value to obtain the processed unsigned distance field; the processed unsigned distance field is multiplied by the transformation binary mask to obtain a signed distance field.

[0052] Optionally, the signed distance field obtained above can be reconstructed using a marching cube algorithm, but the obtained signed distance field lacks continuity. Based on the obtained signed distance field, a marching cube algorithm is used to reconstruct a three-dimensional model, and the three-dimensional model is a watertight model; the signed distance field is extracted from the three-dimensional model to obtain a signed distance field.

[0053] Optionally, the above step 105 may also include: obtaining an initial signed distance field based on the binary mask and the unsigned distance field; obtaining a signed distance field based on the initial signed distance field. Wherein, the above step of obtaining the initial signed distance field based on the binary mask and the unsigned distance field includes: using the first parameter value to fill the holes in the binary mask to obtain a transformation mask; subtracting the mask threshold (a threshold for converting the unsigned distance function value into the mask value) from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly setting the mask value of the processed unsigned distance field corresponding to the transformation mask and the part of the unsigned distance function value greater than zero to the negative value of the unsigned distance function value to obtain the initial signed distance field; the above step of obtaining the signed distance field based on the initial signed distance field includes: based on the initial signed distance field, using the marching cube algorithm to perform three-dimensional reconstruction to obtain a watertight patch model; based on the watertight patch model, obtaining the signed distance field, such as Figure 4 As shown, a positive signed distance function value of the signed distance field indicates that the point is outside the real surface W, a negative signed distance function value indicates that the point is inside the real surface W, and a signed distance function value of zero indicates that the point is on the real surface W.

[0054] Optionally, the step of obtaining the initial signed distance field based on the binary mask and the unsigned distance field may further include: filling holes in the binary mask with the first parameter value to obtain a transformed mask, converting a mask value of the transformed mask into a mask corresponding to the signed distance field, and obtaining the initial signed distance field by multiplying the changed mask with the unsigned distance field.

[0055] In this embodiment, the initial signed distance field is an initial signed distance field with weak continuity (partial signed distance function values ​​are missing). By performing three-dimensional reconstruction on the initial signed distance field to obtain a watertight patch model, and then obtaining a signed distance field based on the watertight patch model, the continuity of the obtained signed distance field can be strong, thereby improving the reliability of the signed distance field extraction.

[0056] The method for generating a signed distance field provided by the present disclosure first obtains a non-watertight patch model; secondly, constructs a field space with multiple grids; thirdly, obtains an unsigned distance field based on the field space and the non-watertight patch model; thirdly, sets a binary mask based on the unsigned distance field; and finally, obtains a signed distance field based on the binary mask and the unsigned distance field. Thus, a method for extracting an effective signed distance field through a non-watertight patch model is provided, and the problem of converting the patch model to the signed distance field is solved through the constructed field space and binary mask, thereby improving the accuracy of the obtained signed distance field.

[0057] In some embodiments of the present disclosure, the above-mentioned construction of a field space having a plurality of grids includes: setting the size of the field space; and setting a preset number of three-dimensional grids in the field space, where the preset number is the cube of the size.

[0058] In this optional implementation, the field space size N is set, that is, a three-dimensional grid with a length of N, a width of N, and a height of N, totaling N^3, and the center position of each grid is Pi.

[0059] The field space generation method provided in this embodiment sets the size of the field space and sets a preset number of three-dimensional grids in the field space, thereby providing a reliable implementation method for obtaining the field space.

[0060] Optionally, the above-mentioned construction of the field space having multiple grids includes: setting the size of the field space, setting three-dimensional grids with the same length, width and height, and the number of the three-dimensional grids is the cube of the length or width or height.

[0061] Optionally, the above construction of a field space with multiple grids includes: before setting the size of the field space, normalizing all models to a preset range (such as a range between -1 and 1), and within the preset range, dividing them into three-dimensional grids at equal scales.

[0062] In some optional implementations of this embodiment, obtaining the unsigned distance field based on the field space and the non-watertight patch model includes: determining the center position of each grid based on the field space; and calculating the shortest distance from the center position to the non-watertight patch model to obtain the unsigned distance field.

[0063] In this optional implementation, the closest distance from the center position of each grid to the non-watertight model refers to: the closest distance from the center position of each grid to each facet F of the non-watertight model. It should be noted that since the distance in the vertical direction is the shortest, the above-mentioned closest distance can be the vertical distance from the vertical line through the center position to each facet of the non-watertight model. Optionally, the above-mentioned closest distance can also be the distance from the center position of each grid to the nearest facet of the non-watertight model.

[0064] In this optional implementation, an algorithm in a pre-set application, such as an algorithm for calculating the distance from a point to a surface, can be used to obtain an unsigned distance field. This algorithm is a mature algorithm in traditional technology and can efficiently calculate a large number of three-dimensional distances.

[0065] The embodiment of the present disclosure provides a method for obtaining an unsigned distance field. Based on the center position of each grid in the constructed field space, the shortest distance from the center position to the non-watertight patch model is calculated to obtain the unsigned distance field, which provides a reliable implementation method for obtaining the unsigned distance field.

[0066] Optionally, obtaining the unsigned distance field based on the field space and the non-watertight patch model includes: determining the center position of each grid based on the field space; calculating the shortest distance from the center position to the non-watertight patch model, and normalizing the shortest distances corresponding to all patches to obtain the unsigned distance field.

[0067] In some embodiments of the present disclosure, setting a binary mask based on the unsigned distance field includes: determining a mask threshold based on the size of the field space; and obtaining a binary mask based on the mask threshold and the unsigned distance field.

[0068] In this embodiment, the above-mentioned determination of the mask threshold based on the size of the field space includes: determining a fixed threshold, dividing the accuracy threshold by the size of the field space to obtain the mask threshold; wherein the fixed threshold can be determined based on the accuracy requirement of the signed distance field, for example, the fixed threshold is 0.04.

[0069] In this embodiment, obtaining the binary mask based on the mask threshold and the unsigned distance field includes: judging whether each unsigned distance function value in the unsigned distance field is less than the mask threshold, and if so, setting the unsigned distance function value in the unsigned distance field to a first fixed value; and if so, setting the unsigned distance function value in the unsigned distance field to a second fixed value, wherein the first fixed value is not equal to the second fixed value, and obtaining the binary mask by normalizing the first fixed value and the second fixed value.

[0070] like Figure 3aAs shown, the binary mask may be a mask with a double-surface reconstruction (ie, a reconstructed inner surface and a reconstructed outer surface), and the binary mask with a double-surface reconstruction is used to correspond to the double-surface patch model.

[0071] The method for setting a binary mask provided by an embodiment of the present disclosure determines a mask threshold based on the size of a field space; obtains a binary mask corresponding to the unsigned distance field based on the mask threshold and the unsigned distance field, and the obtained binary mask can effectively characterize a unit in the unsigned distance field, thereby improving the reliability of obtaining the binary mask.

[0072] In some embodiments of the present disclosure, obtaining a binary mask based on the mask threshold and the unsigned distance field includes: setting unsigned distance function values ​​greater than or equal to the mask threshold in the unsigned distance field to 0; and setting unsigned distance function values ​​less than the mask threshold in the unsigned distance field to 1, to obtain a binary mask.

[0073] For the method of obtaining a binary mask in this optional implementation, the above-mentioned method of obtaining a signed distance field based on the binary mask and the unsigned distance field includes: filling the holes in the binary mask with 1, so that the mask value of the grid within the binary mask and the inner surface of the non-watertight patch model becomes 1, and obtaining a transformed mask; subtracting the mask threshold from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly setting the unsigned distance function value in the processed unsigned distance field whose mask value in the transformed mask is 1 and is greater than or equal to 1 in the unsigned distance field to the negative value of the unsigned distance function value to obtain an initial signed distance field; based on the initial signed distance field, using the marching cubes algorithm to perform three-dimensional reconstruction to obtain a watertight patch model; based on the watertight patch model, obtaining the signed distance field.

[0074] In this optional implementation, the initial signed distance field is an initial signed distance field that is not very continuous (some signed distance function values ​​are missing). By performing three-dimensional reconstruction on the initial signed distance field to obtain a watertight patch model, and then obtaining a signed distance field based on the watertight patch model, the continuity of the obtained signed distance field can be strong, thereby improving the reliability of the signed distance field extraction.

[0075] The method for obtaining a binary mask provided by this optional implementation method sets the unsigned distance function values ​​greater than or equal to the mask threshold in the unsigned distance field to 0; and sets the unsigned distance function values ​​less than the mask threshold in the unsigned distance field to 1, thereby obtaining a binary mask. This provides a reliable implementation method for obtaining a binary mask and improves the reliability of obtaining a binary mask.

[0076] In some optional implementations of the present disclosure, the step of obtaining a binary mask based on the mask threshold and the unsigned distance field includes: setting unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 1; and setting unsigned distance function values ​​in the unsigned distance field that are less than the mask threshold to 0, to obtain a binary mask.

[0077] For the method of obtaining a binary mask in this optional implementation, the above-mentioned method of obtaining a signed distance field based on the binary mask and the unsigned distance field includes: filling holes in the binary mask with 0, so that the mask values ​​of the grids within the binary mask and the inner surface of the non-watertight patch model become 0, and obtaining a transformed mask; subtracting the mask threshold from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly setting the unsigned distance function values ​​in the processed unsigned distance field whose mask values ​​in the transformed mask are 0 and are less than or equal to 0 in the unsigned distance field to the negative value of the unsigned distance function value to obtain an initial signed distance field; based on the initial signed distance field, performing three-dimensional reconstruction using a marching cube algorithm to obtain a watertight patch model; and obtaining a signed distance field based on the watertight patch model.

[0078] In this optional implementation, the initial signed distance field is an initial signed distance field that is not very continuous (some signed distance function values ​​are missing). By performing three-dimensional reconstruction on the initial signed distance field to obtain a watertight patch model, and then obtaining a signed distance field based on the watertight patch model, the continuity of the obtained signed distance field can be strong, thereby improving the reliability of the signed distance field extraction.

[0079] The method for obtaining a binary mask provided by this optional implementation method sets the unsigned distance function values ​​greater than or equal to the mask threshold in the unsigned distance field to 1; and sets the unsigned distance function values ​​less than the mask threshold in the unsigned distance field to 0, thereby obtaining a binary mask. This provides another reliable implementation method for obtaining a binary mask, thereby improving the reliability of obtaining a binary mask.

[0080] In some optional implementations of the present disclosure, obtaining a signed distance field based on a binary mask and an unsigned distance field includes: filling holes in a binary mask with a first parameter value to obtain a transformation mask; subtracting a mask threshold from an unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly setting a portion of the processed unsigned distance field whose mask value corresponds to the transformation mask and whose unsigned distance function value is greater than zero to a negative value of the unsigned distance function value to obtain an initial signed distance field; performing three-dimensional reconstruction based on the initial signed distance field using a marching cubes algorithm to obtain a watertight patch model; and obtaining a signed distance field based on the watertight patch model.

[0081] In this optional implementation, the mask value of the unsigned distance field corresponding to the transformation mask is the first parameter value and the part of the unsigned distance function value greater than zero is set to the negative value of the unsigned distance function value because: a positive SDF value indicates that the point is outside the surface, a negative SDF value indicates that the point is inside the surface, and a zero SDF value indicates that the point is on the surface. The unsigned distance function value udf of the unsigned distance field is always positive, such as Figure 2 After sdf_tmp = udf – level, the value will be negative for the part close to the surface and positive for the part far from the surface, such as Figure 5 A positive signed distance function value of the signed distance field corresponding to sdf_tmp indicates that the point is outside the reconstructed outer surface O, a negative signed distance function value indicates that the point is between the reconstructed outer surface O and the reconstructed inner surface N, that is, near the real surface W, and a positive signed distance function value indicates that the point is within the reconstructed inner surface N. In this embodiment, within refers to the direction from the current position to the center of the signed distance field or the unsigned distance field.

[0082] You can Figure 3b and Figure 5 To overlap, "set the part where (Mask == 1) and (sdf_tmp>0) to -sdf_tmp" means to turn the value of "reconstructing inner surface" to negative. Since both sides of the inner surface are negative values, the inner surface does not exist, thus eliminating the double surface problem.

[0083] In this optional implementation, the first parameter value is a value related to each mask value in the binary mask. For example, if 1 or 0 is set in the binary mask, the first parameter value may be 0 or 1.

[0084] In this optional implementation, after the holes in the binary mask are filled with the first parameter value, all points in the binary mask may have corresponding mask values. For example, when the first parameter value is 1, the mask value corresponding to the grid from the inner surface to the center of the unsigned distance field may be 1; when the first parameter value is 0, the mask value corresponding to the grid from the inner surface to the center of the unsigned distance field may be 0.

[0085] In this optional implementation, the initial signed distance field can be used for marching cube algorithm reconstruction, but the initial signed distance field lacks continuity. Therefore, a watertight patch model can be obtained by marching cube algorithm reconstruction; an effective signed distance field can be obtained by adopting a conventional watertight patch to signed distance field extraction algorithm.

[0086] The method for obtaining a signed distance field provided by the optional implementation adopts a first parameter value to fill holes in a binary mask; subtracts a mask threshold from an unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, and directly sets the mask value of the processed unsigned distance field corresponding to the transformed mask and the part of the unsigned distance function value greater than zero to the negative value of the unsigned distance function value to obtain an initial signed distance field; based on the initial signed distance field, a marching cube algorithm is used to perform three-dimensional reconstruction to obtain a watertight patch model; based on the watertight patch model, a signed distance field is obtained, and an effective initial signed distance field can be obtained by transforming the unsigned distance function value within the binary mask and the inner surface of the unsigned distance field; by reconstructing the watertight patch model of the initial signed distance field, and then based on the reconstructed watertight patch model, the reliability of the obtained signed distance field is improved.

[0087] In some optional implementations of the present disclosure, the above-mentioned acquisition of a non-watertight patch model includes: acquiring the structure of an initial patch model; based on the structure, detecting whether all edges of the initial patch model are simultaneously located on two surfaces; in response to an edge of the initial patch model being located only on one surface, determining that the initial patch model is a non-watertight patch model.

[0088] In this optional implementation, the initial patch model is a model whose watertightness and non-watertightness are to be determined, and the structure of the initial patch model refers to: the vertices of the initial patch model, the edges where each vertex is located, the position of each patch, and the patch where each edge is located. Through the structure of the initial patch model, it can be determined whether there is an edge that is not located on two faces at the same time. If there is an edge that is not located on two faces at the same time, it is determined that the initial patch model is a non-watertight patch model.

[0089] The embodiment of the present disclosure provides a method for obtaining a non-watertight patch model, which obtains the structure of an initial patch model; based on the structure, detects whether all the edges of the initial patch model are simultaneously located on two surfaces; in response to an edge of the initial patch model being located only on one surface, determines that the initial patch model is a non-watertight patch model, thereby improving the reliability of obtaining the non-watertight patch model.

[0090] Optionally, before obtaining the non-watertight patch model, the signed distance field generation method provided by the present disclosure further includes: in response to all edges of the initial patch model being located on two surfaces at the same time, determining that the initial patch model is a watertight patch model, and obtaining the signed distance field based on the watertight patch model.

[0091] In this embodiment, the watertight patch model is a continuous, closed patch model without breaks or gaps. The signed distance field can be directly obtained through the watertight patch model by traditional technical methods. Among them, the traditional technical method is a mature method for obtaining the signed distance field, which will not be repeated here. For example, a traditional technical method is to assume that all models are watertight, and by judging the internal and external properties of the model, a positive value is used to represent a point outside the model surface, a negative value is used to represent a point inside the model surface, and a zero value is used to represent a point on the model surface.

[0092] See also Figure 6 , which shows a process 600 of an embodiment of a three-dimensional model generation method provided by the present application. The three-dimensional model generation method may include the following steps:

[0093] Step 601: Obtain a signed distance field.

[0094] In this embodiment, the execution subject of the three-dimensional model generation method can obtain the signed distance field in a variety of ways. For example, the execution subject can obtain the signed distance field stored in the database server through a wired connection or a wireless connection. For another example, the execution subject can also receive the signed distance field collected by a terminal or other device.

[0095] In this embodiment, the signed distance field may be a Figure 1 The specific generation process can be found in Figure 1 The relevant description of the embodiments will not be repeated here.

[0096] Step 602 : Based on the signed distance field and the pre-trained three-dimensional network, a three-dimensional model corresponding to the signed distance field is obtained.

[0097] In this embodiment, the three-dimensional network is a network for obtaining a three-dimensional model, and the three-dimensional network is used to characterize the correspondence between the signed distance field and the three-dimensional model, wherein the three-dimensional model is a model that reflects the three-dimensional content of the object. The execution subject can input the signed distance field obtained in step 601 into the pre-constructed three-dimensional network to obtain the three-dimensional model output by the three-dimensional network.

[0098] In this embodiment, the three-dimensional model is a polygonal representation of an object, which is usually displayed by a computer or other video device. The displayed object can be a real-world entity or a fictional object. Anything that exists in the physical nature can be represented by a three-dimensional model. The three-dimensional model shows the three-dimensional content of the object. By rendering the three-dimensional model, a two-dimensional rendering result can be obtained. Image rendering is a process of converting light energy transfer processing into a two-dimensional image. After the image rendering is completed, the image information will be input into an image file or a video file, or into the frame buffer of the display device to complete the generation of the graphics.

[0099] In this embodiment, the training process of the three-dimensional network has mature means in traditional technology, which will not be described here.

[0100] It should be noted that the three-dimensional model generation method of this embodiment can be used to test the signed distance field generated by the above embodiments. Then, the signed distance field can be continuously optimized according to the three-dimensional model. The three-dimensional model generation method can also be a practical application method of the signed distance field generated by the above embodiments.

[0101] The three-dimensional model generation method provided in this embodiment obtains a signed distance field, and obtains a three-dimensional model based on the signed distance field and a pre-trained three-dimensional network, thereby providing a reliable implementation method for obtaining the three-dimensional model.

[0102] See also Figure 7 , which shows a process 700 of another embodiment of the three-dimensional model generation method provided by the present application. The three-dimensional model generation method may include the following steps:

[0103] Step 701: Obtain a signed distance field.

[0104] In this embodiment, the execution subject of the three-dimensional model generation method can obtain the signed distance field in a variety of ways. For example, the execution subject can obtain the signed distance field stored in the database server through a wired connection or a wireless connection. For another example, the execution subject can also receive the signed distance field collected by a terminal or other device.

[0105] In this embodiment, the signed distance field may be a Figure 1 The specific generation process can be found in Figure 1 The relevant description of the embodiments will not be repeated here.

[0106] Step 702: Based on the signed distance field, a marching cubes algorithm is used to perform three-dimensional reconstruction to obtain a three-dimensional model.

[0107] In this embodiment, the marching cubes algorithm is a classic algorithm in surface drawing algorithms and is also a voxel-level reconstruction algorithm. It approximates isosurfaces by linear interpolation in a three-dimensional discrete data field.

[0108] In this embodiment, the process of using the marching cubes algorithm has mature means in traditional technology and will not be described in detail here.

[0109] It should be noted that the three-dimensional model generation method of this embodiment can be used to test the signed distance field generated by the above embodiments. Then, the signed distance field can be continuously optimized according to the conversion result. The three-dimensional model generation method can also be a practical application method of the signed distance field generated by the above embodiments.

[0110] The 3D model generation method provided in this embodiment obtains a signed distance field, and based on the signed distance field, uses a marching cubes algorithm to perform 3D reconstruction to obtain a 3D model, thereby providing another reliable implementation method for obtaining a 3D model.

[0111] Further references Figure 8 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a signed distance field generating device, which is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0112] like Figure 8 As shown, the signed distance field generating device 800 provided in this embodiment includes: a model acquisition unit 801, a construction unit 802, a first obtaining unit 803, a setting unit 804, and a second obtaining unit 805. Among them, the above-mentioned model acquisition unit 801 can be configured to obtain a non-watertight patch model. The above-mentioned construction unit 802 can be configured to construct a field space with multiple grids. The above-mentioned first obtaining unit 803 can be configured to obtain an unsigned distance field based on the field space and the non-watertight patch model. The above-mentioned setting unit 804 can be configured to set a binary mask based on the unsigned distance field. The above-mentioned second obtaining unit 805 can be configured to obtain a signed distance field based on the binary mask and the unsigned distance field.

[0113] In this embodiment, the specific processing of the model acquisition unit 801, the construction unit 802, the first obtaining unit 803, the setting unit 804, and the second obtaining unit 805 and the technical effects thereof can be referred to respectively. Figure 1 The relevant descriptions of step 101, step 102, step 103, step 104, and step 105 in the corresponding embodiments are not repeated here.

[0114] In some optional implementations of this embodiment, the above-mentioned device also includes: an adjustment unit (not shown in the figure), and the above-mentioned adjustment unit can be configured to adjust the automation processing module based on the automation evaluation result to obtain an adjusted automation processing module.

[0115] In some optional implementations of this embodiment, the construction unit 802 is configured to: set the size of the field space; and set a preset number of three-dimensional grids in the field space, where the preset number is the cube of the size.

[0116] In some optional implementations of this embodiment, the first obtaining unit 803 is configured to: determine the center position of each grid based on the field space; calculate the shortest distance from the center position to the non-watertight patch model to obtain an unsigned distance field.

[0117] In some optional implementations of the present disclosure, the setting unit 804 is configured to: determine a mask threshold based on the size of the field space; and obtain a binary mask based on the mask threshold and the unsigned distance field.

[0118] In some optional implementations of the present disclosure, the setting unit 804 is further configured to: set the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 0; set the unsigned distance function values ​​in the unsigned distance field that are less than the mask threshold to 1, so as to obtain a binary mask.

[0119] In some optional implementations of the present disclosure, the setting unit 804 is further configured to: set the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 1; set the unsigned distance function values ​​in the unsigned distance field that are less than the mask threshold to 0, to obtain a binary mask.

[0120] In some optional implementations of the present disclosure, the second obtaining unit 805 is configured to: fill the holes in the binary mask with the first parameter value to obtain a transformation mask; subtract the mask threshold from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly set the mask value of the processed unsigned distance field corresponding to the transformation mask and the part of the unsigned distance function value greater than zero to the negative value of the unsigned distance function value to obtain an initial signed distance field; perform three-dimensional reconstruction based on the initial signed distance field using a marching cubes algorithm to obtain a watertight patch model; and obtain a signed distance field based on the watertight patch model.

[0121] In some optional implementations of the present disclosure, the model acquisition unit 801 is configured to: acquire the structure of the initial mesh model; based on the structure, detect whether all the edges of the initial mesh model are simultaneously located on two surfaces; in response to an edge of the initial mesh model being located only on one surface, determine that the initial mesh model is a non-watertight mesh model.

[0122] The signed distance field generating device provided by the embodiment of the present disclosure, first, the model acquisition unit 801 acquires the non-watertight patch model; secondly, the construction unit 802 constructs a field space with multiple grids; thirdly, the first obtaining unit 803 obtains the unsigned distance field based on the field space and the non-watertight patch model; thirdly, the setting unit 804 sets a binary mask based on the unsigned distance field; finally, the second obtaining unit 805 obtains the signed distance field based on the binary mask and the unsigned distance field. Thus, a method for extracting an effective signed distance field through a non-watertight patch model is provided, and the problem of converting the patch model to the signed distance field is solved through the constructed field space and binary mask, and the accuracy of the obtained signed distance field is improved.

[0123] Further references Fig. 9 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a three-dimensional model generation device. Figure 6 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0124] like Fig. 9 As shown, the three-dimensional model generation device 900 provided in this embodiment includes: a field acquisition unit 901 and a training unit 902. The field acquisition unit 901 can be configured to acquire a signed distance field, and the signed distance field is generated by the signed distance field generation device of the above embodiment. The training unit 902 can be configured to obtain a three-dimensional model corresponding to the signed distance field based on the signed distance field and a pre-trained three-dimensional network.

[0125] In this embodiment, in the three-dimensional model generation device 900, the specific processing of the field acquisition unit 901 and the training unit 902 and the technical effects thereof can be referred to respectively. Figure 6 The relevant descriptions of step 601 and step 602 in the corresponding embodiment are not repeated here.

[0126] Further references Fig.10 As an implementation of the methods shown in the above figures, the present disclosure provides another embodiment of a three-dimensional model generation device, which is similar to Figure 7 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0127] like Fig.10 As shown, the 3D model generation device 1000 provided in this embodiment includes: a data acquisition unit 1001 and a reconstruction unit 1002. The data acquisition unit 1001 can be configured to acquire a signed distance field, and the signed distance field is generated by the signed distance field generation device of the above embodiment. The reconstruction unit 1002 can be configured to perform 3D reconstruction based on the signed distance field using a marching cube algorithm to obtain a 3D model.

[0128] In this embodiment, in the 3D model generation device 1000, the specific processing of the data acquisition unit 1001 and the reconstruction unit 1002 and the technical effects thereof can be referred to in Figure 7 The relevant descriptions of step 701 and step 702 in the corresponding embodiment are not repeated here.

[0129] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure 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.

[0130] 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.

[0131] Fig.11 A schematic block diagram of an example electronic device 1100 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.

[0132] like Fig.11 As shown, the device 1100 includes a computing unit 801101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 801102 or a computer program loaded from a storage unit 801108 into a random access memory (RAM) 801103. In the RAM 801103, various programs and data required for the operation of the device 801100 can also be stored. The computing unit 801101, the ROM 801102, and the RAM 801103 are connected to each other via a bus 801104. An input / output (I / O) interface 801105 is also connected to the bus 801104.

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

[0134] The computing unit 801101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801101 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 801101 performs the various methods and processes described above, such as a signed distance field generation method or a three-dimensional model generation method. For example, in some embodiments, the signed distance field generation method or the three-dimensional model generation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 801108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 801100 via the ROM 801102 and / or the communication unit 801109. When the computer program is loaded into the RAM 801103 and executed by the computing unit 801101, one or more steps of the signed distance field generation method or the three-dimensional model generation method described above may be performed. Alternatively, in other embodiments, the computing unit 801101 may be configured to execute the signed distance field generation method or the three-dimensional model generation method in any other appropriate manner (e.g., by means of firmware).

[0135] 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.

[0136] 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 signed distance field generation device or a three-dimensional model generation device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0137] 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.

[0138] 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).

[0139] 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.

[0140] A computer system may include clients and servers. Clients and servers 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 to each other.

[0141] 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.

[0142] 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 method for generating a signed distance field, the method comprising: Obtain a non-watertight patch model; Construct a field space with multiple grids; Based on the field space and the non-watertight patch model, an unsigned distance field is obtained; Based on the unsigned distance field, setting a binary mask; A signed distance field is obtained based on the binary mask and the unsigned distance field; wherein the signed distance field is used to generate a three-dimensional model, and the three-dimensional model is used to perform image rendering.

2. The method according to claim 1, wherein: The constructing of a field space having a plurality of grids comprises: Set the size of the field space; In the field space, a preset number of three-dimensional grids are set, and the preset number is the cube of the size.

3. The method according to claim 1, wherein: The obtaining of an unsigned distance field based on the field space and the non-watertight patch model comprises: Based on the field space, determining the center position of each grid; The shortest distance from the center position to the non-watertight patch model is calculated to obtain an unsigned distance field.

4. The method according to claim 2, wherein: The setting of a binary mask based on the unsigned distance field comprises: Determining a mask threshold based on the size of the field space; A binary mask is obtained based on the mask threshold and the unsigned distance field.

5. The method according to claim 4, wherein: The obtaining of a binary mask based on the mask threshold and the unsigned distance field comprises: Setting the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 0; The unsigned distance function values ​​in the unsigned distance field that are smaller than the mask threshold are set to 1 to obtain a binary mask.

6. The method according to claim 4, wherein: The obtaining of a binary mask based on the mask threshold and the unsigned distance field comprises: Setting the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 1; The unsigned distance function values ​​in the unsigned distance field that are smaller than the mask threshold are set to 0 to obtain a binary mask.

7. The method according to claim 4, wherein: The obtaining a signed distance field based on the binary mask and the unsigned distance field comprises: Filling the holes in the binary mask with the first parameter value to obtain a transformed mask; subtracting the mask threshold from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, and directly setting the portion of the processed unsigned distance field whose mask value corresponds to the transformation mask and whose unsigned distance function value is greater than zero to the negative value of the unsigned distance function value to obtain an initial signed distance field; Based on the initial signed distance field, a marching cube algorithm is used to perform three-dimensional reconstruction to obtain a watertight patch model; Based on the watertight patch model, a signed distance field is obtained.

8. The method according to any one of claims 1 to 7, wherein: The obtaining of the non-watertight patch model comprises: Get the structure of the initial patch model; Based on the structure, detecting whether each of all the edges of the initial patch model is located on two surfaces at the same time; In response to one edge of the initial mesh model being located on only one face, the initial mesh model is determined to be a non-watertight mesh model.

9. A three-dimensional model generation method, the method comprising: Acquire a signed distance field, where the signed distance field is generated by using the signed distance field generation method according to any one of claims 1 to 8; Based on the signed distance field and a pre-trained three-dimensional network, a three-dimensional model corresponding to the signed distance field is obtained; wherein the three-dimensional model is used for image rendering.

10. A three-dimensional model generation method, the method comprising: Acquire a signed distance field, where the signed distance field is generated by using the signed distance field generation method according to any one of claims 1 to 8; Based on the signed distance field, a marching cube algorithm is used to perform three-dimensional reconstruction to obtain a three-dimensional model; wherein the three-dimensional model is used for image rendering.

11. A signed distance field generating device, the device comprising: A model acquisition unit is configured to acquire a non-watertight patch model; A construction unit is configured to construct a field space having a plurality of grids; A first obtaining unit is configured to obtain an unsigned distance field based on the field space and the non-watertight patch model; A setting unit configured to set a binary mask based on the unsigned distance field; The second obtaining unit is configured to obtain a signed distance field based on the binary mask and the unsigned distance field; wherein the signed distance field is used to generate a three-dimensional model, and the three-dimensional model is used to perform image rendering.

12. The device according to claim 11, wherein The construction unit is configured to: set the size of the field space; and set a preset number of three-dimensional grids in the field space, where the preset number is the cube of the size.

13. The device according to claim 11, wherein: The first obtaining unit is configured to: determine the center position of each grid based on the field space; calculate the shortest distance from the center position to the non-watertight patch model to obtain an unsigned distance field.

14. The device according to claim 12, wherein: The setting unit is configured to: determine a mask threshold based on the size of the field space; and obtain a binary mask based on the mask threshold and the unsigned distance field.

15. The device according to claim 14, wherein: The setting unit is further configured to: set the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 0; set the unsigned distance function values ​​in the unsigned distance field that are less than the mask threshold to 1, so as to obtain a binary mask.

16. The device according to claim 14, wherein: The setting unit is further configured to: set the unsigned distance function values ​​in the unsigned distance field that are greater than or equal to the mask threshold to 1; and set the unsigned distance function values ​​in the unsigned distance field that are less than the mask threshold to 0, to obtain a binary mask.

17. The device according to claim 14, wherein: The second obtaining unit is configured to: fill the holes in the binary mask with a first parameter value to obtain a transformation mask; subtract the mask threshold from the unsigned distance function value in the unsigned distance field to obtain a processed unsigned distance field, directly set the mask value corresponding to the transformation mask in the processed unsigned distance field to the negative value of the unsigned distance function value, which is the first parameter value; perform three-dimensional reconstruction based on the initial signed distance field using a marching cube algorithm to obtain a watertight patch model; and obtain a signed distance field based on the watertight patch model.

18. The device according to any one of claims 11 to 17, wherein: The model acquisition unit is configured to: acquire the structure of the initial mesh model; based on the structure, detect whether each of all the edges of the initial mesh model is located on two surfaces at the same time; in response to an edge of the initial mesh model being located on only one surface, determine that the initial mesh model is a non-watertight mesh model.

19. A three-dimensional model generation device, the device comprising: A field acquisition unit, configured to acquire a signed distance field, wherein the signed distance field is generated by the signed distance field generation device according to any one of claims 11 to 18; The training unit is configured to obtain a three-dimensional model corresponding to the signed distance field based on the signed distance field and a pre-trained three-dimensional network; wherein the three-dimensional model is used for image rendering.

20. A three-dimensional model generation device, the device comprising: A data acquisition unit, configured to acquire a signed distance field, wherein the signed distance field is generated by the signed distance field generating device according to any one of claims 11 to 18; The reconstruction unit is configured to perform three-dimensional reconstruction based on the signed distance field using a marching cube algorithm to obtain a three-dimensional model; wherein the three-dimensional model is used for image rendering.

21. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, 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 the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.

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

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and device, electronic equipment and readable storage medium

    CN114820980A

  • Scene data generation method and device, electronic equipment and storage medium

    CN115359170A