A method and apparatus for training data generation for building model reconstruction tasks

By normalizing and repairing building point cloud data and CAD models, a defect-free mesh model is generated and the symbolic distance field value is calculated, which solves the problem of insufficient training data quality in the existing technology and improves the model reconstruction accuracy and neural network training effect.

CN122156528APending Publication Date: 2026-06-05GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
Filing Date
2026-02-02
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, training data based on building CAD models suffer from geometric and topological defects, leading to poor training results for deep neural networks and low accuracy in building model reconstruction.

Method used

By normalizing the original point cloud data of the building and the defective CAD model, the CAD model is repaired to generate a defect-free mesh model, and the symbolic distance field value is calculated in the unit sphere space to generate a high-quality training dataset.

Benefits of technology

It enables the automatic and efficient generation of high-quality training data from defective CAD models, improving the training effect of deep neural networks and the accuracy of building model reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156528A_ABST
    Figure CN122156528A_ABST
Patent Text Reader

Abstract

The application discloses a kind of training data generation methods for building model reconstruction task, comprising: obtaining the original point cloud data of building and corresponding original CAD model with geometric defects;The original point cloud data and the original CAD model are normalized to make the original point cloud data and the original CAD model in the unit sphere space of uniform coordinate system;Model repair is carried out to the normalized CAD model, and the repaired defect-free grid model is obtained;Sampling is carried out in the unit sphere space to obtain a query point set, and the signed distance field value of each query point in the query point set is calculated based on the defect-free grid model;The normalized point cloud data, the query point set and the signed distance field value are combined to generate a training data set.The application can automatically generate high-quality training data for building model reconstruction based on the original point cloud data of building and the defective CAD model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and storage medium for generating training data for building model reconstruction tasks. Background Technology

[0002] In recent years, significant progress has been made in the 3D reconstruction technology of buildings based on deep learning. Various deep neural network architectures have been designed in the existing technology, which can reconstruct building models based on the point cloud data of buildings. These deep neural networks, especially those based on implicit surface representation, usually require a large amount of training data. The training data usually needs to include the point cloud data of each building as input data, and the symbolic distance field value of the query point in the space where the building is located as supervision data.

[0003] However, obtaining such pairs of high-quality training data is extremely difficult. In the existing technology, although there are a large number of manually created computer-aided design (CAD) models of buildings, CAD models are often designed for visualization purposes and generally have geometric and topological defects such as holes, self-intersections, inconsistent surface normals, and non-manifold edges. Directly calculating the symbolic distance field value based on building CAD models with geometric defects will produce erroneous supervision data. If such erroneous training data is used, it will seriously affect the training effect of subsequent deep neural networks and the reconstruction accuracy of the final building model.

[0004] Therefore, how to automatically and efficiently generate high-quality training datasets using existing point cloud data of buildings and defective CAD models is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This invention provides a method for generating training data for building model reconstruction tasks, which can automatically generate high-quality training data for building model reconstruction based on the original point cloud data of the building and a defective CAD model.

[0006] In a first aspect, embodiments of the present invention provide a method for generating training data for a building model reconstruction task, comprising: Obtain the original point cloud data of the building and the corresponding original CAD model with geometric defects; The original point cloud data and the original CAD model are normalized so that they are located in a unit sphere space with a unified coordinate system. The normalized CAD model is repaired to obtain a repaired, defect-free mesh model. A set of query points is obtained by sampling within the unit sphere space, and the symbolic distance field value of each query point in the set of query points is calculated based on the defect-free mesh model. The normalized point cloud data, the query point set, and the symbolic distance field value are combined to generate a training dataset.

[0007] Furthermore, the normalization process for the original point cloud data and the original CAD model includes: Obtain the set of vertex coordinates of the CAD model; The bounding box center point of the original CAD model is calculated based on the vertex coordinate set, and the CAD model is translated and centered according to the bounding box center point; Calculate the Euclidean distance from all vertices of the translated CAD model to the origin, and obtain the maximum distance value among all Euclidean distances. Based on the maximum distance value, scale the CAD model to a unit sphere space. Based on the bounding box center point and the maximum distance value, perform the same translation, centering, and scaling operations on the original point cloud data.

[0008] Furthermore, the step of repairing the normalized CAD model to obtain a repaired defect-free mesh model includes: Calculate the unsigned distance field of the normalized CAD model; wherein the unsigned distance field is the set of distances from all spatial points in the circumscribed cubic space of the unit sphere to the model surface; The moving cube algorithm is used to extract isosurfaces from the unsigned distance field to obtain candidate triangular meshes; Select the connected component with the largest bounding box among the candidate triangular meshes as the target mesh component; Based on the target mesh component, the symbolic distance field is recalculated, and the zero level set in the symbolic distance field is extracted to obtain a defect-free mesh model.

[0009] Furthermore, the calculation of the unsigned distance field of the normalized CAD model includes: The circumscribed cubic space of the unit sphere is discretized into a three-dimensional voxel mesh. The original distance value of the voxel node closest to the CAD model surface is assigned to its minimum Euclidean distance to the model surface, and the original distance values ​​of all other voxel nodes are assigned to infinity. Scan the voxel grid from different directions; In each scan, when a voxel node is accessed, the distance values ​​of all its neighboring nodes are obtained, and a minimum distance value is selected in each of the three axes. Based on the minimum distance values ​​in the three axes, the candidate distance values ​​of the current voxel node are calculated, and the smaller of the candidate distance value and the original distance value is selected as the final distance value of the current voxel node. After the scan is completed, the final distance values ​​of all voxel nodes are integrated to obtain the unsigned distance field.

[0010] Furthermore, the step of extracting isosurfaces from the unsigned distance field using the traveling cube algorithm to obtain candidate triangular meshes includes: Obtain the vertex distance values ​​of all vertices of each voxel node in the unsigned distance field; Traverse all voxel nodes, compare the distance value of each vertex of the voxel node with a pre-set isosurface threshold. When the vertex distance value is greater than or equal to the isosurface threshold, determine that the vertex is outside the isosurface and assign a first index value. When the vertex distance value is less than the isosurface threshold, determine that the vertex is inside the isosurface and assign a second index value. Finally, obtain the index value sequence of all vertices of each voxel node. The isosurface threshold is used to determine the positional relationship between the vertices of the voxel node and the target isosurface. Based on the index value sequence and the pre-constructed topology table, determine all intersections between the isosurface and the voxel node; Connecting all intersections yields several triangular facets, and connecting all triangular facets yields a candidate triangular mesh.

[0011] Furthermore, the step of sampling the query point set within the unit sphere space includes: Sampling is performed on the surface of the defect-free mesh model to obtain the first query point set; Sampling is performed within the unit sphere space to obtain the second query point set; The first query point set and the second query point set are combined to obtain the query point set.

[0012] Furthermore, the step of calculating the symbolic distance field value for each query point in the query point set based on the defect-free mesh model includes: For each query point in the query point set, calculate the Euclidean distance from the query point to the surface of the defect-free mesh model; When the query point is inside the defect-free mesh model, the corresponding Euclidean distance is assigned a negative value; when the query point is outside the defect-free mesh model, the corresponding Euclidean distance is assigned a positive value.

[0013] Secondly, embodiments of the present invention provide a training data generation apparatus for a building model reconstruction task, comprising: The raw data acquisition module is used to acquire the raw point cloud data of the building and the corresponding raw CAD model with geometric defects. The normalization module is used to normalize the original point cloud data and the original CAD model so that the original point cloud data and the original CAD model are located in the unit sphere space of a unified coordinate system. The CAD model repair module is used to repair the normalized CAD model and obtain a repaired, defect-free mesh model. The distance field calculation module is used to sample the query point set within the unit sphere space and calculate the symbolic distance field value of each query point in the query point set based on the defect-free mesh model. The training data generation module is used to combine the normalized point cloud data, the query point set, and the symbolic distance field value to generate a training dataset.

[0014] Thirdly, embodiments of the present invention provide an electronic device, comprising: Memory, used to store computer programs; A processor for executing the computer program; Wherein, when the processor executes the computer program, it implements the training data generation method for building model reconstruction task as described in any of the first aspects above.

[0015] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed, implements the training data generation method for building model reconstruction tasks as described in any of the first aspects above.

[0016] Compared with existing technologies, the present invention provides a method for generating training data for building model reconstruction tasks, which has the following advantages: It acquires the original point cloud data of the building and the corresponding original CAD model with geometric defects; it normalizes the original point cloud data and the original CAD model so that they are located in a unit sphere space with a unified coordinate system; it repairs the normalized CAD model to obtain a repaired defect-free mesh model; it samples a set of query points in the unit sphere space, and calculates the symbolic distance field value of each query point in the set based on the defect-free mesh model; it combines the normalized point cloud data, the query point set, and the symbolic distance field value to generate a training dataset. This invention can automatically generate high-quality training data for building model reconstruction based on the original point cloud data and defective CAD models of the building. Attached Figure Description

[0017] To more clearly illustrate the technical features of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating a method for generating training data for a building model reconstruction task, provided by an embodiment of the present invention. Figure 2 This is a schematic diagram of the original CAD model for a training data generation method for building model reconstruction tasks provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a defect-free mesh model for a training data generation method for building model reconstruction tasks provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the query point set of signed distance field values ​​for a training data generation method for building model reconstruction tasks provided in an embodiment of the present invention. Figure 5 This is a schematic diagram of the structure of a training data generation device for building model reconstruction tasks provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0022] In a first aspect, embodiments of the present invention provide a method for generating training data for a building model reconstruction task, see [link to relevant documentation]. Figure 1 This is a flowchart illustrating an embodiment of a training data generation method for building model reconstruction tasks provided by the present invention.

[0023] like Figure 1 As shown, the method includes the following steps: S1: Obtain the original point cloud data of the building and the corresponding original CAD model with geometric defects; Specifically, the original data of the building is acquired, including raw point cloud data with noise collected by LiDAR or generated by oblique photogrammetry, and original CAD model data manually created with reference to the point cloud data. The original CAD model data of the building usually contains geometric defects such as holes, self-intersections, and non-manifolds.

[0024] S2: Normalize the original point cloud data and the original CAD model so that the original point cloud data and the original CAD model are located in a unit sphere space of a unified coordinate system; Specifically, the original point cloud data and the original CAD model are normalized and placed in a unit sphere space with a unified coordinate system to ensure spatial consistency and scale uniformity, thereby improving the quality of training data.

[0025] S3: Perform model repair on the normalized CAD model to obtain a repaired defect-free mesh model; Specifically, the normalized CAD model with geometric defects is repaired into a manifold and watertight mesh model, the inner and outer boundaries of the model space are clearly defined, the error in subsequent symbolic distance field calculation is eliminated, and the accuracy of the supervision data is ensured.

[0026] S4: Sample the query point set within the unit sphere space, and calculate the symbolic distance field value of each query point in the query point set based on the defect-free mesh model; Specifically, the normalized unified unit sphere space is used as the sampling range, and the manifold and watertight defect-free mesh model is used as the calculation benchmark. The signed distance field value of each query point in the query point set is calculated. This ensures that the query point set can support the model in learning the surface details of buildings and the global spatial structure, and also achieves unambiguous and accurate calculation of the signed distance field value by relying on the characteristics of the defect-free mesh.

[0027] S5: Combine the normalized point cloud data, the query point set, and the symbolic distance field value to generate a training dataset.

[0028] Specifically, the normalized point cloud (as the input features of the model) is combined with the query point set and its corresponding symbolic distance field value (as the supervision label of the model) to generate the final training data sample, which is then used to train the deep neural network that reconstructs the building model based on the point cloud data.

[0029] In summary, this invention can automatically convert the original CAD model of a building containing geometric defects into a manifold and watertight mesh model, and calculate accurate symbolic distance field values ​​based on this mesh. This achieves the goal of automatically and efficiently generating large-scale, high-quality training data from noisy point clouds and defective CAD models of buildings, providing a reliable data foundation for neural network training for building 3D model reconstruction tasks.

[0030] In one optional implementation, the normalization process for the original point cloud data and the original CAD model includes: Obtain the set of vertex coordinates of the CAD model; The bounding box center point of the original CAD model is calculated based on the vertex coordinate set, and the CAD model is translated and centered according to the bounding box center point; Calculate the Euclidean distance from all vertices of the translated CAD model to the origin, and obtain the maximum distance value among all Euclidean distances. Based on the maximum distance value, scale the CAD model to a unit sphere space. Based on the bounding box center point and the maximum distance value, perform the same translation, centering, and scaling operations on the original point cloud data.

[0031] Specifically, a CAD model is essentially a triangular mesh model, composed of vertices, edges, and faces. The three-dimensional coordinates of all vertices in the original CAD model are extracted to form a vertex coordinate set. .

[0032] The bounding box center point is the geometric center of the geometry that completely encloses all vertices of the original CAD model. The maximum and minimum values ​​of all vertices on the x, y, and z axes are extracted from the vertex coordinate set V to calculate the coordinates of the bounding box center point of the original CAD model. ; in, , Let V be the coordinates of the minimum and maximum values ​​of the vertex set V on the x-axis. , Let V be the coordinates of the minimum and maximum values ​​of the vertex set V on the y-axis. , Let V be the coordinates of the minimum and maximum values ​​of the vertex set V on the z-axis.

[0033] By subtracting the coordinates of the bounding box center point C from the coordinates of all vertices of the original CAD model, the CAD model is translated and centered. After translation, the geometric center (bounding box center point) of the original CAD model coincides with the origin of the coordinate system, eliminating the positional offset difference of the original CAD model in space.

[0034] For all vertices of the translated and normalized CAD model, calculate the Euclidean distance from each vertex to the origin of the coordinate system. Iterate through the Euclidean distances of all vertices, extract the maximum value, and divide the coordinates of all translated and normalized vertices by the maximum distance value to achieve scaling to the unit sphere space and obtain normalized vertices.

[0035] To ensure that the original point cloud data and the normalized CAD model are located in the same unit sphere space and to avoid spatial misalignment, the original point cloud data is subjected to translation, centering and scaling operations that are exactly the same as those performed on the CAD model, using the bounding box center point and maximum distance value as a unified benchmark.

[0036] This embodiment can effectively eliminate the positional offset differences of the original CAD model in space, so that the original point cloud data and the normalized CAD model are located in the same unit sphere space, avoiding spatial misalignment. This provides a good foundation for subsequent operations such as accurate matching and analysis of point cloud data and CAD model, and helps to improve the accuracy and reliability of related processing tasks.

[0037] In one optional implementation, the step of repairing the normalized CAD model to obtain a repaired defect-free mesh model includes: Calculate the unsigned distance field of the normalized CAD model; wherein the unsigned distance field is the set of distances from all spatial points in the circumscribed cubic space of the unit sphere to the model surface; The moving cube algorithm is used to extract isosurfaces from the unsigned distance field to obtain candidate triangular meshes; Select the connected component with the largest bounding box among the candidate triangular meshes as the target mesh component; Based on the target mesh component, the symbolic distance field is recalculated, and the zero level set in the symbolic distance field is extracted to obtain a defect-free mesh model.

[0038] Specifically, the unsigned distance field of the normalized CAD model is calculated. The unsigned distance field is a three-dimensional continuous scalar field constructed for the normalized CAD model. In essence, it is the set of minimum Euclidean distances from all spatial points in the preset computational domain to the surface of the normalized CAD model. The distance value only represents the distance between the spatial point and the model surface, without distinguishing whether the spatial point is inside or outside the model.

[0039] The moving cube algorithm is a voxel-based isosurface extraction algorithm. By traversing the voxel grid of the unsigned distance field, it finds all spatial points whose distance values ​​are equal to the preset isosurface threshold. These points are then connected to form a continuous surface, which is the initial regularized triangular mesh.

[0040] The candidate triangular mesh may contain multiple independent connected components, including the main building components and scattered redundant components, such as small patches left over from defect repair. The candidate triangular mesh is divided into multiple independent components that are not connected to each other through a connectivity analysis algorithm. For each independent connected component, its minimum axis-aligned bounding box is calculated. The component size is quantified by calculating the volume (or side length) of the bounding box. The connected component with the largest bounding box is selected as the target mesh component, and the remaining scattered redundant components are eliminated to ensure that the target mesh component accurately corresponds to the complete main structure of the building.

[0041] The distance field is recalculated based on the target mesh component. Compared with the unsigned distance field, the signed distance field adds positive and negative sign attributes. The zero level set in the signed distance field is extracted, and the resulting triangular mesh model with a manifold and watertight surface (manifoldness ensures no self-intersections and non-manifold edges, and watertightness ensures no holes) is the repaired defect-free mesh model.

[0042] This embodiment can effectively remove scattered and redundant components in the candidate triangular mesh, accurately retain the mesh corresponding to the complete main structure of the building, and repair the model into a manifold and watertight triangular mesh, avoiding defects such as self-intersection, non-manifold edges and holes, and significantly improving the quality and usability of the CAD model.

[0043] In one optional implementation, the calculation of the unsigned distance field of the normalized CAD model includes: The bounding box of the normalized CAD model is discretized into a three-dimensional voxel mesh. The original distance value of the voxel node closest to the surface of the CAD model is assigned to its minimum Euclidean distance to the surface of the model, and the original distance values ​​of all other voxel nodes are assigned to infinity. Scan the voxel grid from different directions; In each scan, when a voxel node is accessed, the distance values ​​of all its neighboring nodes are obtained, and a minimum distance value is selected in each of the three axes. Based on the minimum distance values ​​in the three axes, the candidate distance values ​​of the current voxel node are calculated, and the smaller of the candidate distance value and the original distance value is selected as the final distance value of the current voxel node. After the scan is completed, the final distance values ​​of all voxel nodes are integrated to obtain the unsigned distance field.

[0044] Specifically, the bounding box is discretized into a three-dimensional voxel grid according to a preset voxel spacing, with the outer cubic space of the unit sphere as the computational domain. After discretization, each voxel is a regular small cube, and the geometric center of the voxel is the voxel node. All voxel nodes constitute the core carrier for the calculation of the distance field.

[0045] For voxel nodes close to the CAD model surface, calculate the minimum Euclidean distance from it to the normalized CAD model surface and assign this distance value as the original distance value of the node. For other voxel nodes not close to the model surface, assign an infinite original distance value to represent that the distance is unknown in the initial state and will be supplemented by subsequent scan propagation.

[0046] The scanning direction is determined by the x, y, and z coordinate axes of a 3D voxel mesh. Each coordinate axis contains two scanning directions: increasing and decreasing. The combinations of the three coordinate axes form a total of 8 scanning directions. The voxel mesh is traversed and scanned sequentially according to the 8 preset directions. When any target voxel node is accessed during the scanning process, the distance values ​​of its 6 directly adjacent nodes are first obtained (the 6 adjacent nodes are located in the positive and negative x-axis, positive and negative y-axis, and positive and negative z-axis directions of the target node, i.e., front and back, left and right, and up and down). Among the adjacent nodes, the distance values ​​of the nodes that have been scanned are known, while the distance values ​​of the nodes that have not been scanned are still initially infinite. Based on the distance values ​​of the 6 adjacent nodes, the nodes are split and filtered according to the three axes of x, y, and z. Each axis corresponds to 2 adjacent nodes (e.g., the x-axis corresponds to the positive x-direction and the negative x-direction adjacent nodes). The minimum distance value in each of the three axes is selected, and the candidate distance value of the target node is calculated based on the minimum distance value in the three axes. ; in, These are candidate distance values ​​for the target node. , , These are the minimum distance values ​​along the three axes, The spacing of the voxel grid.

[0047] The calculated candidate distance values ​​are compared with the original distance values ​​of the target node, and the smaller value is retained as the final distance value of the target node to complete the update of the node distance values.

[0048] After completing the full-domain scan in 8 directions, all voxel nodes have undergone at least one distance value update, with no missing nodes and the node distance values ​​tending to be stable without significant fluctuations. Then the scan is considered complete. The final distance values ​​of all voxel nodes are collected. Each voxel node corresponds to a unique final distance value. The distance values ​​of all nodes constitute a continuous three-dimensional spatial scalar field, which is the unsigned distance field of the normalized CAD model.

[0049] This embodiment can accurately calculate the distance from each point in space to the surface of the CAD model, constructing a continuous and accurate three-dimensional spatial scalar field, providing a reliable data foundation for subsequent operations such as model repair and isosurface extraction based on this distance field.

[0050] In one optional implementation, the step of extracting isosurfaces from the unsigned distance field using the traveling cube algorithm to obtain candidate triangular meshes includes: Obtain the vertex distance values ​​of all vertices of each voxel node in the unsigned distance field; Traverse all voxel nodes, compare the distance value of each vertex of the voxel node with a pre-set isosurface threshold. When the vertex distance value is greater than or equal to the isosurface threshold, determine that the vertex is outside the isosurface and assign a first index value. When the vertex distance value is less than the isosurface threshold, determine that the vertex is inside the isosurface and assign a second index value. Finally, obtain the index value sequence of all vertices of each voxel node. The isosurface threshold is used to determine the positional relationship between the vertices of the voxel node and the target isosurface. Based on the index value sequence and the pre-constructed topology table, determine all intersections between the isosurface and the voxel node; Connecting all intersections yields several triangular facets, and connecting all triangular facets yields a candidate triangular mesh.

[0051] Specifically, each voxel contains a fixed 8 vertices. The unsigned distance value corresponding to each vertex is directly extracted, which is the vertex distance value. The distance value of each vertex of the voxel node is compared with a pre-set isosurface threshold. When the vertex distance value is greater than or equal to the isosurface threshold, it indicates that the distance from the vertex to the CAD model surface is greater than the corresponding distance of the target isosurface, that is, it is located outside the isosurface, and a first index value (binary identifier 1) is assigned. When the vertex distance value is less than the isosurface threshold, it indicates that the distance from the vertex to the CAD model surface is less than the corresponding distance of the target isosurface, that is, it is located inside the isosurface, and a second index value (binary identifier 0) is assigned. The index values ​​of the 8 vertices are arranged in a preset vertex order (such as the fixed order of front upper left, front lower left, back upper left, back lower left, front upper right, front lower right, back upper right, back lower right) to form an 8-bit binary index value sequence (such as 00011010). Each voxel corresponds to a unique index value sequence, which represents the internal and external distribution state of the vertices within the voxel.

[0052] Obtain a pre-constructed topology table, which is a standardized rule table for the moving cube algorithm. It is constructed based on the internal and external state combinations of the eight vertices of a voxel. Each of the eight vertices has two states, resulting in 256 unique combinations, corresponding to 256 rules. The topology table provides full coverage without omissions. The core of the topology table stores two types of key information: first, whether the isosurface passes through the current voxel; and second, if it does, which edges of the voxel the isosurface intersects with, and the intersection points of the intersecting edges are calculated using reference rules.

[0053] The calculated 8-bit index value sequence of the voxel is used as the query keyword to match the corresponding rule entry in the topology table. If the index value sequence is 00000000 (all inside) or 11111111 (all outside), it is determined that the isosurface does not pass through the voxel and there is no intersection point, so the voxel is skipped directly. If the index value sequence is one of the other 254 combinations (mixed inside and outside), the topology table determines that the isosurface passes through the voxel and clearly marks the target intersection edge of the isosurface and the 12 edges of the voxel. For the target intersection edge marked in the topology table, the precise intersection point coordinates of the isosurface and the edge are calculated using linear interpolation.

[0054] According to the preset connection order of the topology table, all the intersection points of the isosurfaces within the same voxel are connected in sequence to form closed triangular patches. All voxels in the unsigned distance field are traversed, and the triangular patches generated by all voxels are collected. They are then spliced ​​together according to their spatial positional relationships. After all the triangular patches are spliced ​​together, a continuous and regular three-dimensional mesh structure is formed, which is the candidate triangular mesh. This mesh has eliminated defects such as holes and self-intersections in the original CAD model, and the topology structure is initially regular.

[0055] This embodiment can efficiently and accurately extract isosurfaces from unsigned distance fields, and construct a continuous, regular three-dimensional candidate triangular mesh that has initially eliminated defects such as holes and self-intersections.

[0056] In one optional implementation, the step of sampling the query point set within the unit sphere space includes: Sampling is performed on the surface of the defect-free mesh model to obtain the first query point set; Sampling is performed within the unit sphere space to obtain the second query point set; The first query point set and the second query point set are combined to obtain the query point set.

[0057] Specifically, sampling is performed near the surface of a manifold and watertight defect-free mesh model to obtain the first query point set. In practice, small Gaussian noise can be added to the mesh surface to obtain near-surface points, or random movement can be added to the normal direction of the mesh surface points to obtain near-surface points. The obtained first query point set is crucial for learning the geometric details of the object.

[0058] Random or uniform sampling is performed within the unit sphere space to obtain a second set of query points. These points are used to help the deep neural network learn to determine the occupancy status of any point in the space, i.e. whether the point is inside or outside the building, providing global context information.

[0059] The first query point set and the second query point set are combined to obtain the query point set.

[0060] This embodiment uses a hierarchical sampling strategy. The first query point set ensures accurate capture of building surface features, while the second query point set achieves global coverage of the unit sphere space. This solves the problem of the one-sidedness of a single sampling method and allows the generated training dataset to support the model in learning both surface details and global structure.

[0061] In one optional implementation, calculating the symbolic distance field value for each query point in the query point set based on the defect-free mesh model includes: For each query point in the query point set, calculate the Euclidean distance from the query point to the surface of the defect-free mesh model; When the query point is inside the defect-free mesh model, the corresponding Euclidean distance is assigned a negative value; when the query point is outside the defect-free mesh model, the corresponding Euclidean distance is assigned a positive value.

[0062] Specifically, for each query point in the query point set, calculate its symbolic distance field value: ; in, Indicates located on the surface of the mesh model any point on, Indicates query point To the surface of the mesh model The minimum Euclidean distance, For symbolic functions, used to indicate positional relationships: .

[0063] This embodiment can clearly and accurately characterize the positional relationship and distance information between the query point and the defect-free mesh model, providing support for the construction of high-quality training datasets.

[0064] It should be noted that this invention uses the original CAD model of a specific building for experimentation; see [link / reference]. Figure 2 This is the original CAD model of the building provided in this embodiment of the invention. The left side is the complete model, the red edges are non-manifold edges, and the right side is the sectioned model. It can be seen that there are geometric defects such as inconsistent normals of the internal facets. See [link / reference]. Figure 3This is a manifold and watertight mesh model of the building obtained using the method proposed in this application. The complete model on the left has no non-manifold edges, and the sectioned model on the right has no inconsistent surface normals. See [link to relevant documentation]. Figure 4 This is the set of query points for the signed distance field values ​​of the building obtained using the method proposed in this application. Query points located outside the model are represented in red, and query points located inside the model are represented in green. Figure 4 It is evident that the symbolic distance field value of the query point set constructed using the method proposed in this invention is accurate and does not generate obviously erroneous supervisory data.

[0065] Secondly, embodiments of the present invention provide a training data generation apparatus for building model reconstruction tasks, see [link to relevant documentation]. Figure 5 This is a schematic diagram of an embodiment of a training data generation device for building model reconstruction tasks provided by the present invention.

[0066] like Figure 5 As shown, the device includes: The raw data acquisition module 21 is used to acquire the raw point cloud data of the building and the corresponding raw CAD model with geometric defects. The normalization module 22 is used to normalize the original point cloud data and the original CAD model so that the original point cloud data and the original CAD model are located in the unit sphere space of a unified coordinate system. The CAD model repair module 23 is used to repair the normalized CAD model to obtain a repaired defect-free mesh model. The distance field calculation module 24 is used to sample the query point set within the unit sphere space and calculate the symbolic distance field value of each query point in the query point set based on the defect-free mesh model. The training data generation module 25 is used to combine the normalized point cloud data, the query point set, and the symbolic distance field value to generate a training dataset.

[0067] In one optional implementation, the normalization process for the original point cloud data and the original CAD model includes: Obtain the set of vertex coordinates of the CAD model; The bounding box center point of the original CAD model is calculated based on the vertex coordinate set, and the CAD model is translated and centered according to the bounding box center point; Calculate the Euclidean distance from all vertices of the translated CAD model to the origin, and obtain the maximum distance value among all Euclidean distances. Based on the maximum distance value, scale the CAD model to a unit sphere space. Based on the bounding box center point and the maximum distance value, perform the same translation, centering, and scaling operations on the original point cloud data.

[0068] In one optional implementation, the step of repairing the normalized CAD model to obtain a repaired defect-free mesh model includes: Calculate the unsigned distance field of the normalized CAD model; wherein the unsigned distance field is the set of distances from all spatial points in the circumscribed cubic space of the unit sphere to the model surface; The moving cube algorithm is used to extract isosurfaces from the unsigned distance field to obtain candidate triangular meshes; Select the connected component with the largest bounding box among the candidate triangular meshes as the target mesh component; Based on the target mesh component, the symbolic distance field is recalculated, and the zero level set in the symbolic distance field is extracted to obtain a defect-free mesh model.

[0069] In one optional implementation, the calculation of the unsigned distance field of the normalized CAD model includes: The bounding box of the normalized CAD model is discretized into a three-dimensional voxel mesh. The original distance value of the voxel node closest to the surface of the CAD model is assigned to its minimum Euclidean distance to the surface of the model, and the original distance values ​​of all other voxel nodes are assigned to infinity. Scan the voxel grid from different directions; In each scan, when a voxel node is accessed, the distance values ​​of all its neighboring nodes are obtained, and a minimum distance value is selected in each of the three axes. Based on the minimum distance values ​​in the three axes, the candidate distance values ​​of the current voxel node are calculated, and the smaller of the candidate distance value and the original distance value is selected as the final distance value of the current voxel node. After the scan is completed, the final distance values ​​of all voxel nodes are integrated to obtain the unsigned distance field.

[0070] In one optional implementation, the step of extracting isosurfaces from the unsigned distance field using the traveling cube algorithm to obtain candidate triangular meshes includes: Obtain the vertex distance values ​​of all vertices of each voxel node in the unsigned distance field; Traverse all voxel nodes, compare the distance value of each vertex of the voxel node with a pre-set isosurface threshold. When the vertex distance value is greater than or equal to the isosurface threshold, determine that the vertex is outside the isosurface and assign a first index value. When the vertex distance value is less than the isosurface threshold, determine that the vertex is inside the isosurface and assign a second index value. Finally, obtain the index value sequence of all vertices of each voxel node. The isosurface threshold is used to determine the positional relationship between the vertices of the voxel node and the target isosurface. Based on the index value sequence and the pre-constructed topology table, determine all intersections between the isosurface and the voxel node; Connecting all intersections yields several triangular facets, and connecting all triangular facets yields a candidate triangular mesh.

[0071] In one optional implementation, the step of sampling the query point set within the unit sphere space includes: Sampling is performed on the surface of the defect-free mesh model to obtain the first query point set; Sampling is performed within the unit sphere space to obtain the second query point set; The first query point set and the second query point set are combined to obtain the query point set.

[0072] In one optional implementation, calculating the symbolic distance field value for each query point in the query point set based on the defect-free mesh model includes: For each query point in the query point set, calculate the Euclidean distance from the query point to the surface of the defect-free mesh model; When the query point is inside the defect-free mesh model, the corresponding Euclidean distance is assigned a negative value; when the query point is outside the defect-free mesh model, the corresponding Euclidean distance is assigned a positive value.

[0073] It should be noted that the training data generation device for building model reconstruction task provided in the embodiments of the present invention is used to execute all the process steps of the training data generation method for building model reconstruction task in the above embodiments. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0074] Thirdly, embodiments of the present invention provide an electronic device, see [link to previous document]. Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of the present invention.

[0075] like Figure 6 As shown, the device includes: Memory 31 is used to store computer programs; Processor 32 is used to execute the computer program; When the processor 32 executes the computer program, it implements the training data generation method for building model reconstruction tasks as described in any of the above embodiments.

[0076] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 32 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0077] The processor 32 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0078] The memory 31 can be used to store the computer programs and / or modules. The processor 32 implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory 31 and calling the data stored in the memory 31. The memory 31 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 31 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0079] It should be noted that the aforementioned electronic devices include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 6The structural diagram is merely an example of the electronic device described above and does not constitute a limitation on the electronic device. It may include more components than shown in the diagram, or combine certain components, or use different components.

[0080] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed, implements the training data generation method for building model reconstruction tasks described in any of the above embodiments.

[0081] It should be understood that the present invention can implement all or part of the processes in the above-described method for generating training data for building model reconstruction tasks, or it can be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the above-described method for generating training data for building model reconstruction tasks. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0082] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. It should be noted that, for those skilled in the art, several equivalent obvious modifications and / or equivalent substitutions can be made without departing from the technical principles of the present invention, and these obvious modifications and / or equivalent substitutions should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating training data for building model reconstruction tasks, characterized in that, include: Obtain the original point cloud data of the building and the corresponding original CAD model with geometric defects; The original point cloud data and the original CAD model are normalized so that they are located in a unit sphere space with a unified coordinate system. The normalized CAD model is repaired to obtain a repaired, defect-free mesh model. A set of query points is obtained by sampling within the unit sphere space, and the symbolic distance field value of each query point in the set of query points is calculated based on the defect-free mesh model. The normalized point cloud data, the query point set, and the symbolic distance field value are combined to generate a training dataset.

2. The method for generating training data for building model reconstruction as described in claim 1, characterized in that, The normalization process for the original point cloud data and the original CAD model includes: Obtain the set of vertex coordinates of the CAD model; The bounding box center point of the original CAD model is calculated based on the vertex coordinate set, and the CAD model is translated and centered according to the bounding box center point; Calculate the Euclidean distance from all vertices of the translated CAD model to the origin, and obtain the maximum distance value among all Euclidean distances. Based on the maximum distance value, scale the CAD model to a unit sphere space. Based on the bounding box center point and the maximum distance value, perform the same translation, centering, and scaling operations on the original point cloud data.

3. The method for generating training data for building model reconstruction tasks as described in claim 1, characterized in that, The process of repairing the normalized CAD model to obtain a repaired, defect-free mesh model includes: Calculate the unsigned distance field of the normalized CAD model; wherein, the unsigned distance field is the set of distances from all spatial points in the circumscribed cubic space of the unit sphere to the model surface; The moving cube algorithm is used to extract isosurfaces from the unsigned distance field to obtain candidate triangular meshes; Select the connected component with the largest bounding box among the candidate triangular meshes as the target mesh component; Based on the target mesh component, the symbolic distance field is recalculated, and the zero level set in the symbolic distance field is extracted to obtain a defect-free mesh model.

4. The training data generation method for building model reconstruction tasks as described in claim 3, characterized in that, The calculation of the unsigned distance field of the normalized CAD model includes: The circumscribed cubic space of the unit sphere is discretized into a three-dimensional voxel mesh. The original distance value of the voxel node closest to the CAD model surface is assigned to its minimum Euclidean distance to the model surface, and the original distance values ​​of all other voxel nodes are assigned to infinity. Scan the voxel grid from different directions; In each scan, when a voxel node is accessed, the distance values ​​of all its neighboring nodes are obtained, and a minimum distance value is selected in each of the three axes. Based on the minimum distance values ​​in the three axes, the candidate distance values ​​of the current voxel node are calculated, and the smaller of the candidate distance value and the original distance value is selected as the final distance value of the current voxel node. After the scan is completed, the final distance values ​​of all voxel nodes are integrated to obtain the unsigned distance field.

5. The method for generating training data for building model reconstruction tasks as described in claim 3, characterized in that, The step of extracting isosurfaces from the unsigned range field using the moving cube algorithm to obtain candidate triangular meshes includes: Obtain the vertex distance values ​​of all vertices of each voxel node in the unsigned distance field; Traverse all voxel nodes, compare the distance value of each vertex of the voxel node with a pre-set isosurface threshold. When the vertex distance value is greater than or equal to the isosurface threshold, determine that the vertex is outside the isosurface and assign a first index value. When the vertex distance value is less than the isosurface threshold, determine that the vertex is inside the isosurface and assign a second index value. Finally, obtain the index value sequence of all vertices of each voxel node. The isosurface threshold is used to determine the positional relationship between the vertices of the voxel node and the target isosurface. Based on the index value sequence and the pre-constructed topology table, determine all intersections between the isosurface and the voxel node; Connecting all intersections yields several triangular facets, and connecting all triangular facets yields a candidate triangular mesh.

6. The method for generating training data for building model reconstruction tasks as described in claim 1, characterized in that, The step of sampling the query point set within the unit sphere space includes: Sampling is performed on the surface of the defect-free mesh model to obtain the first query point set; Sampling is performed within the unit sphere space to obtain the second query point set; The first query point set and the second query point set are combined to obtain the query point set.

7. The method for generating training data for building model reconstruction tasks as described in claim 1, characterized in that, The step of calculating the symbolic distance field value for each query point in the query point set based on the defect-free mesh model includes: For each query point in the query point set, calculate the Euclidean distance from the query point to the surface of the defect-free mesh model; When the query point is inside the defect-free mesh model, the corresponding Euclidean distance is assigned a negative value; when the query point is outside the defect-free mesh model, the corresponding Euclidean distance is assigned a positive value.

8. A training data generation device for building model reconstruction tasks, characterized in that, include: The raw data acquisition module is used to acquire the raw point cloud data of the building and the corresponding raw CAD model with geometric defects. The normalization module is used to normalize the original point cloud data and the original CAD model so that the original point cloud data and the original CAD model are located in the unit sphere space of a unified coordinate system. The CAD model repair module is used to repair the normalized CAD model and obtain a repaired, defect-free mesh model. The distance field calculation module is used to sample the query point set within the unit sphere space and calculate the symbolic distance field value of each query point in the query point set based on the defect-free mesh model. The training data generation module is used to combine the normalized point cloud data, the query point set, and the symbolic distance field value to generate a training dataset.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program; The processor executes the computer program to implement the training data generation method for building model reconstruction tasks as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the training data generation method for a building model reconstruction task as described in any one of claims 1 to 7.