Building extraction and restoration method based on oblique photography model
Through the method based on grid operation and ray judgment, the problem of side loss of building models in three-dimensional GIS is solved, the integrity and visual effects of the model are improved, and the user experience is improved.
Patent Information
- Application Number
- CN202311737622.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-01-14
AI Technical Summary
When the existing three-dimensional GIS method extracts building models from massive tilt photography models, there is a problem of side loss, resulting in incomplete model and affecting visual effects and user experience.
The side of the building model is repaired by using grid calculation and ray judgment methods. By obtaining the intersection relationship between the building surface and the tilt photography model, the texture and color coordinates are calculated, and the repaired model is merged to improve the integrity of the model.
Effectively fix the problem of side loss of building models, improve the integrity and visual effect of the model, and improve the user experience.
Smart Images

Figure CN119313830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic information technology, and specifically can quickly extract corresponding building models from massive oblique photography models according to given building faces, and the boundaries of the building models are strictly fitted with the building roofs; since the oblique photography model uses a continuous grid surface to store scenes within a plot, there is a problem of side loss in the extraction results of the continuous building model, and this paper creatively proposes a method based on grid calculation and ray judgment to repair the lost sides of the continuous building model, thereby improving the integrity and visual effects of the building model and improving the user experience, a building extraction and repair method based on the oblique photography model. Background Art
[0002] With the rapid development of IT technology and industry, geographic information technology (GIS) has penetrated into all walks of life with its remarkable characteristics and increasingly powerful functions, and has played an increasingly important role in them. At the same time, these applications have in turn put forward more and higher requirements for GIS. People live in a real three-dimensional space, and many practical phenomena cannot be well solved by existing 2D GIS, such as the design and landscape simulation of overpasses and buildings in urban planning; data management and graphic display of underground railways, shopping malls, parking lots and other service facilities; reasonable layout and planning of power and communication facilities; reasonable configuration of fire protection, power supply, water supply, gas supply, alarm and other facilities in residential buildings in the real estate department; reasonable distribution, management, query and selection of optimal paths for urban ground and underground pipelines; planning and management of aviation flight routes; description and analysis of various phenomena such as strata, faults, geological structures, oil layers, underground gas, groundwater, etc. in the fields of geology and petroleum, etc. All of these require intuitive true three-dimensional representation. Traditional 2DGIS can no longer meet people's application needs, and it urgently needs to be converted to 3D GIS. Therefore, 3D GIS has aroused strong interest among researchers. The research on 3D GIS has become a hot topic in the academic community.
[0003] With the introduction of a series of concepts such as "digital earth" and "digital city", the application demand for three-dimensional city models is increasing rapidly. Universal services of geographic information such as digital cities and virtual geographic environments have also put forward urgent requirements for their three-dimensional representation, and the progress of earth observation technology, computer technology, especially high-resolution remote sensing technology and computer graphics and image processing technology has provided a variety of display methods for this. The three-dimensional representation of geographic information has the following significant features:
[0004] Three-dimensional representation can provide users with more intuitive spatial elevation information, while traditional two-dimensional representation reflects the planar position of spatial objects, and its elevation information only exists as an attribute value and cannot be intuitively reflected.
[0005] The types, quantity and quality characteristics of spatial targets, as well as the spatial positions of objects and the spatiotemporal distribution of phenomena are pointed out in a more intuitive and realistic way, so the three-dimensional representation has complete spatiotemporal positioning characteristics.
[0006] Correspondingly, the digital city is a realistic three-dimensional digital representation of the city, which allows people to explore and interact with the natural and cultural information of the city. In the field of photogrammetry, the digital city refers to the three-dimensional city model in most cases. It not only presents the three-dimensional city model, but also provides a photo-intuitive surface description such as realistic material and texture features and related attribute information. The GIS that meets the needs of the digital city is called "digital city GIS". Compared with three-dimensional visualization and virtual display technology, the research progress of practical true three-dimensional GIS is much slower, and its theory and technology are not yet mature. Therefore, unlike the true three-dimensional GIS in the general sense, the digital city GIS is still only a special prototype method of true three-dimensional GIS at this stage. It has been simplified in many aspects according to most application requirements, such as using the outer enclosing surface model instead of the solid geometric model and downplaying the complex spatial topological relationship. Regardless of how the real world is mapped to the spatial database, it emphasizes that GIS provides three-dimensional capabilities in a robust and effective way.
[0007] However, the current 3D GIS methods have several key technical problems that need to be solved. For example, how to quickly extract the corresponding building model from massive oblique photography models based on a given building surface, and ensure that the building model boundary and the building roof are strictly fitted; since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a problem of side loss in the extraction results of the continuous building model. This paper creatively proposes a method based on grid calculation and ray judgment to repair the lost sides of the continuous building model, thereby improving the integrity and visual effect of the building model and enhancing the user experience. Summary of the invention
[0008] In order to overcome the drawbacks of the existing technical solutions, the corresponding building model can be quickly extracted from massive oblique photography models according to the given building surface, and the boundary of the building model is strictly fitted with the building roof; since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a problem of side loss in the extraction result of the continuous building model. This paper creatively proposes a method based on grid operation and ray judgment to repair the lost side of the continuous building model, which improves the integrity and visual effect of the building model and enhances the user experience.
[0009] A method for extracting and restoring buildings based on an oblique photography model, wherein the method comprises the following steps: obtaining an oblique photography model related to a building: obtaining a building surface, and using a formula to convert the coordinates of the building surface into an oblique photography model coordinate system; traversing an oblique photography model set, obtaining the four boundaries of each oblique photography model, and determining whether it intersects with the building surface, and if so, putting it into the oblique photography model set related to the building; and finally obtaining all oblique photography models intersecting with the building surface;
[0010] v'=Mv
[0011] Where:
[0012] v represents a fixed point in the building surface;
[0013] M represents the position matrix of the oblique photography model;
[0014] v' represents the vertices in the building surface converted to the vertices in the oblique photography coordinate system;
[0015] Extract the building model: determine the relationship between each triangle in the oblique photography model and the building surface. If the two intersect, calculate the intersection polygon of the building triangle and the building surface. Then triangulate the intersection polygon to obtain the internal triangle, and use the formula to assign texture coordinates and color coordinates to the internal triangle. Finally, extract all the internal triangles to obtain the building model. Repair the side of the building: count the z value range of the building model, and use the building surface to construct the building bounding box. Then use the building bounding box and the building model to perform intersection calculation to obtain the side of the building. Merge the result model: merge the building model in the second step with the repaired model in the third step, set the model coordinate system for the merged model, and finally obtain the building and its repair result model.
[0016] A method for extracting and restoring a building based on an oblique photography model, wherein the specific steps of extracting the building model are:
[0017] Determine the triangle relationship: obtain the triangle in the oblique photography model and determine the relationship between each vertex of the triangle and the building surface. If the three vertices of the triangle are all located inside the building surface, the triangle is an internal triangle; if the three vertices of the triangle are all located outside the building surface, the triangle is an external triangle; the others are intersecting triangles;
[0018] Divide the intersecting triangles: Calculate the intersecting polygons between the triangles in the oblique photography model and the building surface, then triangulate the intersecting polygons. All the obtained triangles are internal triangles. Finally, the texture coordinates and color coordinates are assigned to the internal triangles obtained by the divid.
[0019] Construct a building model: Get the internal triangles obtained in the first step and the internal triangles obtained by subdivision, and merge all the internal triangles into a building model.
[0020] A method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of dividing intersecting triangles are:
[0021] Calculate position parameters: Get the vertex coordinates of the oblique photography model triangle and a vertex of the internal triangle, and use the formula to calculate the position parameters of the internal triangle vertex inside the oblique photography model triangle:
[0022]
[0023] Where:
[0024] v 0x , v 0y Represents the horizontal and vertical coordinates of the first vertex of the oblique photography model triangle;
[0025] v 1x , v 1y Represents the horizontal and vertical coordinates of the second vertex of the oblique photography model triangle;
[0026] v 2x , v 2y Represents the horizontal and vertical coordinates of the third vertex of the oblique photography model triangle;
[0027] v 3x , v 3y Represents the horizontal and vertical coordinates of the vertices of the internal triangle;
[0028] f represents the intermediate result of the calculation that can be reused;
[0029] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0030] t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle;
[0031] Calculate texture coordinates: Get the texture coordinates of the oblique photography model triangle and use the formula to calculate the texture coordinates for the inner triangle vertices:
[0032] Tex=Tex 0 +(Tex 1 -Tex 0 )*s+(Tex 2 -Tex 0 )*t
[0033] Where:
[0034] Tex represents the texture coordinates of the internal vertex;
[0035] Tex 0 Represents the texture coordinate of the first vertex of the oblique photography model triangle;
[0036] Tex 1 Represents the texture coordinate of the second vertex of the oblique photography model triangle;
[0037] Tex 2 Represents the texture coordinate of the third vertex of the oblique photography model triangle;
[0038] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0039] t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle;
[0040] Calculate color coordinates: Get the color coordinates of the oblique photography model triangle and calculate the color coordinates for the inner triangle vertices using the formula:
[0041] Color=Color 0 +(Color 1 -Color 0 )*s+(Color 2 -Color 0 )*t
[0042] Where:
[0043] Color represents the texture coordinates of the internal vertices;
[0044] Color 0 Represents the color coordinate of the first vertex of the oblique photography model triangle;
[0045] Color 1 Represents the color coordinate of the second vertex of the oblique photography model triangle;
[0046] Color 2 Represents the color coordinate of the third vertex of the oblique photography model triangle;
[0047] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0048] t represents the component of the internal vertex of the triangle on the second edge of the oblique photography model triangle.
[0049] A method for extracting and repairing buildings based on an oblique photography model, wherein the specific steps of repairing the side of the building are:
[0050] Generate building bounding box: Statistically obtain the z coordinate range of the building model, where z min is the minimum value of the z coordinate, z max The maximum value of the z coordinate is constructed with the building face to form a building bounding box;
[0051] Calculate the side of the building: obtain the triangle set of the building bounding box and the triangle set of the building, and calculate the two sets of triangle sets to obtain the side of the building.
[0052] A method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of generating a building bounding box are:
[0053] Generate the top and bottom surfaces: Triangulate the building surface to obtain a set of triangles representing the top and bottom of the building bounding box, and then set the z coordinates of all triangles to z max Get the bounding box and set the z coordinates of all triangles to z min Get the bottom of the bounding box;
[0054] Generate side faces: Get the sides of the building faces (v n , v n+1 ), where v n Represents the nth vertex of the building face, v n+1 Represents the n+1th vertex of the building face and uses v n , v n+1 , z min , z max Construct 2 triangles to get the sides of the bounding box.
[0055] A method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of calculating the side of the building are:
[0056] Calculate the intersection line set: obtain a triangle in the building bounding box triangle set, calculate its intersection line with each triangle in the building triangle set, and obtain the intersection line set of the building bounding box triangle and the building triangle set;
[0057] Triangulate triangles: Using the intersection line set of the building bounding box triangle and the building triangle set as a constraint, re-triangulate the building bounding box triangle to obtain a set of candidate triangles;
[0058] Determine the position relationship: Get one of the candidate triangles and calculate its position relationship with the building.
[0059] A method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of determining the positional relationship are:
[0060] Get the vertices for determining the position relationship: Get the three vertices of the candidate triangle and use the formula to get the vertices for determining the position relationship of the candidate triangle
[0061] c=(v 0 +v 1 +v 2 ) / 3
[0062] Where:
[0063] c represents the coordinates of the center point of the candidate triangle;
[0064] v 0 Represents the first vertex of the candidate triangle;
[0065] v 1 Represents the second vertex of the candidate triangle;
[0066] v 2 Represents the third vertex of the candidate triangle;
[0067] Calculate the intersection set: Use the position relationship vertex c of the candidate triangle and the direction (0,0,1) to construct a ray, use the formula to calculate the intersection of the ray and each triangle in the building triangle set, and then put the intersection into the intersection set;
[0068]
[0069] Where:
[0070] c represents the coordinates of the center point of the candidate triangle;
[0071] v 0 Represents the first vertex of the building triangle;
[0072] v 1 Represents the second vertex of the building triangle;
[0073] v 2 Represents the third vertex of the building triangle;
[0074] d represents a unit vector with direction (0,0,1);
[0075] t represents the distance between the ray and the building triangle’s intersection;
[0076] u represents the weight of the intersection of the ray and the building triangle within the building triangle;
[0077] v represents the weight of the intersection of the ray and the building triangle within the building triangle;
[0078] Determine the position relationship: count the number of intersections between the ray and each triangle in the building triangle set. If the number of intersections is odd, the candidate triangle belongs to the internal triangle. If the number of intersections is even, the candidate triangle is an external triangle.
[0079] Construct the side of the building: obtain all the internal triangles in the candidate triangles, and merge all the obtained internal triangles into the side model of the building.
[0080] It can be seen from this that:
[0081] The method in the embodiment of the present invention can quickly extract the corresponding building model from a large number of oblique photography models according to a given building surface, and the boundary of the building model is strictly fitted with the building roof; since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a problem of side loss in the extraction result of the continuous building model. This article creatively proposes a method based on grid calculation and ray judgment to repair the lost side of the continuous building model, thereby improving the integrity and visual effect of the building model and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 A schematic flow chart of a method for extracting and restoring buildings based on an oblique photography model provided in an embodiment of the present invention;
[0083] Figure 2 Schematic diagram of the process of extracting a building model in an embodiment of the present invention;
[0084] Figure 3 Schematic diagram of the process of dividing intersecting triangles in an embodiment of the present invention;
[0085] Figure 4 It is a schematic diagram of the steps of repairing the side of a building in an embodiment of the present invention;
[0086] Figure 5 It is a schematic diagram of the process of generating a building bounding box in an embodiment of the present invention;
[0087] Figure 6 Schematic diagram of the steps of calculating the side of a building in an embodiment of the present invention;
[0088] Figure 7 Schematic diagram of the process of determining position relationship in an embodiment of the present invention. DETAILED DESCRIPTION
[0089] In order to enable those skilled in the art to better understand the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The exemplary embodiments and descriptions of the present invention are used to explain the present invention but are not intended to limit the present invention.
[0090] Embodiment 1:
[0091] Figure 1 A schematic diagram of the process of the building extraction and restoration method based on the oblique photography model provided in this embodiment is shown in FIG. Figure 1 As shown, a building extraction and restoration method based on oblique photography model, wherein the method comprises the following steps: obtaining the oblique photography model related to the building: obtaining the building surface, and using a formula to convert the coordinates of the building surface into the oblique photography model coordinate system; traversing the oblique photography model set, obtaining the four-dimensional range of each oblique photography model, and judging whether it intersects with the building surface, and if it intersects, putting it into the building related oblique photography model set; finally, all oblique photography models intersecting with the building surface can be obtained;
[0092] v'=Mv
[0093] Where:
[0094] v represents a fixed point in the building surface;
[0095] M represents the position matrix of the oblique photography model;
[0096] v' represents the vertices in the building surface converted to the vertices in the oblique photography coordinate system;
[0097] Extract the building model: determine the relationship between each triangle in the oblique photography model and the building surface. If the two intersect, calculate the intersection polygon of the building triangle and the building surface. Then triangulate the intersection polygon to obtain the internal triangle, and use the formula to assign texture coordinates and color coordinates to the internal triangle. Finally, extract all the internal triangles to obtain the building model. Repair the side of the building: count the z value range of the building model, and use the building surface to construct the building bounding box. Then use the building bounding box and the building model to perform intersection calculation to obtain the side of the building. Merge the result model: merge the building model in the second step with the repaired model in the third step, set the model coordinate system for the merged model, and finally obtain the building and its repair result model.
[0098] like Figure 2 As shown, a method for extracting and restoring a building based on an oblique photography model, wherein the specific steps of extracting the building model are:
[0099] Determine the triangle relationship: obtain the triangle in the oblique photography model and determine the relationship between each vertex of the triangle and the building surface. If the three vertices of the triangle are all located inside the building surface, the triangle is an internal triangle; if the three vertices of the triangle are all located outside the building surface, the triangle is an external triangle; the others are intersecting triangles;
[0100] Divide the intersecting triangles: Calculate the intersecting polygons between the triangles in the oblique photography model and the building surface, then triangulate the intersecting polygons. All the obtained triangles are internal triangles. Finally, the texture coordinates and color coordinates are assigned to the internal triangles obtained by the divid.
[0101] Construct a building model: Get the internal triangles obtained in the first step and the internal triangles obtained by subdivision, and merge all the internal triangles into a building model.
[0102] like Figure 3 As shown, a building extraction and restoration method based on an oblique photography model, wherein the specific steps of dividing the intersecting triangles are:
[0103] Calculate position parameters: Get the vertex coordinates of the oblique photography model triangle and a vertex of the internal triangle, and use the formula to calculate the position parameters of the internal triangle vertex inside the oblique photography model triangle:
[0104]
[0105] Where:
[0106] v 0x , v 0y Represents the horizontal and vertical coordinates of the first vertex of the oblique photography model triangle;
[0107] v 1x , v 1y Represents the horizontal and vertical coordinates of the second vertex of the oblique photography model triangle;
[0108] v 2x , v 2y Represents the horizontal and vertical coordinates of the third vertex of the oblique photography model triangle;
[0109] v 3x , v 3y Represents the horizontal and vertical coordinates of the vertices of the internal triangle;
[0110] f represents the intermediate result of the calculation that can be reused;
[0111] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0112] t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle;
[0113] Calculate texture coordinates: Get the texture coordinates of the oblique photography model triangle and use the formula to calculate the texture coordinates for the inner triangle vertices:
[0114] Tex=Tex 0 +(Tex 1 -Tex0 )*s+(Tex 2 -Tex 0 )*t
[0115] Where:
[0116] Tex represents the texture coordinates of the internal vertex;
[0117] Tex 0 Represents the texture coordinate of the first vertex of the oblique photography model triangle;
[0118] Tex 1 Represents the texture coordinate of the second vertex of the oblique photography model triangle;
[0119] Tex 2 Represents the texture coordinate of the third vertex of the oblique photography model triangle;
[0120] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0121] t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle;
[0122] Calculate color coordinates: Get the color coordinates of the oblique photography model triangle and calculate the color coordinates for the inner triangle vertices using the formula:
[0123] Color=Color 0 +(Color 1 -Color 0 )*s+(Color 2 -Color 0 )*t
[0124] Where:
[0125] Color represents the texture coordinates of the internal vertices;
[0126] Color 0 Represents the color coordinate of the first vertex of the oblique photography model triangle;
[0127] Color 1 Represents the color coordinate of the second vertex of the oblique photography model triangle;
[0128] Color 2 Represents the color coordinate of the third vertex of the oblique photography model triangle;
[0129] s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle;
[0130] t represents the component of the internal vertex of the triangle on the second edge of the oblique photography model triangle.
[0131] like Figure 4 As shown, a method for extracting and repairing buildings based on an oblique photography model, wherein the specific steps of repairing the side of the building are:
[0132] Generate building bounding box: Statistically obtain the z coordinate range of the building model, where z min is the minimum value of the z coordinate, z max The maximum value of the z coordinate is constructed with the building face to form a building bounding box;
[0133] Calculate the side of the building: obtain the triangle set of the building bounding box and the triangle set of the building, and calculate the two sets of triangle sets to obtain the side of the building.
[0134] like Figure 5 As shown, a building extraction and restoration method based on an oblique photography model, wherein the specific steps of generating a building bounding box are:
[0135] Generate the top and bottom surfaces: Triangulate the building surface to obtain a set of triangles representing the top and bottom of the building bounding box, and then set the z coordinates of all triangles to z max Get the bounding box and set the z coordinates of all triangles to z min Get the bottom of the bounding box;
[0136] Generate side faces: Get the sides of the building faces (v n , v n+1 ), where v n Represents the nth vertex of the building face, v n+1 Represents the n+1th vertex of the building face and uses v n , v n+1 , z min , z max Construct 2 triangles to get the sides of the bounding box.
[0137] like Figure 6 As shown, a method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of calculating the side of the building are:
[0138] Calculate the intersection line set: obtain a triangle in the building bounding box triangle set, calculate its intersection line with each triangle in the building triangle set, and obtain the intersection line set of the building bounding box triangle and the building triangle set;
[0139] Triangulate triangles: Using the intersection line set of the building bounding box triangle and the building triangle set as a constraint, re-triangulate the building bounding box triangle to obtain a set of candidate triangles;
[0140] Determine the position relationship: Get one of the candidate triangles and calculate its position relationship with the building.
[0141] like Figure 7 As shown, a method for extracting and restoring buildings based on an oblique photography model, wherein the specific steps of determining the position relationship are:
[0142] Get the vertices for determining the position relationship: Get the three vertices of the candidate triangle and use the formula to get the vertices for determining the position relationship of the candidate triangle
[0143] c=(v 0 +v 1 +v 2 ) / 3
[0144] Where:
[0145] c represents the coordinates of the center point of the candidate triangle;
[0146] v 0 Represents the first vertex of the candidate triangle;
[0147] v 1 Represents the second vertex of the candidate triangle;
[0148] v 2 Represents the third vertex of the candidate triangle;
[0149] Calculate the intersection set: Use the position relationship vertex c of the candidate triangle and the direction (0,0,1) to construct a ray, use the formula to calculate the intersection of the ray and each triangle in the building triangle set, and then put the intersection into the intersection set;
[0150]
[0151] Where:
[0152] c represents the coordinates of the center point of the candidate triangle;
[0153] v 0 Represents the first vertex of the building triangle;
[0154] v 1 Represents the second vertex of the building triangle;
[0155] v 2 Represents the third vertex of the building triangle;
[0156] d represents a unit vector with direction (0,0,1);
[0157] t represents the distance between the ray and the building triangle’s intersection;
[0158] u represents the weight of the intersection of the ray and the building triangle within the building triangle;
[0159] v represents the weight of the intersection of the ray and the building triangle within the building triangle;
[0160] Determine the position relationship: count the number of intersections between the ray and each triangle in the building triangle set. If the number of intersections is odd, the candidate triangle belongs to the internal triangle. If the number of intersections is even, the candidate triangle is an external triangle.
[0161] Construct the side of the building: obtain all the internal triangles in the candidate triangles, and merge all the obtained internal triangles into the side model of the building.
[0162] The following is an example of a specific implementation:
[0163] The following is a specific implementation case to illustrate in detail the application of this method to extract building models from massive tilted data and repair the lost sides.
[0164] According to the given tilt data and building surface layer data, the coordinate system of the building surface layer data is converted into the coordinate system of the tilt data, and then each building surface in the building surface layer data is obtained. This method is applied to extract the building model from the massive tilt data, and the lost sides are repaired. Finally, the building models corresponding to all the building surfaces in the building roof layer can be obtained.
[0165] Obtain building-related oblique photography models: traverse the given oblique photography model set, obtain the boundaries of each oblique photography model, and determine whether it intersects with the building surface. If it intersects, put it into the building-related oblique photography model set; finally, obtain all oblique photography models that intersect with the building surface.
[0166] Extract the building model: extract the building model from all the oblique photography models that intersect with the building surface obtained in the first step. First, determine the relationship between each triangle in the oblique photography model and the building surface. If the two are determined to intersect, calculate the intersection polygon of the oblique photography triangle and the building surface. Then triangulate the intersection polygon to obtain the internal triangle, and use the formula to assign texture coordinates and color coordinates to the internal triangle. Finally, repeat the first two steps to obtain all the internal triangles and construct a building model.
[0167] Repair the side of the building: Since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a problem of missing sides in the extraction results of some building models that are continuous but have different attributes. To address this problem, first count the z-value range of the building model and use the building surface to construct the building bounding box. Then, use the building bounding box and the building model to perform grid calculations, and use the intersection line set of the grid calculation to re-divide the bounding box triangles. Use the ray intersection method to determine the positional relationship of the subdivision results. Finally, collect all the internal triangles to get the lost side of the building.
[0168] Merge result model: merge the building model in the second step with the repair model in the third step, set the model coordinate system for the merged model, and finally obtain the building and its repair result model.
[0169] In a specific embodiment, the oblique photography data and the building surface layer data of a certain area are taken as an example.
[0170] According to the tilt data and house surface layer data of the area, the coordinate system of the house surface layer data is converted into the coordinate system of the tilt data, and then each building surface in the house surface layer data is obtained. This method is applied to extract the building model from the massive tilt data, and the lost sides are repaired. Finally, the building models corresponding to all the building surfaces of the house surface layer data can be obtained.
[0171] Traverse the given oblique photography model set, obtain the boundaries of each oblique photography model, and determine whether the boundaries of the oblique photography model intersect with the building surface. If so, put it into the building-related oblique photography model set; finally, obtain all oblique photography models that intersect with the building surface.
[0172] Extract the building model from all the oblique photography models that intersect with the building surface obtained in the first step, obtain each triangle in the oblique photography model, and determine the relationship between this triangle and the building surface. If this triangle is inside the building surface, then this triangle can be directly placed in the extracted building model. If this triangle is outside the building surface, then this triangle does not belong to the extracted building model. The others belong to the intersection of triangles and building surfaces.
[0173] At this time, the intersection polygons of the triangles in the oblique photography model and the building surface are calculated, and then the intersection polygons are triangulated. All the triangles obtained are internal triangles, that is, they belong to the extracted building model. Then, the texture coordinates and color coordinates of the internal triangles are calculated to obtain the complete extracted building model.
[0174] When calculating texture coordinates and color coordinates, obtain the vertex coordinates of the oblique photography model triangle and a vertex of the internal triangle, use the formula to calculate the position parameters of the internal triangle vertex inside the oblique photography model triangle, and then substitute the texture coordinates and position parameters of the oblique photography model triangle into the texture coordinate calculation formula to obtain the texture coordinates of the internal triangle vertex; substitute the color coordinates and position parameters of the oblique photography model triangle into the color calculation formula to obtain the color coordinates of the internal triangle vertex.
[0175] Since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a side loss problem in the extraction results of some building models that are continuous but have different attributes. To address this problem, a bounding box containing the building can be constructed, and the bounding box and the building model can be used to perform the grid calculation used in this method to finally obtain the missing surface part of the building model.
[0176] When constructing a building bounding box, first obtain the z value range of the building model and the triangle set of the building face, then set the z coordinates of the triangle set to z_max and z_min respectively, to get the upper and lower faces of the bounding box; use the edges of the building face, z_max and z_min to construct a rectangle, then triangulate it, and finally get the sides of the building bounding box, and finally get a complete building bounding box.
[0177] Get all the triangle sets of the building bounding box and extract all the triangle sets of the building model, calculate the intersection lines of the bounding box triangle set and the building model triangle set, and use the intersection line set as a constraint to re-triangulate the triangles of the building bounding box to obtain a set of candidate triangles. Then, for each candidate triangle, use the formula to calculate a vertex for determining the positional relationship, construct a ray with this vertex as the origin and direction (0,0,1), calculate the intersection set of the ray and the building model triangle set, and determine the positional relationship of the candidate triangle by the number of intersection sets. If the number of intersections is an odd number, the candidate triangle belongs to an internal triangle. If the number of intersections is an even number, the candidate triangle is an external triangle. Finally, collect all the internal triangles in the candidate triangles to obtain the missing side model of the building model.
[0178] Finally, the building model in the second step is merged with the repaired model in the third step, and a model coordinate system is set for the merged model to finally obtain the building and its repair result model.
[0179] The foregoing method descriptions and flow charts are provided only as illustrative examples and are not intended to require or imply that the above operations or steps of various aspects must be performed in the order given. As will be appreciated by those skilled in the art, the order of the boxes in the foregoing aspects may be performed in any order. Words such as "thereafter," "then," "next," and the like are not intended to limit the order of operations or steps; these words are only used to guide the reader through the description of the method. In addition, any singular reference to a claim element, for example, the use of the article "a," "an," or "the" is not to be construed as limiting the element to the singular.
[0180] The various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the aspects disclosed herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly represent the interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on the specific application and the design constraints imposed on the entire method. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of protection of the present invention.
[0181] The method in the embodiment of the present invention can quickly extract the corresponding building model from a large number of oblique photography models according to a given building surface, and the boundary of the building model is strictly fitted with the building roof; since the oblique photography model uses a continuous grid surface to store the scene within the plot, there is a problem of side loss in the extraction result of the continuous building model. This article creatively proposes a method based on grid operation and ray judgment to repair the lost side of the continuous building model, thereby improving the integrity and visual effect of the building model and improving the user experience.
[0182] The foregoing description of the disclosed aspects is provided to enable any person skilled in the art to implement or use the present invention. Various modifications to these aspects will be apparent to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects provided herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A building extraction and restoration method based on an oblique photography model, characterized in that The method comprises the following steps: obtaining a building-related oblique photography model: obtaining a building surface, and using a formula to convert the coordinates of the building surface into an oblique photography model coordinate system; traversing an oblique photography model set, obtaining the four boundaries of each oblique photography model, and determining whether it intersects with the building surface, and if so, putting it into the building-related oblique photography model set; finally, all oblique photography models intersecting with the building surface can be obtained; v′=Mv Where: v represents a fixed point in the building surface; M represents the position matrix of the oblique photography model; v' represents the vertices in the building surface converted to the vertices in the oblique photography coordinate system; Extract the building model: determine the relationship between each triangle in the oblique photography model and the building surface. If the two intersect, calculate the intersection polygon of the building triangle and the building surface. Then triangulate the intersection polygon to obtain the internal triangle, and use the formula to assign texture coordinates and color coordinates to the internal triangle. Finally, extract all the internal triangles to obtain the building model. Repair the side of the building: count the z value range of the building model, and use the building surface to construct the building bounding box, and then use the building bounding box and the building model to perform intersection calculation to obtain the side of the building. Merge result model: merge the building model in the second step with the repair model in the third step, set the model coordinate system for the merged model, and finally obtain the building and its repair result model.
2. The method for extracting and restoring buildings based on an oblique photography model according to claim 1, characterized in that: The specific steps of extracting the building model are: Determine the triangle relationship: obtain the triangle in the oblique photography model and determine the relationship between each vertex of the triangle and the building surface. If the three vertices of the triangle are all located inside the building surface, the triangle is an internal triangle; if the three vertices of the triangle are all located outside the building surface, the triangle is an external triangle; the others are intersecting triangles; Divide the intersecting triangles: Calculate the intersecting polygons between the triangles in the oblique photography model and the building surface, then triangulate the intersecting polygons. All the obtained triangles are internal triangles. Finally, the texture coordinates and color coordinates are assigned to the internal triangles obtained by the divid. Construct a building model: Get the internal triangles obtained in the first step and the internal triangles obtained by subdivision, and merge all the internal triangles into a building model.
3. The method for extracting and restoring buildings based on an oblique photography model according to claim 2, characterized in that: The specific steps of dividing the intersecting triangles are: Calculate position parameters: Get the vertex coordinates of the oblique photography model triangle and a vertex of the internal triangle, and use the formula to calculate the position parameters of the internal triangle vertex inside the oblique photography model triangle: Where: v 0x , v 0y Represents the horizontal and vertical coordinates of the first vertex of the oblique photography model triangle; v 1x , v 1y Represents the horizontal and vertical coordinates of the second vertex of the oblique photography model triangle; v 2x , v 2y Represents the horizontal and vertical coordinates of the third vertex of the oblique photography model triangle; v 3x , v 3y Represents the horizontal and vertical coordinates of the vertices of the internal triangle; f represents the intermediate result of the calculation that can be reused; s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle; t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle; Calculate texture coordinates: Get the texture coordinates of the oblique photography model triangle and use the formula to calculate the texture coordinates for the inner triangle vertices: Tex=Tex0+(Tex1-Tex0)*s+(Tex2-Tex0)*t Where: Tex represents the texture coordinates of the internal vertex; Tex0 represents the texture coordinate of the first vertex of the oblique photography model triangle; Tex1 represents the texture coordinate of the second vertex of the oblique photography model triangle; Tex2 represents the texture coordinates of the third vertex of the oblique photography model triangle; s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle; t represents the component of the internal vertex of the triangle on the second side of the oblique photography model triangle; Calculate color coordinates: Get the color coordinates of the oblique photography model triangle and calculate the color coordinates for the inner triangle vertices using the formula: Color=Color0+(Color1-Color0)*s+(Color2-Color0)*t Where: Color represents the texture coordinates of the internal vertices; Color0 represents the color coordinate of the first vertex of the oblique photography model triangle; Color1 represents the color coordinate of the second vertex of the oblique photography model triangle; Color2 represents the color coordinate of the third vertex of the oblique photography model triangle; s represents the component of the internal vertex of the triangle on the first edge of the oblique photography model triangle; t represents the component of the internal vertex of the triangle on the second edge of the oblique photography model triangle.
4. The method for extracting and restoring buildings based on an oblique photography model according to claim 1, characterized in that: The specific steps of repairing the side of the building are: Generate building bounding box: Statistically obtain the z coordinate range of the building model, where z min is the minimum value of the z coordinate, z max The maximum value of the z coordinate is constructed with the building face to form a building bounding box; Calculate the side of the building: obtain the triangle set of the building bounding box and the triangle set of the building, and calculate the two sets of triangle sets to obtain the side of the building.
5. The method for extracting and restoring buildings based on an oblique photography model according to claim 4, characterized in that: The specific steps of generating the building bounding box are: Generate the top and bottom surfaces: Triangulate the building surface to obtain a set of triangles representing the top and bottom surfaces of the building bounding box, and then set the z coordinates of all triangles to z max Get the bounding box and set the z coordinates of all triangles to z min Get the bottom of the bounding box; Generate side faces: Get the sides of the building faces (v n , v n+1 ), where v n Represents the nth vertex of the building face, v n+1 Represents the n+1th vertex of the building face and uses v n , v n+1 , z min , z max Construct 2 triangles to get the sides of the bounding box.
6. The method for extracting and restoring buildings based on an oblique photography model according to claim 4, characterized in that: The specific steps of calculating the side of the building are: Calculate the intersection line set: obtain a triangle in the building bounding box triangle set, calculate its intersection line with each triangle in the building triangle set, and obtain the intersection line set of the building bounding box triangle and the building triangle set; Triangulate triangles: Using the intersection line set of the building bounding box triangle and the building triangle set as a constraint, re-triangulate the building bounding box triangle to obtain a set of candidate triangles; Determine the position relationship: Get one of the candidate triangles and calculate its position relationship with the building.
7. The method for extracting and restoring buildings based on an oblique photography model according to claim 6, characterized in that: The specific steps of determining the position relationship are: Get the vertices for determining the position relationship: Get the three vertices of the candidate triangle and use the formula to get the vertices for determining the position relationship of the candidate triangle c=(v0+v1+v2) / 3 Where: c represents the coordinates of the center point of the candidate triangle; v0 represents the first vertex of the candidate triangle; v1 represents the second vertex of the candidate triangle; v2 represents the third vertex of the candidate triangle; Calculate the intersection set: Use the position relationship vertex c of the candidate triangle and the direction (0,0,1) to construct a ray, use the formula to calculate the intersection of the ray and each triangle in the building triangle set, and then put the intersection into the intersection set; Where: c represents the coordinates of the center point of the candidate triangle; v0 represents the first vertex of the building triangle; v1 represents the second vertex of the building triangle; v2 represents the third vertex of the building triangle; d represents a unit vector with direction (0,0,1); t represents the distance between the ray and the building triangle’s intersection; u represents the weight of the intersection of the ray and the building triangle within the building triangle; v represents the weight of the intersection of the ray and the building triangle within the building triangle; Determine the position relationship: count the number of intersections between the ray and each triangle in the building triangle set. If the number of intersections is odd, the candidate triangle belongs to the internal triangle. If the number of intersections is even, the candidate triangle is an external triangle. Construct the side of the building: obtain all the internal triangles in the candidate triangles, and merge all the obtained internal triangles into the side model of the building.