Building method and application of Delaunay triangulated surface reconstruction model
Technical Field
The invention belongs to the field of computer vision, and particularly relates to a building method of a Delaunay triangularization surface reconstruction model and application thereof.
Background
Surface reconstruction is the process of recovering the three-dimensional shape of an object from a 3D point cloud. At present, there are two major types of surface reconstruction methods, one is a method using an implicit function, in which, classical poisson surface reconstruction converts discrete sample points into a continuous integrable surface function through an octree grid discretization space, and thus a Marching Cubes method is used to output a reconstructed surface in the octree grid. As the octree depth increases, the memory occupation of the algorithm also increases, and the efficiency is reduced. Another type of method, which may be referred to as an interpolation technique, often uses Voronoi diagrams and Delaunay triangulation to represent the point cloud. The more classical processing mode is to subdivide the space into uneven tetrahedrons through DE Lao inner triangulation, triangular patches on the object reconstruction surface can be identified based on the inner and outer attributes of the tetrahedrons, and the triangular patches on the object reconstruction surface are further spliced to reconstruct the object surface, compared with a method using an implicit function, DE Lao inner triangulation can be used for self-adapting to the sampling density of point cloud when the space is divided, but the traditional DE Lao inner triangulation method based on graph cutting must provide visibility information of the point cloud when reconstruction work is completed; and more tetrahedron classification errors exist, and the generated complex multilayer surface influences the reconstruction quality.
Aiming at the problem that the Reconstruction accuracy of the existing Surface Reconstruction method based on Delaunay Triangulation depends on the visibility information of point cloud, a point cloud Delaunay Triangulation curved Surface Reconstruction network DeepDT based on Learning is proposed in the 'DeepDT: Learning From Delaunay Triangulation for Surface Reconstruction', and the DeepDT learns the internal/external labels of Delaunay tetrahedrons in the Delaunay Triangulation of the point cloud. Firstly, local geometric features are extracted from an input point cloud and are aggregated to a standard graph model obtained by Delaunay triangulation. And then, carrying out graph filtering to introduce regularization for the label prediction of the tetrahedron, wherein a multi-label supervision strategy is provided, namely, a plurality of points are sampled from the tetrahedron, and internal/external labels of the tetrahedron are obtained based on the assistance of the internal/external labels of the points, so that the problem that the true value labels of the tetrahedron cannot be directly generated due to the complex spatial relationship between the tetrahedron and the surface is solved.
Deep dt can maintain rich geometric details without generating an excessively complex curved surface, but to achieve this effect, the model structure is complex, and particularly, the graph filtering module therein is still accompanied by a large amount of computation in the surface reconstruction process, which significantly affects the reconstruction efficiency. In practical applications, in order to complete surface reconstruction quickly, a Graphics Processing Unit (GPU) is often used to complete related calculations, the number of point clouds that can be processed simultaneously by limited GPU resources is limited, and in practical applications, the number of point clouds is often extremely large, so that reconstruction efficiency needs to be further improved when surface reconstruction is performed by using deep dt.
Disclosure of Invention
Aiming at the defects and improvement requirements of the prior art, the invention provides a method for establishing a Delaunay triangulated surface reconstruction model and application thereof, aiming at effectively improving the reconstruction efficiency of surface reconstruction while ensuring the surface reconstruction precision.
To achieve the above object, according to an aspect of the present invention, there is provided a method for building a delaunay triangulated surface reconstruction model, including:
performing Delaunay triangulation on the three-dimensional point cloud of the object with a known surface to obtain a corresponding tetrahedral network, and obtaining tangent plane images corresponding to each point in the three-dimensional point cloud, and internal/external labels of a plurality of points randomly sampled inside each tetrahedron relative to the surface of the object, and constructing a training data set by using the tetrahedral network marked with the internal/external label information of the sampling points inside the tetrahedron and the tangent plane images corresponding to each point;
establishing a deep learning model for predicting the internal/external attributes of each tetrahedron in the tetrahedron network on the surface of the object; the deep learning model comprises a feature extraction network, a feature aggregation network and a label prediction network; the feature extraction network comprises a tangent plane convolution module, a pooling layer and an anti-pooling layer which are connected in sequence, wherein the tangent plane convolution module is used for performing convolution operation on tangent plane images corresponding to each point in the three-dimensional point cloud to obtain initial features of each point; the pooling layer is used for averaging the initial characteristics and positions of the points to realize down-sampling of the point cloud; the anti-pooling layer is used for distributing the characteristics of the points after the down-sampling to the characteristics of the points before the down-sampling as the characteristics of the final points; the characteristic aggregation network is used for aggregating the characteristics of each vertex of the tetrahedron into the characteristics of the tetrahedron; the label prediction network is a 1 x 1 convolution network and is used for predicting the internal/external properties of each tetrahedron on the surface of an object according to the characteristics of each tetrahedron in the tetrahedron network;
and training the deep learning model by using the training data set, thereby obtaining a Delaunay triangulated surface reconstruction model after the training is finished.
The invention establishes a Delaunay triangularized surface reconstruction model, wherein a feature extraction network finishes feature extraction of points according to tangent plane images of the points, and the specific process is as follows: firstly, carrying out convolution operation on the slice plane image, and then carrying out pooling and anti-pooling operations, on one hand, the process only relates to simple operations of 2D convolution, pooling and anti-pooling, and indexes of points used by the operations are obtained by pre-calculation and do not need to be calculated in real time during training, so that the reconstruction efficiency is high, and correspondingly, the feature extraction network structure is simple; on the other hand, because the tangent plane image stores neighbor point information, a local geometric structure is coded, and the local geometric information can be accurately reflected; the Delaunay triangulated surface reconstruction model established by the invention only utilizes the 1 multiplied by 1 convolutional network to complete the prediction from the tetrahedral characteristics to the internal and external attributes of the tetrahedron, is simple and efficient, and can accurately extract the characteristics of points and ensure the accuracy of the tetrahedron characteristics obtained by aggregation, so the 1 multiplied by 1 convolutional network can accurately predict the internal and external attributes of the tetrahedron and ensure the accuracy of subsequent surface reconstruction. In general, the invention utilizes the feature extraction network comprising the tangent plane convolution module, the pooling layer and the anti-pooling layer to extract the feature of the point from the tangent plane image of the point, and utilizes the 1 x 1 convolution network to predict the internal and external attributes of the tetrahedron according to the feature of the tetrahedron, thereby effectively reducing the complexity of the model and improving the reconstruction efficiency under the condition of ensuring the prediction accuracy, and further effectively reducing the calculated amount in the surface reconstruction process.
Further, obtaining tangent plane images corresponding to each point in the three-dimensional point cloud, including:
and respectively taking each point in the three-dimensional point cloud as a reference point, obtaining neighbor points of each reference point by a neighbor searching method, and projecting local geometric features represented by each neighbor point to a tangent plane corresponding to the reference point, thereby obtaining tangent plane images corresponding to each reference point.
Further, the definition mode of the tangent plane normal direction corresponding to the reference point includes:
calculating tangent plane normal n corresponding to the reference point by using principal component analysis methodpAnd calculating the average normal n corresponding to the neighbor pointaIf tangent to the plane normal npFrom the average normal naThe included angle between the two is acute angle, then the normal direction of the tangent plane is defined as np(ii) a Otherwise, n is addedpAfter negation, the tangent plane normal is defined.
Because the direction of the tangent plane is ambiguous, the directions obtained by different calculation modes can be completely opposite; the normal direction of the tangent plane directly influences the positive and negative of the projected signed distance, and the signed distance is a key characteristic in surface reconstruction, so that the surface reconstruction is greatly associated with the normal direction of the surface, and the ambiguity of the tangent plane direction has great influence on the network performance; when the tangent plane normal direction of the reference point is defined, the average normal direction corresponding to the neighbor point is calculated according to the reference point, besides the corresponding tangent plane normal direction, and the tangent plane normal direction of the reference point is finally defined according to the included angle between the two normal directions, so that the normal directions of the tangent plane can be accurately defined by means of the information of the neighbor point, the normal directions calculated by the same data have consistency, the characteristics of the points calculated based on the tangent plane image can better reflect the local characteristics of the consistent surface, and the correct characteristics are ensured to be input into the network and have consistency.
Further, the neighbor search method is a sphere radius search, thereby ensuring that the correlation operation of the tangent plane convolution module is performed within a fixed area.
Further, the local geometric features represented by the neighboring points include normal and signed projection distances.
Further, the pooling layer and the anti-pooling layer are implemented using mesh hashing, thereby ensuring that the related operations of the pooling layer and the anti-pooling layer are performed within a fixed region.
Further, the tangent plane image includes signed projected distances and normals for each neighboring point therein.
Further, when the deep learning model is trained by using the training data set, the adopted loss function is as follows:
L=λmLm+λnLn;
wherein L is the overall loss; l ismThe multi-label loss calculated according to the labels of the random sampling points in the tetrahedron is expressed, and the multi-label loss is used for measuring the errors between the labels of the sampling points in the tetrahedron and the prediction result; l isnRepresenting cross entropy losses calculated from the prediction of a tetrahedron, for measuring attribute differences between the tetrahedron and its surrounding neighbors; lambda [ alpha ]mAnd λnRespectively represents the loss LmAnd LnThe weight coefficient of (2).
When the loss of model training is calculated, the error between the prediction result output by the network and the label information is considered, and the attribute difference between the tetrahedron and the surrounding adjacent tetrahedron is also considered, so that more constraints can be provided for the model training effect, and the model training effect is further improved.
According to another aspect of the present invention, there is provided a delaunay triangulated surface reconstruction method, comprising:
performing Delaunay triangulation on the three-dimensional point cloud of the object to be reconstructed to obtain a corresponding tetrahedral network, and obtaining tangent plane images corresponding to each point in the three-dimensional point cloud of the object to be reconstructed;
inputting the three-dimensional point cloud of the object to be reconstructed, the corresponding tetrahedral mesh and tangent plane images corresponding to each point in the three-dimensional point cloud into the delaunay triangulated surface reconstruction model obtained by the establishing method of the delaunay triangulated surface reconstruction model provided by the invention so as to obtain the internal/external attributes of each tetrahedron in the tetrahedral mesh on the surface of the object;
and identifying the common triangular patch of two adjacent tetrahedrons with opposite attributes as one of the triangular patches of the reconstruction surface of the object to be reconstructed, and reconstructing by using all the triangular patches of the identified reconstruction surface of the object to be reconstructed to obtain the surface of the object to be reconstructed.
According to yet another aspect of the present invention, there is provided a computer-readable storage medium comprising a stored computer program which, when executed by a processor, controls an apparatus on which the computer-readable storage medium is stored to perform the method for building a delaunay triangulated surface reconstruction model provided by the present invention, and/or the method for building a delaunay triangulated surface provided by the present invention.
Generally, by the above technical solution conceived by the present invention, the following beneficial effects can be obtained: the method comprises the steps of firstly calculating tangent plane images corresponding to all points in the three-dimensional point cloud, accurately extracting local geometric features of all points according to the tangent plane images by a feature extraction network comprising a tangent plane convolution module, a pooling layer and a reverse pooling layer, aggregating the features of all points in a tetrahedron, and predicting whether the tetrahedron is located in an object or outside the object by using simple operations such as 1 x 1 convolution and the like, wherein the simple operations such as simple 2D convolution, pooling, reverse pooling, feature aggregation, 1 x 1 convolution and the like are only involved in the process. In general, under the condition of ensuring the prediction precision, the complexity of the model is effectively reduced, and the reconstruction efficiency is improved, so that the calculated amount in the surface reconstruction process is effectively reduced.
Drawings
Fig. 1 is a flowchart of a method for building a delaunay triangulated surface reconstruction model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a Delaunay triangulated surface reconstruction model provided in an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating triangle identification of the surface of an object to be reconstructed according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
In the present application, the terms "first," "second," and the like (if any) in the description and the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In order to solve the technical problems that in the surface reconstruction of the existing DeepDT, when the quality of a reconstructed surface is ensured by keeping rich geometric details, a large amount of calculation is brought, the reconstruction efficiency is influenced, and the number of point clouds capable of being processed by the DeepDT in a GPU with limited resources is limited, the invention provides a method for establishing a Delaunay triangulated surface reconstruction model and application thereof, and the overall thought is as follows: the method is characterized in that a tetrahedron is predicted to be positioned in an object or outside the object according to the characteristics of the tetrahedron by utilizing 1 x 1 convolution so as to effectively reduce the complexity and the calculated amount of a model, and the geometric characteristics of each point are extracted according to a tangent plane image by utilizing a characteristic extraction network comprising a tangent plane convolution module, a pooling layer and a reverse pooling layer so as to improve the characteristic quality of the point cloud midpoint, thereby ensuring that the integral model has higher prediction precision.
The following are examples.
Example 1:
a method for building a delaunay triangulated surface reconstruction model, as shown in fig. 1, includes:
performing Delaunay triangulation on the three-dimensional point cloud of the object with a known surface to obtain a corresponding tetrahedral network, and obtaining tangent plane images corresponding to each point in the three-dimensional point cloud, and internal/external labels of a plurality of points randomly sampled inside each tetrahedron relative to the surface of the object, and constructing a training data set by using the tetrahedral network marked with the internal/external label information of the sampling points inside the tetrahedron and the tangent plane images corresponding to each point;
establishing a deep learning model for predicting the internal/external attributes of each tetrahedron in the tetrahedron network on the surface of the object; as shown in fig. 2, the deep learning model includes a feature extraction network, a feature aggregation network, and a label prediction network; the feature extraction network comprises a tangent plane convolution module, a pooling layer and an anti-pooling layer which are connected in sequence, wherein the tangent plane convolution module is used for performing convolution operation on tangent plane images corresponding to each point in the three-dimensional point cloud to obtain initial features of each point; the pooling layer is used for averaging the initial characteristics and positions of the points to realize down-sampling of the point cloud; the anti-pooling layer is used for distributing the characteristics of the points after the down-sampling to the characteristics of the points before the down-sampling as the characteristics of the final points; the characteristic aggregation network is used for aggregating the characteristics of each vertex of the tetrahedron into the characteristics of the tetrahedron; the label prediction network is a 1 x 1 convolution network and is used for predicting the internal/external properties of each tetrahedron on the surface of an object according to the characteristics of each tetrahedron in the tetrahedron network;
and training the deep learning model by using the training data set, thereby obtaining a Delaunay triangulated surface reconstruction model after the training is finished.
Because the tangent plane image is formed by projecting neighbor point information to the tangent plane, the local geometric information can be accurately reflected on the basis of the characteristics of the points extracted from the tangent plane image; as an optional implementation manner, in this embodiment, obtaining a tangent plane image corresponding to each point in the three-dimensional point cloud includes:
respectively taking each point in the three-dimensional point cloud as a reference point, obtaining neighbor points of each reference point by a neighbor searching method, and projecting local geometric features represented by each neighbor point to a tangent plane corresponding to the reference point, so as to obtain tangent plane images corresponding to each reference point; optionally, in this embodiment, the local geometric features represented by the neighboring points include normal and signed projection distances, so that the reconstruction efficiency can be effectively improved while the calculation accuracy is ensured.
Because the direction of the tangent plane is ambiguous, the directions obtained by different calculation modes can be completely opposite; the normal direction of the tangent plane directly influences the positive and negative of the projected signed distance, and the signed distance is a key characteristic in surface reconstruction, so that the surface reconstruction is greatly associated with the normal direction of the surface, and the ambiguity of the tangent plane direction has great influence on the network performance; in order to accurately define the tangent plane normal direction when acquiring the tangent plane image corresponding to the point, so as to avoid affecting the extracted feature quality due to ambiguity of the input of the feature extraction network, in this embodiment, the definition mode of the tangent plane normal direction corresponding to the reference point includes:
calculating tangent plane normal n corresponding to the reference point by using principal component analysis methodpAnd calculating the average normal n corresponding to the neighbor pointaIf tangent to the plane normal npFrom the average normal naThe included angle between the two is acute angle, then the normal direction of the tangent plane is defined as np(ii) a Otherwise, n is addedpAfter negation, the tangent plane normal is defined.
In the embodiment, the tangent plane normal direction is defined in the above manner, besides the corresponding tangent plane normal direction is calculated according to the reference point, the average normal direction corresponding to the neighbor point is also calculated, and the tangent plane normal direction of the reference point is finally defined according to the included angle between the two normal directions, so that the normal directions of the tangent plane can be accurately defined by means of the information of the neighbor point, the normal directions calculated by the same data have consistency, the characteristics of the points calculated based on the tangent plane image can better reflect the local characteristics of the consistent surface, and the correct characteristics are ensured to be input into the network and have consistency.
In order to ensure that the related operations of the tangent plane convolution module, the pooling layer and the anti-pooling layer are all executed in a fixed area range in the feature extraction network, in the embodiment, the neighbor search method is spherical radius search, and the pooling layer and the anti-pooling layer are realized by using grid hash;
the neighbor search method used by tangent plane convolution is spherical radius search, and all points in a fixed radius range of a reference point can be found; the grid Hash sampling averages the characteristics of points in the same grid, and averages the positions to obtain a more sparse point cloud.
In this embodiment, the tangent plane image includes the signed projection distance and normal of each neighboring point therein.
In order to further ensure the training effect of the model, as an optional implementation manner, in this embodiment, when the deep learning model is trained by using the training data set, the loss function adopted is as follows:
L=λmLm+λnLn;
wherein L is the overall loss; l ismThe loss L can be calculated by respectively calculating the difference between the prediction result of the tetrahedron and the label of each sampling point in the tetrahedronm;LnRepresenting cross entropy loss calculated according to the labels of the tetrahedron, for measuring the attribute difference between the tetrahedron and the neighboring tetrahedron around the tetrahedron, and calculating the difference between the prediction result of the tetrahedron and the prediction result of each neighboring tetrahedron respectively to obtain the loss Ln;λmAnd λnRespectively represents the loss LmAnd LnOptionally, in this embodiment, λm=0.9,λn=0.1。
When the loss of the model training is calculated, besides the error between the prediction result output by the network and the label information, the attribute difference between the tetrahedron and the neighboring tetrahedron around the tetrahedron is also considered, so that more constraints can be provided for the model training effect, and the model training effect is further improved.
In general, in the delaunay triangulated surface reconstruction model established in this embodiment, the feature extraction network performs feature extraction of points according to a tangential plane image of the points, that is, an image formed by projection of neighboring points in a tangential plane corresponding to the neighboring points, and the specific process is as follows: firstly, carrying out convolution operation on the slice plane image, and then carrying out pooling and anti-pooling operations, on one hand, the process only relates to simple operations of 2D convolution, pooling and anti-pooling, and indexes of points used by the operations are obtained by pre-calculation and do not need to be calculated in real time during training, so that the reconstruction efficiency is high, and correspondingly, the feature extraction network structure is simple; on the other hand, because the tangent plane image is formed by projecting the neighbor points to the tangent plane, the local geometric information of the points can be accurately reflected on the basis of the characteristics of the points extracted from the tangent plane image; the delaunay triangulated surface reconstruction model established in the embodiment only uses the 1 × 1 convolution network to complete the prediction from the tetrahedral characteristics to the internal and external attributes of the tetrahedron, and is simple and efficient, and the accuracy of the tetrahedral characteristics obtained by aggregation can be ensured because the characteristic extraction network can accurately extract the characteristics of the points, so that the internal and external attributes of the tetrahedron can be accurately predicted by using the 1 × 1 convolution network, and the accuracy of subsequent surface reconstruction is ensured. In general, in the embodiment, the feature network including the tangent plane convolution module, the pooling layer and the anti-pooling layer is used for extracting the feature of the point from the tangent plane image of the point, and the 1 × 1 convolution network is used for predicting the internal and external attributes of the tetrahedron according to the feature of the tetrahedron, so that the complexity of the model is effectively reduced under the condition of ensuring the prediction accuracy, the calculated amount in the surface reconstruction process is effectively reduced, and the reconstruction efficiency is improved. The comparison experiment shows that the prediction precision of the embodiment on the internal and external attributes of the tetrahedron is equivalent to that of DeepDT, but in practical application, the reconstruction efficiency can be improved by about 10%.
Example 2:
a delaunay triangulated surface reconstruction method, comprising:
performing Delaunay triangulation on the three-dimensional point cloud of the object to be reconstructed to obtain a corresponding tetrahedral network, and obtaining tangent plane images corresponding to each point in the three-dimensional point cloud of the object to be reconstructed;
inputting the three-dimensional point cloud of the object to be reconstructed, the corresponding tetrahedral mesh and the tangent plane images corresponding to the points in the three-dimensional point cloud into the delaunay triangulated surface reconstruction model obtained by the method for establishing the delaunay triangulated surface reconstruction model provided in the above embodiment 1, so as to obtain the internal/external attributes of each tetrahedron in the tetrahedral mesh on the surface of the object;
identifying a common triangular patch of two adjacent tetrahedrons with opposite attributes as one of the triangular patches of the reconstruction surface of the object to be reconstructed, as shown in fig. 3; and reconstructing by utilizing all the triangular patches of the identified reconstruction surface of the object to be reconstructed to obtain the surface of the object to be reconstructed.
The delaunay triangulated surface reconstruction model provided in embodiment 1 of the present invention can accurately and efficiently predict the internal and external attributes of a tetrahedron, so that the present embodiment can quickly and effectively complete object surface reconstruction based on the model, and the reconstruction quality is high.
Example 3:
a computer-readable storage medium comprising a stored computer program which, when executed by a processor, controls an apparatus comprising the computer-readable storage medium to perform the method for building a delaunay triangulated surface reconstruction model as provided in example 1 above, and/or the method for building a delaunay triangulated surface reconstruction as provided in example 2 above.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.