A commanding point analysis method and system based on dual spatial index

Through the dual spatial indexing method, quad-tree and K-D tree indexes are used to quickly locate potential commanding heights in real-life three-dimensional models, solving the problem of time-consuming, labor-intensive and easy-to-missing problems, and achieving efficient and accurate commanding height analysis.

CN119648927BActive Publication Date: 2025-05-02HANGZHOU SURVEY & DESIGN RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510180923.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-02
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

Human resources to investigate the commanding heights is time-consuming and labor-intensive, and it is easy to miss potential commanding heights, threatening the safety of important people.

Method used

The commanding height analysis method based on double spatial index is adopted. By obtaining the real scene three-dimensional model, segmenting it into tiles and constructing a quad-tree index, and establishing a K-D tree index for the triangular face sheet, calculating the intersection point between the ray and the triangular face sheet, generating a point cloud of three-dimensional commanding height position, and projecting it to a two-dimensional vector surface for superposition, and determining the commanding height building.

Benefits of technology

It realizes the rapid positioning of the triangle facets intersecting with rays in the real-life three-dimensional model, accurately discovers the commanding heights along the security route, greatly improves the calculation efficiency of commanding heights, and enhances the practical feasibility of completing large-scale commanding heights based on the real-life three-dimensional model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648927B_ABST
    Figure CN119648927B_ABST
Patent Text Reader

Abstract

The present application relates to a commanding height analysis method and system based on dual spatial indexing, wherein a dual indexing construction method is used in the indexing construction link, that is, a dual indexing of a tile quadtree and a triangle K-D tree is constructed, so as to realize the rapid positioning of triangles intersecting with rays in a real-life three-dimensional model. With the help of the powerful computing power of computers, commanding heights with potential hidden dangers along the security route can be accurately discovered, which greatly improves the efficiency of commanding height calculation, enhances the practical feasibility of completing large-scale commanding height calculations based on real-life three-dimensional models, and promotes security work to be carried out in a more scientific and efficient manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of security technology, and in particular to a commanding height analysis method and system based on dual spatial indexing. Background Art

[0002] In related technologies, in order to ensure the safety of important people when traveling, it is usually necessary to dispatch a large number of human resources to conduct strict inspections along the route and implement control measures on places that may serve as commanding heights along the way. However, the manual inspection method is not only time-consuming and labor-intensive, but also very easy to miss potential commanding heights, thus threatening the personal safety of important people. Summary of the invention

[0003] The embodiments of the present application provide a commanding heights analysis method, system, computer device, and computer-readable storage medium based on dual spatial indexing, so as to at least solve the problem in the related art that it is time-consuming and labor-intensive to manually check commanding heights that pose safety hazards.

[0004] In a first aspect, an embodiment of the present application provides a commanding point analysis method based on a dual spatial index, the method comprising:

[0005] Acquire a real-scene 3D model of an offline target scene, divide the real-scene 3D model into a plurality of mutually adjacent tiles of the same size, and construct a quadtree index for each tile;

[0006] Discretize the security lines that need to participate in the commanding height calculation to obtain multiple equidistant discrete points, and determine the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establish a KD tree index for the triangular facets of the target tiles;

[0007] The discrete points are upgraded to three-dimensional route points, and based on the KD tree index, the intersection points of the rays of the three-dimensional route points and the triangular facets are calculated to obtain a three-dimensional commanding height point cloud;

[0008] The commanding height building is determined by projecting the three-dimensional commanding height position point cloud onto a two-dimensional vector surface and superimposing it with the two-dimensional building vector surface of the real-scene three-dimensional model.

[0009] In some embodiments, constructing a quadtree index for each tile includes:

[0010] By calculating the maximum and minimum values ​​of all tiles in the X and Y axis directions, the bounding boxes of all tiles are determined, and the root node of the quadtree is constructed based on the bounding boxes;

[0011] The quadtree is recursively subdivided starting from the root node until the spatial range of each child node corresponds to the spatial range of a real-scene 3D model tile.

[0012] In some embodiments, establishing a KD-tree index for the triangle face of the target tile includes:

[0013] S1, calculate the variance distribution of the vertex coordinates of any triangle in the X, Y, and Z directions, set ;

[0014] S2, calculating the span of the triangular face in the D direction, and obtaining the triangular face whose coordinate of the centroid in the D direction is closest to half of the span as the initial triangular face, and inserting the initial triangular face into the KD tree;

[0015] S3, obtaining a target triangular patch whose centroid coordinate in the D direction is less than half of the span as a first target triangular patch, and recursively executing S1 and S2 on the first target triangular patch to insert the first target triangular patch into the left child node of the KD tree;

[0016] S4, obtaining a target triangle whose centroid coordinates in the D direction are greater than half the span as a second target triangle, and recursively executing S1 and S2 on the second target triangle to insert the second target triangle into the right child node of the KD tree.

[0017] In some embodiments, upgrading the discrete points to three-dimensional route points comprises:

[0018] According to the preset elevation value, the discrete points are raised a certain distance in the vertical direction to obtain preliminary three-dimensional route points;

[0019] Taking the preliminary three-dimensional route point as a starting point and combining it with a specific direction vector, a dimension-raising auxiliary ray is created;

[0020] According to the quadtree index, searching for a tile to be selected that includes the preliminary three-dimensional route point in the real-scene three-dimensional model;

[0021] The intersection point of the dimension-raising auxiliary ray and the tile to be selected is obtained, and the three-dimensional route point is obtained by combining the position coordinates of the intersection point with the target reference height.

[0022] In some embodiments, obtaining a three-dimensional commanding height point cloud by calculating the intersection of the ray of the three-dimensional route point and the triangular facet includes:

[0023] Determine the sampling intervals of the three-dimensional route points in the longitude direction and the latitude direction on the spherical surface, and calculate the number of samples in the longitude direction and the latitude direction respectively according to the sampling intervals;

[0024] Determining a direction vector of the ray based on the three-dimensional route point, the sampling interval and the sampling number;

[0025] According to the three-dimensional route point, the direction vector of the ray, and the KD tree index, the intersection points of the three-dimensional route point and the triangular facet are determined, and all the intersection points are stored as the three-dimensional commanding height point cloud.

[0026] In some embodiments, determining the intersection of the three-dimensional route point and the triangle patch according to the three-dimensional route point, the direction vector of the ray, and the KD tree index comprises:

[0027] Determine a warning area according to the three-dimensional route point and the estimated risk distance, and obtain a three-dimensional model tile in the warning area;

[0028] The KD tree index is used to establish a spatial index for the triangular facets in the three-dimensional model tile, and an intersection test is performed on the triangular facets with the spatial index according to the direction vector of the ray, and a plurality of intersection points are obtained according to the result of the intersection test.

[0029] In some embodiments, determining the commanding height building by projecting the three-dimensional commanding height point cloud onto a two-dimensional vector surface and superimposing the cloud onto the two-dimensional building vector surface of the real-scene three-dimensional model includes:

[0030] Projecting the three-dimensional commanding height point cloud onto the two-dimensional vector surface of the real-scene three-dimensional model to determine the commanding height building where the projection point exists;

[0031] By combining manual inspection and automated inspection strategies, commanding points with potential safety hazards are identified in the commanding point buildings.

[0032] In a second aspect, an embodiment of the present application provides a commanding point analysis system based on dual spatial indexing, the system comprising: an acquisition module, a point cloud construction module and a commanding point analysis module, wherein:

[0033] The acquisition module is used to acquire a real-scene three-dimensional model of an offline target scene, divide the real-scene three-dimensional model into a plurality of mutually adjacent tiles of the same size, and construct a quadtree index for each tile;

[0034] The point cloud construction module is used to discretize the security lines that need to participate in the commanding height calculation to obtain multiple equidistant discrete points, and determine the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establish a KD tree index for the triangular facets of the target tiles; and, upgrade the discrete points to three-dimensional route points, and based on the KD tree index, calculate the intersection of the rays of the three-dimensional route points and the triangular facets to obtain a three-dimensional commanding height point cloud;

[0035] The commanding height analysis module is used to determine the commanding height building by projecting the three-dimensional commanding height position point cloud onto a two-dimensional vector surface of a two-dimensional plane and superimposing it with the two-dimensional building vector surface of the real-scene three-dimensional model.

[0036] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect above when executing the computer program.

[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect above.

[0038] Compared with the related art, the commanding height analysis method based on dual spatial indexing provided in the embodiment of the present application uses a dual index construction method in the index construction link, that is, constructs a dual index of tile quadtree and triangle K-D tree, so as to realize the rapid positioning of triangles intersecting with rays in the real-life three-dimensional model. With the help of the powerful computing power of computers, the commanding heights of potential hidden dangers along the security route can be accurately discovered, which greatly improves the efficiency of commanding height calculation, enhances the practical feasibility of completing large-scale commanding height calculations based on real-life three-dimensional models, and promotes security work to be carried out more scientifically and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0040] Figure 1 is a flow chart of a commanding point analysis method based on dual spatial indexing according to an embodiment of the present application;

[0041] Figure 2 is a schematic diagram of a tile range of a real-scene 3D model according to an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of the overall structure of a real-scene three-dimensional model tile according to an embodiment of the present application;

[0043] Figure 4 It is a schematic diagram of the structure of a real-scene 3D model tile quadtree according to an embodiment of the present application;

[0044] Figure 5 It is a structural block diagram of a commanding point analysis system based on dual spatial indexing according to an embodiment of the present application;

[0045] Figure 6It is a schematic diagram of the process of another high point analysis algorithm model for dual spatial indexing according to an embodiment of the present application;

[0046] Figure 7 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0048] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0049] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] In order to ensure the safety of important people's travel routes, it is usually necessary to dispatch a large number of human resources to conduct strict inspections along the routes and implement control measures on places that may serve as commanding heights along the way. However, the manual inspection method is not only time-consuming and labor-intensive, but also very easy to miss potential commanding heights, thus threatening the personal safety of important people.

[0052] In related technologies, real-life 3D models can achieve a 1:1 restoration of the real world, so security routes can be simulated based on the real-life 3D models. By using the powerful computing power of computers, all possible hidden dangers along the route can be discovered, providing an important reference for deploying security work.

[0053] In view of this, the embodiment of the present application proposes a commanding height analysis method based on dual spatial indexing. By simulating the process of a vehicle driving on the road, the intersection of rays and the real-life three-dimensional model is used, and based on the constructed tile quadtree and triangle KD tree dual indexing, the triangular patches that intersect with the rays in the real-life three-dimensional model are efficiently located quickly, thereby generating a three-dimensional point cloud. All potential commanding heights are obtained by superimposing and analyzing the point cloud and building vector data, providing important information support for security deployment and ensuring the safety of important people when traveling to participate in various activities.

[0054] Figure 1is a flowchart of a commanding point analysis method based on dual spatial index according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:

[0055] S101, obtaining a real-scene 3D model of an offline target scene, dividing the real-scene 3D model into a plurality of mutually adjacent tiles of the same size, and constructing a quadtree index for each tile;

[0056] The target scene is a real scene in which important people participate in activities in the subsequent process. Furthermore, the real-scene 3D model is a 3D digital representation of the offline scene, which can be constructed by, but not limited to, laser scanning technology, 3D reconstruction and other technologies, and can reflect the real shape, size and spatial position relationship of the terrain and buildings in the real scene.

[0057] Furthermore, the real-scene 3D model presents a regular segmentation state in terms of physical structure. In this embodiment, it is divided into a large number of square tiles of the same size, so that the model can be operated with tiles as basic units during storage and processing. Figure 2 is a schematic diagram of a tile range of a real-scene 3D model according to an embodiment of the present application, such as Figure 2 As shown, each tile has model information within a specific spatial range, and these tiles are closely adjacent to each other without any gaps; Figure 3 It is a schematic diagram of the overall structure of a real-scene 3D model tile according to an embodiment of the present application.

[0058] Specifically, step S101 includes the following subdivision steps:

[0059] Step 1, determine the bounding box of all tiles by calculating the maximum and minimum values ​​of all tiles in the X and Y axis directions, and construct the root node of the quadtree based on the bounding box;

[0060] The range of the bounding box includes: , this range can clearly define the maximum and minimum boundaries of the entire tile set in three-dimensional space, providing a basic framework for the subsequent construction of the quadtree, so that the quadtree can perform reasonable space division and organization based on this overall range;

[0061] Furthermore, a quadtree is constructed based on the bounding box range, that is, the spatial range corresponding to the root node is equal to A rectangular range consisting of four points; this rectangular area covers the space occupied by all tiles and is the starting level of the quadtree structure.

[0062] Step 2, recursively subdivide the quadtree starting from the root node until the spatial range of each child node corresponds to the spatial range of a real-life 3D model tile.

[0063] Specifically, starting from the root node, the spatial range is continuously subdivided, and the spatial range represented by each node is divided into four equal subspaces according to certain rules, and each subspace corresponds to a child node. This process continues, and the lower-level node further divides the spatial range of the upper-level node to which it belongs into four equal subspaces, and this cycle is executed until the range of each leaf node accurately corresponds to a tile range in the real three-dimensional scene.

[0064] Figure 4 is a schematic diagram of the structure of a real-scene 3D model tile quadtree according to an embodiment of the present application, such as Figure 4 As shown in the figure, after the quadtree index is established for the real-life 3D model tiles, all tiles within the range can be quickly retrieved based on the spatial range, the spatial range where the route point is located can be quickly narrowed down, and all tiles within the range can be efficiently obtained. It can be understood that this fast retrieval capability based on spatial range greatly improves the speed of finding tiles in a specific area in large-scale real-life 3D model data, and provides data retrieval support for subsequent analysis and processing.

[0065] S102, discretizing the security lines that need to participate in the high point calculation to obtain multiple equidistant discrete points, determining the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establishing a KD tree index for the triangle facets of the target tiles;

[0066] It should be noted that the security line is the actual movement route of important people, which is composed of a series of two-dimensional broken line segments connected end to end. In order to facilitate calculation, the broken line segments need to be discretized, that is, the broken line segments are converted into a series of equidistant discrete points.

[0067] In an exemplary embodiment, a and For the line segment with endpoints, according to The line segment is discretized by interval, and the resulting point set is:

[0068]

[0069] In the formula, L represents the length of the line segment, N represents the number of points after the line segment is discretized, P is the set of all discrete points, and s represents the starting endpoint of the line segment (in coordinate form ), e represents the end point of the line segment (in coordinate form ), n is the maximum index value of the discrete point, and i as the discrete point index ranges from [0,n]. It can be understood that the security line is composed of multiple line segments, and each line segment corresponds to a set of discrete points.

[0070] Furthermore, for each route point, its corresponding risk area is determined. Usually, the area can be a spherical area established with the route point as the center and the estimated risk distance that can cause substantial harm to important people as the radius ρ.

[0071] Specifically, in this step, the quadtree index constructed in step S101 is used to quickly determine the spherical range corresponding to each route point in the real-life 3D model, and obtain the tiles within the spherical range. It can be understood that since the quadtree spatial index has been established in advance, compared with traversing one by one, the method in this embodiment can quickly retrieve and efficiently locate all tiles in the dangerous area.

[0072] Furthermore, each tile contains a series of triangles, which are defined as triangular facets in this embodiment. In this embodiment, considering the large number of triangular facets, in order to further improve the computing efficiency, a KD tree index is established for them, specifically, including the following steps:

[0073] Step 1: Calculate the variance of all triangle vertex coordinates in the X, Y, and Z directions, set as ;

[0074] The variance is a statistic used to measure the degree of discreteness of a set of data. In this embodiment, the variance is calculated for the coordinates of the triangle vertex in the three directions of X, Y, and Z to understand the discrete distribution of these vertices in various directions, thereby providing data support for the subsequent establishment of the KD tree; wherein D represents a direction set, representing the three directions of X, Y, and Z.

[0075] Step 2, calculate the span of the triangle patch vertices in the D direction, set it to , then select the centroid point in the D direction The nearest triangle is inserted into the KD tree as a node;

[0076] Furthermore, among all the triangles, the triangle whose centroid point in the D direction is closest to half the span value is selected as the initial triangle, and it is inserted into the K-D tree as a node. The centroid point is the geometric center of the triangle. The triangle patch where the nearest centroid point is located is inserted as the root node, so that the K-D tree can have a relatively reasonable starting split point in the early stage of construction, which helps to build the tree structure more evenly and improve search efficiency.

[0077] Step 3: Set the coordinate of the centroid in the D direction to be smaller than Recursively execute Step 1 and Step 2 for the triangle patch, and then insert it into the left child node of the root node of the KD tree;

[0078] This step is to recalculate the variance distribution in three directions for this partial triangular face, determine the new D direction again, and then select the triangular face whose new centroid is closest to the newly calculated one as a child node and insert it into the left child node of the current node (i.e. the root node inserted in the previous step). In this way, the left subtree is continuously recursively constructed, so that in the left branch of the K-D tree, the coordinate values ​​of the triangular face in the D direction gradually become smaller, forming an orderly hierarchical structure, which is convenient for subsequent searches to quickly locate the triangular face that may intersect with the ray.

[0079] Step 4: Set the coordinates of the centroid in the D direction to be greater than Recursively execute Step 1 and Step 2 for the triangle patch, and then insert it into the right child node of the KD tree root node.

[0080] Similarly, for triangles whose centroid coordinates in the D direction are greater than , recursively execute Step 1 and Step 2. Calculate the variance distribution, determine the new D direction and span, and select the appropriate triangle as a child node to be inserted into the right child node of the current node (root node).

[0081] Through the above operations, the coordinate values ​​of the triangles in the D direction gradually increase in the right branch of the KD tree. Repeat this process and continue to recursively subdivide the left and right child nodes until all triangles are inserted into the K-D tree, and finally construct a complete triangle K-D tree index, which provides strong support for efficient ray and triangle intersection calculation.

[0082] S103, upgrade the discrete points to three-dimensional route points, and based on the KD tree index, calculate the intersection of the rays of the discrete points and the triangular facets to obtain a three-dimensional commanding height point cloud; determine the commanding height building by projecting the three-dimensional commanding height point cloud onto a two-dimensional vector surface and superimposing it with the two-dimensional building vector surface of the real-life three-dimensional model.

[0083] It should be noted that the route points generated in step S102 are two-dimensional. In order to complete the subsequent calculation, the two-dimensional points need to be upgraded to three-dimensional points, that is, the Z coordinates are added, which specifically includes the following steps:

[0084] Step 1: According to the preset elevation value, the discrete points are raised a certain distance in the vertical direction to obtain preliminary three-dimensional route points;

[0085] Specifically, for discrete route points , raise it becomes ,in, It is usually taken as a value much higher than the ground elevation;

[0086] It can be understood that for the generated two-dimensional discrete route point, it is raised a certain distance in the vertical direction (which can be understood as the height direction). This distance is usually much higher than the actual elevation of the ground, so that it becomes a point with preliminary height information, forming a new point.

[0087] Step 2, using the preliminary 3D route point as the starting point, creating a dimension-raising auxiliary ray with a specific direction vector;

[0088] Specifically, As the starting point, d(0,0,-1) is used as the direction to create an auxiliary ray r with increased dimension; that is, take the point raised in the above steps as the starting point, and create a ray with a specific direction vector (0,0,-1). This direction vector represents the downward direction of the ray in three-dimensional space, in preparation for the subsequent intersection with the real-life three-dimensional model tile.

[0089] Step 3, according to the quadtree index, searching for a tile to be selected that includes a preliminary three-dimensional route point in the real-scene three-dimensional model;

[0090] Specifically, look for the values ​​containing the elevated The real-life 3D model tile T; it can be understood that the tile containing the previously elevated point is searched in the real-life 3D model, and the tile is quickly located through the constructed tile quadtree index to facilitate subsequent intersection calculations.

[0091] Step 4, obtain the intersection of the dimension-upgraded auxiliary ray and the tile to be selected, and obtain the three-dimensional route point by combining the position coordinates of the intersection with the target height.

[0092] Specifically, intersect r with T to get the intersection point In this step, the created dimensional auxiliary ray is used to perform intersection calculation with the found tile to obtain the intersection point of the two. This intersection point is the position where the ray intersects with the tile surface in three-dimensional space, and is an important reference for determining the height of the three-dimensional route point.

[0093] Furthermore, the height of the three-dimensional route point is set to , where σ is the height of the important person, for example, the height of the person or the height of the car window. The height of the intersection is adjusted to the appropriate target height value, and finally the dimensional conversion from the two-dimensional point to the three-dimensional point is completed, so that the point has the accurate position information of the relevant calculation in the simulated security scene in the three-dimensional space.

[0094] Furthermore, after determining the 3D route point, rays are emitted in all directions with the route point as the center to intersect with the real-scene 3D model, and the intersection is used as the basis for commanding height analysis. The steps for creating rays are as follows:

[0095] Step 1, determine the sampling intervals in the longitude and latitude directions on the spherical surface, and calculate the number of samples in the longitude and latitude directions respectively according to the sampling intervals;

[0096] Step 2, determine the direction vector of the ray based on the three-dimensional route points, sampling interval and sampling number;

[0097] Among them, taking the three-dimensional route point as the center, first determine the sampling interval in the longitude direction and the sampling interval in the latitude direction on the sphere, and then calculate the number of samples in the longitude direction and latitude direction respectively according to the set risk attack distance. These parameters together determine the direction and density of the rays emitted around the route point in three-dimensional space.

[0098] Step 3, determine the intersection coordinates based on the three-dimensional route points, the direction vector of the ray, the quadtree index and the KD tree index, and construct a three-dimensional commanding height point cloud based on the intersection coordinates.

[0099] Based on the parameters obtained from the above calculations, the direction vector of each ray is calculated through a specific formula; for example, for each sampling value in the longitude direction and each sampling value combination in the latitude direction, the direction vector of the ray from the route point to different directions is calculated according to the conversion relationship between spherical coordinates and rectangular coordinates, thereby realizing the emission of rays from the route point to various possible directions, so as to perform subsequent intersection calculations with the real-life three-dimensional model and detect potential risk commanding heights.

[0100] In an exemplary embodiment, determining the ray may be achieved by the following steps:

[0101] Step 1, let the sampling interval in the longitude direction of the spherical surface be φ, then the number of samples in the longitude direction is ;

[0102] Step 2, let the sampling interval in the spherical latitude direction be θ, then the number of samples in the latitude direction is ;

[0103] Step 3, assuming the risk distance is ω, the spherical ray direction vector formed around the route point can be expressed as:

[0104]

[0105] in, , .

[0106] Furthermore, after determining the three-dimensional points of the route and the ray expression, the ray intersection calculation can be performed to generate a three-dimensional point cloud. The specific steps are as follows:

[0107] Step 1: Determine the warning area based on the 3D route points and the estimated risk distance, and obtain the 3D model tiles in the warning area;

[0108] Based on each route point obtained in the previous step and the direction vectors of the corresponding multiple rays, the intersection test operation between the ray and the K-D tree is prepared. Each route point will be used as the starting point of the ray, combined with its corresponding direction vector, to form a ray emitted in different directions in the three-dimensional space.

[0109] Step 2: Use the KD tree index to create a spatial index for the triangular facets in the 3D model tile, and use the direction vector of the ray to perform an intersection test on the triangular facets with the spatial index to obtain multiple intersection points.

[0110] For each ray, perform an intersection test with the triangle K-D tree constructed in the previous step. Specifically, starting from the root node of the K-D tree, determine whether the ray may intersect with the triangles contained in the node and its child nodes according to the direction of the ray and the distribution of the triangles represented by the current node in space (based on the segmentation direction and node organization method determined when the K-D tree is constructed). If the intersection is possible, further recursively test in the corresponding subtree; if it is determined that the intersection is impossible, skip this part of the subtree and continue to test in other subtree branches that may intersect.

[0111] Step 3, store all intersection points as a three-dimensional commanding height point cloud.

[0112] In this way, the area where the triangles that may intersect with the ray are located can be quickly located, reducing unnecessary calculations, improving the efficiency of intersection testing, and ultimately determining whether the ray intersects with the triangles in the K-D tree. If so, the intersection points are returned. These intersection points will be used as potential points that can pose a major security threat to important people, and can be used for subsequent generation of three-dimensional point clouds and further vantage point analysis.

[0113] In an exemplary embodiment, constructing a three-dimensional commanding height point cloud includes the following steps:

[0114] 1) Filter all real-scene 3D model tiles within the radius ω according to the route point;

[0115] 2) Use KD tree to create spatial index for the triangular facets in the tiles selected in step 1);

[0116] 3) Generate a ray for each route point and its corresponding direction vector and perform an intersection test with the KD tree in step 2);

[0117] 4) If a triangle intersects the ray, the intersection point is returned and stored as a point cloud.

[0118] Furthermore, the three-dimensional commanding height point cloud is a collection of many three-dimensional points, reflecting the location of potential safety hazards. The building vector surface is a two-dimensional polygon used to express the outline of the building's footprint. Therefore, in this embodiment, during the overlay analysis, the point cloud is projected onto the two-dimensional vector surface, that is, the Z coordinate is discarded to form a projection point set. It is then determined whether each building vector surface contains a projection point. If a building vector surface has a corresponding projection point, it indicates that its position and height may make it a commanding height overlooking the security route, posing a safety hazard. The building is identified as a potential commanding height building, and manual or automated investigation strategies are required for investigation and control. This process combines three-dimensional point clouds with two-dimensional vector data to provide key decision-making basis for security risk prevention and control.

[0119] Through the above steps S101 to S103, compared with the commanding height analysis method in the related art, the embodiment of the present application uses a dual index construction method through the index construction link, that is, constructing a dual index of a tile quadtree and a triangle K-D tree, so as to achieve rapid positioning of the triangles intersecting with the rays in the real-life three-dimensional model. With the help of the powerful computing power of the computer, the commanding heights of potential hidden dangers along the security route can be accurately discovered, which greatly improves the efficiency of commanding height calculation, enhances the practical feasibility of completing large-scale commanding height calculations based on the real-life three-dimensional model, and promotes security work to be carried out more scientifically and efficiently.

[0120] It should be noted that the steps shown in the above process or the flowchart in 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.

[0121] This embodiment also provides a commanding point analysis system based on dual spatial indexing. Figure 5 is a structural block diagram of a commanding point analysis system based on dual spatial index according to an embodiment of the present application, such as Figure 5 As shown, the system includes: an acquisition module 50, a point cloud construction module 51 and a commanding height analysis module 52, wherein:

[0122] The acquisition module 50 is used to acquire a real-scene 3D model of an offline target scene, divide the real-scene 3D model into a plurality of mutually adjacent tiles of the same size, and construct a quadtree index for each tile;

[0123] The point cloud construction module 51 is used to discretize the security lines that need to participate in the commanding height calculation to obtain multiple equidistant discrete points, and determine the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establish a KD tree index for the triangular facets of the target tiles; and, upgrade the discrete points to three-dimensional route points, and obtain a three-dimensional commanding height point cloud by calculating the intersection of the rays of the three-dimensional route points and the triangular facets based on the KD tree index;

[0124] The commanding height analysis module 52 is used to determine the commanding height building by superimposing and analyzing the three-dimensional commanding height position point cloud and the two-dimensional building vector surface of the real-scene three-dimensional model.

[0125] Through the above system, the dual indexing mechanism of tile quadtree and triangle K-D tree is used in the index construction link to realize the rapid positioning of triangles intersecting with rays in the real-life three-dimensional model. With the help of the powerful computing power of the computer, the commanding heights of potential hidden dangers along the security route can be accurately discovered, which greatly improves the efficiency of commanding height calculations, enhances the practical feasibility of completing large-scale commanding height calculations based on real-life three-dimensional models, and promotes security work to be carried out more scientifically and efficiently.

[0126] also, Figure 6 It is a flow chart of another vantage point analysis algorithm model for dual spatial indexing according to an embodiment of the present application.

[0127] In one embodiment, Figure 7 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 7 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 7 As shown. The electronic device includes a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system and the computer program, the computer program is executed by the processor to implement a commanding height analysis method based on a dual spatial index, and the database is used to store data.

[0128] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0130] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A commanding point analysis method based on dual spatial index, characterized in that: The method comprises: Acquire a real-scene 3D model of an offline target scene, divide the real-scene 3D model into a plurality of mutually adjacent tiles of the same size, and construct a quadtree index for each tile; Discretize the security lines that need to participate in the commanding height calculation to obtain multiple equidistant discrete points, determine the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establish a KD tree index for the triangular facets of the target tiles; The discrete points are upgraded to three-dimensional route points, rays are emitted in all directions with the three-dimensional route points as the center, and the intersections of the rays and the triangular facets are calculated based on the KD tree index to obtain a three-dimensional commanding height point cloud, which specifically includes: Determine the sampling intervals of the three-dimensional route points in the longitude direction and the latitude direction on the spherical surface, and calculate the number of samples in the longitude direction and the latitude direction respectively according to the sampling intervals; Determining a direction vector of the ray based on the three-dimensional route point, the sampling interval and the sampling number; Determine a warning area according to the three-dimensional route point and the estimated risk distance, and obtain a three-dimensional model tile in the warning area; Using the KD tree index, a spatial index is established for the triangular facets in the three-dimensional model tile, and according to the direction vector of the ray, an intersection test is performed on the triangular facets for which the spatial index is established, and according to the result of the intersection test, a plurality of intersection points are obtained, and all the intersection points are stored as the three-dimensional commanding height point cloud; The commanding height building is determined by projecting the three-dimensional commanding height point cloud onto a two-dimensional vector surface and superimposing the cloud onto the two-dimensional building vector surface of the real-scene three-dimensional model, specifically comprising: projecting the three-dimensional commanding height point cloud onto the two-dimensional vector surface of the real-scene three-dimensional model, and determining the commanding height building where the projection point exists; By combining manual inspection and automated inspection strategies, commanding points with potential safety hazards are identified in the commanding point buildings.

2. The method according to claim 1, characterized in that Building a quadtree index for each tile includes: By calculating the maximum and minimum values ​​of all tiles in the X and Y axis directions, the bounding boxes of all tiles are determined, and the root node of the quadtree is constructed based on the bounding boxes; The quadtree is recursively subdivided starting from the root node until the spatial range of each child node corresponds to the spatial range of a real-scene 3D model tile.

3. The method according to claim 2, characterized in that Establishing a KD tree index for the triangle face of the target tile includes: S1, calculate the variance distribution of the vertex coordinates of all triangles in the X, Y, and Z directions; S2, calculating the minimum and maximum values ​​of the variance distribution, determining the span of the variance distribution, and obtaining the triangle whose coordinates of the centroid on the variance distribution are closest to half the span as the initial triangle, and inserting the initial triangle into the KD tree; S3, obtaining a target triangular patch whose centroid coordinate on the variance distribution is less than half of the span as a first target triangular patch, and recursively executing S1 and S2 on the first target triangular patch to insert the first target triangular patch into the left child node of the KD tree; S4, obtaining a target triangle whose centroid coordinates on the variance distribution are greater than half the span as a second target triangle, and recursively executing S1 and S2 on the second target triangle to insert the second target triangle into the right child node of the KD tree.

4. The method according to claim 1, characterized in that Upgrading the discrete points to three-dimensional route points comprises: According to the preset elevation value, the discrete points are raised a certain distance in the vertical direction to obtain preliminary three-dimensional route points; Taking the preliminary three-dimensional route point as a starting point and combining it with a specific direction vector, a dimension-raising auxiliary ray is created; According to the quadtree index, searching for a tile to be selected that includes the preliminary three-dimensional route point in the real-scene three-dimensional model; The intersection point of the dimension-raising auxiliary ray and the tile to be selected is obtained, and the three-dimensional route point is obtained by combining the position coordinates of the intersection point with the target reference height.

5. A commanding point analysis system based on dual spatial index, characterized in that: The system comprises: an acquisition module, a point cloud construction module and a commanding height analysis module, wherein: The acquisition module is used to acquire a real-scene three-dimensional model of an offline target scene, divide the real-scene three-dimensional model into a plurality of mutually adjacent tiles of the same size, and construct a quadtree index for each tile; The point cloud construction module is used to discretize the security lines that need to participate in the commanding height calculation to obtain multiple equidistant discrete points, and determine the target tiles related to the risk area of ​​each discrete point according to the quadtree index, and establish a KD tree index for the triangular facets of the target tiles; and upgrade the discrete points to three-dimensional route points, and based on the KD tree index, calculate the intersection of the rays of the three-dimensional route points and the triangular facets to obtain a three-dimensional commanding height point cloud, which specifically includes: Determine the sampling intervals of the three-dimensional route points in the longitude direction and the latitude direction on the spherical surface, and calculate the number of samples in the longitude direction and the latitude direction respectively according to the sampling intervals; Determining a direction vector of the ray based on the three-dimensional route point, the sampling interval and the sampling number; Determine a warning area according to the three-dimensional route point and the estimated risk distance, and obtain a three-dimensional model tile in the warning area; Using the KD tree index, a spatial index is established for the triangular facets in the three-dimensional model tile, and according to the direction vector of the ray, an intersection test is performed on the triangular facets for which the spatial index is established, and according to the result of the intersection test, a plurality of intersection points are obtained, and all the intersection points are stored as the three-dimensional commanding height point cloud; The commanding height analysis module is used to determine the commanding height building by projecting the three-dimensional commanding height position point cloud onto a two-dimensional vector surface and superimposing it with the two-dimensional building vector surface of the real-scene three-dimensional model, specifically comprising: projecting the three-dimensional commanding height position point cloud onto the two-dimensional vector surface of the real-scene three-dimensional model, and determining the commanding height building where the projection point exists; By combining manual inspection and automated inspection strategies, commanding points with potential safety hazards are identified in the commanding point buildings.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Point, line and plane obstacle model construction-based station real-time emergency response path planning method

    CN109900276A

  • Tile set visualization method for oblique photography three-dimensional model for time sequence updating

    CN116127115A