Methods, devices, equipment, and storage media for roof surface recognition in 3D building models
By combining the characteristics of the average slope and the number of triangular faces, and through automatic or manual merging, the problem of insufficient efficiency and accuracy in the recognition of roof surfaces of 3D building models is solved, achieving a dynamic balance between automated recognition and manual fitting, thus improving recognition efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 赛瓦软件(上海)有限公司
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies for recognizing roof surfaces of 3D building models are inefficient and lack accuracy, relying mainly on manual operation, which leads to low efficiency and low accuracy.
By combining the multi-dimensional features of the average slope and the number of triangular faces, automatic or manual merging methods are used to automatically identify the triangles by utilizing the coordinates of the corner vertices. By combining the normal vectors of adjacent triangles and the average slope, automatic merging or manual fitting is achieved, thereby improving the efficiency and accuracy of identification.
It achieves accurate identification of complex roof surfaces and rapid merging of simple roof surfaces, reduces redundant calculations, improves the automation and ease of operation of the identification process, adapts to different building model scenarios, and improves the efficiency and accuracy of roof surface identification.
Smart Images

Figure CN122336737A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer processing technology, and in particular to a method, apparatus, device, and storage medium for identifying the roof surface of a three-dimensional building model. Background Technology
[0002] With the rapid development of 3D modeling technology, 3D building models are increasingly widely used in fields such as architectural design, urban planning, and scene simulation. As a core component of building models, the accurate identification and efficient extraction of the roof surface are fundamental prerequisites for subsequent 3D scene processing and architectural analysis.
[0003] Currently, most existing roof surface recognition technologies rely on manual operation, where users manually mark the roof area on the 3D model after importing it to complete the roof surface recognition. This manual marking method leads to certain deficiencies in the efficiency and accuracy of roof surface recognition for 3D building models. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for roof surface recognition of three-dimensional building models, so as to improve the efficiency and accuracy of roof surface recognition of three-dimensional building models.
[0005] According to one aspect of the present invention, a method for roof surface recognition of a three-dimensional building model is provided, the method comprising:
[0006] In response to the target user's uploaded target 3D building model based on the front-end interactive interface, the target 3D building model is parsed to obtain several triangular faces;
[0007] Based on the coordinates of each vertex corresponding to each of the aforementioned triangular faces, and the number of triangular faces corresponding to each of the aforementioned triangular faces, the target roof surface merging method is determined;
[0008] If the target roof surface merging method is automatic merging, then at least one pair of adjacent triangular surfaces are determined according to the coordinates of each vertex corresponding to each of the triangular surfaces;
[0009] The triangular faces to be merged are determined based on the coordinates of the corner vertices of each pair of adjacent triangular faces.
[0010] The triangular faces to be merged are merged to obtain the target merged face;
[0011] Determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than a preset area threshold, then the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0012] According to another aspect of the present invention, a roof surface recognition device for a three-dimensional building model is provided, the device comprising:
[0013] The model parsing module is used to respond to the target 3D building model uploaded by the target user based on the front-end interactive interface, and to parse the target 3D building model to obtain several triangular faces;
[0014] The merging method determination module is used to determine the merging method of the target roof surface based on the coordinates of each vertex corresponding to each of the triangles and the number of triangles corresponding to each triangle.
[0015] The adjacent triangular face determination module is used to determine at least one pair of adjacent triangular faces based on the coordinates of each vertex corresponding to each of the triangular faces if the target roof surface merging method is automatic merging.
[0016] The module for determining the triangles to be merged is used to determine the triangles to be merged based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles.
[0017] The triangle merging module is used to merge the triangles to be merged to obtain the target merged face.
[0018] The model roof surface determination module is used to determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than a preset area threshold, the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] At least one processor; and
[0021] A memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the roof surface recognition method for a three-dimensional building model according to any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the roof surface recognition method of a three-dimensional building model according to any embodiment of the present invention.
[0024] The technical solution of this invention automatically determines whether to use a manual or automatic merging method by combining multi-dimensional features such as the average slope and the number of triangular faces. This satisfies the roof recognition needs of varying complexity and improves operational flexibility. The automatic merging mode achieves accurate recognition and automatic merging of complex roof surfaces based on the coordinates of each vertex corresponding to each triangular face, ensuring the accuracy of complex roof recognition. The manual merging method allows users to quickly fit the roof surface by manually simplifying and marking points, achieving rapid merging of simple roof surfaces. This significantly reduces redundant calculations and operation time. The automatic switching mechanism between manual and automatic modes eliminates the subjectivity and tedious operation of manual mode selection, achieving a dynamic balance between efficient recognition of simple roofs and accurate recognition of complex roofs. This improves the automation and ease of operation of the recognition process, while also taking into account the adaptability to different building model scenarios, thus improving the efficiency and accuracy of roof surface recognition for 3D building models.
[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 1 of the present invention;
[0028] Figure 2 This is a flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 2 of the present invention;
[0029] Figure 3 This is a flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 3 of the present invention;
[0030] Figure 4 This is a schematic diagram of the structure of a roof surface recognition device for a three-dimensional building model according to Embodiment 4 of the present invention;
[0031] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the roof surface recognition method for three-dimensional building models according to embodiments of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] Example 1
[0035] Figure 1 This is a flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 1 of the present invention. This embodiment is applicable to the automated, efficient, and accurate identification of the roof area in a three-dimensional building model. The method can be executed by a roof surface identification device for the three-dimensional building model, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0036] S110. Responding to the target 3D building model uploaded by the target user based on the front-end interactive interface, and performing model analysis on the target 3D building model to obtain several triangular faces.
[0037] S120. Based on the coordinates of each vertex corresponding to each triangle and the number of triangles corresponding to each triangle, determine the merging method of the target roof surface.
[0038] S130. If the target roof surface merging method is automatic merging, then at least one pair of adjacent triangular surfaces are determined based on the coordinates of each corner vertex corresponding to each triangular surface.
[0039] S140. Determine the triangular faces to be merged based on the coordinates of the corner vertices of each pair of adjacent triangular faces.
[0040] S150. Merge the triangular faces to be merged to obtain the target merged face.
[0041] S160. Determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than the preset area threshold, then the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0042] The target users can be those who require roof area or roof surface identification in the architectural model, such as technical personnel involved in model development. The target 3D architectural model can be a 3D model file imported from an external source, displayed to the user through the front-end interactive interface. Rendering and interaction of the 3D architectural model can be achieved using WebGL (Web Graphics Library) technology. Model file formats can include OBJ (Object File Format) and FBX (Filmbox), among others.
[0043] It should be noted that the target 3D building model can be a model uploaded by the target user in real time, or it can be a model uploaded by the target user and then processed in batches. This embodiment does not impose any restrictions on this.
[0044] Specifically, the target 3D building model is analyzed, the geometric structure data in the model is disassembled, irrelevant material and texture redundant information is removed, all the triangular faces contained in the target 3D building model are obtained, and the three-dimensional coordinates of the three vertices of each triangular face are extracted, that is, the corner vertex coordinates (x, y, z).
[0045] The number of triangular faces in the target 3D building model is determined, and the roof surface merging method is determined based on the coordinates of each vertex and the number of triangular faces. The roof surface merging method can include automatic merging and manual merging. For example, the target user can select the roof surface merging method according to their needs; that is, the target user can choose the roof surface merging method used for identifying the roof surface of the target 3D building model. Furthermore, to improve the efficiency of roof surface recognition, the target roof surface merging method can be automatically determined according to different requirement scenarios.
[0046] In one optional embodiment, the target roof surface merging method is determined based on the coordinates of each vertex corresponding to each triangular face and the number of triangular faces corresponding to each triangular face. This includes: for any triangular face, determining the slope value corresponding to the triangular face based on the coordinates of each vertex corresponding to the triangular face; determining the average slope value based on the slope value corresponding to each triangular face; if the average slope value is not greater than a preset average slope value threshold and the number of triangular faces is not greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be manual merging; if the average slope value is greater than a preset average slope value threshold, or the number of triangular faces is greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be automatic merging.
[0047] Specifically, for any triangular face, based on the coordinates of each vertex of that triangular face... , and Determine the normal vector of the triangle. In which, the two edge vectors of the triangular face and They are respectively:
[0048]
[0049]
[0050] Cross product of normal vectors: The expanded form is as follows:
[0051]
[0052]
[0053]
[0054] Based on the Z-axis component of the normal vector of the triangle face The slope value S corresponding to the triangular face can be determined:
[0055]
[0056] Based on the slope values corresponding to each triangular facet, the average slope can be determined by averaging the slope values of all triangular faces. Then, based on the average slope and the number of triangular faces, and using preset thresholds for the average slope and the number of triangular faces, the method for merging the target roof surfaces is determined. The average slope threshold and the number of triangular faces threshold can be preset by relevant technical personnel according to actual needs; for example, the average slope threshold can be set to 30°, and the number of triangular faces threshold can be set to 500.
[0057] If the average slope is not greater than the preset average slope threshold and the number of triangular faces is not greater than the preset number of triangular faces threshold, then the roof type corresponding to the target 3D building model can be determined to be a simple roof, such as a common double-slope house or a flat roof. Therefore, the target roof surface merging method can be determined to be manual merging.
[0058] If the average slope is greater than the preset average slope threshold, or the number of triangular faces is greater than the preset number of triangular faces threshold, then the roof type corresponding to the target 3D building model can be determined to be a complex roof, such as a multi-slope villa or an irregularly shaped pitched roof. Therefore, the target roof surface merging method can be determined to be automatic merging.
[0059] The above technical solution determines the complexity of a roof by using the average slope of the triangular facets and the number of triangular faces as dual features. It automatically matches and merges roofs in either an automatic or manual merging mode. The average slope of the triangular facets quickly distinguishes between flat roofs, simple low-slope roofs, and complex high-slope roofs. The number of triangular faces accurately distinguishes between small roofs with simple structures and low triangular facet redundancy and complex structures. This allows simple roofs to automatically trigger a simplified manual fitting mode, significantly reducing redundant calculations and shortening recognition time. Meanwhile, complex roofs automatically trigger a multi-feature fusion and automatic merging mode, effectively ensuring the recognition accuracy of complex slopes and multi-slope structures, and completely avoiding the subjectivity, errors, and cumbersome operation problems of manual mode selection.
[0060] If the target roof surface merging method is automatic merging, then at least one pair of adjacent triangular faces is determined based on the coordinates of each vertex corresponding to each triangular face. For any two triangular faces, it is determined whether the two triangular faces have the same vertex or the same edge. If so, the two triangular faces are determined to be adjacent; otherwise, they are determined to be non-adjacent. Based on the above determination method, at least one pair of adjacent triangular faces can be obtained, and each pair of adjacent triangular faces includes two triangular faces that are adjacent to each other.
[0061] The triangles to be merged can be determined based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles. The number of triangles to be merged is at least two. In one optional embodiment, determining the triangles to be merged based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles includes: for any pair of adjacent triangles, determining the normalized normal vector corresponding to each triangle based on the coordinates of the corner vertices of each triangle in the adjacent triangles; and determining the triangles to be merged based on the normalized normal vectors corresponding to each triangle in each pair of adjacent triangles.
[0062] Based on the above method, by analyzing the triangular face normals of each triangle, we can obtain the triangular face normals corresponding to each of the adjacent triangles. We then normalize these normalized normals to obtain the normalized normals for each triangle. Based on these normalized normals, we determine the triangles to be merged.
[0063] Optionally, the triangles to be merged are determined based on the normalized normal vectors corresponding to each of the adjacent triangles, including: for any adjacent triangle, determining the angle between the normal vectors of the adjacent triangles based on the normalized normal vectors of each of the adjacent triangles; and determining the triangles to be merged based on a preset angle threshold for the normal vectors, based on the angle between the normal vectors of each of the adjacent triangles; wherein the angle threshold for the normal vectors is determined based on the number of triangles.
[0064] For any adjacent triangular facets, assume that these adjacent triangular facets include triangle A and triangle B. The normalized normal vector corresponding to triangle A is... The normalized normal vector corresponding to triangle B is Then the angle between the normal vectors of triangular faces A and B in adjacent triangular faces is... for:
[0065]
[0066]
[0067] The threshold for the included angle of the normal vector can be predetermined by relevant technical personnel according to actual needs. For example, the threshold for the included angle of the normal vector can be set to 5°.
[0068] Specifically, if the angle between the normal vectors of adjacent triangular faces A and B is... If the angle between the normal vectors is less than the threshold, then triangle A and triangle B can be determined to have the same normal vector, and triangle A and triangle B are identified as triangles to be merged. If the angle between the normal vectors of adjacent triangles A and B is less than the threshold, then triangle A and triangle B are considered to be merged. If the angle between the normal vectors is not less than the threshold, then it can be determined that the normal vectors of triangle A and triangle B are inconsistent, and triangle A and triangle B are not triangles to be merged.
[0069] Based on the above method, all adjacent triangles can be evaluated one by one to obtain several triangles to be merged. It should be noted that, assuming that when traversing adjacent triangles A and B, based on the above determination relationship, triangles A and B have the same normal vector, and therefore are not triangles to be merged. This determination is limited to the evaluation period for triangles A and B. Assuming that during the traversal of adjacent triangles, adjacent triangles B and C satisfy the determination condition of consistent normal vectors, then triangles B and C are determined to be triangles to be merged. Within the evaluation period for adjacent triangles B and C, if triangle B is determined to be a triangle to be merged, then triangle B is still considered a triangle to be merged.
[0070] To further enable dynamic determination of the normal vector angle threshold, the normal vector angle threshold can be dynamically adjusted based on the subsequent target roof surface merging results, or it can be dynamically adjusted before the determination is made based on the normal vector angle threshold. Specifically, the normal vector angle threshold can be dynamically set according to the number of triangular faces. If the number of triangular faces is greater than a preset threshold, it indicates that the triangular faces in the target 3D building model are relatively densely distributed; in this case, the normal vector angle threshold can be set to 2°~3°. If the number of triangular faces is not greater than the preset threshold, it indicates that the triangular faces in the target 3D building model are relatively dispersed; in this case, the normal vector angle threshold can be set to 3°~6°. The preset threshold can be pre-set by relevant technical personnel, for example, it can be set to 500 faces.
[0071] The above technical solution calculates the angle between the normalized normal vectors of adjacent triangular faces and filters the triangular faces to be merged based on a preset angle threshold. The normalized normal vector completely eliminates the interference of triangular face area differences on direction determination, thereby ensuring that the angle calculation only reflects the essential differences in the direction of the triangular faces. This avoids misjudgments caused by different triangular face sizes and avoids the problem of low accuracy in roof surface merging caused by omissions due to small direction errors, thus improving the accuracy and completeness of roof surface merging.
[0072] The process involves merging the triangular faces to be merged to obtain the target merged face. Specifically, the outer boundaries of all triangular faces to be merged are fitted, and the vertices are sorted clockwise or counterclockwise to generate a single closed target merged face. The area of the target merged face is determined. If the area of the merged face is greater than a preset area threshold, it is determined to be a valid merged face and is designated as the roof surface of the target 3D building model. If the area of the merged face is not greater than the preset area threshold, it is determined to be an invalid merged face and cannot be used as the roof surface of the target 3D building model. In this case, manual annotation prompts are generated, and the target user manually annotates and generates the roof surface of the target 3D building model. The area threshold can be preset by relevant technical personnel according to actual needs.
[0073] In an optional embodiment, after determining the target roof surface merging method based on the coordinates of each vertex corresponding to each triangle and the number of triangles corresponding to each triangle, the method further includes: if the target roof surface merging method is manual merging, sending a manual merging prompt message to the target user through the front-end interactive interface, so that the target user can click on the target 3D building model based on the manual merging prompt message to obtain at least three click point coordinates; generating a target merging surface based on each click point coordinate and a preset polygon fitting algorithm based on the click point coordinates, and determining the target merging surface as the roof surface of the target 3D building model.
[0074] The manual merging prompt can be a text prompt or a voice prompt to prompt the target user to perform manual merging; this embodiment does not impose any restrictions on this.
[0075] Specifically, when the target roof surface merging method is determined to be manual merging, a manual merging prompt message is sent to the target user through the front-end interactive interface. Based on this prompt, the target user can then click on the target 3D building model on the front-end interactive interface to select roof surface boundary points. The coordinates of at least three click points selected by the target user are collected in real time. These coordinates are then sorted clockwise or counterclockwise to form a closed contour. Connecting the sorted points generates the closed boundary of the roof surface, thus obtaining the roof surface of the target 3D building model.
[0076] Optionally, after obtaining the roof surface of the target 3D building model, the coplanarity of all points on the roof surface can be verified. If the error is not greater than the threshold, the coplanarity verification can be considered successful.
[0077] The technical solution of this invention automatically determines whether to use a manual or automatic merging method by combining multi-dimensional features such as the average slope and the number of triangular faces. This satisfies the roof recognition needs of varying complexity and improves operational flexibility. The automatic merging mode achieves accurate recognition and automatic merging of complex roof surfaces based on the coordinates of each vertex corresponding to each triangular face, ensuring the accuracy of complex roof recognition. The manual merging method allows users to quickly fit the roof surface by manually simplifying and marking points, achieving rapid merging of simple roof surfaces. This significantly reduces redundant calculations and operation time. The automatic switching mechanism between manual and automatic modes eliminates the subjectivity and tedious operation of manual mode selection, achieving a dynamic balance between efficient recognition of simple roofs and accurate recognition of complex roofs. This improves the automation and ease of operation of the recognition process, while also taking into account the adaptability to different building model scenarios, thus improving the efficiency and accuracy of roof surface recognition for 3D building models.
[0078] Example 2
[0079] Figure 2 This is a flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 2 of the present invention. This embodiment is an optimization and improvement based on the above technical solutions.
[0080] Furthermore, the step "determine the triangles to be merged based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles" is refined to "for any pair of adjacent triangles, determine the normalized normal vectors corresponding to each triangle based on the coordinates of the corner vertices of each triangle in the adjacent triangles; determine the triangles to be merged based on the normalized normal vectors corresponding to each triangle in the adjacent triangles." The step "determine the triangles to be merged based on the normalized normal vectors corresponding to each triangle in each pair of adjacent triangles" is further refined to "for any pair of adjacent triangles, determine the normal vectors between the triangles in the vector triangle based on the normalized normal vectors corresponding to each triangle in the adjacent triangles." Consistency assessment results; based on the Z-axis component of the normalized normal vector corresponding to each triangle in the adjacent triangle, determine the slope corresponding to each triangle in the adjacent triangle, and based on the slope corresponding to each triangle in the adjacent triangle, determine the inclination consistency assessment result; based on the RGB pixel values corresponding to each triangle in the adjacent triangle, determine the texture consistency assessment result; based on the normal vector consistency assessment result, inclination consistency assessment result, and texture consistency assessment result corresponding to each adjacent triangle, determine the triangles to be merged. This improves the method for determining the triangles to be merged.
[0081] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments. For example... Figure 2As shown, the method includes the following specific steps:
[0082] S210, responding to the target 3D building model uploaded by the target user based on the front-end interactive interface, and performing model analysis on the target 3D building model to obtain several triangular faces.
[0083] S220. Based on the coordinates of each vertex corresponding to each triangle and the number of triangles corresponding to each triangle, determine the method for merging the target roof surface.
[0084] S230. If the target roof surface merging method is automatic merging, then at least one pair of adjacent triangular surfaces are determined based on the coordinates of each corner vertex corresponding to each triangular surface.
[0085] S240. For any pair of adjacent triangular faces, determine the normalized normal vector corresponding to each triangular face based on the coordinates of the corner vertices of each triangular face in the adjacent triangular faces.
[0086] S250A. Based on the normalized normal vectors corresponding to each triangle of the adjacent triangle, determine the consistency evaluation result of the normal vectors among the triangles in the vector triangle.
[0087] S250B: Based on the Z-axis component of the normalized normal vector corresponding to each triangle in the adjacent triangle, determine the slope corresponding to each triangle in the adjacent triangle, and based on the slope corresponding to each triangle in the adjacent triangle, determine the consistency evaluation result of the inclination degree between each triangle in the adjacent triangle.
[0088] S250C: Based on the RGB pixel values corresponding to each triangle in the adjacent triangle, determine the texture consistency evaluation result between each triangle in the adjacent triangle.
[0089] S260. Based on the consistency evaluation results of the normal vectors, the inclination, and the texture of each adjacent triangle, determine the triangles to be merged.
[0090] S270. Merge the triangular faces to be merged to obtain the target merged face.
[0091] S280. Determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than the preset area threshold, then the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0092] For any pair of adjacent triangular faces, assuming that the pair includes triangular face A and triangular face B, the normalized normal vector corresponding to triangular face A is: The normalized normal vector corresponding to triangle B is The normal vector consistency evaluation result, NormalSim, is determined based on vector dot product.
[0093]
[0094] The NormalSim value ranges from 0 to 1. The closer the NormalSim value is to 1, the more consistent the normal vectors of triangle A and triangle B are.
[0095] For triangle A and triangle B mentioned above, determine the slopes corresponding to triangle A and triangle B respectively. and :
[0096]
[0097]
[0098] in, Let Z be the Z-axis component of the normalized normal vector corresponding to triangle A; Let Z be the Z-axis component of the normalized normal vector corresponding to triangle B.
[0099] Based on the slopes corresponding to triangle A and triangle B and Determine the slope consistency assessment results between triangle A and triangle B using SlopeSim:
[0100]
[0101] The closer the SlopeSim value is to 1, the smaller the slope difference between triangle A and triangle B; conversely, the closer the SlopeSim value is to 0, the larger the slope difference between triangle A and triangle B.
[0102] If the average RGB value of triangle A is determined based on its RGB pixel values, and denoted as , then... The average RGB value of triangle B is determined based on its RGB pixel values and denoted as . According to triangle A and triangle B Determine the texture consistency evaluation result for TextureSim:
[0103]
[0104] in, Represents the L1 norm, which is the sum of the absolute values of all components. The closer the TextureSim value is to 1, the more similar the textures are between triangle A and triangle B; conversely, the closer the TextureSim value is to 0, the greater the difference in textures between triangle A and triangle B.
[0105] In an optional embodiment, the triangles to be merged are determined based on the consistency evaluation results of the normal vectors, the consistency evaluation results of the slope, and the consistency evaluation results of the texture corresponding to each adjacent triangle. This includes: for any adjacent triangle, determining the comprehensive similarity between each triangle based on the consistency evaluation results of the normal vectors, the consistency evaluation results of the texture, and the consistency evaluation results of the slope, using preset normal weight parameters, slope weight parameters, and texture weight parameters; and determining the triangles to be merged based on the comprehensive similarity between each triangle.
[0106] The normal vector weight parameter, slope weight parameter, and texture weight parameter can be preset by relevant technical personnel according to actual needs. For example, the normal vector weight parameter can be set to 40%, and the slope weight parameter and texture weight parameter can each be set to 30%.
[0107] Based on the normal vector consistency evaluation results (NormalSim), texture consistency evaluation results (TextureSim), and slope consistency evaluation results (SlopeSim) of the adjacent triangular faces, and based on the preset normal vector weight parameters... Slope weight parameters and texture weight parameters Determine the total similarity (TotalSim) between the triangles of the adjacent triangles:
[0108]
[0109] If we consider the overall similarity If the similarity exceeds a preset similarity threshold, then triangle A and triangle B are determined to be merged. The similarity threshold can be preset by relevant technical personnel; for example, it can be set to 0.9. A higher similarity threshold indicates a more stringent merging process.
[0110] This embodiment's technical solution, during the determination of the triangular faces to be merged, integrates the evaluation results of normal vector consistency, tilt consistency, and texture consistency between two adjacent triangular faces, performing weighted fusion judgment from multiple feature dimensions. The introduced normal vector consistency evaluation feature effectively eliminates the interference of triangular face area differences on direction determination, thus more accurately representing the directional differences between triangular faces and ensuring the recognition accuracy of triangular faces on the same slope. The introduced slope feature effectively distinguishes roofs with different tilt levels, avoiding the erroneous merging of different slopes with similar normal vectors but significant slope differences. The texture consistency feature assists in verification from the material dimension, further filtering out triangular faces from different roofs with similar normal vectors and slopes but different materials, significantly improving the anti-interference ability and scene adaptability of triangular face merging, and further improving the accuracy of determining the triangular faces to be merged.
[0111] Example 3
[0112] Figure 3 This is a schematic flowchart of a method for identifying the roof surface of a three-dimensional building model according to Embodiment 3 of the present invention. Based on the above embodiments, this embodiment provides a preferred example.
[0113] like Figure 3 As shown, the method includes the following steps:
[0114] S31. Obtain the target 3D building model and parse it to obtain several triangular faces. For any triangular face, determine the slope value corresponding to the triangular face based on the coordinates of each vertex of the triangular face, and determine the average slope value based on the slope value corresponding to each triangular face.
[0115] S32. Determine the target roof merging method based on the average slope and the number of triangular faces; if the target roof merging method is manual merging, then execute S38-S39; if the target roof merging method is automatic merging, then execute S33-S37.
[0116] If the average slope is not greater than the average slope threshold and the number of triangular faces is not greater than the preset triangular face number threshold, then the target roof surface merging method is determined to be manual merging. If the average slope is greater than the preset average slope threshold, or the number of triangular faces is greater than the preset triangular face number threshold, then the target roof surface merging method is determined to be automatic merging.
[0117] S33. Determine at least one pair of adjacent triangular faces based on the coordinates of each vertex corresponding to each triangular face. For any pair of adjacent triangular faces, determine the normalized normal vector corresponding to each triangular face based on the coordinates of each vertex corresponding to each triangular face in the adjacent triangular face.
[0118] S34A. Based on the normalized normal vectors corresponding to each triangle of the adjacent triangle, determine the consistency evaluation result of the normal vectors among the triangles in the vector triangle.
[0119] S34B. Based on the Z-axis component of the normalized normal vector corresponding to each triangle in the adjacent triangle, determine the slope corresponding to each triangle in the adjacent triangle, and based on the slope corresponding to each triangle in the adjacent triangle, determine the consistency evaluation result of the inclination degree between the triangles in the adjacent triangle.
[0120] S34C. Based on the RGB pixel values corresponding to each triangle in the adjacent triangle, determine the texture consistency evaluation result between each triangle in the adjacent triangle.
[0121] S35. Based on the normal vector consistency evaluation results, texture consistency evaluation results, and tilt degree consistency evaluation results of the adjacent triangular faces, and based on the preset normal vector weight parameters, slope weight parameters, and texture weight parameters, determine the comprehensive similarity between each triangular face of the adjacent triangular face.
[0122] S36. Based on the comprehensive similarity between the triangular faces of each adjacent triangle, determine the triangular faces to be merged, and merge the triangular faces to be merged to obtain the target merged face.
[0123] S37. Determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than the preset area threshold, then the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0124] S38. Send a manual merging prompt message to the target user through the front-end interactive interface, so that the target user can click on the target 3D building model based on the manual merging prompt message to obtain the coordinates of at least three click points.
[0125] S39. Based on the coordinates of each click point, and using a preset polygon fitting algorithm, generate a target merging surface, and determine the target merging surface as the roof surface of the target 3D building model.
[0126] Example 4
[0127] Figure 4 This is a structural schematic diagram of a roof surface recognition device for a three-dimensional building model provided in Embodiment 4 of the present invention. The roof surface recognition device for a three-dimensional building model provided in this embodiment of the present invention is suitable for the automated, efficient, and accurate recognition of roof areas in a three-dimensional building model. This roof surface recognition device for a three-dimensional building model can be implemented in hardware and / or software, such as... Figure 4As shown, the device includes: a model analysis module 401, a merging method determination module 402, an adjacent triangle determination module 403, a triangle to be merged determination module 404, a triangle merging module 405, and a model roof surface determination module 406. Among them,
[0128] The technical solution of this invention automatically determines whether to use a manual or automatic merging method by combining multi-dimensional features such as the average slope and the number of triangular faces. This satisfies the roof recognition needs of varying complexity and improves operational flexibility. The automatic merging mode achieves accurate recognition and automatic merging of complex roof surfaces based on the coordinates of each vertex corresponding to each triangular face, ensuring the accuracy of complex roof recognition. The manual merging method allows users to quickly fit the roof surface by manually simplifying and marking points, achieving rapid merging of simple roof surfaces. This significantly reduces redundant calculations and operation time. The automatic switching mechanism between manual and automatic modes eliminates the subjectivity and tedious operation of manual mode selection, achieving a dynamic balance between efficient recognition of simple roofs and accurate recognition of complex roofs. This improves the automation and ease of operation of the recognition process, while also taking into account the adaptability to different building model scenarios, thus improving the efficiency and accuracy of roof surface recognition for 3D building models.
[0129] The model parsing module 401 is used to respond to the target three-dimensional building model uploaded by the target user based on the front-end interactive interface, and to parse the target three-dimensional building model to obtain a number of triangular faces.
[0130] The merging method determination module 402 is used to determine the merging method of the target roof surface based on the coordinates of each vertex corresponding to each of the triangles and the number of triangles corresponding to each triangle.
[0131] The adjacent triangle determination module 403 is used to determine at least one pair of adjacent triangles based on the coordinates of each vertex corresponding to each of the triangles if the target roof surface merging method is automatic merging.
[0132] The module 404 for determining the triangles to be merged is used to determine the triangles to be merged based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles.
[0133] Triangle merging module 405 is used to merge the triangles to be merged to obtain the target merged face;
[0134] The model roof surface determination module 406 is used to determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than a preset area threshold, the target merged surface is determined as the roof surface of the target three-dimensional building model.
[0135] Optionally, the module 404 for determining the triangles to be merged includes:
[0136] The normalized normal vector determination unit is used to determine the normalized normal vector corresponding to each triangle face based on the coordinates of the corner vertices of each triangle face in any pair of adjacent triangle faces.
[0137] The unit for determining the triangular faces to be merged is used to determine the triangular faces to be merged based on the normalized normal vectors corresponding to each of the adjacent triangular faces.
[0138] Optionally, the triangular facets to be merged include:
[0139] The normal vector angle determination sub-unit is used to determine the angle between the normal vectors of any adjacent triangular face based on the normalized normal vectors of each triangular face in that adjacent triangular face.
[0140] The first merging subunit is used to determine the triangular faces to be merged based on the included angle of the normal vectors corresponding to each adjacent triangular face and a preset normal vector angle threshold; wherein the normal vector angle threshold is determined based on the number of triangular faces.
[0141] Optionally, the triangular facets to be merged include:
[0142] The first evaluation subunit is used to determine the consistency evaluation result of the normal vectors between the triangles in the vector triangle based on the normalized normal vectors corresponding to each triangle in any pair of adjacent triangles.
[0143] The second evaluation subunit is used to determine the slope of each triangle in the adjacent triangle based on the Z-axis component of the normalized normal vector corresponding to each triangle in the adjacent triangle, and to determine the consistency evaluation result of the inclination degree between each triangle in the adjacent triangle based on the slope of each triangle in the adjacent triangle.
[0144] The third evaluation subunit is used to determine the texture consistency evaluation result between the triangles in the adjacent triangles based on the RGB pixel values corresponding to each triangle in the adjacent triangles.
[0145] The second merging sub-unit is used to determine the triangular faces to be merged based on the consistency evaluation results of the normal vectors, the inclination, and the texture of each adjacent triangular face.
[0146] Optional, the second merging subunit is specifically used for:
[0147] For any adjacent triangular facet, based on the consistency evaluation results of the normal vector, texture, and tilt of the adjacent triangular facet, and using preset normal weight parameters, slope weight parameters, and texture weight parameters, the comprehensive similarity between the triangular facets of the adjacent triangular facet is determined.
[0148] The triangular faces to be merged are determined based on the comprehensive similarity between the triangular faces of each adjacent triangle.
[0149] Optionally, the merging method determination module 402 is specifically used for:
[0150] For any triangular face, determine the slope value of the triangular face based on the coordinates of each vertex of the triangular face;
[0151] The average slope is determined based on the slope values corresponding to each of the aforementioned triangular faces.
[0152] If the average slope is not greater than a preset average slope threshold and the number of triangular faces is not greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be manual merging.
[0153] If the average slope is greater than a preset average slope threshold, or the number of triangular faces is greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be automatic merging.
[0154] Optionally, the device further includes:
[0155] The click coordinate acquisition module is used to determine the target roof surface merging method based on the coordinates of each vertex corresponding to each of the triangles and the number of triangles corresponding to each triangle. If the target roof surface merging method is manual merging, the module sends a manual merging prompt message to the target user through the front-end interactive interface so that the target user can click on the target 3D building model based on the manual merging prompt message to obtain at least three click point coordinates.
[0156] The manual merging module is used to generate a target merging surface based on the coordinates of each click point and a preset polygon fitting algorithm, and to determine the target merging surface as the roof surface of the target three-dimensional building model.
[0157] The roof surface recognition device for three-dimensional building models provided in this embodiment of the invention can execute the roof surface recognition method for three-dimensional building models provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0158] Example 5
[0159] Figure 5A schematic diagram of an electronic device 50 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0160] like Figure 5 As shown, the electronic device 50 includes at least one processor 51 and a memory, such as a read-only memory (ROM) 52 and a random access memory (RAM) 53, communicatively connected to the at least one processor 51. The memory stores computer programs executable by the at least one processor. The processor 51 can perform various appropriate actions and processes based on the computer program stored in the ROM 52 or loaded from storage unit 58 into the RAM 53. The RAM 53 can also store various programs and data required for the operation of the electronic device 50. The processor 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0161] Multiple components in electronic device 50 are connected to I / O interface 55, including: input unit 56, such as keyboard, mouse, etc.; output unit 57, such as various types of monitors, speakers, etc.; storage unit 58, such as disk, optical disk, etc.; and communication unit 59, such as network card, modem, wireless transceiver, etc. Communication unit 59 allows electronic device 50 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0162] Processor 51 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 51 performs the various methods and processes described above, such as the roof surface recognition method for a 3D building model.
[0163] In some embodiments, the roof surface recognition method for a 3D building model can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 58. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 50 via ROM 52 and / or communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the roof surface recognition method for a 3D building model described above can be performed. Alternatively, in other embodiments, processor 51 can be configured to perform the roof surface recognition method for a 3D building model by any other suitable means (e.g., by means of firmware).
[0164] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0165] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0166] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0167] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0168] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0169] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0170] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0171] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method of identifying a roof surface of a three-dimensional building model, characterized by, include: In response to the target user's uploaded target 3D building model based on the front-end interactive interface, the target 3D building model is parsed to obtain several triangular faces; Based on the coordinates of each vertex corresponding to each of the aforementioned triangular faces, and the number of triangular faces corresponding to each of the aforementioned triangular faces, the target roof surface merging method is determined; If the target roof surface merging method is automatic merging, then at least one pair of adjacent triangular surfaces are determined according to the coordinates of each vertex corresponding to each of the triangular surfaces; The triangular faces to be merged are determined based on the coordinates of the corner vertices of each pair of adjacent triangular faces. The triangular faces to be merged are merged to obtain the target merged face; Determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than a preset area threshold, then the target merged surface is determined as the roof surface of the target three-dimensional building model.
2. The method of claim 1, wherein, The step of determining the triangular faces to be merged based on the coordinates of the corner vertices of each pair of adjacent triangular faces includes: For any pair of adjacent triangular faces, determine the normalized normal vector corresponding to each triangular face based on the coordinates of the corner vertices of each triangular face in the pair; The triangular faces to be merged are determined based on the normalized normal vectors corresponding to each of the adjacent triangular faces.
3. The method of claim 2, wherein, The step of determining the triangular faces to be merged based on the normalized normal vectors corresponding to each of the adjacent triangular faces includes: For any adjacent triangular face, determine the included angle of the normal vectors of the adjacent triangular face based on the normalized normal vectors of each triangular face in the adjacent triangular face. Based on the included angle of the normal vectors corresponding to each adjacent triangle, and based on a preset threshold for the included angle of the normal vectors, the triangles to be merged are determined; wherein, the threshold for the included angle of the normal vectors is determined based on the number of triangles.
4. The method of claim 2, wherein, The step of determining the triangular faces to be merged based on the normalized normal vectors corresponding to each of the adjacent triangular faces includes: For any pair of adjacent triangular faces, the consistency evaluation result of the normal vectors among the triangular faces in the vector triangular face is determined based on the normalized normal vectors corresponding to each triangular face of the adjacent triangular face. Based on the Z-axis component of the normalized normal vector corresponding to each triangle in the adjacent triangle, the slope corresponding to each triangle in the adjacent triangle is determined, and based on the slope corresponding to each triangle in the adjacent triangle, the consistency evaluation result of the inclination degree between each triangle in the adjacent triangle is determined. Based on the RGB pixel values corresponding to each triangle in the adjacent triangle, the texture consistency evaluation result between the triangles in the adjacent triangle is determined; Based on the consistency evaluation results of the normal vectors, the inclination, and the texture of each adjacent triangle, the triangles to be merged are determined.
5. The method of claim 4, wherein, The process of determining the triangular faces to be merged based on the consistency evaluation results of the normal vectors, the tilt degree, and the texture consistency evaluation results corresponding to each adjacent triangular face includes: For any adjacent triangular facet, based on the consistency evaluation results of the normal vector, texture, and tilt of the adjacent triangular facet, and using preset normal weight parameters, slope weight parameters, and texture weight parameters, the comprehensive similarity between the triangular facets of the adjacent triangular facet is determined. The triangular faces to be merged are determined based on the comprehensive similarity between the triangular faces of each adjacent triangle.
6. The method of claim 1, wherein, The step of determining the target roof surface merging method based on the coordinates of each vertex corresponding to each of the aforementioned triangular faces and the number of triangular faces corresponding to each of the aforementioned triangular faces includes: For any triangular face, determine the slope value of the triangular face based on the coordinates of each vertex of the triangular face; The average slope is determined based on the slope values corresponding to each of the aforementioned triangular faces. If the average slope is not greater than a preset average slope threshold and the number of triangular faces is not greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be manual merging. If the average slope is greater than a preset average slope threshold, or the number of triangular faces is greater than a preset number of triangular faces threshold, then the target roof surface merging method is determined to be automatic merging.
7. The method of claim 1, wherein, After determining the target roof surface merging method based on the coordinates of each vertex corresponding to each of the triangles and the number of triangles corresponding to each triangle, the method further includes: If the target roof surface is merged manually, a manual merging prompt message is sent to the target user through the front-end interactive interface, so that the target user can click on the target three-dimensional building model based on the manual merging prompt message to obtain at least three click point coordinates; Based on the coordinates of each click point, a target merging surface is generated using a preset polygon fitting algorithm, and the target merging surface is determined as the roof surface of the target three-dimensional building model.
8. A roof surface recognition device for a three-dimensional building model, characterized in that, include: The model parsing module is used to respond to the target 3D building model uploaded by the target user based on the front-end interactive interface, and to parse the target 3D building model to obtain several triangular faces; The merging method determination module is used to determine the merging method of the target roof surface based on the coordinates of each vertex corresponding to each of the triangles and the number of triangles corresponding to each triangle. The adjacent triangle face determination module is used to determine at least one pair of adjacent triangle faces based on the coordinates of each vertex corresponding to each of the triangle faces if the target roof surface merging method is automatic merging. The module for determining the triangles to be merged is used to determine the triangles to be merged based on the coordinates of the corner vertices of each triangle in each pair of adjacent triangles. The triangle merging module is used to merge the triangles to be merged to obtain the target merged face. The model roof surface determination module is used to determine the area of the merged surface corresponding to the target merged surface. If the area of the merged surface is greater than a preset area threshold, the target merged surface is determined as the roof surface of the target three-dimensional building model.
9. An electronic device, comprising: The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the roof surface recognition method of the three-dimensional building model according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the roof surface recognition method for a three-dimensional building model according to any one of claims 1-7.