Roof plane accurate extraction method and system based on scene geometric relationship constraint
By employing a method for accurate roof plane extraction based on scene geometric constraints, and utilizing a set of supervoxels and random sampling to confirm the candidate plane primitive set, combined with a mathematical model for plane parameter fitting, the method solves the accuracy and consistency problems of existing roof plane extraction techniques and achieves efficient roof plane extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING UNIV OF CIVIL ENG & ARCHITECTURE
- Filing Date
- 2026-03-06
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies for extracting building roof planes from 3D point clouds suffer from several problems, including difficulty in balancing accuracy and efficiency, challenges in achieving smooth transitions at plane connections, insufficient topological consistency, and neglect of geometric constraints. These issues result in incomplete and inaccurate roof plane extraction.
By acquiring the 3D point cloud of the roof, using supervoxel sets and random sampling methods, combined with thickness feature values and centroid sets, a candidate set of plane primitives is identified. Then, plane parameter fitting and label merging are performed through a mathematical model to achieve accurate extraction of the roof plane.
It improves the accuracy of roof plan extraction, ensures the integrity and accuracy of plan extraction, and provides a reliable foundation for 3D reconstruction and building measurement data.
Smart Images

Figure CN122454077A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and surveying data processing technology, and in particular to a method and system for accurately extracting roof planes based on scene geometric relationship constraints. Background Technology
[0002] In the current process of the country vigorously promoting the construction of smart cities and the digitalization of the entire region, the buildings in the city, as the basic carriers for people's daily residence, work and life, their three-dimensional models are not only digital mirrors of the urban form, but also provide a unified and accurate spatial data foundation for diverse scenarios such as noise propagation simulation, environmental assessment, and visual visibility analysis. They have become the digital foundation and core production factor supporting the smart operation of the city.
[0003] The roof plan, as a key geometric element in the construction of a building's 3D model, directly determines the accuracy and usability of the final 3D model, serving as a fundamental condition for ensuring the effectiveness of subsequent analytical applications. This also reflects the important implementation of the State Council's deployment requirements for promoting the construction of Digital China and accelerating the building of a digital infrastructure system.
[0004] Currently, high-precision roof planes are mainly extracted from 3D point clouds, including point clouds generated from aerial or oblique photographic images, as well as point cloud data obtained through 3D laser scanning.
[0005] However, due to the discrete nature of 3D point clouds, especially the complex structure and uneven density of point clouds in building scenes, roof plan extraction still faces many challenges. On the one hand, existing methods are sensitive to parameter selection, easily generating false planes, making it difficult to balance accuracy and efficiency. On the other hand, when dealing with complex roof structures, sequential extraction methods often result in boundary points in transition regions being absorbed by the preferentially extracted primitives, leading to difficulties in smooth transitions at patch connections and insufficient topological consistency in intersecting regions. Furthermore, multi-model global extraction often faces global optimization difficulties, easily getting trapped in local minima and convergence problems. The implicit geometric constraints between roof primitives are often ignored or simplified during the extraction process, further restricting the completeness and accuracy of plan extraction. Therefore, improving the accuracy of roof plan extraction has become an urgent problem to be solved. Summary of the Invention
[0006] This invention provides a method for accurately extracting roof planes based on scene geometric relationship constraints and a computer-readable storage medium, the main purpose of which is to improve the accuracy of roof plane extraction.
[0007] To achieve the above objectives, this invention provides a method for accurately extracting roof planes based on scene geometric constraints, comprising:
[0008] Obtain the 3D point cloud of the roof and input it into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points.
[0009] The set of thickness eigenvalues and the set of supervoxel centroids were identified based on the set of supervoxels.
[0010] The first candidate planar primitive set is identified based on the thickness feature set and the preset thickness threshold.
[0011] The second candidate set of planar primitives was identified based on the supervoxel set and a pre-constructed random sampling method;
[0012] Merge the first candidate planar primitive set and the second candidate planar primitive set to obtain the first candidate planar primitive set for the roof.
[0013] Data item set A was identified based on the first candidate planar primitive set and the supervoxel set of the roof;
[0014] Based on the first candidate planar primitive set of the roof, the smooth itemset A is identified;
[0015] Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate planar primitive set for the roof was identified.
[0016] The data item set was identified based on the candidate planar primitive set of the roof and the centroid set of the supervoxels.
[0017] The smooth itemset was identified based on the hypervoxel set;
[0018] The set of labeled itemsets was identified based on the candidate planar primitive set of the roof;
[0019] The data itemset, smoothing itemset, and label itemset are input into the pre-constructed second mathematical model to obtain the supervoxel label set;
[0020] Perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets;
[0021] Perform the following operation on each of the multiple supervoxel sets:
[0022] The multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a 3D coordinate point set;
[0023] The roof plane is obtained by fitting plane parameters based on the three-dimensional coordinate point set;
[0024] By summarizing the roof planes, a set of roof planes is obtained, enabling accurate extraction of the planes from the point cloud of building roofs.
[0025] Optionally, the step of identifying the set of thickness eigenvalues and the set of supervoxel centroids based on the supervoxel set includes:
[0026] For each supervoxel in the supervoxel set, perform the following operation:
[0027] The point coordinate vector set is determined based on the hypervoxel, which includes multiple three-dimensional coordinate point vectors;
[0028] Calculate the centroid of the hypervoxel based on multiple three-dimensional coordinate point vectors;
[0029] Construct a hypervoxel matrix based on multiple three-dimensional coordinate point vectors and hypervoxel centroids;
[0030] The eigenvalues were identified based on the hypervoxel matrix, including: the first eigenvalue, the second eigenvalue, and the third eigenvalue.
[0031] The thickness characteristic value is calculated based on the first characteristic value, the second characteristic value, and the third characteristic value;
[0032] Summarize the thickness feature values to obtain the thickness feature value set;
[0033] By summing the centroids of hypervoxels, we obtain the hypervoxel centroid set.
[0034] Optionally, the step of identifying the first candidate planar primitive set based on the thickness feature value set and a preset thickness threshold includes:
[0035] For each thickness feature value in the set of thickness feature values, perform the following operation:
[0036] Compare the thickness feature value with the thickness threshold. If the thickness feature value is less than the thickness threshold, then the hypervoxel corresponding to the thickness feature value is taken as the first candidate hypervoxel.
[0037] Multiple three-dimensional coordinate points in the first candidate hypervoxel are fitted to obtain the first candidate planar primitive, which includes: a first basic parameter, a second basic parameter, a third basic parameter, and a fourth basic parameter;
[0038] Summarize the first candidate planar primitives to obtain the first candidate planar primitive set.
[0039] Optionally, the second candidate planar primitive set is identified based on the supervoxel set and a pre-constructed random sampling method, including:
[0040] The set of supervoxels was sampled with replacement using a random sampling method to obtain the centroids of four supervoxels.
[0041] The second candidate planar primitive was identified based on the centroids of the four supervoxels. The second candidate planar primitive includes: a first fitting parameter, a second fitting parameter, a third fitting parameter, and a fourth fitting parameter.
[0042] The second candidate planar primitive is placed into the pre-constructed empty set to obtain the primitive set;
[0043] The number of primitives is determined based on the primitive set, where the number of primitives is the number of second candidate planar primitives in the primitive set;
[0044] Compare the number of primitives with a preset threshold. If the number of primitives is less than the threshold, return to the step of sampling the supervoxel set with replacement using a random sampling method until the number of primitives is greater than or equal to the threshold. Then, use the primitive set as the second candidate planar primitive set.
[0045] Optionally, the step of identifying data item set A based on the first candidate planar primitive set and the supervoxel set of the roof includes:
[0046] For each supervoxel in the supervoxel set, perform the following operation:
[0047] The number of coordinate points is determined based on the hypervoxel, where the number of coordinate points is the number of multiple three-dimensional coordinate points contained in the hypervoxel;
[0048] Compare the number of coordinate points with a preset first threshold. If the number of coordinate points is less than the preset first threshold, then perform the following operation on each of the first candidate plane primitives in the first candidate plane primitive set for the roof:
[0049] The x-coordinate, y-coordinate, and z-coordinate of the centroid were determined based on the hypervoxel.
[0050] The first parameter, second parameter, third parameter, and fourth parameter were identified based on the first candidate planar primitive of the roof.
[0051] Calculate the first geometric distance based on the centroid x-coordinate, centroid y-coordinate, centroid z-coordinate, first parameter, second parameter, third parameter, and fourth parameter;
[0052] Summarize the first geometric distances to obtain the first geometric distance set;
[0053] If the number of coordinate points is greater than or equal to the first threshold, then the preset planar residual threshold is used as the second geometric distance;
[0054] By summing the first geometric distance set and the second geometric distance set respectively, multiple first geometric distance sets and second geometric distance sets are obtained;
[0055] Multiple first geometric distance sets and second geometric distance sets are merged to obtain data item set A.
[0056] Optionally, the process of identifying the smooth itemset A based on the first candidate planar primitive set of the roof includes:
[0057] Based on the first candidate plane primitive set of the roof, multiple candidate plane pairs were identified. The candidate plane pairs include: a first candidate plane and a second candidate plane. The first candidate plane includes: candidate coefficient 1, candidate coefficient 2, and candidate coefficient 3. The second candidate plane includes: candidate coefficient 21, candidate coefficient 22, and candidate coefficient 23.
[0058] For each of the multiple candidate plane pairs, perform the following operation:
[0059] Calculate the first unit normal vector based on the candidate coefficients 1-1, 2-1, and 3-1 in the first candidate plane of the candidate plane pair.
[0060] Calculate the second unit normal vector based on the candidate 2-1 coefficient, the candidate 2-2 coefficient, and the candidate 2-3 coefficient in the second candidate plane of the first candidate plane pair;
[0061] Calculate the candidate angles based on the first unit normal vector and the second unit normal vector;
[0062] Calculate the angle constraint index value based on the candidate angles;
[0063] Calculate the smoothing term based on the angle constraint index value;
[0064] Summarize the smoothed items to obtain the smoothed itemset A.
[0065] Optionally, the step of identifying the candidate planar primitive set of the roof based on data itemset A, smoothing itemset A, and a pre-constructed first mathematical model includes:
[0066] Substituting the data itemset A and the smoothing itemset A into the first mathematical model, we obtain the supervoxel label set A;
[0067] Perform label merging on supervoxel label set A to obtain multiple target supervoxel sets;
[0068] For each of the multiple target supervoxel sets, perform the following operation:
[0069] Merge the multiple 3D coordinate points corresponding to each target supervoxel in the target supervoxel set to obtain the target 3D coordinate point set;
[0070] Based on the target 3D coordinate point set, plane parameters are fitted to obtain the candidate roof plane;
[0071] Summarize the candidate roof planes to obtain the primitive set of candidate roof planes.
[0072] Optionally, the step of identifying the data item set based on the candidate planar primitive set of the roof and the supervoxel centroid set includes:
[0073] Candidate planar primitives are randomly extracted from the set of candidate planar primitives for the roof;
[0074] Perform the following operation on each supervoxel centroid within the supervoxel centroid set:
[0075] The geometric distance was determined based on the centroid of the hypervoxel and candidate planar primitives;
[0076] Compare the geometric distance with a preset distance threshold. If the geometric distance is less than or equal to the distance threshold, then the geometric distance is taken as the target distance.
[0077] If the geometric distance is greater than the distance threshold, then the distance threshold is used as the target distance;
[0078] Calculate data items based on target distance;
[0079] Summarize the data items to obtain the target data item set;
[0080] Remove candidate plane primitives from the candidate plane primitive set for the roof to obtain an updated candidate plane primitive set;
[0081] The number of second plane primitives is determined based on the updated candidate plane primitive set, wherein the number of second plane primitives is the number of candidate plane primitives in the updated candidate plane primitive set;
[0082] Compare the number of second plane primitives with a preset second threshold. If the number of second plane primitives is greater than or equal to the second threshold, update the candidate plane primitive set as the candidate plane primitive set, and return to the step of randomly extracting candidate plane primitives from the roof candidate plane primitive set until the number of second plane primitives is less than the second threshold. Then, summarize the target data item set to obtain the data item set.
[0083] Optionally, the step of identifying smooth itemsets based on the supervoxel set includes:
[0084] The first supervoxel is obtained by randomly sampling the set of supervoxels.
[0085] Based on the set of supervoxels and the first supervoxel, the adjacent sets of supervoxels are identified, wherein the adjacent sets of supervoxels include: multiple supervoxels;
[0086] For each of multiple supervoxels in adjacent supervoxel sets, perform the following operation:
[0087] The first and second centers of gravity were identified based on the first and second hypervoxels.
[0088] Calculate the spatial geometric distance based on the first and second centroids;
[0089] The second smoothing term is calculated based on the spatial geometric distance and the plane index, as shown in the following formula:
[0090] ;
[0091] in, Indicates the second smoothing term. Represents the plane index, It is a natural exponential function. Represents spatial geometric distance;
[0092] Summarize the second smoothing terms to obtain the smoothing itemset.
[0093] Optionally, the step of identifying the tag itemset based on the candidate roof planar primitive set includes:
[0094] For each roof candidate plane primitive in the roof candidate plane primitive set, perform the following operation:
[0095] The number of candidate points is determined based on the candidate roof plane primitive, where the number of candidate points is the number of three-dimensional coordinate points in the candidate roof plane primitive;
[0096] Calculate the label item based on the number of candidate points;
[0097] Summarize the tag items to obtain the tag item set.
[0098] Optionally, the second mathematical model is as follows:
[0099] ;
[0100] in, This represents the second mathematical model. Represents a data item set. Represents a smooth itemset. Represents a set of labeled items.
[0101] To achieve the above objectives, the present invention also provides a system for accurately extracting roof planes based on scene geometric relationship constraints, comprising:
[0102] The roof point cloud acquisition module is used to acquire the 3D point cloud of the roof. The 3D point cloud of the roof is input into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points. The thickness feature value set and the super voxel centroid set are determined based on the set of super voxels.
[0103] The candidate plane confirmation module is used to confirm a first candidate plane primitive set based on a set of thickness feature values and a preset thickness threshold, and to confirm a second candidate plane primitive set based on a set of supervoxels and a pre-constructed random sampling method. The first candidate plane primitive set and the second candidate plane primitive set are merged to obtain the first candidate plane primitive set for the roof. Based on the first candidate plane primitive set for the roof and the set of supervoxels, a data itemset A is confirmed. Based on the first candidate plane primitive set for the roof, a smoothing itemset A is confirmed. Based on the data itemset A, the smoothing itemset A, and the pre-constructed first mathematical model, the candidate plane primitive set for the roof is confirmed.
[0104] The roof label confirmation module is used to confirm the data itemset based on the roof candidate plane primitive set and the super voxel centroid set, confirm the smooth itemset based on the super voxel set, and confirm the label itemset based on the roof candidate plane primitive set. The data itemset, smooth itemset and label itemset are input into the pre-constructed second mathematical model to obtain the super voxel label set.
[0105] The roof plane extraction module is used to perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets. For each of the multiple supervoxel sets, the following operations are performed: merge the multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set to obtain a 3D coordinate point set; perform plane parameter fitting based on the 3D coordinate point set to obtain the roof plane; summarize the roof planes to obtain the roof plane set, thus completing the accurate extraction of the plane from the building roof point cloud.
[0106] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0107] Memory, storing at least one instruction; and
[0108] The processor executes the instructions stored in the memory to implement the above-described method for accurately extracting the roof plane based on scene geometric constraints.
[0109] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one instruction, which is executed by a processor in an electronic device to implement the above-described method for accurately extracting roof planes based on scene geometric constraints.
[0110] To address the problems described in the background section, this invention acquires a 3D point cloud of a roof and inputs it into a pre-constructed point cloud segmentation model to obtain a set of supervoxels. Each supervoxel contains multiple 3D coordinate points. This invention, by employing supervoxelization processing to group point cloud data into local units with similar characteristics, significantly reduces data complexity while preserving key geometric information. Furthermore, based on the supervoxel set, the thickness feature set and the supervoxel centroid set are identified. This invention, by extracting key features of the thickness distribution and centroid position of supervoxels, provides a quantitative basis for subsequent planar primitive identification and selection, based on the thickness feature set and a preset thickness threshold. The first candidate planar primitive set was identified. This embodiment of the invention utilizes thickness features for preliminary screening, quickly eliminating regions that clearly do not conform to planar characteristics, thus improving processing efficiency. Based on the supervoxel set and a pre-constructed random sampling method, a second candidate planar primitive set was identified. This embodiment of the invention introduces the random sampling consistency principle to enhance robustness against noise and outliers, ensuring the comprehensive discovery of potential planar primitives. The first and second candidate planar primitive sets were merged to obtain the first candidate planar primitive set for the roof. This embodiment of the invention significantly improves the recall rate and coverage integrity of candidate planes by fusing the detection results of rule-based screening and random sampling methods. Based on the first candidate planar primitive set and the supervoxel set for the roof... Recognizing data itemset A, it is evident that this embodiment of the invention constructs data items to evaluate the fitting degree between candidate planes and the original point cloud, providing accurate objective function input for subsequent optimization. Based on the first candidate plane primitive set of the roof, the smoothing itemset A is identified. This embodiment of the invention fully utilizes the parallel, perpendicular, and other geometric constraints existing between building scenes by establishing constraint terms for the continuity of planar parameters between adjacent supervoxels, promoting the smoothness and consistency of the segmentation results in space. Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate plane primitive set of the roof is identified. This embodiment of the invention achieves accurate selection and optimization of the candidate plane set by comprehensively balancing fitting accuracy and smoothing constraints using an optimization model. The data itemset is determined by combining the centroid set and the supervoxel centroid set. This embodiment of the invention refines the data item calculation by incorporating centroid position information, enhancing the accuracy and stability of planar parameter estimation. The smoothing itemset is determined based on the supervoxel set. This embodiment of the invention effectively avoids over-segmentation and fragmentation of the plane by constructing spatial smoothing constraints based on supervoxel adjacency relationships. The label itemset is determined based on the candidate roof planar primitive set. This embodiment of the invention guides the classification results to aggregate towards semantically consistent regions by establishing consistency constraints on planar labels. The data itemset, smoothing itemset, and label itemset are input into a pre-constructed second mathematical model to obtain the supervoxel label set. This embodiment of the invention achieves globally optimal label allocation by employing advanced mathematical models such as graph optimization.To ensure the accuracy and rationality of the planar segmentation results, a label merging operation is performed on the supervoxel label set to obtain multiple supervoxel sets. This embodiment of the invention forms semantically complete planar regions by merging adjacent and homogeneous supervoxels, eliminating redundant segmentation. For each supervoxel set, the following operation is performed: multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a 3D coordinate point set. This embodiment of the invention integrates all point cloud data belonging to the same plane, preparing complete samples for accurate planar parameter fitting. Planar parameter fitting is performed based on the 3D coordinate point set to obtain the roof plane. This embodiment of the invention accurately calculates the planar equation parameters from the point cloud data using a least squares fitting algorithm, achieving accurate reconstruction of the geometric plane. The roof planes are summarized to obtain a roof plane set, completing the accurate extraction of the plane from the building roof point cloud. This embodiment of the invention systematically integrates all extracted planar structures, transforming the conventional problem of directly extracting planes from point clouds into a problem of assigning points to candidate planes, thereby forming a complete roof plane model. This provides a reliable data foundation for applications such as 3D reconstruction and building surveying, improving the accuracy of roof plane extraction. Therefore, this invention can improve the accuracy of roof plane extraction. Attached Figure Description
[0111] Figure 1 This is a flowchart illustrating a method for accurately extracting roof planes based on scene geometric constraints, according to an embodiment of the present invention.
[0112] Figure 2 This is a functional block diagram of a roof plan accurate extraction system based on scene geometric relationship constraints provided in an embodiment of the present invention;
[0113] Figure 3 This is a schematic diagram of the structure of an electronic device that implements the method for accurately extracting roof planes based on scene geometric relationship constraints, according to an embodiment of the present invention.
[0114] Explanation of reference numerals in the attached figures:
[0115] 10. Electronic device; 11. Processor; 12. Memory; 13. Bus.
[0116] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0117] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0118] This application provides a method for accurately extracting roof planes based on scene geometric constraints. The execution entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method for accurately extracting roof planes based on scene geometric constraints can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.
[0119] Reference Figure 1 The diagram shown is a flowchart illustrating a method for accurately extracting roof planes based on scene geometric constraints according to an embodiment of the present invention. In this embodiment, the method for accurately extracting roof planes based on scene geometric constraints includes:
[0120] S1. Obtain the 3D point cloud of the roof. Input the 3D point cloud of the roof into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points.
[0121] For example, Xiao Zhang works for a photovoltaic system company and plans to install photovoltaic modules on the rooftops of multiple residential buildings in a residential community. To ensure the modules can be accurately and efficiently deployed on the rooftops, Xiao Zhang first needs to precisely extract the roof plan of each building. Therefore, Xiao Zhang obtains point cloud data of the residential community's rooftops, which is the 3D point cloud of the rooftops. For example, a drone equipped with a LiDAR gimbal is used to obtain the 3D point cloud. The drone refers to an unmanned aerial vehicle; optionally, a DJI M300RTK is used. The LiDAR gimbal is a gimbal with laser scanning capabilities; optionally, a DJI Zenmuse L1 is used.
[0122] It should be explained that inputting the 3D point cloud of the roof into a pre-constructed point cloud segmentation model to obtain a supervoxel set means: inputting the 3D point cloud of the roof into the point cloud segmentation model, processing the 3D point cloud of the roof using the point cloud segmentation model, and thus obtaining multiple supervoxels. The supervoxel set refers to a set composed of multiple supervoxels. Optionally, the (super)voxel cloud connectivity segmentation algorithm (VCCS) is used as the point cloud segmentation model, and the (super)voxel cloud connectivity segmentation algorithm (VCCS) is existing technology, which will not be described in detail here. A hypervoxel is a set of multiple three-dimensional coordinate points. A hypervoxel also includes information about its adjacent hypervoxels. A three-dimensional coordinate point refers to a point in a spatial rectangular coordinate system, and a three-dimensional coordinate point includes: x-coordinate, y-coordinate, and z-coordinate. The x-coordinate refers to the coordinate of the three-dimensional coordinate point on the x-axis in the spatial rectangular coordinate system, the y-coordinate refers to the coordinate of the three-dimensional coordinate point on the y-axis in the spatial rectangular coordinate system, and the z-coordinate refers to the coordinate of the three-dimensional coordinate point on the z-axis in the spatial rectangular coordinate system. Optionally, a Cartesian coordinate system is used as the spatial rectangular coordinate system.
[0123] S2. Based on the set of supervoxels, the set of thickness feature values and the set of supervoxel centroids are identified. Based on the set of thickness feature values and the preset thickness threshold, the first candidate set of planar primitives is identified.
[0124] Specifically, the determination of the thickness feature set and the supervoxel centroid set based on the supervoxel set includes:
[0125] For each supervoxel in the supervoxel set, perform the following operation:
[0126] The point coordinate vector set is determined based on the hypervoxel, which includes multiple three-dimensional coordinate point vectors;
[0127] The centroid of the hypervoxel is calculated based on multiple 3D coordinate point vectors, using the following formula:
[0128] ;
[0129] in, Indicates the center of gravity of the supervoxel. Represents the first of multiple three-dimensional coordinate point vectors A three-dimensional coordinate point vector, The number of three-dimensional coordinate points inside the hypervoxel;
[0130] A hypervoxel matrix is constructed based on multiple 3D coordinate point vectors and hypervoxel centroids, as shown below:
[0131] ;
[0132] in, Represents the supervoxel matrix, This represents the matrix transpose operation;
[0133] The eigenvalues were identified based on the hypervoxel matrix, including: the first eigenvalue, the second eigenvalue, and the third eigenvalue.
[0134] The thickness characteristic value is calculated based on the first, second, and third characteristic values, using the following formula:
[0135] ;
[0136] in, Indicates the thickness characteristic value. Represents the first eigenvalue. Represents the second eigenvalue. Represents the third eigenvalue. Represents the arctangent function;
[0137] Summarize the thickness feature values to obtain the thickness feature value set;
[0138] By summing the centroids of hypervoxels, we obtain the hypervoxel centroid set.
[0139] It should be explained that the centroid of a hypervoxel refers to the average of the spatial coordinates of all points within a hypervoxel, used to characterize the center position of that hypervoxel in three-dimensional space. The hypervoxel matrix is a covariance matrix constructed based on the spatial distribution characteristics of points within a hypervoxel, used to characterize the geometric dispersion and principal direction information of points in three-dimensional space. Identifying eigenvalues based on the hypervoxel matrix means performing eigenvalue decomposition on the constructed hypervoxel matrix to obtain three real eigenvalues and corresponding eigenvectors. The first eigenvalue is the largest eigenvalue obtained after eigenvalue decomposition of the hypervoxel matrix, used to characterize the dispersion of the point cloud in the principal distribution direction. The larger the value, the stronger the extension of the points in that principal direction and the wider the spatial distribution; it is usually related to the principal direction of the surface or the plane extension direction. The second eigenvalue is the intermediate eigenvalue obtained after eigenvalue decomposition of the hypervoxel matrix, used to characterize the dispersion of the point cloud in the secondary principal direction. This value reflects the extensibility of the point cloud in the secondary principal direction in a local region, usually related to the curvature changes or transition regions of the local shape. The third eigenvalue refers to the smallest eigenvalue obtained after eigenvalue decomposition of the hypervoxel matrix. It is used to characterize the dispersion of the point cloud in the normal or thickness direction. The smaller the value, the more concentrated the point cloud is in that direction and the smoother the surface. It can usually be used to describe the local thickness or planarity features of an object's surface.
[0140] It should be understood that the thickness eigenvalue refers to a quantitative index calculated based on three eigenvalues of a hypervoxel, used to comprehensively describe the geometric thickness characteristics of the hypervoxel in the normal direction. The smaller the thickness eigenvalue, the more concentrated the distribution of points within the hypervoxel in the thickness direction and the smoother the surface; the larger the thickness eigenvalue, the more significant the thickness variation or surface undulation in the region. The thickness eigenvalue set is a collection of multiple thickness eigenvalues, and the hypervoxel centroid set is a collection of multiple hypervoxel centroids.
[0141] Specifically, the determination of the point coordinate vector set based on hypervoxels includes:
[0142] Multiple 3D coordinates are extracted from multiple 3D coordinates in the hypervoxel. The 3D coordinates include the 3D x-coordinate, 3D y-coordinate, and 3D z-coordinate.
[0143] For each of the multiple 3D coordinate points, perform the following operation:
[0144] A three-dimensional coordinate point vector is constructed based on the coordinates of the three-dimensional coordinate points, as shown below:
[0145] ;
[0146] in, Represents a point vector. This represents the three-dimensional x-coordinate of a point in a three-dimensional coordinate system. This represents the y-coordinate of a point in a three-dimensional coordinate system. This represents the three-dimensional z-coordinate of a point in a three-dimensional coordinate system.
[0147] By summing the three-dimensional coordinate point vectors, we obtain the point coordinate vector set.
[0148] It should be explained that extracting multiple 3D coordinate points from multiple 3D coordinate points in a supervoxel means: reading and extracting the spatial coordinate information of each sampling point from the point cloud set constituting the supervoxel point by point to obtain a coordinate sequence of several 3D coordinate points within the supervoxel. The coordinates of the 3D coordinate points within the supervoxel are the 3D coordinate points, which include: 3D x-coordinate, 3D y-coordinate, and 3D z-coordinate. The 3D x-coordinate refers to the coordinate of the 3D coordinate point on the x-axis in a Cartesian coordinate system; the 3D y-coordinate refers to the coordinate of the 3D coordinate point on the y-axis in a Cartesian coordinate system; and the 3D z-coordinate refers to the coordinate of the 3D coordinate point on the z-axis in a Cartesian coordinate system. Optionally, a Cartesian coordinate system is used as the Cartesian coordinate system. A 3D coordinate point vector is a column vector obtained by combining the three components of a 3D coordinate point in a fixed order. A set of point coordinate vectors is a collection of multiple 3D coordinate point vectors.
[0149] Specifically, the process of identifying the first candidate planar primitive set based on the set of thickness feature values and a preset thickness threshold includes:
[0150] For each thickness feature value in the set of thickness feature values, perform the following operation:
[0151] Compare the thickness feature value with the thickness threshold. If the thickness feature value is less than the thickness threshold, then the hypervoxel corresponding to the thickness feature value is taken as the first candidate hypervoxel.
[0152] Multiple three-dimensional coordinate points in the first candidate hypervoxel are fitted to obtain the first candidate planar primitive, which includes: a first basic parameter, a second basic parameter, a third basic parameter, and a fourth basic parameter;
[0153] Summarize the first candidate planar primitives to obtain the first candidate planar primitive set.
[0154] It should be explained that the thickness threshold is a value set manually by the staff of the photovoltaic system company; optionally, the thickness threshold is 0.25 radians. The first candidate supervoxel refers to the supervoxel corresponding to a thickness feature value less than the thickness threshold. Fitting multiple three-dimensional coordinate points from the first candidate supervoxels to obtain the first candidate plane primitive means: using a plane fitting method to fit multiple three-dimensional coordinate points to a plane, thereby obtaining four basic parameters of the fitted plane, and then confirming the first candidate plane primitive based on the four basic parameters. The first candidate plane primitive is the plane confirmed by the four basic parameters of the fitted plane. Optionally, the least squares method is used as the plane fitting method. The first basic parameter refers to the first coefficient of the plane, i.e., the component of the plane normal vector in the x-direction; the second basic parameter refers to the second coefficient of the plane, i.e., the component of the plane normal vector in the y-direction; the third basic parameter refers to the third coefficient of the plane, i.e., the component of the plane normal vector in the z-direction; and the fourth basic parameter refers to the fourth coefficient of the plane, representing the displacement of the plane relative to the origin of the coordinate system. The set of first candidate plane primitives is a collection composed of multiple first candidate plane primitives.
[0155] S3. Based on the supervoxel set and the pre-constructed random sampling method, the second candidate plane primitive set is identified. The first candidate plane primitive set and the second candidate plane primitive set are merged to obtain the first candidate plane primitive set of the roof.
[0156] In detail, the second candidate planar primitive set is identified based on the supervoxel set and the pre-constructed random sampling method, including:
[0157] The set of supervoxels was sampled with replacement using a random sampling method to obtain the centroids of four supervoxels.
[0158] The second candidate planar primitive was identified based on the centroids of the four supervoxels. The second candidate planar primitive includes: a first fitting parameter, a second fitting parameter, a third fitting parameter, and a fourth fitting parameter.
[0159] The second candidate planar primitive is placed into the pre-constructed empty set to obtain the primitive set;
[0160] The number of primitives is determined based on the primitive set, where the number of primitives is the number of second candidate planar primitives in the primitive set;
[0161] Compare the number of primitives with a preset threshold. If the number of primitives is less than the threshold, return to the step of sampling the supervoxel set with replacement using a random sampling method until the number of primitives is greater than or equal to the threshold. Then, use the primitive set as the second candidate planar primitive set.
[0162] It should be explained that the random sampling method for sampling the supervoxel set with replacement means: randomly selecting four supervoxels from the supervoxel set, processing these four supervoxels, and then returning them to the supervoxel set. The method of identifying the second candidate plane primitive based on the centroids of the four supervoxels means: using a plane fitting method to fit the centroids of the four supervoxels to a plane, thereby obtaining four fitted plane parameters, and then identifying the second candidate plane primitive based on these four fitted plane parameters. The second candidate plane primitive is the plane identified by the four fitted plane parameters. Optionally, the least squares method can be used as the plane fitting method. The first fitting parameter refers to the first coefficient of the plane, i.e., the component of the plane normal vector in the x-direction; the second fitting parameter refers to the second coefficient of the plane, i.e., the component of the plane normal vector in the y-direction; the third fitting parameter refers to the third coefficient of the plane, i.e., the component of the plane normal vector in the z-direction; and the fourth fitting parameter refers to the fourth coefficient of the plane, used to characterize the degree of positional offset of the plane relative to the origin of the coordinate system. The positional offset refers to the distance from the plane to the origin of the coordinate system along the direction of the plane normal vector. For example, if the equation of the plane is: ,in, These correspond to the first fitting parameter, the second fitting parameter, and the third fitting parameter, respectively. Corresponding to the fourth fitting parameter, the absolute value of the fourth fitting parameter is proportional to the perpendicular distance from the plane to the origin of the coordinate system. In the plane equation, after the first, second, and third fitting parameters are determined, the larger the fourth fitting parameter, the greater the overall offset of the plane relative to the origin of the coordinate system along the normal vector direction. When the fourth fitting parameter is 0, it indicates that the plane intersects with the origin of the coordinate system. Adding the second candidate plane primitive to the pre-constructed empty set refers to adding the second candidate plane primitive to the empty set. The empty set is a set without any elements, and the primitive set is the empty set containing the second candidate plane primitive. The quantity threshold is a value manually set by the staff of the photovoltaic system company; optionally, the quantity threshold is 500. The second candidate plane primitive set refers to the primitive set with a quantity greater than or equal to the quantity threshold.
[0163] S4. Based on the first candidate plane primitive set and the supervoxel set of the roof, the data itemset A is identified. Based on the first candidate plane primitive set of the roof, the smoothing itemset A is identified. Based on the data itemset A, the smoothing itemset A, and the pre-constructed first mathematical model, the candidate plane primitive set of the roof is identified.
[0164] Specifically, the data itemset A identified based on the first candidate planar primitive set and the supervoxel set of the roof includes:
[0165] For each supervoxel in the supervoxel set, perform the following operation:
[0166] The number of coordinate points is determined based on the hypervoxel, where the number of coordinate points is the number of multiple three-dimensional coordinate points contained in the hypervoxel;
[0167] Compare the number of coordinate points with a preset first threshold. If the number of coordinate points is less than the preset first threshold, then perform the following operation on each of the first candidate plane primitives in the first candidate plane primitive set for the roof:
[0168] The x-coordinate, y-coordinate, and z-coordinate of the centroid were determined based on the hypervoxel.
[0169] The first parameter, second parameter, third parameter, and fourth parameter were identified based on the first candidate planar primitive of the roof.
[0170] The first geometric distance is calculated based on the centroid x-coordinate, centroid y-coordinate, centroid z-coordinate, first parameter, second parameter, third parameter, and fourth parameter, using the following formula:
[0171] ;
[0172] in, Represents the first geometric distance. Indicates the first parameter. Indicates the second parameter. Indicates the third parameter. Indicates the fourth parameter. , and These represent the x-coordinate, y-coordinate, and z-coordinate of the centroid, respectively.
[0173] Summarize the first geometric distances to obtain the first geometric distance set;
[0174] If the number of coordinate points is greater than or equal to the first threshold, then the preset planar residual threshold is used as the second geometric distance;
[0175] By summing the first geometric distance set and the second geometric distance set respectively, multiple first geometric distance sets and second geometric distance sets are obtained;
[0176] Multiple first geometric distance sets and second geometric distance sets are merged to obtain data item set A.
[0177] It should be explained that the first threshold refers to the minimum number of 3D points within a supervoxel, set by the photovoltaic company's staff based on the average point cloud density per unit distance of the input point cloud. For example, if the average point cloud density per unit distance of the input point cloud is 30, then the first threshold is 30. The determination of the centroid x-coordinate, centroid y-coordinate, and centroid z-coordinate based on the supervoxel means: determining the x-coordinate, y-coordinate, and z-coordinate of the centroid of the supervoxel. The x-coordinate, y-coordinate, and z-coordinate of the centroid of the supervoxel are the same as the centroid x-coordinate, centroid y-coordinate, and centroid z-coordinate. The first parameter refers to the component of the plane normal vector of the first candidate plane element of the roof in the x-direction; the second parameter refers to the component of the plane normal vector of the first candidate plane element of the roof in the y-direction; the third parameter refers to the component of the plane normal vector of the first candidate plane element of the roof in the z-direction; and the fourth parameter is a quantity used to characterize the degree of positional offset of the plane relative to the origin of the coordinate system. The positional offset refers to the distance from the plane to the origin of the coordinate system along the plane normal vector direction.
[0178] Understandably, the first geometric distance reflects the spatial distance from the supervoxel's centroid to the first candidate planar primitive of the roof. The larger the first geometric distance, the greater the spatial distance from the supervoxel's centroid to the first candidate planar primitive of the roof. The first geometric distance set is a set composed of multiple first geometric distances. The planar residual threshold is a value manually set by the photovoltaic company's staff based on twice the average resolution of the input point cloud. For example, if the average resolution of the input point cloud is 0.01 meters, then the planar residual threshold is 0.02 meters. The second geometric distance is the planar residual threshold, and the second geometric distance set is a set composed of multiple second geometric distances.
[0179] For example, if multiple first geometric distance sets are {1, 2, 3}, {2, 3, 4}, {3, 4, 5}, and a second geometric distance set is {5, 6, 7, 8}, then merging the multiple first geometric distance sets and the second geometric distance sets yields a data item set A of {1, 2, 3, 2, 3, 4, 3, 4, 5, 5, 6, 7, 8}.
[0180] Specifically, the process of identifying the smooth itemset A based on the first candidate planar primitive set of the roof includes:
[0181] Based on the first candidate plane primitive set of the roof, multiple candidate plane pairs were identified. The candidate plane pairs include: a first candidate plane and a second candidate plane. The first candidate plane includes: candidate coefficient 1, candidate coefficient 2, and candidate coefficient 3. The second candidate plane includes: candidate coefficient 21, candidate coefficient 22, and candidate coefficient 23.
[0182] For each of the multiple candidate plane pairs, perform the following operation:
[0183] The first unit normal vector is calculated based on the candidate coefficients 1-1, 1-2, and 1-3 of the first candidate plane in the candidate plane pair. The calculation formula is as follows:
[0184] ;
[0185] in, Denotes the first unit normal vector. Represents the candidate coefficients in the first candidate plane. Indicates the candidate first and second coefficients in the first candidate plane. Indicates the candidate first and third coefficients in the first candidate plane;
[0186] Calculate the second unit normal vector based on the candidate 2-1 coefficient, the candidate 2-2 coefficient, and the candidate 2-3 coefficient in the second candidate plane of the first candidate plane pair;
[0187] The candidate angles are calculated based on the first unit normal vector and the second unit normal vector, using the following formula:
[0188] ;
[0189] in, Indicates candidate angles, It is a cosine function. Represents pi (π). Dot product, This indicates taking the absolute value. Represents the second unit normal vector;
[0190] The angle constraint index value is calculated based on the candidate angles, and the calculation formula is as follows:
[0191] ;
[0192] in, This represents the angle constraint index value. Indicates the function to take the smaller value;
[0193] The smoothing term is calculated based on the angle constraint index value, and the calculation formula is as follows:
[0194] ;
[0195] in, Indicates the smoothing term. It is a natural exponential function;
[0196] Summarize the smoothed items to obtain the smoothed itemset A.
[0197] It should be explained that the identification of multiple candidate plane pairs based on the first candidate plane primitive set of the roof refers to: based on the information of adjacent supervoxels of multiple supervoxels in the first candidate plane primitive set of the roof,
[0198] Multiple pairs of adjacent supervoxels were identified, and the multiple pairs of first candidate roof plane primitives corresponding to these pairs were designated as multiple candidate plane pairs. A pair of first candidate roof plane primitives corresponding to a pair of adjacent supervoxels constitutes a candidate plane pair. A first candidate plane refers to one plane within a candidate plane pair, and a second candidate plane refers to the other plane in the candidate plane pair that is different from the first candidate plane. The first unit normal vector refers to the unit vector of the first candidate plane. The candidate-1 coefficient refers to the x-component of the plane normal vector of the first candidate plane, the candidate-1-2 coefficient refers to the y-component of the plane normal vector of the first candidate plane, and the candidate-1-3 coefficient refers to the z-component of the plane normal vector of the first candidate plane. Similarly, the candidate-2-1 coefficient refers to the x-component of the plane normal vector of the second candidate plane, the candidate-2-2 coefficient refers to the y-component of the plane normal vector of the second candidate plane, and the candidate-2-3 coefficient refers to the z-component of the plane normal vector of the second candidate plane.
[0199] It should be understood that the method for calculating the second unit normal vector based on the candidate 2-1 coefficient, the candidate 2-2 coefficient, and the candidate 2-3 coefficient in the second candidate plane of the first candidate plane pair is the same as the method for calculating the first unit normal vector based on the candidate 1-1 coefficient, the candidate 1-2 coefficient, and the candidate 1-3 coefficient in the first candidate plane of the candidate plane pair, and will not be repeated here.
[0200] Understandably, the candidate angle refers to the angle between the first and second candidate planes. The angle constraint index value represents the degree of folding between a pair of candidate planes. It is obtained by symmetric processing of the angle between the two planes. The smaller the value, the closer the two planes are to being parallel or coplanar; the larger the value, the more obvious the folding between the two planes. The smoothing term maps the angle constraint index value to a penalty value for energy optimization. Energy optimization refers to: in the process of determining the candidate plane set, by constructing an energy function including the smoothing term, adjusting the geometric relationship between multiple candidate planes as a whole to minimize the value of the energy function. The penalty value is a scalar obtained by mapping the angle constraint index value. Specifically, the larger the penalty value, the more obvious the discontinuity between the pair of candidate planes. In energy optimization, a stronger penalty will be imposed to make it tend to reduce folding or maintain geometric smoothness. The smaller the penalty value, the gentler the change between the candidate planes. In energy optimization, a weaker penalty will be imposed. The penalty refers to adding an extra negative value to the energy function. The smoothing itemset A refers to the set composed of multiple smoothing terms.
[0201] Specifically, the process of identifying the candidate planar primitive set for the roof based on data itemset A, smoothing itemset A, and a pre-constructed first mathematical model includes:
[0202] Substituting the data itemset A and the smoothing itemset A into the first mathematical model, we obtain the supervoxel label set A, where the first mathematical model is as follows:
[0203] ;
[0204] in, This represents the first mathematical model. Let A be a data itemset. Let A be a smooth itemset;
[0205] Perform label merging on supervoxel label set A to obtain multiple target supervoxel sets;
[0206] For each of the multiple target supervoxel sets, perform the following operation:
[0207] Merge the multiple 3D coordinate points corresponding to each target supervoxel in the target supervoxel set to obtain the target 3D coordinate point set;
[0208] Based on the target 3D coordinate point set, plane parameters are fitted to obtain the candidate roof plane;
[0209] Summarize the candidate roof planes to obtain the primitive set of candidate roof planes.
[0210] It should be explained that substituting the data itemset A and the smoothing itemset A into the first mathematical model to obtain the supervoxel label set A means: using the maximum flow minimum cut theorem to optimize and solve the first mathematical model to generate the supervoxel label set. The method of using the maximum flow minimum cut theorem to optimize and solve the first mathematical model to generate the supervoxel label set is existing technology and will not be described in detail here.
[0211] For example, if the supervoxel tag set A is {p1:1, p2:1, p3:2, p4:2, p5:3, p6:3}, then after performing tag merging on the supervoxel tag set A, multiple target supervoxel sets are obtained as: {p1:1, p2:1}, {p3:2, p4:2}, {p5:3, p6:3}, where p1:1 means that the tag of supervoxel p1 is 1.
[0212] For example, if the target supervoxel set is {p1:1, p2:1}, where the three-dimensional coordinate points corresponding to supervoxel p1 are: a1, a2, a3, a4, a5, a6, and the three-dimensional coordinate points corresponding to supervoxel p2 are: b1, b2, b3, b4, b5, b6, then after merging the multiple three-dimensional coordinate points corresponding to each target supervoxel in the target supervoxel set, the target three-dimensional coordinate point set is obtained as {a1, a2, a3, a4, a5, a6, b1, b2, b3, b4, b5, b6}, where a1 and b1 both represent three-dimensional coordinate points.
[0213] It should be explained that the plane parameter fitting based on the target 3D coordinate point set refers to: using a plane fitting method to fit parameters to multiple 3D coordinate points in the target 3D coordinate point set, thereby obtaining four plane parameters; and identifying a plane based on these four plane parameters, which is the candidate roof plane. The candidate roof plane primitive set is a collection composed of multiple candidate roof planes.
[0214] S5. Based on the candidate plane primitive set of the roof and the centroid set of the supervoxels, the data itemset is identified. Based on the supervoxel set, the smoothing itemset is identified. Based on the candidate plane primitive set of the roof, the label itemset is identified. The data itemset, the smoothing itemset, and the label itemset are input into the pre-constructed second mathematical model to obtain the supervoxel label set.
[0215] Specifically, the data item set identified based on the candidate planar primitive set of the roof and the supervoxel centroid set includes:
[0216] Candidate planar primitives are randomly extracted from the set of candidate planar primitives for the roof;
[0217] Perform the following operation on each supervoxel centroid within the supervoxel centroid set:
[0218] The geometric distance was determined based on the centroid of the hypervoxel and candidate planar primitives;
[0219] Compare the geometric distance with a preset distance threshold. If the geometric distance is less than or equal to the distance threshold, then the geometric distance is taken as the target distance.
[0220] If the geometric distance is greater than the distance threshold, then the distance threshold is used as the target distance;
[0221] The data item is calculated based on the target distance, using the following formula:
[0222] ;
[0223] in, Represents a data item. Indicates the distance to the target;
[0224] Summarize the data items to obtain the target data item set;
[0225] Remove candidate plane primitives from the candidate plane primitive set for the roof to obtain an updated candidate plane primitive set;
[0226] The number of second plane primitives is determined based on the updated candidate plane primitive set, wherein the number of second plane primitives is the number of candidate plane primitives in the updated candidate plane primitive set;
[0227] Compare the number of second plane primitives with a preset second threshold. If the number of second plane primitives is greater than or equal to the second threshold, update the candidate plane primitive set as the candidate plane primitive set, and return to the step of randomly extracting candidate plane primitives from the roof candidate plane primitive set until the number of second plane primitives is less than the second threshold. Then, summarize the target data item set to obtain the data item set.
[0228] For example, if the set of candidate plane primitives for the roof is {m1, m2, m3, m4, m5, m6, m7}, then candidate plane primitives are randomly extracted from the set of candidate plane primitives for the roof to obtain m1.
[0229] It should be explained that the determination of geometric distance based on the centroid of the supervoxel and candidate planar primitives refers to calculating the distance from the centroid of the supervoxel to the candidate planar primitive according to the distance formula. Optionally, the point-to-plane distance formula can be used as the distance formula. The distance from the centroid of the supervoxel to the candidate planar primitive is the geometric distance. The distance threshold is a value manually set by the photovoltaic company's staff based on twice the average spacing of the input point cloud. For example, if the average spacing of the input point cloud is 0.02 meters, then the distance threshold is 0.04 meters. The target distance refers to the geometric distance less than or equal to the distance threshold. Data items reflect the probability that a supervoxel belongs to a candidate planar primitive; the smaller the data item, the greater the probability that the supervoxel belongs to a candidate planar primitive. The target data item set is a set composed of multiple data items. The second threshold is a value manually set by the photovoltaic company's staff; optionally, the second threshold is 1. The data item set is a set composed of multiple target data item sets.
[0230] For example, if the candidate plane primitive set for the roof is {m1, m2, m3, m4, m5, m6, m7} and the candidate plane primitive is m1, then after removing the candidate plane primitive from the candidate plane primitive set for the roof, the updated candidate plane primitive set is {m2, m3, m4, m5, m6, m7}.
[0231] Specifically, the identification of smooth itemsets based on the supervoxel set includes:
[0232] The first supervoxel is obtained by randomly sampling the set of supervoxels.
[0233] Based on the set of supervoxels and the first supervoxel, the adjacent sets of supervoxels are identified, wherein the adjacent sets of supervoxels include: multiple supervoxels;
[0234] For each of multiple supervoxels in adjacent supervoxel sets, perform the following operation:
[0235] The first and second centers of gravity were identified based on the first and second hypervoxels.
[0236] The spatial geometric distance is calculated based on the first and second centroids, using the following formula:
[0237] ;
[0238] in, Represents spatial geometric distance, Indicates the first center of gravity coordinate, Indicates the first center of gravity coordinate, Indicates the first center of gravity coordinate, Indicating the second center of gravity coordinate, Indicating the second center of gravity coordinate, Indicating the second center of gravity coordinate;
[0239] The second smoothing term is calculated based on the spatial geometric distance and the plane index, as shown in the following formula:
[0240] ;
[0241] in, Indicates the second smoothing term. Represents the plane index, It is a natural exponential function. Represents spatial geometric distance;
[0242] Summarize the second smoothing terms to obtain the smoothing itemset.
[0243] For example, if the set of supervoxels is {p1, p2}, then after randomly sampling the set of supervoxels, the first supervoxel obtained is either p1 or p2.
[0244] It should be explained that the "identification of adjacent supervoxel sets based on the supervoxel set and the first supervoxel" means: based on the adjacency relationships in the first supervoxel, all supervoxels that are adjacent to the first supervoxel are selected from the supervoxel set. The set of all supervoxels adjacent to the first supervoxel is the adjacent supervoxel set. The "identification of the first centroid and the second centroid based on the first supervoxel and the supervoxel" means: identifying the centroids of the supervoxels in the first supervoxel set. The first centroid refers to the centroid of the first supervoxel, and the second centroid refers to the centroid of the second supervoxel. Spatial geometric distance reflects the distance between the first supervoxel and other supervoxels; the larger the spatial geometric distance, the greater the distance between the first supervoxel and other supervoxels. The plane index is determined as follows: if two adjacent supervoxel labels are inconsistent, the plane index is 1; if two adjacent supervoxel labels are consistent, the plane index is 0.
[0245] Understandably, the second smoothing term is a function used to penalize inconsistencies between the labels of two adjacent supervoxels, constructed based on the spatial geometric distance between the first supervoxel and its adjacent supervoxels. The detailed process of penalizing inconsistencies is as follows: When the labels of two adjacent supervoxels are inconsistent, the plane index is 1. In this case, a second smoothing term greater than 0 and less than 1 is calculated based on the distance between the first and adjacent supervoxels; the closer the distance, the larger the second smoothing term. If the labels of two adjacent supervoxels are consistent, the plane index is 0, and the value of the second smoothing term is always 0. As can be seen from the above, when the labels of two adjacent supervoxels are inconsistent, the calculated second smoothing term is larger than the second smoothing term calculated when the labels of two adjacent supervoxels are consistent. Since the main operating principle of the second mathematical model is to find the label combination with the minimum energy consumption, when the second smoothing term is larger, the second mathematical model will choose the second smoothing term with lower energy, thus preventing the two adjacent supervoxels with inconsistent labels from being selected. The smoothing itemset is a set composed of multiple smoothing terms.
[0246] Specifically, the identification of the tag itemset based on the candidate roof planar primitive set includes:
[0247] For each roof candidate plane primitive in the roof candidate plane primitive set, perform the following operation:
[0248] The number of candidate points is determined based on the candidate roof plane primitive, where the number of candidate points is the number of three-dimensional coordinate points in the candidate roof plane primitive;
[0249] The label is calculated based on the number of candidate points, using the following formula:
[0250] ;
[0251] in, Indicates the label item, Indicates the number of candidate points;
[0252] Summarize the tag items to obtain the tag item set.
[0253] It should be explained that the label is a function used to penalize the number of planes, constructed based on the number of point clouds contained in each candidate plane. The detailed process of penalizing the number of planes is as follows: When the number of points contained in a candidate plane is small, for example, 1 candidate point, the calculated label value is: If the candidate plane contains a large number of points, for example, 1000 candidate points, the calculated value of the label item is: Since the main operating principle of the second mathematical model is to find the label combination with the minimum energy consumption, when the label item is large, the second mathematical model will choose the label item with smaller energy, thus preventing candidate planes containing fewer points from being selected. A label item set is a collection of multiple label items.
[0254] In detail, the second mathematical model is as follows:
[0255] ;
[0256] in, This represents the second mathematical model. Represents a data item set. Represents a smooth itemset. Represents a set of labeled items.
[0257] It should be explained that the classic α-Expansion algorithm is used to optimize and solve the second mathematical model, and the optimized supervoxels are re-estimated and re-optimized to obtain the supervoxel label set.
[0258] S6. Perform a tag merging operation on the supervoxel tag set to obtain multiple supervoxel sets. For each of the multiple supervoxel sets, perform the following operation: merge the multiple three-dimensional coordinate points corresponding to each supervoxel in the supervoxel set to obtain a three-dimensional coordinate point set.
[0259] It should be understood that the method for performing tag merging on the supervoxel tag set is the same as the method for performing tag merging on the supervoxel tag set A, and will not be described again here. Similarly, the method for merging multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set to obtain a 3D coordinate point set is the same as the method for merging multiple 3D coordinate points corresponding to each target supervoxel in the target supervoxel set to obtain a target 3D coordinate point set, and will not be described again here.
[0260] S7. Fit the plane parameters based on the three-dimensional coordinate point set to obtain the roof plane. Summarize the roof planes to obtain the roof plane set, thus completing the accurate extraction of the plane from the building roof point cloud.
[0261] It should be understood that the method for obtaining the roof plane by fitting plane parameters based on the set of three-dimensional coordinate points is the same as the method for obtaining the candidate roof plane by fitting plane parameters based on the target set of three-dimensional coordinate points, and will not be repeated here. The roof plane set is a collection of multiple roof planes.
[0262] For example, after obtaining the roof plan set, Xiao Zhang completed the accurate extraction of the plane from the point cloud of the building roof.
[0263] To address the problems described in the background art, this invention acquires a 3D point cloud of a roof and inputs it into a pre-constructed point cloud segmentation model to obtain a set of supervoxels. The set of supervoxels includes multiple supervoxels, and each supervoxel contains multiple 3D coordinate points. This invention significantly reduces data complexity by grouping point cloud data into local units with similar characteristics through supervoxelization, while preserving key geometric information. Furthermore, based on the supervoxel set, the thickness feature set and the supervoxel centroid set are identified. This invention provides a quantitative basis for subsequent planar primitive identification and screening by extracting key features of the thickness distribution and centroid position of supervoxels. The thickness feature set and a preset thickness threshold are used to confirm... The first candidate planar primitive set is generated. It can be seen that this embodiment of the invention uses thickness features for preliminary screening, quickly eliminating regions that clearly do not conform to planar characteristics, thus improving processing efficiency. Based on the supervoxel set and a pre-constructed random sampling method, a second candidate planar primitive set is identified. It can be seen that this embodiment of the invention introduces the random sampling consistency principle to enhance robustness to noise and outliers, ensuring the comprehensive discovery of potential planar primitives. The first and second candidate planar primitive sets are merged to obtain the first candidate planar primitive set for the roof. It can be seen that this embodiment of the invention significantly improves the recall rate and coverage integrity of candidate planes by fusing the detection results of rule-based screening and random sampling methods. Based on the first candidate planar primitive set and the supervoxel set for the roof, a number of... According to itemset A, it can be seen that this embodiment of the invention constructs data items to evaluate the fitting degree between candidate planes and the original point cloud, providing accurate objective function input for subsequent optimization. Based on the first candidate plane primitive set of the roof, the smoothing itemset A is identified. It can be seen that this embodiment of the invention promotes spatial smoothness and consistency of the segmentation results by establishing constraint terms for the continuity of plane parameters between adjacent supervoxels. Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate plane primitive set of the roof is identified. It can be seen that this embodiment of the invention achieves accurate screening and optimization of the candidate plane set by comprehensively balancing fitting accuracy and smoothness constraints using an optimization model. Based on the candidate plane primitive set of the roof and the supervoxel centroid set, the data itemset is identified. It can be seen that this embodiment of the invention combines the centroid position... The information refinement of data item calculations enhances the accuracy and stability of plane parameter estimation. A smooth itemset is identified based on the supervoxel set. This embodiment of the invention effectively avoids plane over-segmentation and fragmentation by constructing spatial smoothness constraints based on supervoxel adjacency relationships. A label itemset is identified based on the candidate plane primitive set of rooftops. This embodiment of the invention guides the classification results to aggregate towards semantically consistent regions by establishing consistency constraints on plane labels. The data itemset, smooth itemset, and label itemset are input into a pre-constructed second mathematical model to obtain the supervoxel label set. This embodiment of the invention achieves globally optimal label allocation by employing advanced mathematical models such as graph optimization, ensuring the accuracy and rationality of plane segmentation results. A label merging operation is performed on the supervoxel label set.Multiple supervoxel sets are obtained. This embodiment of the invention merges adjacent and homogeneous supervoxels to form semantically complete planar regions, eliminating redundant segmentation. For each supervoxel set, the following operations are performed: multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a set of 3D coordinate points. This embodiment of the invention integrates all point cloud data belonging to the same plane, preparing complete samples for accurate plane parameter fitting. Planar parameter fitting is performed based on the 3D coordinate point set to obtain the roof plane. This embodiment of the invention uses least squares fitting algorithms to accurately calculate plane equation parameters from point cloud data, achieving accurate reconstruction of the geometric plane. The roof planes are summarized to obtain a roof plane set, completing the accurate extraction of the plane from the building roof point cloud. This embodiment of the invention systematically integrates all extracted planar structures to form a complete roof plane model, providing a reliable data foundation for applications such as 3D reconstruction and building surveying, and improving the accuracy of roof plane extraction. Therefore, this invention can improve the accuracy of roof plane extraction.
[0264] like Figure 2 The diagram shown is a functional block diagram of a roof plane accurate extraction system based on scene geometric relationship constraints provided in an embodiment of the present invention.
[0265] The roof plan precise extraction system 100 based on scene geometric relationship constraints described in this invention can be installed in an electronic device. Depending on the functions implemented, the roof plan precise extraction system 100 may include a roof point cloud acquisition module 101, a candidate plan confirmation module 102, a roof label confirmation module 103, and a roof plan extraction module 104. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and is stored in the memory of the electronic device.
[0266] The roof point cloud acquisition module 101 is used to acquire the three-dimensional point cloud of the roof, input the three-dimensional point cloud of the roof into the pre-constructed point cloud segmentation model to obtain a set of super voxels, wherein the set of super voxels includes multiple super voxels, and each super voxel contains multiple three-dimensional coordinate points. Based on the set of super voxels, the set of thickness feature values and the set of super voxel centroids are identified.
[0267] The candidate plane confirmation module 102 is used to confirm a first candidate plane primitive set based on a set of thickness feature values and a preset thickness threshold, confirm a second candidate plane primitive set based on a set of supervoxels and a pre-constructed random sampling method, merge the first candidate plane primitive set and the second candidate plane primitive set to obtain the first candidate plane primitive set for the roof; confirm a data itemset A based on the first candidate plane primitive set for the roof and the set of supervoxels, confirm a smoothing itemset A based on the first candidate plane primitive set for the roof, and confirm the candidate plane primitive set for the roof based on the data itemset A, the smoothing itemset A and the pre-constructed first mathematical model;
[0268] The roof label confirmation module 103 is used to confirm the data item set based on the roof candidate plane primitive set and the super voxel centroid set, confirm the smooth item set based on the super voxel set, and confirm the label item set based on the roof candidate plane primitive set. The data item set, smooth item set and label item set are input into the pre-constructed second mathematical model to obtain the super voxel label set.
[0269] The roof plane extraction module 104 is used to perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets. For each supervoxel set, the following operations are performed: merge the multiple three-dimensional coordinate points corresponding to each supervoxel in the supervoxel set to obtain a three-dimensional coordinate point set; perform plane parameter fitting based on the three-dimensional coordinate point set to obtain the roof plane; summarize the roof planes to obtain the roof plane set, thus completing the accurate extraction of the plane from the building roof point cloud.
[0270] In detail, the modules in the roof plan precision extraction system 100 based on scene geometric relationship constraints described in this embodiment of the invention employ the same methods as described above. Figure 1 The method used here is the same as the method for accurately extracting the roof plane based on scene geometric relationship constraints, and can produce the same technical effect, so it will not be repeated here.
[0271] like Figure 3 The diagram shown is a structural schematic of an electronic device that implements a method for accurately extracting roof planes based on scene geometric relationship constraints, according to an embodiment of the present invention.
[0272] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a method program for accurately extracting roof planes based on scene geometric constraints.
[0273] The memory 11 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. Furthermore, the memory 11 includes both internal storage units and external storage devices of the electronic device 1. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 1, such as the code of a method for accurately extracting roof planes based on scene geometric constraints, but also to temporarily store data that has been output or will be output.
[0274] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., a method for accurately extracting roof planes based on scene geometric constraints) and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
[0275] The bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 can be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0276] Figure 3 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0277] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0278] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the electronic device 1 and other electronic devices.
[0279] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.
[0280] The program for accurately extracting the roof plane based on scene geometric constraints, stored in the memory 11 of the electronic device 1, is a combination of multiple instructions. When run in the processor 10, it can achieve the following:
[0281] Obtain the 3D point cloud of the roof and input it into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points.
[0282] The set of thickness eigenvalues and the set of supervoxel centroids were identified based on the set of supervoxels.
[0283] The first candidate planar primitive set is identified based on the thickness feature set and the preset thickness threshold.
[0284] The second candidate set of planar primitives was identified based on the supervoxel set and a pre-constructed random sampling method;
[0285] Merge the first candidate planar primitive set and the second candidate planar primitive set to obtain the first candidate planar primitive set for the roof.
[0286] Data item set A was identified based on the first candidate planar primitive set and the supervoxel set of the roof;
[0287] Based on the first candidate planar primitive set of the roof, the smooth itemset A is identified;
[0288] Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate planar primitive set for the roof was identified.
[0289] The data item set was identified based on the candidate planar primitive set of the roof and the centroid set of the supervoxels.
[0290] The smooth itemset was identified based on the hypervoxel set;
[0291] The set of labeled itemsets was identified based on the candidate planar primitive set of the roof;
[0292] The data itemset, smoothing itemset, and label itemset are input into the pre-constructed second mathematical model to obtain the supervoxel label set;
[0293] Perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets;
[0294] Perform the following operation on each of the multiple supervoxel sets:
[0295] The multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a 3D coordinate point set;
[0296] The roof plane is obtained by fitting plane parameters based on the three-dimensional coordinate point set;
[0297] By summarizing the roof planes, a set of roof planes is obtained, enabling accurate extraction of the planes from the point cloud of building roofs.
[0298] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figures 1 to 3 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0299] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may 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, or a read-only memory (ROM).
[0300] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0301] Obtain the 3D point cloud of the roof and input it into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points.
[0302] The set of thickness eigenvalues and the set of supervoxel centroids were identified based on the set of supervoxels.
[0303] The first candidate planar primitive set is identified based on the thickness feature set and the preset thickness threshold.
[0304] The second candidate set of planar primitives was identified based on the supervoxel set and a pre-constructed random sampling method;
[0305] Merge the first candidate planar primitive set and the second candidate planar primitive set to obtain the first candidate planar primitive set for the roof.
[0306] Data item set A was identified based on the first candidate planar primitive set and the supervoxel set of the roof;
[0307] Based on the first candidate planar primitive set of the roof, the smooth itemset A is identified;
[0308] Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate planar primitive set for the roof was identified.
[0309] The data item set was identified based on the candidate planar primitive set of the roof and the centroid set of the supervoxels.
[0310] The smooth itemset was identified based on the hypervoxel set;
[0311] The set of labeled itemsets was identified based on the candidate planar primitive set of the roof;
[0312] The data itemset, smoothing itemset, and label itemset are input into the pre-constructed second mathematical model to obtain the supervoxel label set;
[0313] Perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets;
[0314] Perform the following operation on each of the multiple supervoxel sets:
[0315] The multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a 3D coordinate point set;
[0316] The roof plane is obtained by fitting plane parameters based on the three-dimensional coordinate point set;
[0317] By summarizing the roof planes, a set of roof planes is obtained, enabling accurate extraction of the planes from the point cloud of building roofs.
[0318] In the embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and actual implementations may have other classification methods.
[0319] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0320] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0321] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0322] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for accurately extracting roof planes based on scene geometric constraints, characterized in that, The method includes: Obtain the 3D point cloud of the roof and input it into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points. The set of thickness eigenvalues and the set of supervoxel centroids were identified based on the set of supervoxels. The first candidate planar primitive set is identified based on the thickness feature set and the preset thickness threshold. The second candidate set of planar primitives was identified based on the supervoxel set and a pre-constructed random sampling method; Merge the first candidate planar primitive set and the second candidate planar primitive set to obtain the first candidate planar primitive set for the roof. Data item set A was identified based on the first candidate planar primitive set and the supervoxel set of the roof; Based on the first candidate planar primitive set of the roof, the smooth itemset A is identified; Based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, the candidate planar primitive set for the roof was identified. The data item set was identified based on the candidate planar primitive set of the roof and the centroid set of the supervoxels. The smooth itemset was identified based on the hypervoxel set; The set of labeled itemsets was identified based on the candidate planar primitive set of the roof; The data itemset, smoothing itemset, and label itemset are input into the pre-constructed second mathematical model to obtain the supervoxel label set; Perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets; Perform the following operation on each of the multiple supervoxel sets: The multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set are merged to obtain a 3D coordinate point set; The roof plane is obtained by fitting plane parameters based on the three-dimensional coordinate point set; By summarizing the roof planes, a set of roof planes is obtained, enabling accurate extraction of the planes from the point cloud of building roofs.
2. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 1, characterized in that, The determination of the thickness feature set and the supervoxel centroid set based on the supervoxel set includes: For each supervoxel in the supervoxel set, perform the following operation: The point coordinate vector set is determined based on the hypervoxel, which includes multiple three-dimensional coordinate point vectors; Calculate the centroid of the hypervoxel based on multiple three-dimensional coordinate point vectors; Construct a hypervoxel matrix based on multiple three-dimensional coordinate point vectors and hypervoxel centroids; The eigenvalues were identified based on the hypervoxel matrix, including: the first eigenvalue, the second eigenvalue, and the third eigenvalue. The thickness characteristic value is calculated based on the first characteristic value, the second characteristic value, and the third characteristic value; Summarize the thickness feature values to obtain the thickness feature value set; By summing the centroids of hypervoxels, we obtain the hypervoxel centroid set.
3. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 2, characterized in that, The process of identifying the first candidate planar primitive set based on the thickness feature value set and a preset thickness threshold includes: For each thickness feature value in the set of thickness feature values, perform the following operation: Compare the thickness feature value with the thickness threshold. If the thickness feature value is less than the thickness threshold, then the hypervoxel corresponding to the thickness feature value is taken as the first candidate hypervoxel. Multiple three-dimensional coordinate points in the first candidate hypervoxel are fitted to obtain the first candidate planar primitive, which includes: a first basic parameter, a second basic parameter, a third basic parameter, and a fourth basic parameter; Summarize the first candidate planar primitives to obtain the first candidate planar primitive set.
4. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 3, characterized in that, The method based on the supervoxel set and pre-constructed random sampling identifies a second candidate set of planar primitives, including: The set of supervoxels was sampled with replacement using a random sampling method to obtain the centroids of four supervoxels. The second candidate planar primitive was identified based on the centroids of the four supervoxels. The second candidate planar primitive includes: a first fitting parameter, a second fitting parameter, a third fitting parameter, and a fourth fitting parameter. The second candidate planar primitive is placed into the pre-constructed empty set to obtain the primitive set; The number of primitives is determined based on the primitive set, where the number of primitives is the number of second candidate planar primitives in the primitive set; Compare the number of primitives with a preset threshold. If the number of primitives is less than the threshold, return to the step of sampling the supervoxel set with replacement using a random sampling method until the number of primitives is greater than or equal to the threshold. Then, use the primitive set as the second candidate planar primitive set.
5. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 4, characterized in that, The data itemset A identified based on the first candidate planar primitive set and the supervoxel set of the roof includes: For each supervoxel in the supervoxel set, perform the following operation: The number of coordinate points is determined based on the hypervoxel, where the number of coordinate points is the number of multiple three-dimensional coordinate points contained in the hypervoxel; Compare the number of coordinate points with a preset first threshold. If the number of coordinate points is less than the preset first threshold, then perform the following operation on each of the first candidate plane primitives in the first candidate plane primitive set for the roof: The x-coordinate, y-coordinate, and z-coordinate of the centroid were determined based on the hypervoxel. The first parameter, second parameter, third parameter, and fourth parameter were identified based on the first candidate planar primitive of the roof. Calculate the first geometric distance based on the centroid x-coordinate, centroid y-coordinate, centroid z-coordinate, first parameter, second parameter, third parameter, and fourth parameter; Summarize the first geometric distances to obtain the first geometric distance set; If the number of coordinate points is greater than or equal to the first threshold, then the preset planar residual threshold is used as the second geometric distance; By summing the first geometric distance set and the second geometric distance set respectively, multiple first geometric distance sets and second geometric distance sets are obtained; Multiple first geometric distance sets and second geometric distance sets are merged to obtain data item set A.
6. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 5, characterized in that, The smooth itemset A identified based on the first candidate planar primitive set of the roof includes: Based on the first candidate plane primitive set of the roof, multiple candidate plane pairs were identified. The candidate plane pairs include: a first candidate plane and a second candidate plane. The first candidate plane includes: candidate coefficient 1, candidate coefficient 2, and candidate coefficient 3. The second candidate plane includes: candidate coefficient 21, candidate coefficient 22, and candidate coefficient 23. For each of the multiple candidate plane pairs, perform the following operation: Calculate the first unit normal vector based on the candidate coefficients 1-1, 2-1, and 3-1 in the first candidate plane of the candidate plane pair. Calculate the second unit normal vector based on the candidate 2-1 coefficient, the candidate 2-2 coefficient, and the candidate 2-3 coefficient in the second candidate plane of the first candidate plane pair; Calculate the candidate angles based on the first unit normal vector and the second unit normal vector; Calculate the angle constraint index value based on the candidate angles; Calculate the smoothing term based on the angle constraint index value; Summarize the smoothed items to obtain the smoothed itemset A.
7. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 6, characterized in that, The candidate planar primitive set for the roof, identified based on data itemset A, smoothing itemset A, and the pre-constructed first mathematical model, includes: Substituting the data itemset A and the smoothing itemset A into the first mathematical model, we obtain the supervoxel label set A; Perform label merging on supervoxel label set A to obtain multiple target supervoxel sets; For each of the multiple target supervoxel sets, perform the following operation: Merge the multiple 3D coordinate points corresponding to each target supervoxel in the target supervoxel set to obtain the target 3D coordinate point set; Based on the target 3D coordinate point set, plane parameters are fitted to obtain the candidate roof plane; Summarize the candidate roof planes to obtain the primitive set of candidate roof planes.
8. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 7, characterized in that, The data item set identified based on the candidate planar primitive set of the roof and the supervoxel centroid set includes: Candidate planar primitives are randomly extracted from the set of candidate planar primitives for the roof; Perform the following operation on each supervoxel centroid within the supervoxel centroid set: The geometric distance was determined based on the centroid of the hypervoxel and candidate planar primitives; Compare the geometric distance with a preset distance threshold. If the geometric distance is less than or equal to the distance threshold, then the geometric distance is taken as the target distance. If the geometric distance is greater than the distance threshold, then the distance threshold is used as the target distance; Calculate data items based on target distance; Summarize the data items to obtain the target data item set; Remove candidate plane primitives from the candidate plane primitive set for the roof to obtain an updated candidate plane primitive set; The number of second plane primitives is determined based on the updated candidate plane primitive set, wherein the number of second plane primitives is the number of candidate plane primitives in the updated candidate plane primitive set; Compare the number of second plane primitives with a preset second threshold. If the number of second plane primitives is greater than or equal to the second threshold, update the candidate plane primitive set as the candidate plane primitive set, and return to the step of randomly extracting candidate plane primitives from the roof candidate plane primitive set until the number of second plane primitives is less than the second threshold. Then, summarize the target data item set to obtain the data item set.
9. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 8, characterized in that, The process of identifying smooth itemsets based on supervoxel sets includes: The first supervoxel is obtained by randomly sampling the set of supervoxels. Based on the set of supervoxels and the first supervoxel, the adjacent sets of supervoxels are identified, wherein the adjacent sets of supervoxels include: multiple supervoxels; For each of multiple supervoxels in adjacent supervoxel sets, perform the following operation: The first and second centers of gravity were identified based on the first and second hypervoxels. Calculate the spatial geometric distance based on the first and second centroids; The second smoothing term is calculated based on the spatial geometric distance and the plane index, as shown in the following formula: ; in, Indicates the second smoothing term. Represents the plane index, It is a natural exponential function. Represents spatial geometric distance; Summarize the second smoothing terms to obtain the smoothing itemset.
10. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 9, characterized in that, The tag itemset identified based on the candidate roof planar primitive set includes: For each roof candidate plane primitive in the roof candidate plane primitive set, perform the following operation: The number of candidate points is determined based on the candidate roof plane primitive, where the number of candidate points is the number of three-dimensional coordinate points in the candidate roof plane primitive; Calculate the label item based on the number of candidate points; Summarize the tag items to obtain the tag item set.
11. The method for accurate extraction of roof plane based on scene geometric relationship constraints as described in claim 10, characterized in that, The second mathematical model is shown below: ; in, This represents the second mathematical model. Represents a data item set. Represents a smooth itemset. Represents a set of labeled items.
12. A system for accurately extracting roof planes based on scene geometric constraints, characterized in that, The system includes: The roof point cloud acquisition module is used to acquire the 3D point cloud of the roof. The 3D point cloud of the roof is input into the pre-constructed point cloud segmentation model to obtain a set of super voxels. The set of super voxels includes multiple super voxels, and each super voxel contains multiple 3D coordinate points. The thickness feature value set and the super voxel centroid set are determined based on the set of super voxels. The candidate plane confirmation module is used to confirm a first candidate plane primitive set based on a set of thickness feature values and a preset thickness threshold, and to confirm a second candidate plane primitive set based on a set of supervoxels and a pre-constructed random sampling method. The first candidate plane primitive set and the second candidate plane primitive set are merged to obtain the first candidate plane primitive set for the roof. Based on the first candidate plane primitive set for the roof and the set of supervoxels, a data itemset A is confirmed. Based on the first candidate plane primitive set for the roof, a smoothing itemset A is confirmed. Based on the data itemset A, the smoothing itemset A, and the pre-constructed first mathematical model, the candidate plane primitive set for the roof is confirmed. The roof label confirmation module is used to confirm the data itemset based on the roof candidate plane primitive set and the super voxel centroid set, confirm the smooth itemset based on the super voxel set, and confirm the label itemset based on the roof candidate plane primitive set. The data itemset, smooth itemset and label itemset are input into the pre-constructed second mathematical model to obtain the super voxel label set. The roof plane extraction module is used to perform a label merging operation on the supervoxel label set to obtain multiple supervoxel sets. For each of the multiple supervoxel sets, the following operations are performed: merge the multiple 3D coordinate points corresponding to each supervoxel in the supervoxel set to obtain a 3D coordinate point set; perform plane parameter fitting based on the 3D coordinate point set to obtain the roof plane; summarize the roof planes to obtain the roof plane set, thus completing the accurate extraction of the plane from the building roof point cloud.