A method and device for three-dimensional reconstruction of a building hip roof
By performing planar detection and substructure matching and stitching on the point cloud of the building's pitched roof, the problems of geometric distortion and low accuracy in the 3D reconstruction of pitched roofs in the existing technology are solved, and higher quality 3D model reconstruction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING FEIDU TECH CO LTD
- Filing Date
- 2025-10-28
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies are prone to geometric distortion and low geometric accuracy in component segmentation when performing 3D reconstruction of pitched roofs.
By performing planar detection on the point cloud of the building's pitched roof, deleting conflicting adjacent planes, and retrieving the best matching preset substructure from the preset substructure library based on the roof substructure, and then stitching and reconstructing it, a three-dimensional pitched roof is constructed.
This avoids geometric distortion, improves the geometric accuracy of component segmentation, and enhances the quality of the 3D model of the building's pitched roof.
Smart Images

Figure CN121437795B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of building technology, specifically relating to a method and apparatus for three-dimensional reconstruction of a pitched roof. Background Technology
[0002] In the process of 3D reconstruction of buildings, pitched roofs are a typical structure and one of the most common roof types. Also known as sloping roofs, they refer to roofs with a drainage slope greater than 3%, including single-slope, double-slope, four-slope, and zigzag roofs. Current 3D reconstruction methods for pitched roofs suffer from problems such as geometric distortion due to high noise levels in real roof data. Furthermore, existing technologies cannot guarantee the geometric accuracy of segmented components during pitched roof reconstruction, resulting in low-quality reconstructed 3D models.
[0003] Therefore, how to avoid geometric distortion and improve the geometric accuracy of component segmentation during the 3D reconstruction of pitched roofs is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to solve the technical problems in the prior art that geometric distortion and low geometric accuracy of component segmentation are easy to occur when performing three-dimensional reconstruction of building pitched roofs.
[0005] To achieve the above-mentioned technical objectives, on the one hand, the present invention provides a method for three-dimensional reconstruction of a building's pitched roof, the method comprising:
[0006] The first planar set is obtained by performing planar detection on the point cloud of the building's pitched roof;
[0007] After deleting two adjacent first planes that conflict in the first plane set, multiple roof substructures are obtained;
[0008] Based on the roof substructure, the best matching preset substructure is retrieved from the preset substructure library;
[0009] All the best preset substructures are spliced together and reconstructed into a three-dimensional pitched roof;
[0010] The method further includes, after performing planar detection on the point cloud of the building's pitched roof to obtain the first set of planes:
[0011] In the first plane, determine the vertex distances between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair;
[0012] Obtain the topological relationships of each point in the point cloud;
[0013] Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure;
[0014] An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the sub-planes.
[0015] After constructing the adjacency graph of the roof substructure, the method further includes:
[0016] Obtain the normal vectors of the first set of planes and all planes in the adjacency graph;
[0017] Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
[0018] Furthermore, the detection specifically includes:
[0019] If the angle between the normal vectors of the adjacent planes is less than a preset threshold, then the adjacent planes are determined to belong to the same plane.
[0020] Furthermore, the conflict specifically refers to a situation where, among two adjacent planes, one plane is located on the positive side of the direction the normal vector of the remaining plane is pointing.
[0021] Furthermore, the step of retrieving the best matching preset substructure from the preset substructure library based on the roof substructure specifically includes:
[0022] Obtain the attribute information of the roof substructure;
[0023] The optimal preset substructure is determined by comparing the attribute information with the attribute information of each preset substructure in the preset substructure library.
[0024] Furthermore, the comparison process specifically includes: normal consistency comparison, closure detection, and boundary distance detection.
[0025] Furthermore, the step of splicing and reconstructing all the optimal preset substructures into a three-dimensional pitched roof specifically includes:
[0026] The spatial relationships between the roof substructures are determined based on the point cloud.
[0027] Based on the spatial relationship, the optimal preset substructures are spliced and reconstructed to obtain a three-dimensional pitched roof.
[0028] On the other hand, the present invention also provides a three-dimensional reconstruction device for a building's pitched roof, the device comprising:
[0029] The detection module is used to perform planar detection on the point cloud of the building's pitched roof to obtain the first planar set;
[0030] The deletion module is used to delete two adjacent first planes that conflict in the first plane set to obtain multiple roof substructures;
[0031] The retrieval module is used to retrieve the best matching preset substructure from the preset substructure library based on the roof substructure;
[0032] The reconstruction module is used to stitch together and reconstruct all the best preset substructures into a three-dimensional pitched roof;
[0033] The detection module is further used for:
[0034] In the first plane, determine the vertex distances between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair;
[0035] Obtain the topological relationships of each point in the point cloud;
[0036] Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure;
[0037] An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the sub-planes.
[0038] After constructing the adjacency graph of the roof substructure, the detection module is further used for:
[0039] Obtain the normal vectors of the first set of planes and all planes in the adjacency graph;
[0040] Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
[0041] This invention provides a method and apparatus for three-dimensional reconstruction of a pitched roof. Compared with existing technologies, this method includes: performing planar detection on the point cloud of the pitched roof to obtain a first set of planes; deleting two adjacent first planes that conflict in the first set to obtain multiple roof substructures; and retrieving the best matching preset substructure from a preset substructure library based on the roof substructures. This method can avoid geometric distortion during the three-dimensional reconstruction of the pitched roof and improve the geometric accuracy of component segmentation, thereby enhancing the quality of the three-dimensional model of the pitched roof. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 The diagram shown is a flowchart illustrating the three-dimensional reconstruction method for a pitched roof provided in the embodiments of this specification.
[0044] Figure 2 The diagram shown is a structural schematic of the three-dimensional reconstruction device for a pitched roof provided in the embodiments of this specification.
[0045] Figure 3 The diagram shown illustrates a conflict in the embodiments described in this specification.
[0046] Figure 4 The diagram shown is a schematic diagram of the embodiment of this specification before the deletion of conflicts;
[0047] Figure 5 The diagram shown is a schematic diagram after deleting conflicts in an embodiment of this specification. Detailed Implementation
[0048] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] like Figure 1 The diagram illustrates a flowchart of a three-dimensional reconstruction method for a pitched roof provided in an embodiment of this specification. While this specification provides the method operation steps or device structure shown in the following embodiments or figures, based on conventional methods or without creative effort, the method or device may include more or fewer operation steps or module units after partial merging. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the device are not limited to the execution order or module structure shown in the embodiments or figures of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed processing or server cluster implementation environment).
[0050] The three-dimensional reconstruction method for pitched roofs provided in the embodiments of this specification can be applied to terminal devices such as client and server devices, such as... Figure 1 As shown, the method specifically includes the following steps:
[0051] Step S101: Perform planar detection on the point cloud of the building's pitched roof to obtain the first planar set.
[0052] Specifically, this application uses real urban rooftop point cloud data as the input data source, derived from LiDAR scanning or oblique photogrammetry modeling results. Each dataset contains approximately 200,000 to 500,000 points with a unit precision of mm, including details such as roof ridges, slopes, and window sills. Plane detection can be performed using image segmentation models, such as SAM (Segment Anything Model), or other image segmentation models. The rooftop point cloud is projected along the principal direction (z-axis) to generate a 2D normal map. SAM is used to perform semantic segmentation on the projected image, automatically identifying potential roof slope regions. The segmented regions are then back-projected back into 3D space to obtain the initial set of plane support points, i.e., the first plane set. RANSAC or PCA is used to fit the 3D plane corresponding to each slope to obtain the normal vector and bounding box.
[0053] In this embodiment of the application, after performing planar detection on the point cloud of the building's pitched roof to obtain a first set of planes, the method further includes:
[0054] In the first plane, determine the vertex distance between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair;
[0055] Obtain the topological relationships of each point in the point cloud;
[0056] Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure;
[0057] An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the subplanes.
[0058] Specifically, to reconstruct the topology of a pitched roof, an adjacency graph based on the geometric adjacency relationships between vertices must first be constructed. This method involves all vertices... Other vertices distance Compare the points and select the pair with the minimum value as the initial adjacent pair, denoted as: .
[0059] In other words, planar primitive detection is performed on the roof point cloud model. Each detected planar primitive can be defined as a supporting plane + P and a set of points participating in fitting the supporting plane P. The point set is a subset of the roof point cloud and can be called the interior points corresponding to the supporting plane P. The plane P can be any of the aforementioned planes. The core idea of constructing the roof planar adjacency graph is to link the coarse roof mesh model with the planar primitive detection results. The coarse roof mesh model can be obtained using any point cloud reconstruction method. In the vertex set V on the roof mesh model, for each vertex... It is possible to find the point set I that is far from the interior point set I. The nearest point is denoted as Then, by treating the topological relationships in the mesh model as adjacency relationships between vertices, it becomes possible to determine the relationships between vertices. Adjacent vertices, simultaneously Substituting into this adjacency relationship, we obtain the adjacency relationship between interior points, and each interior point can find its corresponding planar primitive. This allows us to determine the adjacency relationship between planar primitives, thereby constructing a planar primitive adjacency graph. The primitive is also known as the roof substructure. The roof substructure may be a four-sloped roof structure or some cubic structures. These roof substructures that make up the roof are called the roof primitives.
[0060] In this embodiment of the application, after constructing the adjacency graph of the roof substructure, the method further includes:
[0061] Obtain the normal vectors of the first set of planes and all planes in the adjacency graph;
[0062] Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
[0063] Specifically, sometimes what is objectively a complete plane is detected as multiple planes, resulting in coplanarity. Adjacent coplanar planes can cause errors in subsequent primitive extraction; therefore, it is necessary to merge adjacent coplanar plane primitives. For any two adjacent planes... and If the angle between the normal vectors of the two is less than If the two planes are merged, the plane with more interior points is retained, and the plane with fewer interior points is removed. At the same time, the adjacency graph and the number of interior points of the retained plane are updated, and the adjacency relationship of the removed plane is assigned to the retained plane.
[0064] Furthermore, after constructing the adjacency graph, we further filter out adjacent plane pairs that satisfy geometric relationships. To do this, for each pair of adjacent planes, we calculate its normal vector. , The angle between the two vectors. If their directions are similar, that is, if either of the following conditions is met: the dot product of the difference in the normal vector directions is less than a threshold. Right now:
[0065] ;
[0066] Or the reverse difference of the normal vectors satisfies:
[0067] ;
[0068] If there is a tendency for the two planes to coplanarize, they are retained as a valid adjacent plane pair.
[0069] During implementation, the angle threshold used in normal vector regularization to determine whether a plane is parallel to the coordinate axes is used. It is recommended to set it to 5°. This value can be adjusted appropriately according to the noise level of the actual data, and usually fluctuates between 3° and 10°.
[0070] It should be explained that, because real urban rooftop point cloud data is used as the input data source, there is a lot of noise in the input data. There will be a deviation between the plane detected by the planar primitive and the expected plane. In order to preserve the symmetry and parallelism of the reconstructed roof as much as possible, regularization correction is performed.
[0071] Necessity of Regularization: First, planar primitive detection is performed on the roof point cloud model. Each detected planar primitive can be defined as a supporting plane P and a set of points participating in fitting the supporting plane P. The point set is a subset of the roof point cloud and can be called the interior points corresponding to the supporting plane P. Then, the planar primitive detection results are optimized. In this step, the optimization direction mainly considers some common characteristics of the roof structure and provides convenience for subsequent primitive extraction. The optimization includes planar primitive normal vector regularization and merging of coplanar planar primitives. Therefore, retaining valid adjacent plane pairs is the regularization process, which is part of achieving planar correction and optimization. Normal Vector Regularization: Sloping roofs contain numerous symmetrical and parallel structures. However, due to noise in the input data, the planes obtained through planar primitive detection deviate from our expected planes, making it difficult to guarantee the preservation of the symmetry and parallelism of the reconstructed roof. To preserve the symmetry and parallelism of the reconstructed roof as much as possible, this study applies constraints to planes that may exhibit these relationships. This study defines five common constraint relationships in sloping roofs: parallelism with the XOY plane, parallelism with the YOZ plane, parallelism with the XOZ plane, and parallelism and symmetry between planes. In the regularization process, the principal normal vectors of the roof are first determined. The principal normal vectors represent the main orientation of the faces in the roof. For example, in a simple four-sloped roof, the faces have four main orientations, i.e., four different normal vectors; these four normal vectors are the principal normal vectors of the roof. Next, for all faces with angles less than [a certain value] to the coordinate axes... The normal vector is corrected, and the corresponding coordinate axis parallel constraint is applied. It is a very small angle threshold ( It is recommended to set it to 5° (this value can be adjusted appropriately according to the noise level of the actual data, usually fluctuating between 3° and 10°), and then merge the interior points of the corrected normal vectors. Next, determine the parallelism between the normal vectors; when the angle between the normal vectors is less than... When parallel constraints are applied, normal vectors with more interior points merge with those with fewer interior points. After the above two rounds of correction and merging, the normal vector with more interior points will be... The normal vector is considered the principal normal vector.
[0072] Considering the possibility of incomplete cutting or redundant overlap between planes due to measurement errors, this paper introduces the following plane merging strategy. For multiple adjacent plane pairs with similar normal vectors ( That is, the first plane or each subplane, if the angle between their normal vectors is less than the threshold. If they belong to the same geometric plane, then they are determined to be on the same plane; the included angle threshold used in the coplanar plane merging strategy. It is recommended to set the angle to 10°. The larger the value, the more lenient the merging conditions, which is suitable for situations with many missegments. To ensure the integrity and accuracy of the reconstructed structure, it is recommended to control it within the range of 5° to 15°. Based on each set of planar points, the global plane equation is fitted using the least squares method as the unified reference plane after merging. The planar connectivity of all original planes belonging to this merged plane remains unchanged, while their normal vectors are updated to align with the reference plane.
[0073] Step S102: After deleting two adjacent first planes that conflict in the first plane set, multiple roof substructures are obtained.
[0074] The conflict specifically occurs when, among two adjacent planes, one plane is located on the positive side of the direction the normal vector of the remaining plane is pointing.
[0075] Specifically, the aforementioned conflicts can lead to problems such as normal flipping and topological disruption during the modeling process. By employing a two-round adjacent plane search and conflict elimination mechanism, the extracted roof primitive structure is ensured to be logically closed from the source, improving the robustness and controllability of the model construction. Conflict judgment can be based on the main directional plane, recursively searching for adjacent planes. After two rounds of searching and eliminating conflicting adjacent planes, a candidate plane set is formed. A complete topologically closed structure is constructed based on the candidate plane set. The structural combination relationship is determined by the number of ridge lines and triangular faces, outputting multiple primitive groups, i.e., multiple roof substructures, such as... Figure 4 The diagram shown is a schematic of what happens before the conflict is resolved. Figure 5 The diagram shown is a schematic of the process after the conflict was removed.
[0076] It's important to note that the orientation of the plane's normal vector is crucial in the primitive extraction step. For any 3D model, it's generally assumed that the normal vectors of its faces point outwards. Using this rule, we observe that in the set of planes used to construct the roof primitives, there is a type of structure that cannot exist: a structure consisting of two adjacent planes. and Composition, if The position is in The positive side toward which the normal vector points is called the yes The conflict plane, when and When the planes are conflicting, the planes will be... and The resulting structure is called a conflict structure. If a conflict structure exists in the set of planes that construct the roof primitives, the primitives cut from that set of planes are likely to have problems. This is because when a conflict structure exists, the roof primitives will contain faces whose normal vectors point to the interior of the primitive model, such as... Figure 3 The diagram shown is a schematic representation of the conflict structure.
[0077] Recursive search for adjacent faces: For a sloping roof, starting from any face, a set of planes can be obtained by searching for adjacent planes twice consecutively. Within this set, there exist planes that can correctly construct the roof primitives. The desired correct primitives are those that, after plane cutting and assembly, do not affect the manifold properties of the roof.
[0078] The direction of the normal line: generally pointing to the outside of a pitched roof, and the inside of a non-pitched roof. The direction of the normal line is perpendicular to the roof surface. For example, if the slope faces south, its normal line (perpendicular to the slope) naturally points to the outside side (i.e., the outside).
[0079] Step S103: Based on the roof substructure, retrieve the best matching preset substructure from the preset substructure library.
[0080] Specifically, the pre-built substructure library, also known as the standard primitive library, is a set of standard voxels representing typical four-sloped roof primitives. Each primitive supports parametric adjustments (such as slope and size). This step achieves semanticization, parametricization, and high stability in the modeling process by directly replacing the target region with the most matching geometric structure (i.e., the pre-built substructure library) retrieved from the pre-built roof structure library. This method significantly reduces common modeling problems in existing technologies, such as Boolean operation failures, self-intersections, and normal reversals, improving construction accuracy and model engineering adaptability.
[0081] In this embodiment of the application, the step of retrieving the best matching preset substructure from the preset substructure library based on the roof substructure specifically includes:
[0082] Obtain the attribute information of the roof substructure;
[0083] The optimal preset substructure is determined by comparing the attribute information with the attribute information of each preset substructure in the preset substructure library.
[0084] Specifically, the output primitives, i.e., the roof substructure, are matched with preset substructures in the preset substructure library, based on the following features: normal consistency (less than 5°), closure check (support point coverage > 90%), and boundary distance error (less than 10cm). The one with the highest fit is selected as the matched preset substructure for replacement modeling.
[0085] Furthermore, normal consistency refers to the degree of consistency between the normal direction of the roof substructure surface and the normal direction of the corresponding structural surface in the preset substructure library. A normal is a direction vector perpendicular to the surface. Normal consistency measures the degree of agreement between the two in spatial direction, requiring an angle of less than 5°; the smaller the angle, the better the normal consistency.
[0086] The meaning of the closure check (support point coverage > 90%): By checking the coverage of support points (which can be understood as key points used to characterize the shape of the structure, such as vertices and contour points) in the overlapping area of the roof substructure and the preset substructure in space, the degree of closure of the structure is judged. A support point coverage rate of more than 90% indicates that the two are well matched in shape coverage and have good closure.
[0087] Boundary distance error (less than 10cm) means: Calculate the distance deviation between the corresponding boundary of the roof substructure and the preset substructure, that is, the distance between corresponding points on the boundary of the two. The distance error is required to be less than 10cm. The smaller the distance, the higher the boundary matching degree.
[0088] Normal consistency calculation, also known as normal consistency comparison: Let the normal vector of a point on the surface of the roof substructure be... The normal vector of the corresponding point in the preset substructure library is Then, the consistency of the normal vectors can be measured by calculating the angle θ between the two normal vectors, as shown in the formula: And thus obtain ,like If so, then the requirement of normal consistency is satisfied.
[0089] The closure check calculation, also known as the closure test, involves first determining the overlapping area between the roof substructure and the pre-designed substructure. Then, several support points are selected within this area, and the number of roof substructure support points falling within the pre-designed substructure is counted, along with the support point coverage rate. If the value is greater than 90%, then the closure check is passed.
[0090] Boundary distance error calculation, also known as boundary distance detection, involves discretizing the boundary between the roof substructure and the preset substructure to obtain a series of boundary points. For points on the boundary of the roof substructure... Find the nearest point on the preset substructure boundary. Calculate the distance between two points. , , and for coordinates , and for The coordinates are then used, and the average or maximum value of these distances is taken as the boundary distance error. If this error... If so, then it meets the requirements.
[0091] Calculation of goodness of fit:
[0092] The goodness of fit is a quantitative assessment of the degree of matching between the roof substructure and the pre-designed substructure, taking into account factors such as normal consistency, closure check, and boundary distance error. It is typically calculated using a weighted summation method, and the formula can be expressed as:
[0093] ;
[0094] in: These are the weights for normal consistency, closure check, and boundary distance error, respectively (the sum of the weights is 1, and can be determined based on actual needs or experience; for example, if normal consistency is given more importance, the weights can be increased). ).
[0095] The quantization value for normal uniformity can be determined based on the included angle of the normals. Calculation, for example (when (When), the smaller the included angle, The closer it is to 1.
[0096] This is the quantified value of the closure check, i.e., the support point coverage rate (e.g., if the support point coverage rate is 95%). ).
[0097] This is the quantized value of the boundary distance error, which can be determined based on the error. Calculation, for example (when (Time), the smaller the error, The closer it is to 1.
[0098] Step S104: Assemble and reconstruct all the best preset substructures into a three-dimensional pitched roof.
[0099] Specifically, the above scheme yields several matching pre-defined substructures. These substructures are then assembled according to spatial relationships to form a complete pitched roof structure. The output format is an industrial-grade CAD file (e.g., .STEP or .IGES), which can be directly imported into software such as Rhino and SolidWorks for further processing. Compared to traditional mesh reconstruction methods, this method produces more regular roof shapes, clearer structural semantics, and offers interactivity and parameter controllability, making it suitable for large-scale digital modeling of buildings in smart cities.
[0100] In this embodiment of the application, the step of splicing and reconstructing all the optimal preset substructures into a three-dimensional pitched roof specifically includes:
[0101] The spatial relationships between the roof substructures are determined based on the point cloud.
[0102] Based on the spatial relationship, the optimal preset substructures are spliced and reconstructed to obtain a three-dimensional pitched roof.
[0103] Specifically, after the primitive modeling is completed, the position is determined and assembled by referring to the input point cloud, and primitive candidate matching is performed. For example, the overlap, interweaving and splicing distance of primitives on different slopes are checked, that is, the spatial relationship between each roof substructure is determined, and which positions should be four-slope primitives instead of triangular pyramid primitives, etc. This is a manifestation of prefabricated building construction, which is more accurate and efficient.
[0104] Based on the above-described method for three-dimensional reconstruction of pitched roofs, one or more embodiments of this specification also provide a platform or terminal for three-dimensional reconstruction of pitched roofs. This platform or terminal may include devices, software, modules, plug-ins, servers, clients, etc., using the methods described in the embodiments of this specification, combined with necessary hardware implementation. Based on the same innovative concept, the systems in one or more embodiments provided in this specification are as described in the following embodiments. Since the implementation schemes and methods for solving the system problem are similar, the specific system implementation in the embodiments of this specification can refer to the implementation of the aforementioned methods. Repeated descriptions will not be repeated. The terms "unit" or "module" used below can refer to a combination of software and / or hardware that achieves a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, hardware implementation, and a combination of software and hardware, are also possible and contemplated.
[0105] Specifically, Figure 2 This is a schematic diagram of the module structure of one embodiment of the three-dimensional reconstruction device for pitched roofs provided in this specification, as shown below. Figure 2 As shown, the three-dimensional reconstruction device for pitched roofs provided in this specification includes:
[0106] The detection module 201 is used to perform planar detection on the point cloud of the building's pitched roof to obtain a first planar set;
[0107] The deletion module 202 is used to delete two adjacent first planes that conflict in the first plane set to obtain multiple roof substructures;
[0108] The retrieval module 203 is used to retrieve the best matching preset substructure from the preset substructure library based on the roof substructure;
[0109] Reconstruction module 204 is used to reconstruct all the best preset substructures into a three-dimensional pitched roof.
[0110] The detection module 201 is further used for:
[0111] In the first plane, determine the vertex distances between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair;
[0112] Obtain the topological relationships of each point in the point cloud;
[0113] Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure;
[0114] An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the sub-planes.
[0115] After constructing the adjacency graph of the roof substructure, the detection module 201 is further configured to:
[0116] Obtain the normal vectors of the first set of planes and all planes in the adjacency graph;
[0117] Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
[0118] It should be noted that the system described above may include other implementation methods according to the description of the corresponding method embodiments. The specific implementation methods can be referred to the description of the corresponding method embodiments above, and will not be elaborated here.
[0119] This application also provides an electronic device, including:
[0120] processor;
[0121] Memory used to store the processor's executable instructions;
[0122] The processor is configured to perform the methods provided in the embodiments described above.
[0123] The electronic device provided in this application embodiment stores executable instructions of a processor in a memory. When the processor executes the executable instructions, it can perform planar detection on the point cloud of a building's pitched roof to obtain a first set of planes; delete two adjacent first planes that conflict in the first set to obtain multiple roof substructures; retrieve the best preset substructure from a preset substructure library based on the roof substructure; and retrieve the matching best preset substructure based on the roof substructure from the preset substructure library. This can avoid geometric distortion during the 3D reconstruction of a building's pitched roof and improve the geometric accuracy of component segmentation, thereby enhancing the quality of the 3D model of the building's pitched roof.
[0124] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0125] The methods or apparatus described in the above embodiments of this specification can implement business logic through a computer program and record it on a storage medium. The storage medium can be read and executed by a computer to achieve the effects of the solutions described in the embodiments of this specification, such as:
[0126] The first planar set is obtained by performing planar detection on the point cloud of the building's pitched roof;
[0127] After deleting two adjacent first planes that conflict in the first plane set, multiple roof substructures are obtained;
[0128] Based on the roof substructure, the best matching preset substructure is retrieved from the preset substructure library;
[0129] All the best preset substructures are spliced together and reconstructed into a three-dimensional pitched roof.
[0130] The storage medium can include physical devices for storing information, typically digitizing the information and then storing it using electrical, magnetic, or optical methods. The storage medium can include: devices that store information using electrical energy, such as various types of memory, like RAM and ROM; devices that store information using magnetic energy, such as hard disks, floppy disks, magnetic tapes, magnetic core memory, bubble memory, and USB flash drives; and devices that store information using optical methods, such as CDs or DVDs. Of course, there are other readable storage media, such as quantum memories and graphene memories.
[0131] The embodiments in this specification are not limited to conforming to industry communication standards, standard computer resource data update and data storage rules, or the situations described in one or more embodiments of this specification. Slightly modified implementations based on certain industry standards or custom methods or embodiments can also achieve the same, equivalent, or similar, or predictable, implementation effects as described above. Embodiments that utilize these modified or modified methods for data acquisition, storage, judgment, and processing still fall within the scope of optional implementations of the embodiments in this specification.
[0132] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0133] The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or plug-ins may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0134] These computer program instructions can also be loaded onto a computer or other programmable resource data updating device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0135] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0136] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A method for three-dimensional reconstruction of a building hip roof, characterized in that, The method includes: The first planar set is obtained by performing planar detection on the point cloud of the building's pitched roof; After deleting two adjacent first planes that conflict in the first plane set, multiple roof substructures are obtained. The conflict specifically refers to the situation where one of the two adjacent planes is located on the positive side of the normal vector of the remaining plane. Based on the roof substructure, the best matching preset substructure is retrieved from the preset substructure library; All the best preset substructures are spliced together and reconstructed into a three-dimensional pitched roof; The method further includes, after performing planar detection on the point cloud of the building's pitched roof to obtain the first set of planes: In the first plane, determine the vertex distance between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair; Obtain the topological relationships of each point in the point cloud; Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure; An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the sub-planes. Obtain the normal vectors of the first set of planes and all planes in the adjacency graph; Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
2. The method of claim 1, wherein, The detection specifically includes: If the angle between the normal vectors of the adjacent planes is less than a preset threshold, then the adjacent planes are determined to belong to the same plane.
3. The method of claim 1, wherein the three-dimensional reconstruction of the architectural hip roof is performed by: The step of retrieving the best matching preset substructure from the preset substructure library based on the roof substructure specifically includes: Obtain the attribute information of the roof substructure; The optimal preset substructure is determined by comparing the attribute information with the attribute information of each preset substructure in the preset substructure library.
4. The method of claim 3, wherein the three-dimensional reconstruction of the building's pitched roof is performed by: The comparison process specifically includes: normal consistency comparison, closure detection, and boundary distance detection.
5. The method of claim 1, wherein the building hip roof three-dimensional reconstruction method is characterized by, The process of splicing and reconstructing all the optimal preset substructures into a three-dimensional pitched roof specifically includes: The spatial relationships between the roof substructures are determined based on the point cloud. Based on the spatial relationship, the optimal preset substructures are spliced and reconstructed to obtain a three-dimensional pitched roof.
6. A device for three-dimensional reconstruction of a building hip roof, characterized in that The device includes: The detection module is used to perform planar detection on the point cloud of the building's pitched roof to obtain the first planar set; The deletion module is used to delete two adjacent first planes that conflict in the first plane set to obtain multiple roof substructures. The conflict specifically refers to the situation where one of the two adjacent planes is located on the positive side of the normal vector of the remaining plane. The retrieval module is used to retrieve the best matching preset substructure from the preset substructure library based on the roof substructure; The reconstruction module is used to stitch together all the best preset substructures and reconstruct them into a three-dimensional pitched roof. Wherein, after performing planar detection on the point cloud of the building's pitched roof to obtain the first planar set, the detection module is further configured to: In the first plane, determine the vertex distance between each vertex and all other vertices, and take the vertex with the smallest vertex distance as the initial adjacency pair; Obtain the topological relationships of each point in the point cloud; Substituting the initial adjacency pairs into the topological relationship yields the points of each subplane in the roof substructure; An adjacency graph of the corresponding roof substructure is constructed based on the points corresponding to each of the sub-planes. Obtain the normal vectors of the first set of planes and all planes in the adjacency graph; Based on the normal vector, all adjacent planes are detected, and the detected adjacent planes belonging to the same plane are merged to obtain the final first plane set. The final first plane set includes the topological relationship of the roof substructure and the subplanes.
Citation Information
Patent Citations
Image three-dimensional reconstruction method and device, storage medium and electronic device
CN119228981A
Spatial planning three-dimensional visualization method based on geographic information
CN119760009A