Building data classification and collection method, device and electronic equipment based on grid model

By obtaining reference points, grouping and calculating projected lines in the grid model, the problems of low efficiency and poor accuracy of building data acquisition in traditional methods are solved, and more efficient and accurate data extraction is achieved.

CN119251690BActive Publication Date: 2025-04-18中电信数字城市科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411775182.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-18
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The traditional grid model has the problems of low collection efficiency and poor accuracy.

Method used

By obtaining multiple reference points from the grid model, grouping according to the positional relationship between reference points, calculate the projected line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane, and calculate the intersection coordinates to determine the sides and data of the target building.

Benefits of technology

The accuracy and efficiency of building data extraction in the grid model are improved, and the problems of low efficiency and poor accuracy in traditional methods are alleviated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251690B_ABST
    Figure CN119251690B_ABST
Patent Text Reader

Abstract

The present invention provides a building data classification collection method, device and electronic device based on a grid model, belonging to the technical field of image processing. In the method, by obtaining reference points in the grid model, the relationship between reference surfaces is determined based on the reference points to obtain intersection coordinates, and then the various sides of the target building are determined based on the intersection coordinates. According to the side faces and the roof type of the target building, the data of the target building can be determined, and the target building data can be extracted. Through analysis from point to surface and from surface to body, the data of the target building is finally determined, thereby improving the accuracy and efficiency of building data extraction in the grid model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a building data classification and collection method, device and electronic equipment based on a grid model. Background Art

[0002] The digital images of the ground and the side of the building collected by the aerial camera and the oblique camera are used to generate a mesh model through the real-life 3D software. The mesh model is composed of an irregular triangulated network (TIN) and textures. The traditional 3D model is displayed through point, line, and surface vector expressions. To convert the mesh model into a traditional 3D model, it is necessary to first collect the building data in the mesh model.

[0003] At present, the main method is manual, which requires manual collection and extraction of building data from the grid model. On the one hand, the collection efficiency of the manual method is low, and it needs to be collected bit by bit, and repeated confirmation is required to improve the accuracy. On the other hand, the accuracy of manually collected building data is poor. In addition to manual collection, building data can also be collected by fitting with regular geometric bodies, for example, fitting the regular geometric body mathematical model of 3dmax software, and then realizing the collection of building data through editing functions such as stretching. However, this method affects the accuracy of building data collection due to the limitations of regular geometric bodies.

[0004] In summary, the traditional method of collecting building data in the grid model has technical problems of low collection efficiency and poor accuracy. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a building data classification collection method, device and electronic device based on a grid model to alleviate the technical problems of low collection efficiency and poor accuracy of building data collection methods in traditional grid models.

[0006] In a first aspect, an embodiment of the present invention provides a building data classification and collection method based on a grid model, comprising:

[0007] Acquire a plurality of reference points from the grid model, wherein each of the reference points corresponds to a reference plane of a target building in the grid model;

[0008] According to the positional relationship between the reference points, the reference points are grouped to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination;

[0009] Calculate the projection line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane, and calculate the coordinates of the intersection points between the projection lines corresponding to each reference point combination;

[0010] Determine the side of the target building according to the intersection coordinates;

[0011] The data of the target building is determined based on the roof type of the target building and the side of the target building.

[0012] Further, calculating the projection line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane includes:

[0013] Calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis;

[0014] The projection straight line of the reference plane corresponding to each of the reference points on the XOY plane is calculated according to the direction cosine angle.

[0015] Further, calculating the projection line of the reference plane corresponding to each reference point on the XOY plane according to the direction cosine angle includes:

[0016] Convert the direction cosine angle into the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis;

[0017] The projection line of the reference surface corresponding to each reference point on the XOY plane is calculated according to the spatial coordinates of the reference point and the angle between the projection line of the reference surface corresponding to the reference point on the XOY plane and the X-axis.

[0018] Further, calculating the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis includes:

[0019] Obtaining an X vector in a normal vector of a reference plane corresponding to each of the reference points;

[0020] The direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis is calculated according to the direction cosine angle calculation formula dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI, where dAngle represents the direction cosine angle between the normal vector and the X-axis, mark3DFaceNormal.x represents the X vector in the normal vector of the reference plane corresponding to the reference point, and PI represents pi.

[0021] Further, determining the side of the target building according to the intersection coordinates includes:

[0022] The points corresponding to the coordinates of the plurality of intersections are connected in sequence to obtain the side of the target building.

[0023] Further, when the roof type of the target building is a flat roof or a sloping roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes:

[0024] Determine the side space equation of each side according to the side of the target building, and obtain the elevation of the plane top or the slope top;

[0025] Determine top surface data according to the elevation and the side space equation;

[0026] The side surface data and the top surface data of the target building are used as the data of the target building.

[0027] Further, when the roof type of the target building is a gable roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes:

[0028] Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the gable roof according to the gable roof of the target building;

[0029] Determine the horizontal and vertical coordinate ranges of the gable roof according to the side spatial equation, and determine the top surface intersection line according to the top surface spatial equation of the gable roof;

[0030] The data of the target building is determined according to the side of the target building, the horizontal and vertical coordinate ranges of the gable roof and the top surface intersection line.

[0031] Further, when the roof type of the target building is a four-slope roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes:

[0032] Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the four sloping tops according to the four sloping tops of the target building;

[0033] Calculate the top surface intersection point according to the top surface spatial equation of the four inclined planes;

[0034] The data of the target building is determined according to the side surface of the target building, the side surface space equation and the top surface intersection point.

[0035] In a second aspect, an embodiment of the present invention further provides a building data classification and collection device based on a grid model, comprising:

[0036] An acquisition unit, configured to acquire a plurality of reference points from the grid model, wherein each of the reference points corresponds to a reference plane of a target building in the grid model;

[0037] A grouping unit, configured to group the reference points according to the positional relationship between the reference points to obtain a reference point combination, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination;

[0038] A calculation unit, used to calculate the projection line of the reference surface corresponding to each reference point in the reference point combination on the XOY plane, and calculate the coordinates of the intersection points between the projection lines corresponding to each reference point combination;

[0039] A first determining unit, configured to determine the side of the target building according to the intersection coordinates;

[0040] The second determining unit is configured to determine the data of the target building based on the roof type of the target building and the side of the target building.

[0041] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0042] In an embodiment of the present invention, a building data classification and collection method based on a grid model is provided, comprising: obtaining a plurality of reference points from a grid model, wherein each reference point corresponds to a reference plane of a target building in the grid model; grouping the reference points according to the positional relationship between the reference points to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination; calculating the projection lines of the reference planes corresponding to each reference point in the reference point combination on the XOY plane, and calculating the intersection coordinates between the projection lines corresponding to each reference point combination; determining the side of the target building according to the intersection coordinates; and determining the data of the target building based on the roof type of the target building and the side of the target building. From the above description, it can be seen that in the building data classification and collection method based on the grid model of the present invention, by obtaining the reference points in the grid model, the relationship between the reference surfaces is determined based on the reference points to obtain the intersection coordinates, and then the various sides of the target building are determined based on the intersection coordinates. According to the side and the roof type of the target building, the data of the target building can be determined, and the extraction of the target building data is realized. Through the analysis from point to surface and from surface to body, the data of the target building is finally determined, which improves the accuracy and efficiency of the building data extraction in the grid model, and alleviates the technical problems of low collection efficiency and poor accuracy of the traditional building data collection method in the grid model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 A flowchart of a building data classification and collection method based on a grid model provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a building data classification and collection device based on a grid model provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] The traditional method of collecting building data in grid models has low efficiency and poor accuracy.

[0049] Based on this, in the building data classification and collection method based on the grid model of the present invention, by obtaining the reference points in the grid model, the relationship between the reference surfaces is determined according to the reference points to obtain the intersection coordinates, and then the various sides of the target building are determined according to the intersection coordinates. According to the side faces and the roof type of the target building, the data of the target building can be determined, and the extraction of the target building data is realized. Through the analysis from point to surface and from surface to body, the data of the target building is finally determined, thereby improving the accuracy and efficiency of building data extraction in the grid model.

[0050] To facilitate understanding of this embodiment, a building data classification and collection method based on a grid model disclosed in an embodiment of the present invention is first introduced in detail.

[0051] Embodiment 1:

[0052] According to an embodiment of the present invention, an embodiment of a building data classification and collection method based on a grid model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] Figure 1 is a flow chart of a building data classification and collection method based on a grid model according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0054] Step S102, obtaining a plurality of reference points from the grid model, wherein each reference point corresponds to a reference plane of the target building in the grid model;

[0055] In the embodiment of the present invention, the structure of the grid model is hierarchical and block-based. The hierarchical layers are based on different resolutions, from coarse resolution to the highest resolution from top to bottom; and the blocks are based on the geometric positions in the xy direction. When displaying a scene, if you want to see the whole picture, you zoom out the scene, and then call the coarse resolution grid model. If you want to see the detailed scene, you zoom in the scene, and then dynamically dispatch the detailed resolution grid model.

[0056] The mesh model is a real-life 3D model with two main features: (1) the model expresses the spatial structure through a triangulated network (TIN); and (2) textures are added to the model to truly reflect the natural terrain and objects.

[0057] The grid model is designed based on the principle of block (tile) in the spatial direction. It uses octree technology and adopts the layered principle in structure, that is, pyramid structure. It can edit and process areas of any size and can display real-life 3D models of any size. When the range is large, the resolution model and texture are reduced, and when the range is small, the high-resolution model and texture are increased. Therefore, regardless of the size of the range, models of different resolutions can be clearly displayed.

[0058] The core of mesh model editing operation is layering and segmentation, with the emphasis on visual effects, so the purpose is fast calling and display.

[0059] Since the mesh model is a large-scale TIN triangulation plus texture mode, and the traditional measurement method is a mapping method with points, lines, and surfaces as vectors, it is necessary to convert the mesh model into a traditional mapping method. In this way, using the mesh model as a data source and collecting point, line, and surface data from it, such as house data, becomes a means.

[0060] At present, when drawing buildings based on grid models, if the collection of building data and the entire process of building drawing are done manually, a lot of work will be generated; manual collection requires repeated adjustment of the model, many clicks, and a large workload; since the model is deformed at different angles, the accuracy is difficult to guarantee.

[0061] The present invention provides a building data classification collection method based on a grid model. By directly collecting building data on a grid model (using a combination of mouse keys and keyboard keys to complete the collection steps), the characteristics of the grid model and the functions of the Open Scene Graph library are utilized, and the basic principles of spatial surface mathematics and the mathematical basis of surface normals are used to implement the collection process, which can reduce manual operations and improve data accuracy.

[0062] At the same time, since the traditional model mapping method is to express the natural terrain and landforms by classification, in order to further simplify the collection process and reduce the operation steps, the present invention classifies the buildings and adopts different processing methods according to the different top surfaces of the buildings.

[0063] Specifically, through the display of the grid model, you can see the buildings, but the data corresponding to the buildings is not clear. You need to select the buildings in the grid model. However, for the grid model, the grid model contains an irregular triangulated network, and you cannot know which part of the triangulated network belongs to the building. Therefore, you need to manually obtain reference points in the grid model. Each reference point uniquely corresponds to a face (that is, the reference face) in the target building. It can also be understood as obtaining a reference point on each face of the target building.

[0064] In a specific example, the plane coordinates of the house are collected: the initial values ​​are assigned or adjusted for the parameters that need to be assigned. When the flag for collecting the house plane data is true, it means that the data of the target building needs to be extracted, the existing house data objects in the memory are deleted, and the initial values ​​of various flags are initialized. The flag pMainView->m_bCollectDataEnd for collecting the house plane data is set to false, the flag iNumLineSingleHouse for the number of single house line segments is set to 0, the flag iNumSideHouse for the number of house sides is set to 0, the flag bSuccessSingleLineCollect for the successful collection of single line segments is set to false, the flag bSuccessSingleHouseBodyCollect for the successful collection of single house bodies is set to false, the polyline vector array polylinevec3darray for the collection points is set to null, the coefficient array of the space perpendicular plane equation coeffspaceplaneequatioforperpendiculararray is set to null, the polyline vector array polylinevec3dtopsurfacearray for the top surface is set to null, and the polyline vector array topcornerpolylinevec3darrayarray for the top corner is set to null.

[0065] When the collection point information array collectpointinfoarray is less than 2, set the collection point polyline vector array polylinevec3darray to be empty, the collection point information array collectpointinfoarray to be empty, the corner polyline vector array cornerpolylinevec3darray to be empty, and the temporary polyline vector array tmppolylinevec3darray to be empty. The ctrl key use flag bCtrlUsed is false.

[0066] After completing the initialization of the above parameters, the original triangulated network is displayed: the intersection object is calculated, and the line segment intersector loop is looped. Get the pointers of the drawable object, the geometric object, and the vertex array of the geometric object. When the vertex array pointer is not empty, get the triangulated network vertex index fragment list object and the triangulated network vertex index rate list object. When the number of groups of the triangulated network vertex index fragment list object and the number of groups of the triangulated network vertex index rate list object are both 3, set the color array to blue, and create a line ring object geode according to the triangle vertex pointer array vertices_3. Get the root view switch object root in the scene, get the node object pNode of the second window from the root view switch object root, get the switch object pSwitch from the node object pNode, and add the line ring object geode to the switch object pSwitch. The above second window is used to display the results of the acquisition of the target building, that is, to display the white model data. Through the judgment and assignment of the above parameters, it can be selected in the mesh model using a blue triangle frame, and other colors can also be used, without limitation. The collected reference points are all stored in the polyline vector array polylinevec3darray of the acquisition point.

[0067] Step S104, grouping the reference points according to the positional relationship between the reference points to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination;

[0068] Step S106, calculating the projection line of the reference surface corresponding to each reference point in the reference point combination on the XOY plane, and calculating the coordinates of the intersection points between the projection lines corresponding to each reference point combination;

[0069] Step S108, determining the side of the target building according to the intersection coordinates;

[0070] Step S110 , determining data of the target building based on the roof type of the target building and the side of the target building.

[0071] In an embodiment of the present invention, a building data classification and collection method based on a grid model is provided, comprising: obtaining a plurality of reference points from a grid model, wherein each reference point corresponds to a reference plane of a target building in the grid model; grouping the reference points according to the positional relationship between the reference points to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination; calculating the projection lines of the reference planes corresponding to each reference point in the reference point combination on the XOY plane, and calculating the intersection coordinates between the projection lines corresponding to each reference point combination; determining the side of the target building according to the intersection coordinates; and determining the data of the target building based on the roof type of the target building and the side of the target building. From the above description, it can be seen that in the building data classification and collection method based on the grid model of the present invention, by obtaining the reference points in the grid model, the relationship between the reference surfaces is determined based on the reference points to obtain the intersection coordinates, and then the various sides of the target building are determined based on the intersection coordinates. According to the side and the roof type of the target building, the data of the target building can be determined, and the extraction of the target building data is realized. Through the analysis from point to surface and from surface to body, the data of the target building is finally determined, which improves the accuracy and efficiency of the building data extraction in the grid model, and alleviates the technical problems of low collection efficiency and poor accuracy of the traditional building data collection method in the grid model.

[0072] The above content briefly introduces the building data classification and collection method based on the grid model of the present invention. The specific contents involved are described in detail below.

[0073] In an optional embodiment of the present invention, calculating the projection line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane specifically includes the following steps:

[0074] (1) Calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis;

[0075] Specifically, obtain the X vector in the normal vector of the reference plane corresponding to each reference point; calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis according to the direction cosine angle calculation formula dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI, where dAngle represents the direction cosine angle between the normal vector and the X-axis, mark3DFaceNormal.x represents the X vector in the normal vector of the reference plane corresponding to the reference point, and PI represents pi.

[0076] The above-mentioned grid model includes: the spatial coordinates of the reference point and the normal vector of the reference surface corresponding to the reference point.

[0077] (2) Calculate the projection line of the reference surface corresponding to each reference point on the XOY plane based on the direction cosine angle.

[0078] Specifically, the method includes the following steps: converting the direction cosine angle into the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis; calculating the projection line of the reference plane corresponding to each reference point on the XOY plane according to the spatial coordinates of the reference point and the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis.

[0079] The following is a detailed introduction to the above process:

[0080] The direction cosine angle between the normal vector and the X-axis is obtained by:

[0081] dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI;

[0082] Among them, dAngle represents the direction cosine angle between the normal vector and the X-axis, mark3DFaceNormal.x represents the X vector in the normal vector of the reference plane corresponding to the reference point, and PI represents pi.

[0083] Collect side points and faces, generate collection point information structure, generate plane collection line: get the node object pNode of the first window from the root view switch object root, and get the switch object pSwitch from the node object pNode. According to the collected house side points, namely the reference points (i.e. the points on the side of the real-life 3D model house on the screen where the mouse clicks) and the face information (side information), the collection point information array collectpointinfo is formed. The above collection point information array is a structure array, which is used to record the mouse point position, the spatial coordinates pointposition of the points collected by the ctrl key (i.e. the points on the side of the house, i.e. the reference points), the normal vector array pointfacenormal of the face where the points are located, the triangulation network number iNumTrangleNet, the direction cosine angle dxtriscosangle with the X-axis, the slope kk of the straight line equation of the projection of the side where the points are located on the plane (XOY plane), and the constant term bb. The above first window is used to call the original data of the mesh model, and collect the building data on the above original data. The direction cosine angle between the face normal vector and the X-axis is calculated according to the face normal vector. The calculation formula of the direction cosine angle is as follows:

[0084] dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI;

[0085] Where dAngle is the direction cosine angle between the surface normal vector and the X-axis, in degrees, arccos is the inverse cosine function, mark3DFaceNormal.x is the X vector in the normal vector of the reference surface corresponding to the reference point (that is, the X vector of the normal vector of the surface where the point is located), and PI is pi.

[0086] According to the quadrant where the above direction cosine angle is located, the direction cosine angle is converted into the angle between the projection line of the reference plane where the reference point is located on the plane (XOY plane) and the X-axis. The conversion formula is as follows:

[0087] collectpointinfo.dxtriscosangle=dAngle+90°;

[0088] Where collectpointinfo.dxtriscosangle is the angle between the projection line of the reference plane where the reference point is located on the XOY plane and the X-axis, and dAngle is the direction cosine angle.

[0089] The calculation of the slope kk and constant term bb of the above straight line equation is to find the straight line equation based on a known reference point and slope. The calculation formula is as follows:

[0090] collectpointinfo.kk=tan(collectpointinfo.dxtriscosangle×PI / 180.0);

[0091] collectpointinfo.bb=-collectpointinfo.kk×mark3Dpoint.x()+mark3Dpoint.y();

[0092] Among them, collectpointinfo.kk is the slope of the line, collectpointinfo.bb is the constant term of the line, collectpointinfo.dxtriscosangle is the angle between the projection line of the reference plane where the reference point is located on the XOY plane and the X-axis, mark3Dpoint.x and mark3Dpoint.y are the spatial coordinates of the mouse point (i.e., the reference point), and tan is the tangent function.

[0093] When the collection point information array is 1, the collection point polyline vector array polylinevec3darray is used to save the mouse point position (i.e., the reference point); when the collection point information array is greater than 1, the intersection point is required for the straight line equation formed by two adjacent reference points. The following is the calculation formula for the two straight line equations when the slope and constant term are known:

[0094] y=k1×x+b1;

[0095] y=k2×x+b2;

[0096] Among them, k1 and k2 are the slopes of the two straight line equations (collectpointinfo.kk obtained by the above calculation), b1 and b2 are the constant terms of the two straight line equations (collectpointinfo.bb obtained by the above calculation), and x and y are the plane coordinates of any reference point on the straight line. If the planes corresponding to any two reference points have an intersection line, then the two reference points are adjacent.

[0097] The formula for finding the intersection point of two straight line equations with slopes and constant terms is as follows:

[0098] dd=(b1-b2) / (k1-k2);

[0099] intersectpoint.x=-dd;

[0100] intersectpoint.y=-k1×dd+b1;

[0101] intersectpoint.z=polylinevec3darray(0).z;

[0102] Among them, k1 and k2 are the slopes of the two straight line equations respectively, b1 and b2 are the constant terms of the two straight line equations, intersectpoint.x, intersectpoint.y, and intersectpoint.z are the three-dimensional coordinates of the intersection point, and polylinevec3darray(0).z is the elevation value of the collection point (you must hold down the ctrl key when collecting point data to distinguish it from roaming, because operating the mouse button alone is the scene roaming mode, and only when you click the mouse button and hold down the ctrl key is the data collection mode).

[0103] The polyline vector array polylinevec3darray of the collection points stores the coordinates of the intersection points, and the polyline vector array cornerpolylinevec3darray of the collection points stores the coordinates of the intersection points.

[0104] When the value of the collection point information array is greater than 1, the collection point polyline vector array polylinevec3darray saves the mouse point position, so that the collection point polyline vector array polylinevec3darray saves the mouse point position and intersection coordinates at intervals.

[0105] In an optional embodiment of the present invention, determining the side of the target building according to the intersection coordinates specifically includes the following steps:

[0106] Connect the points corresponding to the coordinates of multiple intersections in sequence to obtain the side of the target building.

[0107] Specifically, each pair of adjacent reference points can be calculated to obtain an intersection coordinate. Multiple intersection coordinates can be obtained according to the number of sides of the target building. The intersection coordinates are connected to form a closed rectangle (specifically, only one intersection coordinate can be obtained for two adjacent sides of the house, and another intersection coordinate can be obtained for the other two adjacent sides in a counterclockwise direction, and so on, a closed rectangle can be obtained). The above closed rectangle is the side of the target building. All sides of the target building can be selected in the above way, and then only the top surface of the target building needs to be selected.

[0108] In an optional embodiment of the present invention, when the roof type of the target building is a flat roof or a sloping roof, determining the data of the target building based on the roof type of the target building and the side of the target building specifically includes the following steps:

[0109] (1) Determine the side space equation of each side according to the side of the target building, and obtain the elevation of the plane top or the slope top;

[0110] Specifically, the side space equation of the side can be calculated by capturing multiple points on the side, and the elevation of the flat top or the sloping top can be obtained by clicking the mouse on the target building.

[0111] (2) Determine the top surface data based on the elevation and side spatial equations;

[0112] Specifically, first determine the range of the horizontal and vertical coordinates of the plane top or the slope top based on the side spatial equation (specifically, because the reference points collected from the side can form a closed plane rectangle, the plane (i.e., the horizontal and vertical coordinates) range of the top surface is also determined, and the spatial equation of the top surface can determine the height), and then add the above-mentioned elevation to determine the top surface data (specifically, the plane data of the top surface data is obtained by the plane rectangle formed by the reference points on the side, and the elevation data is obtained by solving the spatial equation of the top surface and the side plane data.).

[0113] (3) The side and top surface data of the target building are used as the data of the target building.

[0114] In an optional embodiment of the present invention, when the roof type of the target building is a gable roof, determining the data of the target building based on the roof type of the target building and the side of the target building specifically includes the following steps:

[0115] (1) Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the gable roof according to the gable roof of the target building;

[0116] Specifically, the side spatial equation of the side can be calculated by capturing multiple points on the side. The top surface of the gable roof has two surfaces, and the two top surface spatial equations of the gable roof can be calculated by capturing multiple points on the gable roof.

[0117] (2) Determine the horizontal and vertical coordinate ranges of the gable roof based on the side space equation, and determine the top surface intersection line based on the top surface space equation of the gable roof;

[0118] Specifically, the horizontal and vertical coordinate ranges of the gable roof are obtained through the side space equation (specifically, the horizontal and vertical coordinates (i.e., plane coordinates) of the gable roof are the plane coordinates of the rectangle formed by the side reference points, and the coordinate range can be calculated). At the same time, the top surface intersection line is obtained through the two gable top surface space equations of the gable roof.

[0119] (3) Determine the data of the target building based on the side of the target building, the horizontal and vertical coordinate range of the gable roof and the intersection line of the top surface.

[0120] Specifically, after the horizontal and vertical coordinate ranges of the side and gable roof and the top intersection line are determined, the data of the target building can be determined.

[0121] In an optional embodiment of the present invention, when the roof type of the target building is a four-slope roof, determining the data of the target building based on the roof type of the target building and the side of the target building specifically includes the following steps:

[0122] (1) Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the four sloping tops according to the four sloping tops of the target building;

[0123] Specifically, when the roof type is a four-slope roof, the roof is like a pyramid, with four faces and one intersection. When implementing, the side space equation of the side can be calculated by capturing multiple points on the side. The top surface of the four-slope roof has four faces, and the four top surface space equations of the four-slope roof can be calculated by capturing multiple points on the four faces of the four-slope roof.

[0124] (2) Calculate the top surface intersection point based on the top surface spatial equation of the four inclined planes;

[0125] Specifically, the top surface intersection point is calculated according to the four four-slope top surface space equations.

[0126] (3) Determine the data of the target building based on the side surface, the side space equation and the top intersection point of the target building.

[0127] Specifically, the horizontal and vertical coordinate ranges of the four sloping tops are determined according to the side space equation, and then the horizontal and vertical coordinate ranges of the side, four sloping tops and the intersection point of the top surface of the target building are determined, thereby determining the data of the target building.

[0128] The following is an example of collecting top surface data (herringbone top, four-slope top, etc.):

[0129] Set the variable of roof type to iTopSurfaceHouseType. When the value of roof type is 0, it means that the roof type of the target building is a gable roof, and m1=2 is set, indicating that there are 2 top surfaces. When the value of roof type is 1, it means that the roof type of the target building is a four-sloped roof, and m1=4 is set, indicating that there are 4 top surfaces.

[0130] When the roof type is a four-slope roof, get the root view node switch object, delete the original roof object of the house, set the roof four-slope data collection completion flag bCollectHouseRoof4ClineplaneDataEnd to false, the single room body successful collection flag bSuccessSingleHouseBodyCollect to false, the ctrl key used flag bCtrlUsed to false, clear the polyline vector three-dimensional top surface array polylinevec3dtopsurfacearray, clear the top corner polyline vector three-dimensional array topcornerpolylinevec3darrayarray, clear the space plane equation coefficient array coeffspaceplaneequatioarray, and set the global variables iGlobal11 and iGlobal22 to 0 respectively.

[0131] When the ctrl key is used flag is true, return (indicates that the acquisition function is made into a function, return, indicating the end of data acquisition). Record the three-dimensional data of the mouse point position into the polyline vector three-dimensional top surface array polylinevec3dtopsurfacearray. Use the point method to calculate the coefficient of the spatial plane equation, the formula is as follows:

[0132] an = mark3DFaceNormal.x;

[0133] bn = mark3DFaceNormal.y;

[0134] cn=mark3DFaceNormal.z;

[0135] dn=-an×mark3Dpoint.x-bn×mark3Dpoint.y-cn×mark3Dpoint.z;

[0136] Among them, an, bn, cn are the coefficients of the space plane equation, dn is the constant term of the space plane equation, mark3DFaceNormal.x, mark3DFaceNormal.y, mark3DFaceNormal.z are the normal vectors of the surface where the mouse point is located, and mark3Dpoint.x, mark3Dpoint.y, mark3Dpoint.z are the three-dimensional coordinates of the mouse point.

[0137] Clear the top corner polyline vector 3D array topcornerpolylinevec3darrayarray. Find the intersection points and intersection lines between the top space plane and the four side surfaces (the following content is the process of finding the intersection points and intersection lines). The elevation calculation formula of the target points (i.e., reference points) on the four side surfaces is as follows:

[0138] Vt2=polylinevec3darray.at(i);

[0139] vt2.z()=-(an×vt2.x()+bn×vt2.y()+dn) / cn;

[0140] Among them, polylinevec3darray.at(i) is the 3D coordinate of the i-th point of the side polyline vector of the target building, an, bn, cn, dn are the spatial plane equation coefficients and constant terms of the collected and calculated roof, and vt2 is the calculated 3D coordinate of the target point on the side. The 3D coordinates of the target point on the side are stored in the top corner polyline vector 3D array topcornerpolylinevec3darray.

[0141] When the polyline vector three-dimensional top surface array polylinevec3dtopsurfacearray is equal to 1, find the lowest point of the top surface elevation from the top corner polyline vector three-dimensional array topcornerpolylinevec3darray and assign it to the global variable iGlobal11; and find the second lowest point of the top surface elevation and assign it to the global variable iGlobal22.

[0142] Save the top corner polyline vector three-dimensional array topcornerpolylinevec3darray to the top corner polyline vector three-dimensional array array topcornerpolylinevec3darrayarray.

[0143] When the polyline vector 3D top surface array polylinevec3dtopsurfacearray is less than or equal to m1, the assignment is as follows:

[0144] coeffspaceplanequatio1.daa=an;

[0145] coeffspaceplanequatio1.dbb=bn;

[0146] coeffspaceplanequatio1.dcc=cn;

[0147] coeffspaceplanequatio1.ddd=dn;

[0148] Among them, an, bn, cn are the coefficients of the top surface space plane equation calculated previously, dn is the constant term of the space plane equation, and coeffspaceplanequatio1 is the space plane equation coefficient structure. Save the top surface space plane equation structure to the space plane equation coefficient array coeffspaceplaneequatioarray.

[0149] When the polyline vector 3D top surface array polylinevec3dtopsurfacearray is equal to m1, calculate the four sides of the herringbone top. Find the lowest point in elevation from the top corner polyline vector 3D array topcornerpolylinevec3darrayarray.

[0150] To find the first intersection point of the gable, first find the side where the parapet is located.

[0151] When m1=2, given three points in space, find the coefficients of the spatial plane equation.

[0152] The spatial plane equation is ax+by+cz+d=0. By calculating the spatial plane equation coefficients through three target points, the following determinant can be listed:

[0153] becomes ;

[0154] Among them, x, y, z are the three-dimensional coordinates of any point on the spatial plane, x1, y1, z1, x2, y2, z2, x3, y3, z3 are the three-dimensional coordinates of three known points on the spatial plane.

[0155] According to the above determinant, the solution formula for the coefficient of the space plane equation is:

[0156] a=(a22×a33-a23×a32);

[0157] b=-(a21×a33-a23×a31);

[0158] c = (a21 × a32 - a22 × a31);

[0159] d=-(a22×a33-a23×a32)×x1+(a21×a33-a23×a31)×y1-(a21×a32-a22×a31)×z1;

[0160] d = -a × x1 - b × y1 - c × z1;

[0161] Among them, a, b, c, and d are the coefficients and constant terms of the spatial plane equation.

[0162] Find the highest point of the parapet, the calculation process is as follows:

[0163] a1×x+b1×y+c1×z+d1=0;

[0164] a2×x+b2×y+c2×z+d2=0;

[0165] a3×x+b3×y+c3×z+d3=0;

[0166] Among them, a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3 are the coefficients and constant terms of the three space plane equations respectively, and x, y, z are the three-dimensional coordinates of any point on the space plane. The following matrix can be listed through the above three formulas:

[0167]

[0168] Simplifying the above matrix, we get the formula: ;

[0169] Where A represents the matrix , X represents the unknown matrix , L represents the constant term matrix .

[0170] Multiply the left side of the above formula by , the left side becomes an orthogonal matrix, as follows: ,in, express The transposed matrix of .

[0171] Multiply the left side of the above formula by , the left side of the equation becomes the identity matrix.

[0172]

[0173]

[0174] in, express The inverse matrix of X. Solving for X gives the first intersection point of the gable roof. The method for finding the second intersection point of the gable roof is the same as the first intersection point, so it will not be repeated here. After determining the first intersection point and the second intersection point, the top surface intersection line can be determined. Based on the first target point, the second target point, the first intersection point and the second intersection point, the two inclined planes of the gable roof and the triangular faces of the two parapets can be selected to finally obtain the data of the target building.

[0175] In the foregoing content, the data of the target building is obtained by calculation. After that, the above-mentioned building data classification and collection method based on the grid model also includes:

[0176] In response to the shift key, close the data of the above target building.

[0177] Specifically, the root view switch object and the node object are obtained. When the above data is not closed, a node object of the straight line between the first and last points is created and attached to the root view switch object; when the above data is closed, the straight line node object in the root view switch is deleted, and the color of the house plane straight line object is set to green.

[0178] If the volume of the corner polyline vector 3D array cornerpolylinevec3darray is 4, the function of rotating the house plane data and converting it into a rectangular form is implemented. The specific operation is as follows:

[0179] Get the minimum enclosing rectangle of the target building:

[0180] First, we need to determine the simple circumscribed rectangle of the target building. The simple circumscribed rectangle is the circumscribed rectangle with sides parallel to the x-axis or y-axis. Then, we rotate a point on the plane around a fixed point by a certain angle. Suppose the point (x1, y1) on the plane rotated counterclockwise around another point (x0, y0) by an angle A is (x2, y2), then we have

[0181] x2=(x1-x0)×cosA-(y1-y0)×sinA+x0;

[0182] y2=(x1-x0)×sinA+(y1-y0)×cosA+y0;

[0183] If it is a clockwise rotation, just adjust A to -A. Continue to rotate the original polygon (loop, 0-90°, interval set to 1°), find the simple circumscribed rectangle of the polygon after each degree of rotation, and record the area of ​​the simple circumscribed rectangle, vertex coordinates, and degree of rotation at this time.

[0184] After completing the above process, compare all the simple circumscribed rectangles obtained during the rotation of the polygon to obtain the simple circumscribed rectangle with the smallest area, obtain the vertex coordinates and rotation angle of the simple circumscribed rectangle, and rotate the simple circumscribed rectangle with the smallest area in the opposite direction by the same angle to obtain the minimum circumscribed rectangle.

[0185] If the volume of the corner polyline vector three-dimensional array cornerpolylinevec3darray is not 4, clear the polyline vector three-dimensional array polylinevec3darray, push the elements of the corner polyline vector three-dimensional array cornerpolylinevec3darray into the polyline vector three-dimensional array polylinevec3darray, and set the z values ​​of all elements to the z value of the first element.

[0186] Create a line closing ring node object in red color and attach it to the root view switch object and the target view switch object. Set the house view matrix. Release the acquisition point information array, release the angle polyline vector 3D array, and release the temporary polyline vector 3D array.

[0187] In response to the shift key, close the top surface data of the target building; obtain the view root switch object and the target implementation switch object. Set constants. Delete the old object.

[0188] When the flag bCollectHouseRoof4ClineplaneDataEnd for collecting the four slope data of the roof is not true, when processing the case where the roof is a plane, when the volume of the top corner polyline vector three-dimensional array topcornerpolylinevec3darray is greater than 5, the function of creating a house polygon object is called to create a roof polygon node object and append it to the view switch list.

[0189] When the volume of the top corner polyline vector three-dimensional array topcornerpolylinevec3darray is less than 5, the function of creating a house quadrilateral implementation object is called to create a house roof plane, create a roof quadrilateral plane node object, and append it to the view switch list.

[0190] When dealing with the case where the roof is a gable roof or a four-sided sloping roof, the function of creating a house quadrilateral implementation object is called to create a gable roof on the roof of the house, create a roof quadrilateral gable roof node object, and attach it to the view switch list.

[0191] When the bCollectHouseRoof4ClineplaneDataEnd flag for collecting the four sloped surfaces of the roof is true, create a linear closed loop object. Assign vertical and top surface objects, turn off the blending mode and turn on the lighting, set the color to yellow or cyan, and attach these objects to the target view node object. Set the single room body collection success flag bSuccessSingleHouseBodyCollect to true. Set the house view matrix, and display the white model of the collected side and top surfaces in the target view.

[0192] Embodiment 2:

[0193] An embodiment of the present invention also provides a building data classification and collection device based on a grid model. The building data classification and collection device based on a grid model is mainly used to execute the building data classification and collection method based on a grid model provided in the first embodiment of the present invention. The following is a specific introduction to the building data classification and collection device based on a grid model provided in the embodiment of the present invention.

[0194] Figure 2 is a schematic diagram of a building data classification and collection device based on a grid model according to an embodiment of the present invention, such as Figure 2 As shown, the device mainly includes: an acquisition unit 10, a grouping unit 20, a calculation unit 30, a first determination unit 40 and a second determination unit 50, wherein:

[0195] An acquisition unit, used for acquiring a plurality of reference points from the grid model, wherein each reference point corresponds to a reference plane of a target building in the grid model;

[0196] A grouping unit, used for grouping the reference points according to the positional relationship between the reference points to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination;

[0197] A calculation unit, used to calculate the projection line of the reference surface corresponding to each reference point in the reference point combination on the XOY plane, and calculate the coordinates of the intersection points between the projection lines corresponding to each reference point combination;

[0198] A first determining unit, used to determine the side of the target building according to the intersection coordinates;

[0199] The second determining unit is configured to determine the data of the target building based on the roof type of the target building and the side of the target building.

[0200] In an embodiment of the present invention, a building data classification and collection device based on a grid model is provided, comprising: obtaining multiple reference points from a grid model, wherein each reference point corresponds to a reference plane of a target building in the grid model; grouping the reference points according to the positional relationship between the reference points to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination; calculating the projection lines of the reference planes corresponding to each reference point in the reference point combination on the XOY plane, and calculating the intersection coordinates between the projection lines corresponding to each reference point combination; determining the side of the target building according to the intersection coordinates; and determining the data of the target building based on the roof type of the target building and the side of the target building. From the above description, it can be known that in the building data classification and acquisition device based on the grid model of the present invention, by obtaining the reference points in the grid model, the relationship between the reference surfaces is determined according to the reference points to obtain the intersection coordinates, and then the various sides of the target building are determined according to the intersection coordinates. According to the side and the roof type of the target building, the data of the target building can be determined, and the extraction of the target building data is realized. Through the analysis from point to surface and from surface to body, the data of the target building is finally determined, which improves the accuracy and efficiency of the building data extraction in the grid model, and alleviates the technical problems of low collection efficiency and poor accuracy of the traditional building data collection method in the grid model.

[0201] Optionally, the calculation unit is further used to: calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis; and calculate the projection straight line of the reference plane corresponding to each reference point on the XOY plane according to the direction cosine angle.

[0202] Optionally, the calculation unit is also used to: convert the direction cosine angle into the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis; calculate the projection line of the reference plane corresponding to each reference point on the XOY plane according to the spatial coordinates of the reference point and the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis.

[0203] Optionally, the calculation unit is also used to: obtain the X vector in the normal vector of the reference plane corresponding to each reference point; calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis according to the direction cosine angle calculation formula dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI, where dAngle represents the direction cosine angle between the normal vector and the X-axis, mark3DFaceNormal.x represents the X vector in the normal vector of the reference plane corresponding to the reference point, and PI represents pi.

[0204] Optionally, the first determining unit is further used to: connect points corresponding to the multiple intersection coordinates in sequence to obtain the side of the target building.

[0205] Optionally, when the roof type of the target building is a flat roof or a sloping roof, the second determination unit is also used to: determine the side space equation of each side according to the side of the target building, and obtain the elevation of the flat roof or the sloping roof; determine the top surface data according to the elevation and the side space equation; and use the side and top surface data of the target building as the data of the target building.

[0206] Optionally, when the roof type of the target building is a gable roof, the second determination unit is further used to: determine the side spatial equation of each side according to the side of the target building, and determine the gable roof top surface spatial equation according to the gable roof of the target building; determine the horizontal and vertical coordinate ranges of the gable roof according to the side spatial equations, and determine the top surface intersection line according to the gable roof top surface spatial equations; determine the data of the target building according to the side of the target building, the horizontal and vertical coordinate ranges of the gable roof and the top surface intersection line.

[0207] Optionally, when the roof type of the target building is a four-sloped roof, the second determination unit is also used to: determine the side spatial equation of each side according to the side of the target building, and determine the four-sloped roof top surface spatial equation according to the four-sloped roof of the target building; calculate the top surface intersection according to the four-sloped roof top surface spatial equation; determine the data of the target building according to the side, side spatial equation and top surface intersection of the target building.

[0208] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0209] like Figure 3 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the above-mentioned grid model-based building data classification and collection method.

[0210] Specifically, the above-mentioned memory 602 and processor 601 can be general-purpose memory and processor, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, it can execute the above-mentioned grid model-based building data classification and collection method.

[0211] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.

[0212] Corresponding to the above-mentioned building data classification and collection method based on the grid model, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned building data classification and collection method based on the grid model.

[0213] The building data classification and collection device based on the grid model provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application, its implementation principle and the technical effect produced are the same as those in the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0214] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0215] For another example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0216] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0217] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0218] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the building data classification and collection method based on the grid model described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0219] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0220] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solution of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solution recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiment of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A building data classification and collection method based on a grid model, characterized in that: include: Acquire a plurality of reference points from the grid model, wherein each of the reference points corresponds to a reference plane of a target building in the grid model, and the reference plane includes each face of the target building; According to the positional relationship between the reference points, the reference points are grouped to obtain reference point combinations, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination; Calculate the projection line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane, and calculate the coordinates of the intersection points between the projection lines corresponding to each reference point combination; Determine the side of the target building according to the intersection coordinates; Determining data of the target building based on the roof type of the target building and the side of the target building; Wherein, when the roof type of the target building is a flat roof or a sloping roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes: Determine the side space equation of each side according to the side of the target building, and obtain the elevation of the plane top or the slope top; Determine top surface data according to the elevation and the side space equation; Using the side surface data and the top surface data of the target building as the data of the target building; Wherein, when the roof type of the target building is a gable roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes: Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the gable roof according to the gable roof of the target building; Determine the horizontal and vertical coordinate ranges of the gable roof according to the side spatial equation, and determine the top surface intersection line according to the top surface spatial equation of the gable roof; Determine the data of the target building according to the side of the target building, the horizontal and vertical coordinate ranges of the gable roof and the top surface intersection line; Wherein, when the roof type of the target building is a four-slope roof, determining the data of the target building based on the roof type of the target building and the side of the target building includes: Determine the side space equation of each side according to the side of the target building, and determine the top space equation of the four sloping tops according to the four sloping tops of the target building; Calculate the top surface intersection point according to the top surface spatial equation of the four inclined planes; The data of the target building is determined according to the side surface of the target building, the side surface space equation and the top surface intersection point.

2. The method according to claim 1, characterized in that: Calculating the projection line of the reference plane corresponding to each reference point in the reference point combination on the XOY plane includes: Calculate the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis; The projection straight line of the reference plane corresponding to each of the reference points on the XOY plane is calculated according to the direction cosine angle.

3. The method according to claim 2, characterized in that Calculating the projection line of the reference plane corresponding to each reference point on the XOY plane according to the direction cosine angle includes: Convert the direction cosine angle into the angle between the projection line of the reference plane corresponding to the reference point on the XOY plane and the X-axis; The projection line of the reference surface corresponding to each reference point on the XOY plane is calculated according to the spatial coordinates of the reference point and the angle between the projection line of the reference surface corresponding to the reference point on the XOY plane and the X-axis.

4. The method according to claim 2, characterized in that: Calculating the direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis, including: Obtaining an X vector in a normal vector of a reference plane corresponding to each of the reference points; The direction cosine angle between the normal vector of the reference plane corresponding to each reference point and the X-axis is calculated according to the direction cosine angle calculation formula dAngle=arccos(mark3DFaceNormal.x)×180.0 / PI, where dAngle represents the direction cosine angle between the normal vector and the X-axis, mark3DFaceNormal.x represents the X vector in the normal vector of the reference plane corresponding to the reference point, and PI represents pi.

5. The method according to claim 1, characterized in that Determining the side of the target building according to the intersection coordinates includes: The points corresponding to the coordinates of the plurality of intersections are connected in sequence to obtain the side of the target building.

6. A building data classification and collection device based on a grid model, characterized in that: include: An acquisition unit, configured to acquire a plurality of reference points from the grid model, wherein each of the reference points corresponds to a reference plane of a target building in the grid model, and the reference plane includes each face of the target building; A grouping unit, configured to group the reference points according to the positional relationship between the reference points to obtain a reference point combination, wherein there is an intersection line between reference planes corresponding to two reference points included in each reference point combination; A calculation unit, used to calculate the projection line of the reference surface corresponding to each reference point in the reference point combination on the XOY plane, and calculate the coordinates of the intersection points between the projection lines corresponding to each reference point combination; A first determining unit, configured to determine the side of the target building according to the intersection coordinates; A second determining unit, configured to determine data of the target building based on the roof type of the target building and the side of the target building; Wherein, when the roof type of the target building is a flat roof or a sloping roof, the second determining unit is further used to: determine the side space equation of each side according to the side of the target building, and obtain the elevation of the flat roof or the sloping roof; determine the top surface data according to the elevation and the side space equation; and use the side surface and the top surface data of the target building as the data of the target building; Wherein, when the roof type of the target building is a gable roof, the second determining unit is further used to: determine the side space equation of each side according to the side of the target building, and determine the gable roof top surface space equation according to the gable roof of the target building; determine the horizontal and vertical coordinate ranges of the gable roof according to the side space equations, and determine the top surface intersection line according to the gable roof top surface space equations; determine the data of the target building according to the side of the target building, the horizontal and vertical coordinate ranges of the gable roof and the top surface intersection line; Among them, when the roof type of the target building is a four-sloped roof, the second determination unit is also used to: determine the side space equation of each side according to the side of the target building, and determine the four-sloped roof top space equation according to the four-sloped roof of the target building; calculate the top surface intersection according to the four-sloped roof top space equation; determine the data of the target building according to the side of the target building, the side space equation and the top surface intersection.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Rural building modeling method and system fusing remote sensing image and shot image, and storage medium

    CN114820976A

  • Building intelligent extraction method and device based on inclination model

    CN115063557A