Height extraction method, system and equipment based on existing three-dimensional model and medium

By using a height extraction method based on an existing three-dimensional model and calculating the height using the distance between the camera and the object and the ray interval, the problems of high computing resources and low efficiency in the existing technology are solved, and efficient and real-time height data acquisition is achieved.

CN120635175APending Publication Date: 2025-09-12SHENZHEN SED WIRELESS COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510753031.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies require high computing resources and are costly when acquiring altitude data, and are inefficient when processing large-scale data sets, making real-time extraction difficult, especially in real-time navigation and virtual reality applications.

Method used

A height extraction method based on an existing 3D model loads geometric data, calculates the distance between the camera and the object, determines the ray interval, emits rays and records the intersection coordinates, and corrects the intersection coordinates to calculate the height. It relies on the geometric data of the existing model rather than external LiDAR or photogrammetry data, and dynamically adjusts the sampling accuracy to reduce the computational burden.

Benefits of technology

It improves the real-time performance and efficiency of height acquisition, reduces computing delay, significantly optimizes computing efficiency, and meets the needs of real-time applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635175A_ABST
    Figure CN120635175A_ABST
Patent Text Reader

Abstract

The invention relates to a height extraction method, system and device based on an existing three-dimensional model and a medium, and the method comprises the steps: loading geometric data of the existing three-dimensional model, and obtaining the position of a camera in a three-dimensional scene; the actual three-dimensional object of the existing three-dimensional model and the camera are both located in the three-dimensional scene; calculating the distance between the camera and the actual three-dimensional object according to the camera position and the geometric data, and determining a ray interval according to the distance; emitting at least two rays to the existing three-dimensional model according to the ray interval; recording coordinates of at least one pair of first top surface intersection points and coordinates of at least one pair of first bottom surface intersection points of the ray and the existing three-dimensional model; and determining the height of the actual three-dimensional object according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point. The method can improve the real-time performance and efficiency of height acquisition, and is applied to the technical field of geographic information systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of geographic information systems, and in particular to a height extraction method, system, equipment and medium based on an existing three-dimensional model. Background Art

[0002] To address the unavailability of altitude data sources, existing technologies often utilize advanced methods such as Light Detection and Ranging (LiDAR) and multi-angle photogrammetry. LiDAR technology requires specialized equipment and personnel for data collection and involves multi-stage processing, including point cloud filtering, classification, and altitude calculation. Photogrammetry, on the other hand, requires complex steps such as image registration, feature matching, and depth calculation. These technologies are not only demanding on computing resources, but also significantly increase costs due to the equipment and manpower investment. This significantly reduces efficiency when processing large datasets.

[0003] In applications such as real-time navigation and virtual reality, rapid acquisition of height information is crucial for immediate rendering and computation. However, traditional methods, due to their lengthy data processing times, significantly reduce efficiency when working with large datasets, making real-time height extraction difficult. This limitation is particularly pronounced in expansive scenes, where the computational burden increases dramatically, further exacerbating the inefficiency and making it difficult to guarantee real-time performance. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a height extraction method, system, device and medium based on an existing three-dimensional model, which can improve the real-time performance and efficiency of height acquisition.

[0005] In one aspect, the present invention provides a method for extracting height based on an existing three-dimensional model, comprising the following steps:

[0006] Loading geometric data of an existing three-dimensional model and obtaining a camera position in a three-dimensional scene; the actual three-dimensional object of the existing three-dimensional model and the camera are both located in the three-dimensional scene;

[0007] Calculating a distance between the camera and the actual three-dimensional object according to the camera position and the geometric data, and determining a ray spacing according to the distance;

[0008] emitting at least two rays toward the existing three-dimensional model according to the ray interval;

[0009] Recording the coordinates of at least one pair of first top surface intersection points and first bottom surface intersection points of the ray and the existing three-dimensional model;

[0010] The height of the actual three-dimensional object is determined according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point.

[0011] Optionally, the calculating the distance between the camera and the actual three-dimensional object according to the camera position and the geometric data specifically includes:

[0012] Extracting bounding box information of an existing three-dimensional model based on the geometric data, and determining the coordinates of a geometric center point of the bounding box based on the bounding box information;

[0013] The distance between the camera and the actual three-dimensional object is determined according to the camera position and the coordinates of the geometric center point.

[0014] Optionally, determining the ray interval according to the distance specifically includes:

[0015] If the distance is less than the first distance preset value, determining the ray interval to be the first interval preset value;

[0016] If the distance is greater than or equal to the first preset distance value and less than the second preset distance value, determining that the ray interval is the second preset interval value;

[0017] If the distance is greater than or equal to the second distance preset value, the ray interval is determined to be a third interval preset value; wherein the first distance preset value is less than the second distance preset value, the first interval preset value is less than the second interval preset value, and the second interval preset value is less than the third interval preset value.

[0018] Optionally, the emitting at least two rays toward the existing three-dimensional model according to the ray interval specifically includes:

[0019] generating a covering grid on the surface of the existing three-dimensional model according to the ray interval; the covering grid includes a plurality of grid cells, and the plurality of grid cells are located on a bounding box;

[0020] Project the mth ray to the center point of the nth grid unit; wherein n and m are both natural numbers greater than 0.

[0021] Optionally, recording the coordinates of at least one pair of first top surface intersection points and first bottom surface intersection points of the ray and the existing three-dimensional model specifically includes:

[0022] Recording the coordinates of the first intersection point of the i-th ray with the top surface of the existing three-dimensional model as the coordinates of the i-th intersection point of the first top surface; wherein i is a natural number greater than 0;

[0023] Obtain all intersection points of the i-th ray and the existing three-dimensional model, record the coordinates of the intersection point where the difference between the z coordinate and the bounding box is within a first preset range and / or record the coordinates of the intersection point where the difference between the z coordinate and the bottom surface normal is within a second preset range as the coordinates of the i-th intersection point of the first bottom surface.

[0024] Optionally, determining the height of the actual three-dimensional object according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point specifically includes:

[0025] Obtain the coordinates of the second top surface intersection point and the second bottom surface intersection point according to the coordinates of the first top surface intersection point, the coordinates of the first bottom surface intersection point, and the coordinates of the first top surface intersection point and the first bottom surface intersection point excluding abnormalities in the geometric data;

[0026] Determine the abnormal second top surface intersection point and the second bottom surface intersection point according to the coordinates of the second top surface intersection point and the coordinates of the second bottom surface intersection point, and correct them to obtain the coordinates of the third top surface intersection point and the coordinates of the second bottom surface intersection point;

[0027] The height difference between each pair of coordinates of the third top surface intersection point and the coordinates of the third bottom surface intersection point is calculated, and the average value of all height differences is calculated to obtain the height of the actual three-dimensional object.

[0028] Optionally, determining the abnormal second top surface intersection point and the second bottom surface intersection point based on the coordinates of the second top surface intersection point and the coordinates of the second bottom surface intersection point, and correcting them to obtain the coordinates of the third top surface intersection point and the coordinates of the second bottom surface intersection point specifically includes:

[0029] Determine the z-coordinate difference between the j-th second top surface intersection point or the j-th second bottom surface intersection point and each adjacent intersection point. If there is a z-coordinate difference greater than a preset difference value, correct the z-coordinate of the j-th second top surface intersection point or the j-th second bottom surface intersection point to the z-coordinate of the nearest adjacent intersection point; where j is a natural number greater than 0.

[0030] The z coordinate of the corrected j-th second top surface intersection point or the j-th second bottom surface intersection point is verified. If the verification passes, the coordinate of the j-th third top surface intersection point or the j-th third bottom surface intersection point is obtained.

[0031] On the other hand, the present invention provides a height extraction system based on an existing three-dimensional model, comprising a central computing module and a camera, wherein:

[0032] The camera is used to emit at least two rays toward the actual three-dimensional object;

[0033] The central computing module is used to implement the method described above.

[0034] On the other hand, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the aforementioned method when executing the computer program.

[0035] In another aspect, the present invention provides a computer-readable storage medium storing a program executable by a processor. When the program is executed by a processor, the program is used to perform the method described above.

[0036] The implementation of the present invention includes the following beneficial effects: the present invention determines the distance between the camera and the object based on the geometric data of the existing model and the camera position, relying on the geometric data built into the existing model without introducing external LiDAR point cloud or photogrammetry data, thereby reducing the calculation process; the ray interval is determined according to the distance, that is, the sampling accuracy is determined according to the distance, reducing unnecessary calculation burden, thereby improving the processing speed. This dynamic adjustment mechanism can significantly optimize the calculation efficiency while ensuring the height extraction accuracy; by reducing the calculation process and improving the processing speed, the data processing delay can be reduced and the real-time performance of height acquisition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flowchart of the steps of a height extraction method based on an existing three-dimensional model provided by the present invention;

[0038] Figure 2 This is a flowchart of the steps for calculating camera distance provided by the present invention;

[0039] Figure 3 This is a flow chart of steps for determining ray spacing provided by the present invention;

[0040] Figure 4 This is a schematic diagram of a process for detecting the intersection of a ray and an existing three-dimensional model provided by the present invention;

[0041] Figure 5 It is a flow chart of steps for calculating height provided by the present invention;

[0042] Figure 6 It is a structural schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are provided for ease of description only and do not limit the order of the steps. The order of execution of the steps in the embodiments can be adaptively adjusted based on the understanding of those skilled in the art.

[0044] The terms used in the embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of the present application. The singular forms "a," "the," and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0045] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims. In the description of the present application, it should be understood that the terms "first", "second", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0046] To better understand the technical solution of the present invention, we will explain existing 3D models. These existing 3D models can come from existing platforms, such as the Cesium platform, CesiumLab platform, Three.js platform, BIM model engine platform, and Tiandi Map platform. The embodiments of the present invention will be explained using the Cesium platform as an example.

[0047] In some embodiments, as Figure 1 As shown, Figure 1 The present invention provides a method for extracting height based on an existing three-dimensional model, comprising the following steps:

[0048] S100: Loading geometric data of an existing three-dimensional model, and obtaining a camera position in a three-dimensional scene.

[0049] The existing 3D model includes both the actual 3D object and the camera located in a 3D scene. The geometric data includes top, bottom, and side surface information. The existing 3D model can be, but is not limited to, a 3D model of a physical object such as a building or mountain.

[0050] Specifically, if Figure 2 As shown, Figure 2This is a flowchart of the steps for calculating camera distance. The Tileset JSON file is loaded through the Cesium platform's Cesium3DTileset interface. The Cesium3DTileset interface is the application programming interface (API) for loading and manipulating Tileset data on the Cesium platform. The Tileset JSON file is the format used in Cesium to store 3D model block data. Tileset data contains top, bottom, and side information, supports multiple levels of detail (LOD), and supports rendering and calculation operations at different levels of detail.

[0051] Initialize the Cesium 3D scene, set the camera's initial position to the default viewing angle (for example, 120° longitude, 30° latitude, and 5000 meters altitude), and point the camera toward the actual 3D object area. Rendering parameters include enabling anti-aliasing and depth testing to ensure that the tileset data is loaded correctly.

[0052] Check the loading status of the tileset data to confirm that all geometric data (top, bottom, and side faces) has been loaded. If loading fails (for example, due to a network outage or file corruption), throw an exception and terminate the process. If loading succeeds, obtain the camera's position in the 3D scene.

[0053] Use the viewer.camera.position interface to obtain the Cartesian coordinates (Cartesian3) of the camera in the 3D scene, denoted as cameraPosition. The format can be (xc, yc, zc), the unit is meter, and it represents the spatial position of the camera relative to the center of the earth.

[0054] S200 , calculating the distance between the camera and the actual three-dimensional object according to the camera position and geometric data, and determining the ray interval according to the distance.

[0055] The distance may be Euclidean distance or other distances.

[0056] Specifically, the bounding box information of the existing 3D model is determined based on the geometric data, and the distance between the camera and the actual 3D object is calculated based on the bounding box information and the camera position, which specifically includes the following steps:

[0057] S210: Extract bounding box information of the existing three-dimensional model according to the geometric data.

[0058] Specifically, the bounding box information of the building model is extracted from the boundingVolume attribute of Tileset, and the coordinates of the geometric center point of the bounding box are calculated, recorded as buildingCenter, in the format of (xb, yb, zb), in meters, representing the center position of the three-dimensional object.

[0059] If it is other platforms, obtaining the coordinates of the geometric center point of the bounding box by calculating the coordinates of the geometric center point of the bounding box according to other platforms also falls within the scope of protection of the present invention.

[0060] S220 : Determine the distance between the camera and the actual three-dimensional object according to the camera position and the coordinates of the geometric center point.

[0061] Specifically, the Cartesian3.distance method of the Cesium platform can be used to calculate the Euclidean distance between the camera position cameraPosition and the building center buildingCenter. The formula is shown in (1):

[0062]

[0063] like Figure 3 As shown, Figure 3 This is a flow chart of the steps for determining ray spacing. Next, the ray spacing is determined based on the distance. The ray spacing can represent the sampling accuracy on the existing 3D model, specifically including:

[0064] In the present invention, the first distance preset value is smaller than the second distance preset value, the first interval preset value is smaller than the second interval preset value, and the second interval preset value is smaller than the third interval preset value, all of which represent actual ray distances. If converted to intervals on an existing three-dimensional model, they need to be converted according to the scale ratio.

[0065] S220a: If the distance is less than the first preset distance value, determine the ray interval to be the first preset interval value.

[0066] For example, the first distance preset value may be, but is not limited to, 50 meters. The first interval preset value may be, but is not limited to, 5 meters.

[0067] S220b: If the distance is greater than or equal to the first preset distance value and less than the second preset distance value, determine that the ray interval is the second preset interval value.

[0068] For example, the second distance preset value may be, but is not limited to, 150 meters, and the second interval preset value may be, but is not limited to, 10 meters.

[0069] S220c: If the distance is greater than or equal to the second preset distance value, determine that the ray interval is a third preset interval value.

[0070] For example, the third interval preset value may be, but is not limited to, 20 meters.

[0071] S300: Emit at least two rays toward the existing three-dimensional model according to the ray interval.

[0072] Here, the ray represents the line between the camera position and the 3D model.

[0073] Specifically include:

[0074] S310 , generating a covering grid on the surface of the existing three-dimensional model according to the ray interval.

[0075] The covering grid includes a plurality of grid cells, and the plurality of grid cells are located on the bounding box.

[0076] Based on the ray spacing (sampling density) adjusted by the adaptive sampling strategy, a coverage grid is generated on the building surface. The coverage grid is bounded by the bounding box, and the size of the grid cells is determined by the ray spacing (for example, 1m×1m for dense sampling and 5m×5m for sparse sampling). The coordinates (x, y, z) of the center point of each grid cell are recorded, which serves as the starting point for subsequent ray casting.

[0077] S320: Project the mth ray to the center point of the nth grid unit.

[0078] Wherein, n and m are both natural numbers greater than 0.

[0079] Specifically, a ray is emitted from the camera position toward the center point of each grid cell. The ray direction is determined by the camera position and the grid cell center point, using the following formula: direction = normalize(gridPoint - cameraPosition). gridPoint represents the coordinates of the grid cell center point, cameraPosition represents the coordinates of the camera position, and normalize represents a vector normalization operation. The scene.pickPosition method (which retrieves the mouse click position) is used to detect the intersection of the ray and the building model. The mth ray is scanned downward from the top surface of the existing 3D model, passing through the center points of several grid cells on this line.

[0080] S400 , recording the coordinates of at least one pair of first top surface intersection points and first bottom surface intersection points of the ray and the existing three-dimensional model.

[0081] The present invention emits a plurality of rays to the existing three-dimensional model, where a plurality represents more than 2, and a plurality of pairs of first top surface intersection points and first bottom surface intersection points can be obtained.

[0082] The specific steps include:

[0083] S410 , recording the coordinates of the first intersection point between the i-th ray and the top surface of the existing three-dimensional model as the coordinates of the i-th first top surface intersection point.

[0084] Wherein, i is a natural number greater than 0.

[0085] like Figure 4 As shown, Figure 4 This is a flow chart for detecting the intersection of a ray with an existing 3D model. This example uses the Cesium platform's scene.pickPositionFromRay method to detect the first intersection of the first ray with the existing 3D model, typically corresponding to the top surface of the existing 3D model, obtaining the first top-surface intersection point. The second ray's first intersection with the existing 3D model is detected to obtain the second first-top-surface intersection point, and so on. The coordinates of each first-top-surface intersection point are recorded in topPoints in the format [(x1, y1, z1), (x2, y2, z2), ...].

[0086] S420. Obtain all intersection points of the i-th ray and the existing three-dimensional model, record the coordinates of the intersection point whose z coordinate is the difference between the z coordinate and the bounding box within the first preset range and / or record the coordinates of the intersection point whose z coordinate is the difference between the z coordinate and the bottom surface normal within the second preset range as the coordinates of the i-th first bottom surface intersection point.

[0087] The bounding box can be the actual bounding box of an existing 3D model, or a bounding box corrected based on the error. The first preset range is ±0.5 meters of the zMin of the 3D Tileset bounding box. The bottom surface normal can be, but is not limited to, close to (0, 0, -1).

[0088] To overcome the problem of the bottom surface being obscured by the top, walls, or other geometry, the scene.drillPickFromRay method is used to obtain all intersections between the first ray and the existing 3D model. The maximum number of intersections is limited, and the ray is sorted by depth and then validated by height (i.e., z-coordinate). The b3dm data is parsed to identify bottom intersections. The first intersection whose z-coordinate falls within a first preset range and / or whose z-coordinate difference with the bottom surface normal falls within a second preset range is selected as the first bottom intersection point and recorded in bottomPoints , using a format similar to topPoints . If no bottom intersection is detected, the search continues from the first intersection point in 0.1-meter steps along the ray's direction of travel, repeating the intersection check until a valid first bottom intersection is found or the maximum penetration depth (based on the bounding box height setting) is reached. If no first bottom intersection is found, the bottom data is not recorded. If no intersection is detected (either top or bottom), the first ray is marked as invalid and discarded. This process continues in this manner, until the first bottom intersection point corresponding to the first ray is obtained.

[0089] Record the coordinates of the first top surface intersection point and the first bottom surface intersection point corresponding to all rays.

[0090] S500: Determine the height of the actual three-dimensional object according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point.

[0091] In order to reduce the amount of calculation and improve the accuracy, we first remove some of the first top surface intersection points and the first bottom surface intersection points to obtain the second top surface intersection points and the second bottom surface intersection points. We then correct the z coordinates of the second top surface intersection points to obtain the third top surface intersection points. The third top surface intersection points and the second bottom surface intersection points are then combined into a pair of intersection point data. The specific process is as follows:

[0092] S510 , eliminating abnormal coordinates of the first top intersection point and the first bottom intersection point according to the coordinates of the first top intersection point, the coordinates of the first bottom intersection point, and the geometric data, to obtain the coordinates of the second top intersection point and the coordinates of the second bottom intersection point.

[0093] Specifically, the bounding box of the existing 3D model is obtained based on the geometric data using the boundingVolume property of the Tileset. The bounding box is represented as a rectangular volume containing minimum and maximum coordinates (xMin, xMax, yMin, yMax, zMin, zMax). The bounding box is parsed from the Tileset JSON file by the Cesium platform's Cesium3DTileset interface. To accommodate errors in the existing model and ray detection deviations, the bounding box is expanded by ±10% to obtain the verification range. The verification range is [xMin-0.1*(xMax-xMin), xMax+0.1*(xMax-xMin)] on the x-axis; [yMin-0.1*(yMax-yMin), yMax+0.1*(yMax-yMin)] on the y-axis; and [zMin-0.1*(zMax-zMin), zMax+0.1*(zMax-zMin)] on the z-axis.

[0094] Verify whether the coordinates (x, y, z) of each first top intersection point and the first bottom intersection point in topPoints and bottomPoints are within the above verification range. If they exceed the verification range of any axis, the first intersection point is discarded.

[0095] S520 , determining the abnormal second top surface intersection point and the second bottom surface intersection point according to the coordinates of the second top surface intersection point and the coordinates of the second bottom surface intersection point, and correcting them to obtain the coordinates of the third top surface intersection point and the coordinates of the second bottom surface intersection point.

[0096] Specifically, if Figure 5 As shown, Figure 5This is a flowchart of the steps for calculating the height. Traversing all second top surface intersections, for each second top surface intersection, step S520 specifically includes the following steps:

[0097] S521. Determine the z-coordinate difference between the j-th second top surface intersection point or the j-th second bottom surface intersection point and each adjacent intersection point. If there is a z-coordinate difference that is greater than a preset difference value, correct the z-coordinate of the j-th second top surface intersection point or the j-th second bottom surface intersection point to the z-coordinate of the nearest intersection point.

[0098] Wherein, j is a natural number greater than 0. The adjacent intersection point may be the intersection of the four-connected neighborhood and the center point of the grid cell directly adjacent to the current grid cell in the x or y direction. The preset difference value may be, but is not limited to, 0.5 meters.

[0099] Specifically, the z coordinates of the jth second top surface intersection point are compared with each adjacent intersection point, and the z coordinate differences are calculated. If any or all z coordinate differences are greater than a preset difference value, the area is considered to have a large height change and is marked as requiring smoothing. The corresponding intersection index is recorded. Based on these comparison results, the intersection indexes of all areas requiring smoothing are recorded to form a set of areas requiring smoothing.

[0100] For the jth second top surface intersection in the set of regions to be smoothed, the nearest intersection is found based on the grid cell adjacency relationship. The height (z coordinate) of the jth second top surface intersection is replaced with the z coordinate of the nearest intersection to make the z coordinate change smoother.

[0101] The processing method for the j-th second bottom surface intersection point is the same as the processing method for the j-th second top surface intersection point.

[0102] S522 . Verify the z coordinate of the corrected j-th second top surface intersection point or the j-th second bottom surface intersection point. If the verification passes, obtain the coordinate of the j-th third top surface intersection point or the j-th third bottom surface intersection point.

[0103] Specifically, the z-coordinate value difference of the corrected j-th second top surface intersection point is re-determined according to the method of step S521 to ensure that the difference is less than the preset difference value.

[0104] S530: Calculate the height difference between the coordinates of each pair of the third top surface intersection point and the coordinates of the third bottom surface intersection point, calculate the average value of all the height differences, and obtain the actual height of the three-dimensional object.

[0105] Specifically, for the coordinates of each third top intersection point and the coordinates of the third bottom intersection point, use the Cesium.Cartographic.fromCartesian method to convert them into Cartographic coordinates in the format of (longitude, latitude, altitude), and the altitude unit is meters.

[0106] Extract height values ​​from cartographic coordinates to generate a top height array (topHeights) in the format [topHeight1, topHeight2,...] and a bottom height array (bottomHeights) in the format [bottomHeight1, bottomHeight2,...]. Height values ​​represent the relative height of the intersection point to the bottom surface or a set plane. Ensure that each height value is within a reasonable range. If it is outside the range, mark it as an abnormal intersection and remove it. The reasonable range can be, but is not limited to, 0-1000m.

[0107] After removing abnormal height values, calculate the height difference HeightDiff based on each pair of height values i , the formula is shown in (2):

[0108] HeightDiff i =topHeight i -bottomHeight i (2)

[0109] Calculate the average value of the height difference to get the height Height, as shown in formula (3):

[0110]

[0111] The calculated height (unit: meter) is output as the final result.

[0112] On the other hand, the present invention provides a height extraction system based on an existing three-dimensional model, comprising a central computing module and a camera, wherein:

[0113] A camera, configured to emit at least two rays according to the actual three-dimensional object;

[0114] The central computing module is used to implement the above method.

[0115] The specific method is the same as the above method embodiment.

[0116] The present invention also has the following beneficial effects:

[0117] The present invention determines the distance between the camera and the object based on the geometric data of the existing model and the camera position, relying on the built-in geometric data of the existing model without the introduction of external LiDAR point cloud or photogrammetry data, thus reducing the calculation process; the ray interval is determined according to the distance, that is, the sampling accuracy is determined according to the distance, the number of sampling points is reasonably arranged, and unnecessary calculation burden is reduced, thereby improving the processing speed. This dynamic adjustment mechanism can significantly optimize the calculation efficiency while ensuring the height extraction accuracy; by reducing the calculation process and improving the processing speed, the data processing delay can be reduced and the real-time performance of height acquisition can be improved.

[0118] In addition, the present invention combines the bounding box and the normal to determine the bottom surface intersection, which can adapt to the problem of the top surface, wall surface or other geometric surfaces blocking the bottom surface, thereby improving the accuracy.

[0119] The present invention realizes the accurate calculation of building height on the Cesium platform through ray casting climbing point technology (determining the ray interval and forming a coverage network, and obtaining the intersection of the ray and the coverage network by clicking the mouse) and Cesium.Cartographic.fromCartesian method. The ray casting climbing point technology combined with penetration detection (obtaining multiple intersections through scene.drillPickFromRay, with a height verification tolerance of ±0.5 meters) ensures the accuracy of the bottom surface intersection, and further improves the stability of the top surface height through adjacent point height smoothing (based on four-connected neighborhood, z-value difference threshold of 0.5 meters). Experimental results show that when processing the height extraction task of 1000 rays, the average response time of this solution is 0.8 seconds, and the height extraction error is controlled within ±0.1 meters, while traditional methods (such as offline processing based on laser point clouds, with an average response time of 3.5 seconds and an error of ±0.3 meters) are inferior to this solution in terms of real-time performance and accuracy. While ensuring high data quality (error reduction of approximately 66%), the present invention significantly improves extraction efficiency (response time shortened by approximately 77%) and response speed, meeting the needs of dynamic application scenarios (such as real-time urban planning and BIM integration).

[0120] In some embodiments, such as Figure 6 As shown, Figure 6 1 is a structural diagram of an electronic device provided by the present invention. The present invention also provides an electronic device, which includes a processor 10 and a memory 11, wherein the memory 11 stores a computer program, and when the processor 10 executes the computer program, it implements any one of the methods described in the above method embodiments.

[0121] Among them, the memory is a non-transient computer-readable storage medium that can be used to store non-transient software programs and non-transient computer executable programs. The memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory optionally includes a remote memory remotely arranged relative to the processor, and these remote memories can be connected to the processor via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0122] The present invention also provides a computer-readable storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to execute any one of the methods described in the above method embodiments.

[0123] It is understood that all or some steps, systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include computer storage media (or non-transitory media) and communication media (or temporary media). As known to those of ordinary skill in the art, the term computer storage medium is included in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data) and is volatile and non-volatile, removable and non-removable media. Computer storage media includes but is not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or can be used to store desired information and any other medium that can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0124] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A height extraction method based on an existing three-dimensional model, characterized in that: The following steps are involved: Load the geometric data of an existing 3D model and obtain the camera position in the 3D scene; The actual three-dimensional object of the existing three-dimensional model and the camera are both located in the three-dimensional scene; Calculating a distance between the camera and the actual three-dimensional object according to the camera position and the geometric data, and determining a ray spacing according to the distance; emitting at least two rays toward the existing three-dimensional model according to the ray interval; Recording the coordinates of at least one pair of first top surface intersection points and first bottom surface intersection points of the ray and the existing three-dimensional model; The height of the actual three-dimensional object is determined according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point.

2. The method according to claim 1, characterized in that The calculating the distance between the camera and the actual three-dimensional object according to the camera position and the geometric data specifically includes: Extracting bounding box information of an existing three-dimensional model based on the geometric data, and determining the coordinates of a geometric center point of the bounding box based on the bounding box information; The distance between the camera and the actual three-dimensional object is determined according to the camera position and the coordinates of the geometric center point.

3. The method according to claim 1, characterized in that Determining the ray interval according to the distance specifically includes: If the distance is less than the first distance preset value, determining the ray interval to be the first interval preset value; If the distance is greater than or equal to the first preset distance value and less than the second preset distance value, determining that the ray interval is the second preset interval value; If the distance is greater than or equal to the second distance preset value, the ray interval is determined to be a third interval preset value; wherein the first distance preset value is less than the second distance preset value, the first interval preset value is less than the second interval preset value, and the second interval preset value is less than the third interval preset value.

4. The method according to claim 1, wherein The emitting at least two rays toward the existing three-dimensional model according to the ray interval specifically includes: generating a covering grid on the surface of the existing three-dimensional model according to the ray interval; the covering grid includes a plurality of grid cells, and the plurality of grid cells are located on a bounding box; Project the mth ray to the center point of the nth grid unit; wherein n and m are both natural numbers greater than 0.

5. The method according to claim 1, characterized in that The recording of the coordinates of at least one pair of first top surface intersection points and first bottom surface intersection points of the ray and the existing three-dimensional model specifically includes: Recording the coordinates of the first intersection point of the i-th ray with the top surface of the existing three-dimensional model as the coordinates of the i-th intersection point of the first top surface; wherein i is a natural number greater than 0; Obtain all intersection points of the i-th ray and the existing three-dimensional model, record the coordinates of the intersection point where the difference between the z coordinate and the bounding box is within a first preset range and / or record the coordinates of the intersection point where the difference between the z coordinate and the bottom surface normal is within a second preset range as the coordinates of the i-th intersection point of the first bottom surface.

6. The method according to claim 1, characterized in that The determining the height of the actual three-dimensional object according to the coordinates of the first top surface intersection point and the coordinates of the first bottom surface intersection point specifically includes: Obtain the coordinates of the second top surface intersection point and the second bottom surface intersection point according to the coordinates of the first top surface intersection point, the coordinates of the first bottom surface intersection point, and the coordinates of the first top surface intersection point and the first bottom surface intersection point excluding abnormalities in the geometric data; Determine the abnormal second top surface intersection point and the second bottom surface intersection point according to the coordinates of the second top surface intersection point and the coordinates of the second bottom surface intersection point, and correct them to obtain the coordinates of the third top surface intersection point and the coordinates of the second bottom surface intersection point; The height difference between each pair of coordinates of the third top surface intersection point and the coordinates of the third bottom surface intersection point is calculated, and the average value of all height differences is calculated to obtain the height of the actual three-dimensional object.

7. The method according to claim 6, characterized in that The step of determining the abnormal second top surface intersection point and the second bottom surface intersection point based on the coordinates of the second top surface intersection point and the coordinates of the second bottom surface intersection point, and correcting the abnormal second top surface intersection point and the second bottom surface intersection point to obtain the coordinates of the third top surface intersection point and the second bottom surface intersection point specifically includes: Determine the z-coordinate difference between the j-th second top surface intersection point or the j-th second bottom surface intersection point and each adjacent intersection point. If there is a z-coordinate difference greater than a preset difference value, correct the z-coordinate of the j-th second top surface intersection point or the j-th second bottom surface intersection point to the z-coordinate of the nearest adjacent intersection point; where j is a natural number greater than 0. The z coordinate of the corrected j-th second top surface intersection point or the j-th second bottom surface intersection point is verified. If the verification passes, the coordinate of the j-th third top surface intersection point or the j-th third bottom surface intersection point is obtained.

8. A height extraction system based on an existing three-dimensional model, characterized in that: It includes a central computing module and a camera, The camera is used to emit at least two rays toward the actual three-dimensional object; The central computing module is used to implement the method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that A processor-executable program is stored therein, and when the processor-executable program is executed by the processor, it is used to perform the method according to any one of claims 1 to 7.