An intelligent seamless mosaic method for complex hydraulic structure models and three-dimensional terrain

By interactively marking the underground structure of the hydraulic structure model, generating and optimizing the model bottom surface height map, the problem of seamless fitting of the complex hydraulic structure model with the three-dimensional terrain is solved, the display effect is improved, the time cost of data update is reduced, and the surface flickering is avoided.

CN115330978BActive Publication Date: 2025-09-12CHANGJIANG SPATIAL INFORMATION TECH ENG CO LTD (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210909573.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-09-12
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve seamless integration of complex hydraulic structure models with three-dimensional terrain, and there are problems of high time cost and flickering model surfaces during three-dimensional display.

Method used

By interactively marking the underground structure of the hydraulic structure model, a height map of the model bottom surface is generated, and morphological processing is used to filter the hollow structure, calculate the elevation offset value, and update the three-dimensional terrain tiles to ensure seamless fit between the model and the terrain and avoid surface flickering.

Benefits of technology

It achieves seamless integration of complex hydraulic structure models with three-dimensional terrain, improves display effects, reduces data update time costs, and avoids model surface flickering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115330978B_ABST
    Figure CN115330978B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for intelligent seamless mosaicking of complex hydraulic structure models and three-dimensional terrain. It includes the following steps: step one: marking of the model's underground structure; step two: generation of a model bottom surface height map; step three: morphological optimization processing of the height map; step four: calculation of elevation offset values ​​at different levels; based on the viewpoint height of the three-dimensional terrain tiles switched at different levels, approximately estimate the distance between the near and far clipping surfaces during the three-dimensional rendering process, and calculate the minimum elevation difference that meets the depth cache accuracy conditions; step five: generation and update of three-dimensional terrain tiles; based on the three-dimensional terrain tile segmentation and naming rules required by the 3DGIS scene, while taking into account the elevation offset value conditions at different levels, generate three-dimensional terrain tiles for the hydraulic structure model bottom surface height map, and partially replace and update the existing terrain tiles. The present invention has the advantages of achieving seamless fitting of complex hydraulic structure models with three-dimensional terrain scenes and improving the display effect of the model scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional geographic information technology, in particular to a method for modifying three-dimensional terrain, and more specifically to an intelligent seamless mosaic method for a complex hydraulic construction model and three-dimensional terrain. Background Art

[0002] During the project planning and design process, after completing a certain stage of modeling, in order to visually present the finished product, three-dimensional geographic information system (3DGIS) software can be used to overlay the architectural model design results within a virtual scene for a three-dimensional display. In a 3DGIS scene, terrain is stored as a digital elevation model (DEM), with each pixel representing an elevation data point. In practical applications, DEM data is often resampled to form multi-level pyramid-like 3D terrain tiles to meet the loading and rendering requirements of 3DGIS software.

[0003] 3D terrain tiles generated from DEM data can accurately depict the topography of the project area. However, during construction, especially during foundation construction, localized leveling, excavation, and backfilling are often required, altering the original terrain structure. To accurately represent these modified terrain changes in a 3D GIS scene, the DEM or 3D terrain tile data must be modified to achieve a seamless fit between the building model and the 3D terrain.

[0004] Currently, a common method for achieving the fit of building models with three-dimensional terrain is: first, add a regular model base during the model building process, then determine the vector range and elevation value of the model base, and uniformly replace the elevation of the corresponding range in the DEM data with this elevation value, and finally regenerate the three-dimensional terrain tiles based on the modified DEM data and perform three-dimensional display.

[0005] This solution is well suited for simple building models, but for complex hydraulic structure models such as dams, navigation channels, and canals, the following problems may arise during application: (1) Hydraulic structure models are usually modeled using BIM design software. The model structure is complex and most of them do not have a regular base. The slope and other structures of the model need to fit seamlessly with the terrain to truly present the state of the project after completion; (2) The three-dimensional display of hydraulic structure models involves a large range of scenes, and the time cost required to modify the DEM data and regenerate the three-dimensional terrain tiles is high; (3) Due to the large range of the three-dimensional display scene, when the three-dimensional viewpoint is far away, the depth values ​​of the terrain and model are compressed to between 0 and 1 due to the accuracy limitation of the depth cache during the rendering process. When the elevation values ​​of the two are close, the model surface may flicker due to the inability to judge the order of drawing.

[0006] Therefore, it is urgent to propose an intelligent seamless mosaic method for complex hydraulic structure models and three-dimensional terrain to solve the above problems, so as to achieve seamless fitting of complex hydraulic structure models and three-dimensional terrain scenes. Summary of the Invention

[0007] The purpose of the present invention is to provide an intelligent seamless mosaic method for complex hydraulic structure models and three-dimensional terrain, to achieve seamless fitting of complex hydraulic structure models and three-dimensional terrain scenes, and to improve the display effect of model scenes; to solve the problem that complex hydraulic structure BIM models are difficult to seamlessly fit with terrain data when displayed in three-dimensional scenes.

[0008] In order to achieve the above object, the technical solution of the present invention is: a method for intelligent seamless mosaic of complex hydraulic structure model and three-dimensional terrain, characterized by comprising the following steps:

[0009] Step 1: Marking the underground structure of the model:

[0010] Interactively select and mark components of hydraulic structure models that should be buried under the terrain in the 3DGIS scene;

[0011] Step 2: Generate model bottom height map;

[0012] According to a certain sampling resolution, a three-dimensional ray method intersection test is performed on the bottom surface of the model to generate a height map of the bottom surface of the model; the present invention accurately places the hydraulic structure model in the corresponding area of ​​the 3DGIS scene, calculates the rectangular bounding box of the hydraulic structure model on the XY plane, and within the rectangular area of ​​the rectangular bounding box, according to a certain sampling resolution, performs a three-dimensional ray method intersection test point by point along the Z axis from the underground toward the bottom of the hydraulic structure model, and filters the underground structure part of the hydraulic structure model to generate a height map of the bottom surface of the hydraulic structure model; the present invention uses the interactive underground structure mark combined with step one to filter the underground components of the hydraulic structure model to obtain the required terrain height map;

[0013] Step 3: morphological optimization of height map;

[0014] For hollowed-out component structures in hydraulic structure models, as well as gaps between adjacent facets caused by irregular modeling, the height map is morphologically processed. Hollowed-out component structures refer to the ventilation shafts, reserved holes, and other connection structures of hydraulic structure models, which are normal holes. Intermediate facet gaps refer to facet additions and problems caused by irregular modeling or exporting, which are abnormal holes. Both types of holes require morphological processing.

[0015] The present invention filters and eliminates the holes by morphological processing of the height map, and fills the holes according to the mean value of the neighborhood elevation. In step three, the present invention uses the morphological corrosion and expansion method of the grayscale image, and extends its application to terrain height map processing to solve the problem of broken holes caused by factors such as the hollow structure inside the hydraulic structure model.

[0016] Step 4: Calculate the elevation offset values ​​at different levels;

[0017] Based on the viewpoint heights of different levels of 3D terrain tile switching, the distances between the far and near clipping planes during 3D rendering are approximately estimated, and the minimum elevation difference that meets the depth buffer accuracy conditions is calculated to avoid model surface flickering caused by the inability to determine the front and back order of drawing in 3DGIS scenes. Step 4 of the present invention considers the accuracy requirements of the depth buffer and calculates the elevation offset values ​​of different levels to avoid the problem of surface flickering at different viewpoint distances.

[0018] Step 5: Generate and update 3D terrain tiles;

[0019] Based on the 3D terrain tile segmentation and naming rules required by 3DGIS scenarios, and taking into account the elevation offset values ​​at different levels, 3D terrain tiles are generated for the hydraulic structure model's bottom surface height map, and existing terrain tiles are partially replaced and updated. Step 5 of the present invention combines the elevation offset values ​​from step 4 to replace and update the local terrain, improving the efficiency of terrain data updates.

[0020] In the above technical solution, in step 1, the component structures buried under the terrain in the hydraulic structure model include underground water pipelines, corridors, etc.

[0021] In step three, the hollowed-out component structure includes air shafts, reserved holes, etc.

[0022] In the above technical solution, in step 2, the method for generating the bottom surface height map of the hydraulic structure model includes the following steps:

[0023] Step 2.1: Calculate the spatial extent of the hydraulic structure model and initialize the bottom height map;

[0024] Step 2.2: 3D ray intersection test on the bottom surface of the hydraulic structure model;

[0025] Step 2.3: Based on the intersection test results of each pixel, calculate the height map elevation value and assign it.

[0026] In the above technical solution, in step 2.1, the method for calculating the spatial range of the hydraulic structure model and initializing the bottom height map includes the following steps:

[0027] Step 2.1.1: Accurately place the hydraulic structure model in the corresponding area in the 3DGIS scene and calculate the rectangular bounding box Xmin, Xmax, Ymin, Ymax of the hydraulic structure model on the XY plane;

[0028] Step 2.1.2: Based on the spatial reference and 3D display accuracy requirements of the 3DGIS scene, define the resolution R0 of the bottom surface height map of the hydraulic structure model. Set the corresponding coordinate range and spatial reference according to the XY plane range. Calculate the number of rows and columns (Rows) and Cols of the height map and initialize them.

[0029] In step 2.2, the method for three-dimensional ray intersection testing of the bottom surface of the hydraulic structure model includes the following steps:

[0030] Step 2.2.1: Traverse the bottom surface height map of the hydraulic structure model pixel by pixel, and currently traverse to pixel i to obtain the current pixel coordinates (Xi, Yi);

[0031] Step 2.2.2: Perform a 3D ray intersection test along the Z axis from the underground to the bottom of the hydraulic structure model. Define the starting point of the 3D ray as vecStart = (Xi, Yi, -10000) and the end point as vecEnd = (Xi, Yi, 10000). Arrange the intersection test results of each pixel in ascending order of elevation value.

[0032] In step 2.3, the method for calculating and assigning the elevation value of the height map includes the following steps:

[0033] Step 2.3.1: Traverse the result sequence of the 3D ray intersection test of pixel i, filter the 3D terrain in the result sequence by type, and filter the marked underground structure components by model UID;

[0034] Step 2.3.2: If the filtered sequence is not empty, obtain the component with the smallest elevation value, whose type (referring to the type of the BIM component with the smallest elevation value, such as: water pipeline, underground factory building, corridor, etc.; combined with the underground structure components marked in step 2.3.1, filter the corresponding component type) is Tj, and the elevation value is Zj. Assign Zi = Zj to the pixel corresponding to the bottom surface height map; if the filtered sequence is empty, assign Zi = invalid value.

[0035] In the above technical solution, in step 3, the method of performing morphological processing on the height map includes the following steps:

[0036] Step 3.1: Perform morphological dilation on the bottom height map;

[0037] Step 3.2: Perform morphological corrosion on the bottom surface height map.

[0038] In the above technical solution, in step three, in step 3.1, the method of performing morphological dilation processing on the bottom height map includes the following steps:

[0039] Step 3.1.1: Based on the overall shape, resolution, and hole occurrence of the bottom height map, comprehensively determine the number of morphological erosion and dilation times N, and expand the N-pixel invalid value outside the edge of the height map;

[0040] Step 3.1.2: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the central pixel of the 3*3 template is invalid and there is a valid elevation value in the 3*3 neighborhood, then set the central pixel elevation Zt = the average elevation of the 3*3 neighborhood. If the elevation value of the central pixel of the 3*3 template is valid, or the central pixel is invalid and all the 3*3 neighborhoods are invalid, then skip the pixel and perform the traversal of the next pixel.

[0041] Step 3.1.3: Repeat the morphological dilation operation in step 3.1.2 N times and end;

[0042] In step 3.2, the method for performing morphological corrosion processing on the bottom surface height map includes the following steps:

[0043] Step 3.2.1: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the center pixel of the 3*3 template is a valid value and there is an invalid elevation value in the 3*3 neighborhood, then set the center pixel elevation Zt = invalid value; if the elevation value of the center pixel of the 3*3 template is an invalid value, or the center pixel is a valid elevation and the 3*3 neighborhood are all valid values, then skip the pixel and execute the traversal of the next pixel.

[0044] Step 3.2.2: Repeat the morphological corrosion operation in step 3.2.1 for N times;

[0045] Step 3.2.3: Crop the height map, cutting off N pixels that extend beyond the edge to obtain a processed bottom height map.

[0046] In the above technical solution, in step 4, the method for calculating the elevation offset values ​​of different levels includes the following steps:

[0047] Step 4.1: Determine the height map tile level range;

[0048] Step 4.1.1: Determine the camera height Di corresponding to the 3D terrain tile level Li based on the coordinate reference, 3D terrain tile size, and tile scheduling strategy of the 3DGIS scene;

[0049] Step 4.1.2: Determine the level range Lmin and Lmax for generating the ground height map of the hydraulic structure model based on the size of the hydraulic structure model, the visible distance in the scene, and other conditions;

[0050] Step 4.2: Calculate the offset value of each level of the height map tile;

[0051] Step 4.2.1: Define i = Lmin, perform traversal calculations on each level, and approximate the elevation value NearPi of the theoretical near clipping plane and the elevation value FarPi of the theoretical far clipping plane according to the scheduling strategy of the 3DGIS engine;

[0052] Step 4.2.2: Based on the accuracy characteristics of the depth buffer, define the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed, and calculate the theoretical minimum offset value minFi = A0 * |FarPi–NearPi| between the hydraulic structure model and the terrain;

[0053] Depth buffer and near and far clipping planes are characteristics of graphics cards and 3DGIS engines. The present invention uses these characteristics to solve the problem in the calculation. The specific calculation method of the theoretical minimum offset value between the hydraulic structure model and the terrain is:

[0054] At a certain map level i in the system, according to the scheduling strategy of the 3DGIS engine, the elevation value NearPi of the theoretical near clipping surface and the elevation value FarPi of the theoretical far clipping surface are approximately estimated;

[0055] Assume that the elevation difference between the hydraulic structure model and the terrain is dist; affected by the depth cache, the 3DGIS engine will compress the depth value to between 0 and 1. At this time, the compressed depth difference distDepth = dist / |FarPi–NearPi|;

[0056] The depth buffer is usually stored in 32-bit floating point data with a valid number of 6 to 7 bits. Therefore, the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed is defined. If the valid number of bits is 6, A0 can be set to 0.000002. Only when distDepth>=A0 can the face be guaranteed not to flicker.

[0057] Solving distDepth = dist / |FarPi–NearPi|>=A0, we get dist>=A0*|FarPi–NearPi|, and thus we get the theoretical minimum offset value minFi=A0*|FarPi–NearPi| between the hydraulic structure model and the terrain.

[0058] Step 4.2.3: Considering the change of 3DGIS scene perspective, define the distance correction coefficient C0 of the far and near clipping planes, and calculate the corrected offset value Fi = minFi * C0;

[0059] Step 4.2.4: Traverse to i=Lmax and obtain the offset value sequence ArrF of each level.

[0060] In the above technical solution, in step 5, the method for generating and updating three-dimensional terrain tiles includes the following steps:

[0061] Step 5.1: Bottom Height Figure 3 3D terrain tile generation;

[0062] Step 5.1.1: Determine the 3D terrain tile division and naming rules of the 3DGIS scene, and generate 3D terrain tiles for the Lmin to Lmax levels of the bottom height map of the hydraulic structure model;

[0063] Step 5.1.2: For the generated level i tile, obtain the offset value Fi of the level from the offset value sequence ArrF, and perform elevation offset processing on the generated three-dimensional terrain tile;

[0064] Step 5.2: 3D terrain tile traversal and replacement update;

[0065] Step 5.2.1: Traverse the bottom height of the generated hydraulic structure model Figure 3 Dimensional tile, the current tile is Gi, the corresponding tile level is Li, and the maximum level of the original terrain is L0;

[0066] Step 5.2.2: If all pixels in tile Gi have valid elevation values, no further processing is required. If there are invalid elevation values ​​in tile Gi, further determine the level Li corresponding to tile Gi. If Li <= L0, fill the invalid values ​​in Gi with terrain tiles of the same name. Otherwise, resample the original L0 level tiles to fill the invalid values ​​in Gi.

[0067] Step 5.2.3: Directly overwrite the original three-dimensional terrain tile with the same name with the processed tile Gi, and continue to traverse the next tile until all tiles are replaced and updated, avoiding the time overhead caused by modifying the original DEM data and regenerating multi-level tiles, and improving the efficiency of data updating.

[0068] The * above represents the mathematical symbol multiplication sign.

[0069] The complex hydraulic structure model described in the present invention refers to a hydraulic structure that is collaboratively designed by multiple disciplines such as geology, hydraulic structure, electromechanical, metal structure, civil engineering, and factory buildings, and is three-dimensionally modeled using BIM design software. The resulting model has a large amount of data, a complex component structure, and includes a large number of underground structures.

[0070] Compared with the prior art, the present invention has the following advantages:

[0071] (1) The method of the present invention does not require the pre-production of a model base. It can automatically generate a bottom height map for a complex hydraulic structure model and filter structures such as air shafts and reserved holes through image morphological processing methods to achieve seamless integration of the complex hydraulic structure model with the three-dimensional terrain scene, thereby improving the display effect of the model scene.

[0072] (2) The method of the present invention can update existing three-dimensional terrain tiles in a 3DGIS scene, avoiding the time overhead caused by modifying the original DEM data and regenerating multi-level tiles, thereby improving the efficiency of data updating;

[0073] (3) The method of the present invention calculates the elevation offset values ​​of different levels based on the data accuracy of the depth cache, ensuring that there will be no flickering caused by surface overlap during the three-dimensional roaming process. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is the overall technical flow chart of the present invention.

[0075] Figure 2 It is a schematic diagram of the processing process of generating the model bottom surface height map in the present invention.

[0076] Figure 3 This is a flow chart of the algorithm for generating a bottom surface height map of a hydraulic structure model in the present invention.

[0077] Figure 4 It is a schematic diagram of the execution process of the morphological optimization processing of the bottom surface height map of the hydraulic structure model in the present invention.

[0078] Figure 5 This is a flow chart of the algorithm for morphological optimization processing of the bottom surface height map of the hydraulic structure model in the present invention.

[0079] Figure 6 It is a flow chart of the algorithm for calculating the offset of elevation values ​​at different levels in the present invention.

[0080] Figure 7 This is a flow chart of the algorithm for generating and updating three-dimensional terrain tiles in the present invention.

[0081] Figure 8 This is an overview of a complex hydraulic structure model of a navigation channel in an embodiment of the present invention.

[0082] Figure 9 This is a result diagram after marking the underground structure part of the hydraulic structure model in an embodiment of the present invention.

[0083] Figure 10 This is the result diagram after the hydraulic structure model is accurately placed in the corresponding terrain area in the 3DGIS scene in the embodiment of the present invention ( Figure 10The white dotted box in the middle is used to mark the area where the hydraulic structure model and the terrain are seamlessly inlaid).

[0084] Figure 11 This is a diagram showing the bottom height of a hydraulic structure model and its partial magnification in an embodiment of the present invention ( Figure 11 The lower figure is an enlarged view of the black dotted frame area in the upper figure).

[0085] Figure 12 This is a result image after image morphology optimization processing is performed on the bottom surface height map of the hydraulic structure model in an embodiment of the present invention.

[0086] Figure 13 This is the result image after completing the generation and update of three-dimensional terrain tiles in the embodiment of the present invention.

[0087] Figure 14 This is the final effect diagram after adding water surface and ships to the shipping channel in an embodiment of the present invention. DETAILED DESCRIPTION

[0088] The following detailed description of the embodiments of the present invention is given in conjunction with the accompanying drawings, which do not limit the present invention but are merely examples. The description makes the advantages of the present invention clearer and easier to understand.

[0089] The present invention utilizes interactive underground structure marking to filter the underground components of the hydraulic structure model and obtain the required terrain height map; the morphological corrosion and expansion methods of the grayscale image are extended and applied in the terrain height map processing to solve the problem of broken holes caused by factors such as the hollow structure inside the hydraulic structure model; at the same time, the accuracy requirements of the depth buffer are considered to calculate the elevation offset values ​​of different levels to avoid the problem of surface flickering at different viewpoint distances; the elevation offset value of the present invention is used to replace and update the local terrain, thereby improving the updating efficiency of the terrain data.

[0090] Refer to the attached figure: Figure 1 As shown, a method for intelligent seamless mosaicking of a complex hydraulic structure model and a three-dimensional terrain includes the following steps:

[0091] Step 1: Mark underground structures in the model: Interactively select and mark components of the hydraulic structure model that should be buried beneath the terrain, including water pipelines and corridors, in the 3D GIS scene. Record the unique identifiers (UIDs) of these model components, as they will be filtered in subsequent steps.

[0092] Step 2: Generate the model bottom height map: Figure 2 Schematic diagram of the corresponding processing process (through Figure 2It can be seen that: the present invention utilizes the combination of interactive underground structure marking to filter the underground components of the hydraulic construction model and obtain the required terrain height map. There is no need to pre-make the model base. The bottom surface height map can be automatically generated for the complex hydraulic construction model, and the wind shaft, reserved holes and other structures are filtered through the image morphological processing method to achieve the seamless fit of the complex hydraulic construction model and the three-dimensional terrain scene, thereby improving the display effect of the model scene. It solves the problem that the existing technology needs to first establish a regular model base, and the complex hydraulic construction BIM model is difficult to seamlessly fit with the terrain data when displayed in the three-dimensional scene. According to a certain sampling resolution, the bottom surface of the model is tested by the three-dimensional ray method intersection test to generate the model bottom surface height map. The specific algorithm flow is as follows: Figure 3 shown.

[0093] Step 2.1: Calculate the model space extent and initialize the bottom height map.

[0094] Step 2.1.1: Place the model accurately in the corresponding area in the 3DGIS scene and calculate the rectangular bounding box Xmin, Xmax, Ymin, Ymax of the model on the XY plane.

[0095] Step 2.1.2: Define the resolution R0 of the bottom height map based on the spatial reference and 3D display accuracy requirements of the 3DGIS scene, set the corresponding coordinate range and spatial reference based on the XY plane range, calculate the number of rows and columns of the height map (Rows) and Cols, and initialize them.

[0096] Step 2.2: 3D ray intersection test on the bottom surface of the model.

[0097] Step 2.2.1: Traverse the bottom height map pixel by pixel, currently traverse to pixel i, and obtain the current pixel coordinates (Xi, Yi).

[0098] Step 2.2.2: Perform a 3D ray intersection test along the Z axis from the ground to the bottom of the model. Define the ray's starting point vecStart = (Xi, Yi, -10000) and its end point vecEnd = (Xi, Yi, 10000). Arrange the intersection test results for each pixel in ascending order by elevation.

[0099] Step 2.3: Based on the intersection test results of each pixel, calculate the height map elevation value and assign it.

[0100] Step 2.3.1: Traverse the result sequence of the three-dimensional ray intersection test of pixel i, filter the three-dimensional terrain in the result sequence by type, and filter the marked underground structure components by model UID.

[0101] Step 2.3.2: If the filtered sequence is not empty, obtain the component with the smallest elevation value, whose type is Tj and elevation value is Zj, and assign Zi = Zj to the pixel corresponding to the bottom height map; if the filtered sequence is empty, assign Zi = invalid value.

[0102] Step 3, height map morphological optimization processing: For the hollow component structures such as the wind shaft and reserved holes in the hydraulic structure model, as well as the gaps between adjacent surfaces caused by non-standard modeling, etc., according to Figure 4 The process shown (through Figure 4 It can be seen that: after the expansion and template movement, expansion, and corrosion operations of the present invention, the broken hole area of ​​the original height map can be filled; the problem of broken holes caused by factors such as the hollow structure inside the hydraulic building model is solved), the height map is morphologically processed, and the specific algorithm flow is as follows Figure 5 shown.

[0103] Step 3.1: Perform morphological dilation on the bottom height map.

[0104] Step 3.1.1: Based on the overall shape, resolution, and hole occurrence of the bottom height map, comprehensively determine the number of morphological erosion and dilation times N, and invalidate the N pixels outside the edge of the height map.

[0105] Step 3.1.2: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the central pixel of the 3*3 template is invalid and there is a valid elevation value in the 3*3 neighborhood, then set the central pixel elevation Zt = the average elevation of the 3*3 neighborhood. If the elevation value of the central pixel of the 3*3 template is valid, or the central pixel is invalid and the 3*3 neighborhood are all invalid values, then skip the pixel and execute the traversal of the next pixel.

[0106] Step 3.1.3: Repeat the morphological dilation operation in 3.1.2 and terminate after N times.

[0107] Step 3.2: Perform morphological corrosion on the bottom surface height map.

[0108] Step 3.2.1: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the center pixel of the 3*3 template is a valid value and there is an invalid elevation value in the 3*3 neighborhood, then set the center pixel elevation Zt = invalid value; if the elevation value of the center pixel of the 3*3 template is an invalid value, or the center pixel is a valid elevation and the 3*3 neighborhood are all valid values, then skip the pixel and execute the traversal of the next pixel.

[0109] Step 3.2.2: Repeat the morphological corrosion operation in 3.2.1 and terminate after N times.

[0110] Step 3.2.3: Crop the height map, cutting off N pixels that extend beyond the edge to obtain a processed bottom height map.

[0111] Step 4, Calculation of elevation offset values ​​at different levels: Based on the viewpoint height of the 3D terrain tile switching at different levels, the distance between the far and near clipping planes in the 3D rendering process is approximately estimated, and the minimum elevation difference that meets the depth cache accuracy conditions is calculated to avoid the model surface flickering caused by the inability to determine the order of drawing in the 3DGIS scene. The specific algorithm process is as follows Figure 6 shown.

[0112] Step 4.1: Determine the height map tile level range.

[0113] Step 4.1.1: Determine the camera height Di corresponding to the 3D terrain tile level Li based on the coordinate reference, 3D terrain tile size, and tile scheduling strategy of the 3DGIS scene.

[0114] Step 4.1.2: Based on the model's size, visible distance in the scene, and other conditions, determine the level range Lmin and Lmax for which the model's ground height map should be generated.

[0115] Step 4.2: Calculate the offset values ​​of each level of the height map tile.

[0116] Step 4.2.1: Define i = Lmin, traverse and calculate each level, and approximate the elevation value NearPi of the theoretical near clipping surface and the elevation value FarPi of the theoretical far clipping surface according to the scheduling strategy of the 3DGIS engine.

[0117] Step 4.2.2: Based on the accuracy characteristics of the depth buffer, define the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed, and calculate the theoretical minimum offset value minFi between the model and the terrain = A0*|FarPi–NearPi|. The specific calculation method is:

[0118] At a certain map level i in the system, according to the scheduling strategy of the 3DGIS engine, the elevation value NearPi of the theoretical near clipping surface and the elevation value FarPi of the theoretical far clipping surface are approximately estimated;

[0119] Assume that the elevation difference between the hydraulic structure model and the terrain is dist; affected by the depth cache, the 3DGIS engine will compress the depth value to between 0 and 1. At this time, the compressed depth difference distDepth = dist / |FarPi–NearPi|;

[0120] The depth buffer is usually stored in 32-bit floating point type, with a valid number of 6 to 7 bits. Therefore, the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed is defined. If the valid number of bits is 6, A0 = 0.000002 can be set. Only when distDepth> = A0 can the face be guaranteed not to flicker.

[0121] Solve distDepth = dist / |FarPi–NearPi|>=A0, and get dist>=A0*|FarPi–NearPi|, so the theoretical minimum offset value minFi = A0*|FarPi–NearPi| between the hydraulic structure model and the terrain is obtained;

[0122] Step 4.2.3: Considering the change in the viewing angle of the 3DGIS scene, define the distance correction coefficient C0 of the far and near clipping planes, and calculate the corrected offset value Fi = minFi*C0.

[0123] Step 4.2.4: Traverse to i=Lmax and obtain the offset value sequence ArrF of each level.

[0124] Step 5, 3D terrain tile generation and update: According to the 3D terrain tile division and naming rules required by the 3DGIS scene, combined with the calculated elevation offset values ​​of each level, 3D terrain tiles are generated for the model bottom height map, and the original terrain tiles are partially replaced and updated. The specific algorithm process is as follows Figure 7 shown.

[0125] Step 5.1: Bottom Height Figure 3 dimensional terrain tile generation.

[0126] Step 5.1.1: Determine the 3D terrain tile division and naming rules of the 3DGIS scene, and generate 3D terrain tiles for the Lmin to Lmax levels of the model bottom height map.

[0127] Step 5.1.2: For the generated i-th level tile, obtain the offset value Fi of the level from the offset value sequence ArrF, and perform elevation offset processing on the generated three-dimensional terrain tile.

[0128] Step 5.2: 3D terrain tile traversal and replacement update.

[0129] Step 5.2.1: Traverse the generated model bottom height Figure 3 The current tile is Gi, the corresponding tile level is Li, and the maximum level of the original terrain is L0.

[0130] Step 5.2.2: If all pixels in tile Gi have valid elevation values, no processing is required; if there are invalid elevation values ​​in tile Gi, further determine the level Li corresponding to tile Gi. If Li <= L0, use terrain tiles with the same name to fill in the invalid values ​​in Gi; otherwise, resample the original L0 level tiles to fill in the invalid values ​​in Gi.

[0131] Step 5.2.3: Directly overwrite the original three-dimensional terrain tile with the same name with the processed tile Gi, and continue to traverse the next tile until all tiles are replaced and updated.

[0132] Example

[0133] The present invention is now described in detail by taking the application of the present invention to the seamless mosaic of a hydraulic structure model of a certain shipping channel and a three-dimensional terrain as an example. It also has a guiding role in the application of the present invention to the intelligent seamless mosaic of other complex hydraulic structure models and three-dimensional terrain.

[0134] The application scenario and input of this embodiment: A region uses high-precision DEM data to generate three-dimensional terrain tiles, and uses the osgEarth three-dimensional visualization engine to build a 3DGIS scene. A shipping channel is planned in this region, and the hydraulic structure model of the shipping channel is designed using BIM software. Figure 8 As shown, it is necessary to display the effect of the shipping channel after completion in the 3DGIS scene.

[0135] The processing process of this embodiment is as follows: the algorithm flow of the solution of the present invention is used to process and realize the seamless mosaic of the navigation channel hydraulic structure model and the three-dimensional terrain. The process is as follows:

[0136] Step 1: Mark the underground structure of the model: interactively select and mark the component structures that should be buried under the terrain on the bottom of the model in the 3DGIS scene, including water pipelines, underground corridors, etc. The marked components are as follows: Figure 9 shown.

[0137] Step 2: Generate model bottom height map: Accurately place the shipping channel model into the 3DGIS scene, such as Figure 10 After calculating the coordinate range of the model on the XY plane, a sampling resolution of 2.5m is selected, and a three-dimensional ray method intersection test is performed point by point along the Z axis. The underground structure of the model is filtered to generate a height map of the bottom surface of the model, as shown in the figure below. Figure 11 shown.

[0138] Step 3: Height map morphology optimization: Observation Figure 11 It can be found that there are hollow component structures such as lock air shafts and reserved holes in the middle part of the model. They can be filtered out through morphological processing of the height map, and two expansion and corrosion operations are performed. Fill according to the average elevation of the 3*3 neighborhood. The processing results are as follows: Figure 12 As shown, the broken hole portion is eliminated.

[0139] Step 4. Calculate elevation offsets at different levels: Based on the osgEarth engine's 3D terrain tile layer scheduling rules and clipping algorithm, determine the distances between the near and far clipping planes for each level. The near clipping plane's elevation value is NearPi = 350 * 2(18 – i), where i < 19, and the far clipping plane's elevation value is FarPi = -300. Considering that the depth buffer uses 32-bit floating-point storage and is compressed to a range of 0 to 1, with a significant digit count of 6, a minimum value of A0 = 0.00002 is used to ensure depth buffer accuracy and maintain distinction even after rounding. Further accounting for changes in the 3DGIS scene's viewing angle, a correction coefficient C0 = 5 is defined for the distances between the near and far clipping planes. The corrected offset value Fi = 0.0001 * |FarPi – NearPi|. The shipping channel model has visible levels 10 to 18 in the 3DGIS scene. The corrected elevation offset values ​​for each level are calculated and shown in Table 1.

[0140] Table 1 Offset values ​​of each level of a shipping channel model in the 3DGIS scene

[0141]

[0142] Step 5. Generate and update 3D terrain tiles: Based on the 3D terrain tile division and naming rules corresponding to osgEarth, combined with the calculated elevation offset values ​​of different levels, generate 3D terrain tiles for levels 10 to 18 of the model bottom surface height map, and partially replace and update the existing terrain tiles.

[0143] Result analysis: After following the above steps, the result of seamless mosaic of hydraulic structure model and 3D terrain is as follows: Figure 13 As shown in the figure, the hydraulic structure model is seamlessly integrated with the 3D terrain, and when the 3D terrain levels are switched with the change of viewing angle, there is no overlap and flickering of the surface caused by the depth cache accuracy problem. Figure 14 As shown, the effect of the navigation channel hydraulic structure model after completion can be better presented.

[0144] In this embodiment, the DEM data used for the scenario covers a large area, while the hydraulic structure model of the navigation channel only occupies a small portion of this area. This embodiment uses the method of the present invention to generate a height map for the hydraulic structure model, requiring only a partial update, thereby improving update efficiency. This overcomes the shortcomings of existing technologies, which cannot achieve seamless integration of the hydraulic structure model with the terrain, and generally require modifications to the original DEM data, which requires further manual editing and regeneration of the terrain from the DEM data, resulting in low update efficiency.

[0145] Other parts not described belong to the prior art.

Claims

1. An intelligent seamless mosaic method for complex hydraulic structure models and three-dimensional terrain, characterized by: The following steps are included: Step 1: Marking the underground structure of the model: Interactively select and mark components of hydraulic structure models that should be buried under the terrain in the 3DGIS scene; Step 2: Generate model bottom height map; According to a certain sampling resolution, the three-dimensional ray method intersection test is performed on the bottom surface of the model to generate a height map of the bottom surface of the model; Step 3: morphological optimization of height map; Morphological processing is performed on the height map for hollowed-out component structures in hydraulic structure models, as well as gaps between adjacent facets caused by irregular modeling. Step 4: Calculate the elevation offset values ​​at different levels; Based on the viewpoint heights of different levels of 3D terrain tiles, the distances between the far and near clipping planes during 3D rendering are approximately estimated, and the minimum elevation difference that meets the depth buffer accuracy conditions is calculated. Step 5: Generate and update 3D terrain tiles; According to the three-dimensional terrain tile division and naming rules required by the 3DGIS scene, and taking into account the elevation offset value conditions at different levels, three-dimensional terrain tiles are generated for the bottom surface height map of the hydraulic structure model, and the existing terrain tiles are partially replaced and updated.

2. The intelligent seamless mosaic method for complex hydraulic structure models and three-dimensional terrain according to claim 1 is characterized by: In step 1, the component structures buried under the terrain in the hydraulic structure model include underground water pipelines and corridors; In step three, the hollowed-out component structure includes air shafts and reserved holes.

3. The method for intelligent seamless mosaicking of a complex hydraulic structure model and three-dimensional terrain according to claim 1 or 2, characterized in that: In step 2, the method for generating the bottom surface height map of the hydraulic structure model includes the following steps: Step 2.1: Calculate the spatial extent of the hydraulic structure model and initialize the bottom height map; Step 2.2: 3D ray intersection test on the bottom surface of the hydraulic structure model; Step 2.3: Based on the intersection test results of each pixel, calculate the height map elevation value and assign it.

4. The method for intelligent seamless mosaicking of complex hydraulic structure models and three-dimensional terrain according to claim 3 is characterized by: In step 2.1, the method for calculating the spatial extent of the hydraulic structure model and initializing the bottom height map includes the following steps: Step 2.1.1: Accurately place the hydraulic structure model in the corresponding area in the 3DGIS scene and calculate the rectangular bounding box Xmin, Xmax, Ymin, Ymax of the hydraulic structure model on the XY plane; Step 2.1.2: Based on the spatial reference and 3D display accuracy requirements of the 3DGIS scene, define the resolution R0 of the bottom surface height map of the hydraulic structure model. Set the corresponding coordinate range and spatial reference according to the XY plane range. Calculate the number of rows and columns (Rows) and Cols of the height map and initialize them. In step 2.2, the method for three-dimensional ray intersection testing of the bottom surface of the hydraulic structure model includes the following steps: Step 2.2.1: Traverse the bottom surface height map of the hydraulic structure model pixel by pixel, and currently traverse to pixel i to obtain the current pixel coordinates (Xi, Yi); Step 2.2.2: Perform a 3D ray intersection test along the Z axis from the underground to the bottom of the hydraulic structure model. Define the starting point of the 3D ray as vecStart = (Xi, Yi, -10000) and the end point as vecEnd = (Xi, Yi, 10000). Arrange the intersection test results of each pixel in ascending order of elevation value. In step 2.3, the method for calculating and assigning the elevation value of the height map includes the following steps: Step 2.3.1: Traverse the result sequence of the 3D ray intersection test of pixel i, filter the 3D terrain in the result sequence by type, and filter the marked underground structure components by model UID; Step 2.3.2: If the filtered sequence is not empty, obtain the component with the smallest elevation value, whose type is Tj and elevation value is Zj, and assign Zi = Zj to the pixel corresponding to the bottom height map; if the filtered sequence is empty, assign Zi = invalid value.

5. The method for intelligent seamless mosaicking of complex hydraulic structure models and three-dimensional terrain according to claim 4 is characterized by: In step three, the method of performing morphological processing on the height map includes the following steps: Step 3.1: Perform morphological dilation on the bottom height map; Step 3.2: Perform morphological corrosion on the bottom surface height map.

6. The method for intelligent seamless mosaicking of complex hydraulic structure models and three-dimensional terrain according to claim 5 is characterized by: In step three, in step 3.1, the method for performing morphological dilation processing on the bottom surface height map includes the following steps: Step 3.1.1: Based on the overall shape, resolution, and hole occurrence of the bottom height map, comprehensively determine the number of morphological erosion and dilation times N, and expand the N-pixel invalid value outside the edge of the height map; Step 3.1.2: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the central pixel of the 3*3 template is invalid and there is a valid elevation value in the 3*3 neighborhood, then set the central pixel elevation Zt = the average elevation of the 3*3 neighborhood. If the elevation value of the central pixel of the 3*3 template is valid, or the central pixel is invalid and all the 3*3 neighborhoods are invalid, then skip the pixel and perform the traversal of the next pixel. Step 3.1.3: Repeat the morphological dilation operation in step 3.1.2 N times and end; In step 3.2, the method for performing morphological corrosion processing on the bottom surface height map includes the following steps: Step 3.2.1: Use the 3*3 template to traverse the original height map pixel by pixel. If the elevation value of the center pixel of the 3*3 template is a valid value and there is an invalid elevation value in the 3*3 neighborhood, then set the center pixel elevation Zt to invalid value. If the elevation value of the center pixel of the 3*3 template is an invalid value, or the center pixel is a valid elevation and all 3*3 neighborhoods are valid values, then skip the pixel and perform traversal of the next pixel. Step 3.2.2: Repeat the morphological corrosion operation in step 3.2.1 for N times; Step 3.2.3: Crop the height map, cutting off N pixels that extend beyond the edge to obtain a processed bottom height map.

7. The method for intelligent seamless mosaicking of a complex hydraulic structure model and a three-dimensional terrain according to claim 6 is characterized by: In step 4, the method for calculating the elevation offset values ​​of different levels includes the following steps: Step 4.1: Determine the height map tile level range; Step 4.1.1: Determine the camera height Di corresponding to the 3D terrain tile level Li based on the coordinate reference, 3D terrain tile size, and tile scheduling strategy of the 3DGIS scene; Step 4.1.2: Determine the level range Lmin and Lmax of the ground height map of the hydraulic structure model to be generated based on the size of the hydraulic structure model and the visual distance in the scene; Step 4.2: Calculate the offset value of each level of the height map tile; Step 4.2.1: Define i = Lmin, perform traversal calculations on each level, and approximate the elevation value NearPi of the theoretical near clipping plane and the elevation value FarPi of the theoretical far clipping plane according to the scheduling strategy of the 3DGIS engine; Step 4.2.2: Based on the accuracy characteristics of the depth buffer, define the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed, and calculate the theoretical minimum offset value minFi = A0 * |FarPi – NearPi| between the hydraulic structure model and the terrain. The specific calculation method is: At a certain map level i in the system, according to the scheduling strategy of the 3DGIS engine, the elevation value NearPi of the theoretical near clipping surface and the elevation value FarPi of the theoretical far clipping surface are approximately estimated; Assume that the elevation difference between the hydraulic structure model and the terrain is dist; affected by the depth cache, the 3DGIS engine will compress the depth value to between 0 and 1. At this time, the compressed depth difference distDepth = dist / |FarPi–NearPi|; The depth buffer is usually stored in 32-bit floating point type, with a valid number of 6 to 7 bits. Therefore, the minimum floating point number A0 that can guarantee the accuracy of the depth buffer after the elevation value is compressed is defined. If the valid number of bits is 6, A0 = 0.000002 can be set. Only when distDepth> = A0 can the face be guaranteed not to flicker. Solve distDepth = dist / |FarPi–NearPi|>=A0, and get dist>=A0*|FarPi–NearPi|, so the theoretical minimum offset value minFi = A0*|FarPi–NearPi| between the hydraulic structure model and the terrain is obtained; Step 4.2.3: Considering the change of 3DGIS scene perspective, define the distance correction coefficient C0 of the far and near clipping planes, and calculate the corrected offset value Fi = minFi * C0; Step 4.2.4: Traverse to i=Lmax and obtain the offset value sequence ArrF of each level.

8. The method for intelligent seamless mosaicking of a complex hydraulic structure model and three-dimensional terrain according to claim 7 is characterized by: In step 5, the method for generating and updating three-dimensional terrain tiles includes the following steps: Step 5.1: Generate three-dimensional terrain tiles from the bottom height map; Step 5.1.1: Determine the 3D terrain tile division and naming rules of the 3DGIS scene, and generate 3D terrain tiles for the Lmin to Lmax levels of the bottom height map of the hydraulic structure model; Step 5.1.2: For the generated level i tile, obtain the offset value Fi of the level from the offset value sequence ArrF, and perform elevation offset processing on the generated three-dimensional terrain tile; Step 5.2: 3D terrain tile traversal and replacement update; Step 5.2.1: Traverse the generated three-dimensional tiles of the bottom height map of the hydraulic structure model. The current tile is Gi, the corresponding tile level is Li, and the maximum level of the original terrain is L0; Step 5.2.2: If all pixels in tile Gi have valid elevation values, no further processing is required. If there are invalid elevation values ​​in tile Gi, further determine the level Li corresponding to tile Gi. If Li <= L0, fill the invalid values ​​in Gi with terrain tiles of the same name. Otherwise, resample the original L0 level tiles to fill the invalid values ​​in Gi. Step 5.2.3: Directly overwrite the original three-dimensional terrain tile with the same name with the processed tile Gi, and continue to traverse the next tile until all tiles are replaced and updated.

Citation Information

Patent Citations

  • Automatic acquisition method for height of building in urban area based on digital surface model

    CN109579784A

  • Real-time terrain modification method based on height map elevation

    CN111260780A