Terrain grid extension method and device and computer readable storage medium
By combining first-order polynomial interpolation and radial basis function interpolation algorithm, selecting appropriate interpolation methods based on the terrain change trend, solving the problem that it is difficult to effectively extend multiple types of terrain mesh in the prior art, and achieving the smooth transition of terrain mesh extension and the consistency of terrain change trends.
Patent Information
- Application Number
- CN202510010122.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art is difficult to effectively achieve the extension of various types of terrain grids, especially in ensuring smooth grid transitions and consistency of terrain changes trends.
By obtaining the target terrain mesh, determine its terrain variation type, and estimate the elevation value of the grid vertices based on the associated interpolation algorithm. The specific methods include using a combination of first-order polynomial interpolation algorithm and radial basis function interpolation algorithm to select appropriate interpolation methods based on the terrain change trend.
The extension of various types of terrain grids is achieved, the change trend of the original terrain grids and the smooth transition between the grids are maintained, and the extension effect and efficiency are improved.
Smart Images

Figure CN119810357A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terrain grid processing, and in particular to a terrain grid extension method, device and computer-readable storage medium. Background Art
[0002] The essence of extending the terrain grid is to estimate the terrain conditions of the unknown area associated with the known area using terrain interpolation technology based on the terrain conditions of the known area. In the prior art, a single terrain interpolation method is generally used to achieve the extension of the terrain grid.
[0003] However, the inventors have found that the grid extension requirements generally require that the transition between the extended grid and the original grid be not only smooth, but also that the terrain change trend between the two be consistent. The single terrain interpolation algorithm used in the prior art cannot achieve the extension of various types of terrain grids according to the grid extension requirements.
[0004] There is currently no effective solution to the above defects. Summary of the invention
[0005] The object of the present invention is to provide a terrain grid extension method, device and computer-readable storage medium, which can solve the above-mentioned technical problems.
[0006] According to one aspect of the present invention, a terrain grid extension method is provided, the method comprising: Acquire a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; Determine a target terrain change type of the target terrain grid, and estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; Based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid, the target two-dimensional terrain grid is converted into a three-dimensional terrain grid.
[0007] Optionally, obtaining the target terrain grid includes: Acquire the target three-dimensional terrain grid; Projecting the target three-dimensional terrain grid onto the target two-dimensional plane to obtain the first two-dimensional terrain grid; Extending the first two-dimensional terrain grid on the target two-dimensional plane to obtain a second two-dimensional terrain grid; The first two-dimensional terrain grid in the second two-dimensional terrain grid is restored as the target three-dimensional terrain grid to obtain the target terrain grid.
[0008] Optionally, determining a target terrain change type of the target terrain grid, and estimating elevation values of respective grid vertices in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type, comprises: Determining, from the target terrain grid, a grid vertex combination for estimating the elevation value of each grid vertex in the target two-dimensional terrain grid; wherein each grid vertex in the target two-dimensional terrain grid corresponds to a grid vertex combination; Based on a preset first-order polynomial interpolation algorithm, the fitting residual of each grid vertex combination and the fitting elevation value of each grid vertex in the target two-dimensional terrain grid are calculated; wherein the fitting residual is used to characterize the terrain change trend of the three-dimensional terrain grid formed by the grid vertex combination; Determining a target terrain change type of the target terrain grid based on fitting residuals of all grid vertex combinations; When the target terrain change type is used to characterize that the terrain change trend is obvious, the fitted elevation value of each grid vertex in the target two-dimensional terrain grid is used as the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
[0009] Optionally, determining, from the target terrain mesh, a mesh vertex combination for estimating the elevation value of each mesh vertex in the target two-dimensional terrain mesh comprises: From all mesh vertices with known real elevation values and estimated elevation values of the target terrain grid, mesh vertex combinations of each mesh vertex in the target two-dimensional terrain grid are determined respectively; wherein the mesh vertex combinations include first-order neighboring mesh vertices and second-order neighboring mesh vertices of the corresponding mesh vertex in the target two-dimensional terrain grid.
[0010] Optionally, the calculating of the fitting residual of each mesh vertex combination and the fitting elevation value of each mesh vertex in the target two-dimensional terrain mesh based on a preset first-order polynomial interpolation algorithm includes: Based on the real elevation value or estimated elevation value of each mesh vertex in the mesh vertex combination and the real horizontal and vertical coordinate values, the coefficients of the first-order polynomial interpolation algorithm are determined by using the least square method; Inputting the real horizontal and vertical coordinate values of each mesh vertex in the mesh vertex combination into the first-order polynomial interpolation algorithm after determining the coefficients, respectively, to obtain the fitting elevation value of each mesh vertex in the mesh vertex combination; inputting the real elevation value or the estimated elevation value and the fitting elevation value of each mesh vertex in the mesh vertex combination into a preset fitting residual calculation algorithm, to obtain the fitting residual of the mesh vertex combination; The real horizontal and vertical coordinate values of the grid vertices corresponding to the grid vertex combination in the target two-dimensional terrain grid are input into a first-order polynomial interpolation algorithm after the coefficients are determined to obtain the fitting elevation value of the grid vertex.
[0011] Optionally, determining the target terrain change type of the target terrain mesh based on the fitting residuals of all mesh vertex combinations includes: Determine the number of mesh vertex combinations whose fitting residuals are greater than or equal to a preset residual threshold from all mesh vertex combinations; Based on the determined number of mesh vertex combinations, it is determined that the target terrain change type is characterized as the target terrain mesh having an obvious terrain change trend or an insignificant terrain change trend.
[0012] Optionally, the determining the target terrain change type of the target terrain grid and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type further includes: When the target terrain change type is used to characterize that the terrain change trend is not obvious, obtaining a radial basis function interpolation algorithm associated with the target terrain change type; Calculating coefficients of the radial basis function interpolation algorithm based on all mesh vertices in the target three-dimensional terrain mesh; Based on the radial basis function interpolation algorithm with the determined coefficients, the elevation value of each grid vertex in the target two-dimensional terrain grid is estimated.
[0013] Optionally, the radial basis function interpolation algorithm based on the determined coefficients estimates the elevation value of each grid vertex in the target two-dimensional terrain grid, including: ; in, is the estimated elevation value of a grid vertex in the target two-dimensional terrain grid, is the first The coefficients corresponding to the mesh vertices are is the target basis function, is the actual position of the mesh vertex in the target two-dimensional terrain mesh on the target two-dimensional plane, is the first The actual position of the mesh vertices on the target two-dimensional plane, The grid vertex in the target two-dimensional terrain grid and the grid vertex in the target three-dimensional terrain grid The planar Euclidean distance between mesh vertices, , and are coefficients, and are respectively the real horizontal and vertical coordinate values of the grid vertex in the target two-dimensional terrain grid, is a positive integer, is the total number of all mesh vertices in the target 3D terrain mesh.
[0014] In order to achieve the above object, the present invention further provides a terrain grid extension device, the device comprising: An acquisition module, used for acquiring a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; An estimation module, used for determining a target terrain change type of the target terrain grid, and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the true elevation value of the grid vertex; The conversion module is used to convert the target two-dimensional terrain grid into a three-dimensional terrain grid based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
[0015] In order to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, it is used to implement the steps of a terrain grid extension method introduced above.
[0016] In order to achieve the above object, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, it is used to implement the steps of the terrain grid extension method introduced above.
[0017] The terrain grid extension method, device and computer-readable storage medium provided by the present invention detect the trend change of the terrain grid during the grid extension process, and use different terrain interpolation algorithms for different terrain change trends to calculate the elevation value of the unknown point, so that the terrain grid extension result obtained can achieve the effect of maintaining the change trend of the original terrain grid and maintaining a smooth and natural transition between grids. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 A schematic diagram of an interpolation scenario and an estimated scenario provided by the present invention; Figure 2 A flow chart of a terrain grid extension method provided in Example 1; Figure 3 A schematic diagram of solving the elevation value of an unknown elevation point by fitting a first-order polynomial provided in Example 1; Figure 4 A block diagram of a terrain grid extension device provided in Embodiment 2; Figure 5 A block diagram of a computer device suitable for implementing a terrain grid extension method provided in Embodiment 3. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0020] The main application scenarios of the present invention are to estimate missing values in terrain, specifically: when the terrain grid created based on terrain sampling points is smaller than the range of the preset domain, the terrain grid needs to be extended to cover the preset area; when the stratum grid surface is used to cut the stratum body to construct the stratum unit, the stratum grid cannot penetrate the stratum body, and the stratum grid surface needs to be extended to penetrate the stratum body. The above application scenarios are only for illustrative purposes, and the present invention is not limited to the above two application scenarios.
[0021] It should be noted that during the research, the inventor discovered the following: Among various interpolation methods, the inverse distance weighted average method, radial basis function method, trend surface method, Kriging method, etc. can all be used for terrain grid extension. However, it should be noted that terrain grid extension is mainly based on outward estimation based on known data, that is, the unknown data is outside the known area. This feature does not conform to the scenarios where the above interpolation methods are generally used. In other words, the above interpolation methods are generally used in interpolation scenarios, that is, solving unknown data within the known data area. Figure 1 In the figure, solid dots represent known points, and triangle points and prism points are unknown points. If a triangle point is located in the known point region, its value is interpolated; if a prism point is located outside the known point region, its value is estimated.
[0022] The interpolation methods commonly used in interpolation scenarios are applied to the extension of terrain grids. The existing problems are described from the following aspects: first, the trend of the original terrain grid is maintained; second, whether the transition between the original grid and the extended grid is natural and smooth; third, the computational efficiency. The inverse distance weighted average method, radial basis function interpolation method, trend method, and kriging interpolation method are applied to different types of terrain grid extension. Among them, the terrain grid data type is divided into terrain with no obvious trend change (complex terrain undulation) and terrain with obvious trend (single terrain undulation change). Among the results obtained by different methods for different types of data, only radial basis function interpolation and trend method can obtain results that meet the requirements on terrain grids with obvious trends, and the results obtained by trend method are better than radial basis function interpolation method in maintaining the trend of the original terrain grid; on terrain grids with unclear trends, only radial basis function interpolation can obtain results that meet the requirements. Comparing several interpolation methods in terms of efficiency, the inverse distance weighted average method and trend method are more efficient, while the radial basis function interpolation method and kriging interpolation method are significantly less efficient. In summary, the use of a single interpolation method cannot effectively achieve the extension of multiple types of terrain grids.
[0023] In order to obtain better terrain grid extension effect and efficiency, the present invention proposes a terrain grid extension method combining radial basis function interpolation and trend method based on the performance of various methods on two types of terrain grid data, wherein the specific algorithm used in the trend method is local first-order polynomial fitting. The method proposed by the present invention detects the trend change of the local grid during the grid extension process. If the local trend is obvious, the trend method is used. Otherwise, once a local area with an unclear trend is detected, the radial basis function interpolation method is used. This method takes into account the advantages of the radial basis function interpolation method and the trend method, and can obtain a better extension effect while also improving efficiency under certain conditions.
[0024] Embodiment 1 The embodiment of the present invention provides a terrain grid extension method, such as Figure 2As shown, the method includes steps S1 to S3, wherein: Step S1, obtaining a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane.
[0025] The terrain grid is composed of multiple triangles, and the vertex of each triangle is the grid vertex of the terrain grid. Each grid vertex in the three-dimensional terrain grid has an elevation value, a horizontal coordinate value, and a vertical coordinate value, and each grid vertex in the two-dimensional terrain grid has a horizontal coordinate value and a vertical coordinate value.
[0026] In this embodiment, the target two-dimensional terrain grid and the first two-dimensional terrain grid are both located on a target two-dimensional plane, and the target two-dimensional terrain grid and the first two-dimensional terrain grid are connected on the target two-dimensional plane.
[0027] Optionally, obtaining the target terrain grid includes: Acquire the target three-dimensional terrain grid; Projecting the target three-dimensional terrain grid onto the target two-dimensional plane to obtain the first two-dimensional terrain grid; Extending the first two-dimensional terrain grid on the target two-dimensional plane to obtain a second two-dimensional terrain grid; The first two-dimensional terrain grid in the second two-dimensional terrain grid is restored as the target three-dimensional terrain grid to obtain the target terrain grid.
[0028] After the first two-dimensional terrain grid is extended, a second two-dimensional terrain grid is obtained, and the second two-dimensional terrain grid includes the first two-dimensional terrain grid and the two-dimensional terrain grid of the extended portion. The target two-dimensional terrain grid is the two-dimensional terrain grid of the extended portion.
[0029] When extending the first two-dimensional terrain grid, the grid edge of the first two-dimensional terrain grid is extracted, the extracted grid edge is offset outward, and multiple points are inserted between the original grid edge and the grid edge obtained after the offset, and the distance between each point is the average distance between each grid vertices in the first two-dimensional terrain grid; then, triangles are constructed using the inserted points, and the two-dimensional terrain grid formed by the newly constructed triangles is merged with the first two-dimensional terrain grid to obtain a second two-dimensional terrain grid, wherein the two-dimensional terrain grid constructed by the newly constructed triangles is the target two-dimensional terrain grid.
[0030] It should be noted that when offsetting the mesh edge, in addition to the wavefront-based straight skeleton algorithm, the triangulation-based straight skeleton algorithm and the motorogram-based straight skeleton algorithm can also be used for offsetting.
[0031] Step S2, determining the target terrain change type of the target terrain grid, and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on the interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex.
[0032] It is used to characterize terrain change types with obvious terrain change trends, and the associated interpolation algorithm is the first-order polynomial interpolation algorithm; it is used to characterize terrain change types with unobvious terrain change trends, and the associated interpolation algorithm is the radial basis function interpolation algorithm.
[0033] Optionally, determining a target terrain change type of the target terrain grid, and estimating elevation values of respective grid vertices in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type, comprises: Determining, from the target terrain grid, a grid vertex combination for estimating the elevation value of each grid vertex in the target two-dimensional terrain grid; wherein each grid vertex in the target two-dimensional terrain grid corresponds to a grid vertex combination; Based on a preset first-order polynomial interpolation algorithm, the fitting residual of each grid vertex combination and the fitting elevation value of each grid vertex in the target two-dimensional terrain grid are calculated; wherein the fitting residual is used to characterize the terrain change trend of the three-dimensional terrain grid formed by the grid vertex combination; Determining a target terrain change type of the target terrain grid based on fitting residuals of all grid vertex combinations; When the target terrain change type is used to characterize that the terrain change trend is obvious, the fitted elevation value of each grid vertex in the target two-dimensional terrain grid is used as the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
[0034] The mesh vertex combination includes multiple mesh vertices, and each mesh vertex in the mesh vertex group has a real elevation value or an estimated elevation value. The real elevation value can be the elevation value of the mesh vertex that has been defined in the target three-dimensional terrain grid, and the estimated elevation value can be the elevation value of the mesh vertex estimated by the interpolation algorithm of the present invention. When estimating the elevation value of the first mesh vertex in the target two-dimensional terrain grid, the mesh vertices included in the corresponding mesh vertex combination are all located in the target three-dimensional terrain grid; when estimating the elevation value of the non-first mesh vertex in the target two-dimensional terrain grid, the mesh vertices included in the corresponding mesh vertex combination can be located in the target three-dimensional terrain grid, can also be located in the target two-dimensional terrain grid, and can also be located in both the target three-dimensional terrain grid and the target two-dimensional terrain grid. It should be noted that when there are mesh vertices located in the target two-dimensional terrain grid in the mesh vertex combination, these mesh vertices have been estimated to have elevation values. The mesh vertices included in the mesh vertex combination are the first-order neighboring mesh vertices, second-order neighboring mesh vertices and / or more-order neighboring mesh vertices of the corresponding mesh vertices in the target two-dimensional terrain grid. The three-dimensional terrain grid formed by a certain combination of grid vertices is a local terrain grid in the target terrain grid. This embodiment detects the trend change of the local grid during the grid extension process, and uses different elevation value interpolation algorithms for different change trends, so that the terrain grid extension result can obtain a better extension effect and improve efficiency under certain conditions.
[0035] Optionally, determining, from the target terrain mesh, a mesh vertex combination for estimating the elevation value of each mesh vertex in the target two-dimensional terrain mesh comprises: From all mesh vertices with known real elevation values and estimated elevation values of the target terrain grid, mesh vertex combinations of each mesh vertex in the target two-dimensional terrain grid are determined respectively; wherein the mesh vertex combinations include first-order neighboring mesh vertices and second-order neighboring mesh vertices of the corresponding mesh vertex in the target two-dimensional terrain grid.
[0036] The fitting residual can be solved by the following fitting residual calculation algorithm: ; in, is the fitting residual of a mesh vertex combination, is the first vertex combination in the mesh The fitted elevation values of the mesh vertices, is the first vertex combination in the mesh The actual or estimated elevation value of each mesh vertex. is a positive integer, is the total number of mesh vertices in the mesh vertex combination. The fitted elevation value of each mesh vertex in the mesh vertex combination can be calculated by a first-order polynomial interpolation algorithm.
[0037] It should be noted that the solution provided in the existing solution of using a first-order polynomial interpolation algorithm to calculate the fitting elevation value is also feasible. However, in order to further improve the beneficial effect of terrain grid extension, this embodiment provides a better solution of using a first-order polynomial interpolation algorithm to calculate the fitting elevation value.
[0038] Optionally, the calculating of the fitting residual of each mesh vertex combination and the fitting elevation value of each mesh vertex in the target two-dimensional terrain mesh based on a preset first-order polynomial interpolation algorithm includes: Based on the real elevation value or estimated elevation value of each mesh vertex in the mesh vertex combination and the real horizontal and vertical coordinate values, the coefficients of the first-order polynomial interpolation algorithm are determined by using the least square method; Inputting the real horizontal and vertical coordinate values of each mesh vertex in the mesh vertex combination into the first-order polynomial interpolation algorithm after determining the coefficients, respectively, to obtain the fitting elevation value of each mesh vertex in the mesh vertex combination; inputting the real elevation value or the estimated elevation value and the fitting elevation value of each mesh vertex in the mesh vertex combination into a preset fitting residual calculation algorithm, to obtain the fitting residual of the mesh vertex combination; The real horizontal and vertical coordinate values of the grid vertices corresponding to the grid vertex combination in the target two-dimensional terrain grid are input into a first-order polynomial interpolation algorithm after the coefficients are determined to obtain the fitting elevation value of the grid vertex.
[0039] Among them, when a mesh vertex in the mesh vertex combination has a real elevation value, the coefficient of the first-order polynomial interpolation algorithm is calculated using the real elevation value and the real horizontal and vertical coordinate values of the mesh vertex; and when calculating the fitting residual, the real elevation value and the fitting elevation value of the mesh vertex are input into the fitting residual calculation algorithm. When a mesh vertex in the mesh vertex combination has an estimated elevation value, the coefficient of the first-order polynomial interpolation algorithm is calculated using the estimated elevation value and the real horizontal and vertical coordinate values of the mesh vertex; and when calculating the fitting residual, the estimated elevation value and the fitting elevation value of the mesh vertex are input into the fitting residual calculation algorithm.
[0040] In this embodiment, the coefficients of the first-order polynomial interpolation algorithm corresponding to each mesh vertex combination are different. The basic formula of the first-order polynomial interpolation algorithm is: ; is the elevation value of a mesh vertex, is the real horizontal coordinate of the mesh vertex, is the true vertical coordinate of the mesh vertex, , and are all coefficients. When calculating the coefficients of the first-order polynomial interpolation algorithm, is the actual elevation value or estimated elevation value of each mesh vertex in the mesh vertex combination; after calculating the coefficients of the first-order polynomial interpolation algorithm, is the fitted elevation value to be solved.
[0041] It should be noted that the larger the fitting residual, the greater the terrain undulation of the three-dimensional terrain grid formed by the corresponding combination of grid vertices, and the less obvious the change trend; conversely, the more obvious the change trend. Based on this, when determining the target terrain change type, it is necessary to combine all fitting residuals to jointly judge the change trend of the target terrain grid.
[0042] Optionally, when determining the target terrain change type, the following scheme may be adopted: Solution 1: Use the number of mesh vertices included in the mesh vertex combination to weight the fitting residuals corresponding to the mesh vertex combination, and then calculate the sum of all weighted fitting residuals. If the sum is greater than or equal to the preset quantity threshold, it is determined that the target terrain change type is characterized as the terrain change trend of the target terrain grid is not obvious; otherwise, it is determined that the target terrain change type is characterized as the terrain change trend of the target terrain grid is obvious. Among them, if the number of mesh vertices included in the mesh vertex combination is different, the corresponding fitting residual weights are different; if the number of mesh vertices included in the mesh vertex combination is the same, the corresponding fitting residual weights are the same.
[0043] Solution 2: Optionally, determining the target terrain change type of the target terrain grid based on the fitting residuals of all grid vertex combinations includes: Determine the number of mesh vertex combinations whose fitting residuals are greater than or equal to a preset residual threshold from all mesh vertex combinations; Based on the determined number of mesh vertex combinations, it is determined that the target terrain change type is characterized as the target terrain mesh having an obvious terrain change trend or an insignificant terrain change trend.
[0044] Among them, if the determined number of mesh vertex combinations is greater than or equal to a preset number threshold, it is determined that the target terrain change type is characterized as the target terrain mesh, and the terrain change trend is not obvious; otherwise, it is determined that the target terrain change type is characterized as the target terrain mesh, and the terrain change trend is obvious. Alternatively, the number of mesh vertex combinations is weighted, and if the value obtained after weighting is greater than or equal to the preset number threshold, it is determined that the target terrain change type is characterized as the target terrain mesh, and the terrain change trend is not obvious; otherwise, it is determined that the target terrain change type is characterized as the target terrain mesh, and the terrain change trend is obvious. The preset residual threshold can be set to d times the average length of the line segment in all mesh edges of the first two-dimensional terrain mesh, and the preset number threshold can be set to h times the number of all mesh edges of the first two-dimensional terrain mesh. d and h are arbitrary positive numbers, such as d is 0.1 and h is 0.5.
[0045] When the target terrain change type is used to characterize an obvious terrain change trend, since the fitting elevation values of each grid vertex in the target two-dimensional terrain grid have been calculated based on the first-order polynomial interpolation algorithm, it is only necessary to use the previously calculated results as the estimated elevation values of each grid vertex in the target two-dimensional terrain grid.
[0046] Optionally, the determining the target terrain change type of the target terrain grid and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type further includes: When the target terrain change type is used to characterize that the terrain change trend is not obvious, obtaining a radial basis function interpolation algorithm associated with the target terrain change type; Calculating coefficients of the radial basis function interpolation algorithm based on all mesh vertices in the target three-dimensional terrain mesh; Based on the radial basis function interpolation algorithm with the determined coefficients, the elevation value of each grid vertex in the target two-dimensional terrain grid is estimated.
[0047] The coefficients of the radial basis function interpolation algorithm are calculated using the following formula: ; in, The target 3D terrain grid The actual elevation value of each mesh vertex, is the target basis function, for Substitute the value obtained by the objective basis function, where The target 3D terrain grid The actual position of the mesh vertices on the target two-dimensional plane, The target 3D terrain grid The actual position of the mesh vertices on the target two-dimensional plane, The target 3D terrain grid The mesh vertices and The plane Euclidean distance between the grid vertices, that is, the first two-dimensional terrain grid The mesh vertices and The Euclidean distance between mesh vertices The target 3D terrain grid The horizontal coordinate value of the mesh vertex on the target two-dimensional plane, The target 3D terrain grid The vertical coordinate value of the mesh vertex on the target two-dimensional plane, The target 3D terrain grid The coefficients corresponding to the mesh vertices are , and are coefficients, and are all positive integers greater than or equal to 1 and less than or equal to n, The total number of all mesh vertices in the target 3D terrain mesh.
[0048] Optionally, the estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on the radial basis function interpolation algorithm with the determined coefficients includes: ; in, is the estimated elevation value of a grid vertex in the target two-dimensional terrain grid, The target 3D terrain grid The coefficients corresponding to the mesh vertices are is the target basis function, is the actual position of the mesh vertex in the target two-dimensional terrain mesh on the target two-dimensional plane, The target 3D terrain grid The actual position of the mesh vertices on the target two-dimensional plane, The grid vertex in the target two-dimensional terrain grid and the grid vertex in the target three-dimensional terrain grid The plane Euclidean distance between the grid vertices, that is, the distance between the grid vertex in the target two-dimensional terrain grid and the grid vertex in the first two-dimensional terrain grid. The Euclidean distance between mesh vertices, , and are coefficients, and are respectively the real horizontal and vertical coordinate values of the grid vertex in the target two-dimensional terrain grid, is a positive integer, is the total number of all mesh vertices in the target three-dimensional terrain mesh. The target basis function can be a linear function, a thin plate spline function, a Gaussian function, a tension spline function, a regular spline function, a high-order surface function or an inverse high-order surface function.
[0049] Step S3: based on the estimated elevation values of each mesh vertex in the target two-dimensional terrain mesh, convert the target two-dimensional terrain mesh into a three-dimensional terrain mesh.
[0050] The horizontal and vertical coordinate values of each grid vertex in the target two-dimensional terrain grid are known, and the elevation values of each grid vertex in the target two-dimensional terrain grid are estimated. Therefore, based on the horizontal and vertical coordinate values of each grid vertex in the target two-dimensional terrain grid and the estimated elevation values, the target two-dimensional terrain grid can be converted into a three-dimensional terrain grid, that is, the result of the extended part of the three-dimensional terrain grid is obtained. In other words, the target terrain grid is converted into a three-dimensional terrain grid, achieving the purpose of extending the terrain grid.
[0051] The present invention provides a process for extending a terrain grid, which can be applied to various types of terrain grids, and the terrain grid extension result obtained can not only maintain the change trend of the original terrain grid, but also maintain a smooth and natural transition between grids. In addition, the method provided in the present invention combines radial basis function interpolation and local first-order polynomial fitting interpolation to calculate the elevation value of the unknown elevation point in the terrain grid. This method is a key step in the terrain grid extension process and facilitates the achievement of the terrain grid extension goal. In addition, the method of the present invention can be applied not only to the interpolation of terrain elevation points, but also to the estimation of terrain elevation points, and the result can maintain the change trend of the original terrain grid.
[0052] The following example explains the terrain grid extension method of the present invention: The extended target 3D terrain grid is projected onto the plane in the vertical direction to obtain the first 2D terrain grid. ; Extract the first 2D terrain grid The edge of the grid , and extract the mesh edges Offset according to the preset extension distance to obtain the mesh edge ; At the edge of the grid and Insert a series of points between them and use the inserted points and the edge of the grid and Construct a triangle from the points on ; The triangle to be constructed With the first 2D terrain grid Merge to obtain the second two-dimensional terrain grid ; Restore the merged second 2D terrain mesh The elevation values of the mesh vertices belonging to the target three-dimensional terrain mesh are obtained to obtain the target terrain mesh; the elevation values of the mesh vertices of the extended part in the target terrain mesh are calculated. Figure 3 As shown, assuming that the elevation value of point F is to be solved, the grid vertex combination corresponding to point F includes: points A, B, C, D, and E; among them, points B, C, and D are the first-order neighborhood grid vertices of point F, and points A and E are the second-order neighborhood grid vertices of point F. First, the coefficients of the first-order polynomial interpolation algorithm are calculated based on the grid vertex combination, and then the first-order polynomial interpolation algorithm with the coefficients solved is used to calculate the grid vertex combination fitting residual and the fitting elevation value of point F, and it is determined whether the fitting residual is greater than or equal to the preset residual threshold. If so, the counter is increased by 1, otherwise the counter remains unchanged, and the initial value of the counter is 0. Further, it is determined whether there are still points with unknown elevation values. If so, the above process is repeated. If not, it is determined whether the counter value is greater than or equal to the preset number threshold. If so, the fitting elevation value calculated by the first-order polynomial interpolation algorithm is used as the estimated elevation value of each grid vertex in the target two-dimensional terrain grid, otherwise the radial basis function interpolation algorithm is used to recalculate the elevation value of each grid vertex with unknown elevation value.
[0053] The terrain grid extension method provided by the present invention realizes the extension of various types of terrain grids, and the extended parts maintain the change trend of the original grids; for areas with insufficient terrain sampling points, the terrain changes in the entire area are restored to the greatest extent; when using the stratigraphic grid surface to cut the stratigraphic body to construct stratigraphic units, the accuracy of the constructed stratigraphic units is guaranteed to the greatest extent.
[0054] Embodiment 2 The embodiment of the present invention provides a terrain grid extension device, such as Figure 4 As shown, the terrain grid extension device 40 specifically includes the following components: The acquisition module 401 is used to acquire a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; An estimation module 402 is used to determine a target terrain change type of the target terrain grid, and estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; The conversion module 403 is used to convert the target two-dimensional terrain grid into a three-dimensional terrain grid based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
[0055] Optionally, the acquisition module includes: A first acquisition unit, used to acquire the target three-dimensional terrain grid; A projection unit, configured to project the target three-dimensional terrain grid onto the target two-dimensional plane to obtain the first two-dimensional terrain grid; an extending unit, configured to extend the first two-dimensional terrain grid on the target two-dimensional plane to obtain a second two-dimensional terrain grid; A restoration unit is used to restore the first two-dimensional terrain grid in the second two-dimensional terrain grid to the target three-dimensional terrain grid to obtain the target terrain grid.
[0056] Optionally, the estimation module includes: A first determining unit is used to determine, from the target terrain grid, a grid vertex combination used to estimate the elevation value of each grid vertex in the target two-dimensional terrain grid; wherein each grid vertex in the target two-dimensional terrain grid corresponds to a grid vertex combination; A first calculation unit is used to calculate the fitting residual of each mesh vertex combination and the fitting elevation value of each mesh vertex in the target two-dimensional terrain mesh based on a preset first-order polynomial interpolation algorithm; wherein the fitting residual is used to characterize the terrain change trend of the three-dimensional terrain mesh formed by the mesh vertex combination; A second determining unit, configured to determine a target terrain change type of the target terrain grid based on fitting residuals of all grid vertex combinations; The third determination unit is used to use the fitted elevation values of each grid vertex in the target two-dimensional terrain grid as the estimated elevation values of each grid vertex in the target two-dimensional terrain grid when the target terrain change type is used to characterize that the terrain change trend is obvious.
[0057] Optionally, the first determining unit is specifically configured to: From all mesh vertices with known real elevation values and estimated elevation values of the target terrain grid, mesh vertex combinations of each mesh vertex in the target two-dimensional terrain grid are determined respectively; wherein the mesh vertex combinations include first-order neighboring mesh vertices and second-order neighboring mesh vertices of the corresponding mesh vertex in the target two-dimensional terrain grid.
[0058] Optionally, the first computing unit is specifically configured to: Based on the real elevation value or estimated elevation value of each mesh vertex in the mesh vertex combination and the real horizontal and vertical coordinate values, the coefficients of the first-order polynomial interpolation algorithm are determined by using the least square method; Inputting the real horizontal and vertical coordinate values of each mesh vertex in the mesh vertex combination into the first-order polynomial interpolation algorithm after determining the coefficients, respectively, to obtain the fitting elevation value of each mesh vertex in the mesh vertex combination; inputting the real elevation value or the estimated elevation value and the fitting elevation value of each mesh vertex in the mesh vertex combination into a preset fitting residual calculation algorithm, to obtain the fitting residual of the mesh vertex combination; The real horizontal and vertical coordinate values of the grid vertices corresponding to the grid vertex combination in the target two-dimensional terrain grid are input into a first-order polynomial interpolation algorithm after the coefficients are determined to obtain the fitting elevation value of the grid vertex.
[0059] Optionally, the second determining unit is specifically configured to: Determine the number of mesh vertex combinations whose fitting residuals are greater than or equal to a preset residual threshold from all mesh vertex combinations; Based on the determined number of mesh vertex combinations, it is determined that the target terrain change type is characterized as the target terrain mesh having an obvious terrain change trend or an insignificant terrain change trend.
[0060] Optionally, the estimation module further includes: A second acquisition unit is used to acquire a radial basis function interpolation algorithm associated with the target terrain change type when the target terrain change type is used to characterize that the terrain change trend is not obvious; A second calculation unit, used for calculating coefficients of the radial basis function interpolation algorithm based on all mesh vertices in the target three-dimensional terrain mesh; The estimation unit is used to estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on the radial basis function interpolation algorithm with the determined coefficients.
[0061] Optionally, the estimation unit is specifically used to execute the following formula: ; in, is the estimated elevation value of a grid vertex in the target two-dimensional terrain grid, The target 3D terrain grid The coefficients corresponding to the mesh vertices are is the radial basis function, is the actual position of the mesh vertex in the target two-dimensional terrain mesh on the target two-dimensional plane, The target 3D terrain grid The actual position of the mesh vertices on the target two-dimensional plane, The grid vertex in the target two-dimensional terrain grid and the grid vertex in the target three-dimensional terrain grid The planar Euclidean distance between mesh vertices, , and are coefficients, and are respectively the real horizontal and vertical coordinate values of the grid vertex in the target two-dimensional terrain grid, is a positive integer, The total number of all mesh vertices in the target 3D terrain mesh.
[0062] Embodiment 3 This embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 5 As shown, the computer device 50 of this embodiment includes at least but not limited to: a memory 501 and a processor 502 that can communicate with each other via a system bus. It should be noted that Figure 5 Only computer device 50 is shown with components 501 - 502 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0063] In this embodiment, the memory 501 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 501 can be an internal storage unit of the computer device 50, such as a hard disk or memory of the computer device 50. In other embodiments, the memory 501 can also be an external storage device of the computer device 50, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. equipped on the computer device 50. Of course, the memory 501 can also include both the internal storage unit of the computer device 50 and its external storage device. In this embodiment, the memory 501 is generally used to store the operating system and various application software installed on the computer device 50. In addition, the memory 501 can also be used to temporarily store various data that have been output or are to be output.
[0064] In some embodiments, the processor 502 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 502 is generally used to control the overall operation of the computer device 50 .
[0065] Specifically, in this embodiment, the processor 502 is used to execute the program of the terrain grid extension method stored in the memory 501, and the program of the terrain grid extension method implements the following steps when being executed: Acquire a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; Determine a target terrain change type of the target terrain grid, and estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; Based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid, the target two-dimensional terrain grid is converted into a three-dimensional terrain grid.
[0066] The specific implementation process of the above method steps can be found in Example 1, and this embodiment will not be repeated here.
[0067] Embodiment 4 This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored. When the computer program is executed by a processor, the following method steps are implemented: Acquire a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; Determine a target terrain change type of the target terrain grid, and estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; Based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid, the target two-dimensional terrain grid is converted into a three-dimensional terrain grid.
[0068] The specific implementation process of the above method steps can be found in Example 1, and this embodiment will not be repeated here.
[0069] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0070] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0072] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A terrain grid extension method, characterized in that: The method comprises: Acquire a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane, and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; Determine a target terrain change type of the target terrain grid, and estimate the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; Based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid, the target two-dimensional terrain grid is converted into a three-dimensional terrain grid.
2. The method according to claim 1, characterized in that The step of obtaining the target terrain grid comprises: Acquire the target three-dimensional terrain grid; Projecting the target three-dimensional terrain grid onto the target two-dimensional plane to obtain the first two-dimensional terrain grid; Extending the first two-dimensional terrain grid on the target two-dimensional plane to obtain a second two-dimensional terrain grid; The first two-dimensional terrain grid in the second two-dimensional terrain grid is restored as the target three-dimensional terrain grid to obtain the target terrain grid.
3. The method according to claim 1, characterized in that: The step of determining the target terrain change type of the target terrain grid and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type includes: Determining, from the target terrain grid, a grid vertex combination for estimating the elevation value of each grid vertex in the target two-dimensional terrain grid; wherein each grid vertex in the target two-dimensional terrain grid corresponds to a grid vertex combination; Based on a preset first-order polynomial interpolation algorithm, the fitting residual of each grid vertex combination and the fitting elevation value of each grid vertex in the target two-dimensional terrain grid are calculated; wherein the fitting residual is used to characterize the terrain change trend of the three-dimensional terrain grid formed by the grid vertex combination; Determining a target terrain change type of the target terrain grid based on fitting residuals of all grid vertex combinations; When the target terrain change type is used to characterize that the terrain change trend is obvious, the fitted elevation value of each grid vertex in the target two-dimensional terrain grid is used as the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
4. The method according to claim 3, characterized in that Determining, from the target terrain grid, a grid vertex combination for estimating the elevation value of each grid vertex in the target two-dimensional terrain grid comprises: From all mesh vertices with known real elevation values and estimated elevation values of the target terrain grid, mesh vertex combinations of each mesh vertex in the target two-dimensional terrain grid are determined respectively; wherein the mesh vertex combinations include first-order neighboring mesh vertices and second-order neighboring mesh vertices of the corresponding mesh vertex in the target two-dimensional terrain grid.
5. The method according to claim 3, characterized in that: The method of calculating the fitting residual of each mesh vertex combination and the fitting elevation value of each mesh vertex in the target two-dimensional terrain mesh based on a preset first-order polynomial interpolation algorithm includes: Based on the real elevation value or estimated elevation value of each mesh vertex in the mesh vertex combination and the real horizontal and vertical coordinate values, the coefficients of the first-order polynomial interpolation algorithm are determined by using the least square method; Inputting the real horizontal and vertical coordinate values of each mesh vertex in the mesh vertex combination into the first-order polynomial interpolation algorithm after determining the coefficients, respectively, to obtain the fitting elevation value of each mesh vertex in the mesh vertex combination; inputting the real elevation value or the estimated elevation value and the fitting elevation value of each mesh vertex in the mesh vertex combination into a preset fitting residual calculation algorithm, to obtain the fitting residual of the mesh vertex combination; The real horizontal and vertical coordinate values of the grid vertices corresponding to the grid vertex combination in the target two-dimensional terrain grid are input into a first-order polynomial interpolation algorithm after the coefficients are determined to obtain the fitting elevation value of the grid vertex.
6. The method according to claim 3, characterized in that The step of determining the target terrain change type of the target terrain grid based on the fitting residuals of all grid vertex combinations includes: Determine the number of mesh vertex combinations whose fitting residuals are greater than or equal to a preset residual threshold from all mesh vertex combinations; Based on the determined number of mesh vertex combinations, it is determined that the target terrain change type is characterized as the target terrain mesh having an obvious terrain change trend or an insignificant terrain change trend.
7. The method according to claim 3, characterized in that The step of determining a target terrain change type of the target terrain grid and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type further includes: When the target terrain change type is used to characterize that the terrain change trend is not obvious, obtaining a radial basis function interpolation algorithm associated with the target terrain change type; Calculating coefficients of the radial basis function interpolation algorithm based on all mesh vertices in the target three-dimensional terrain mesh; Based on the radial basis function interpolation algorithm with the determined coefficients, the elevation value of each grid vertex in the target two-dimensional terrain grid is estimated.
8. The method according to claim 7, characterized in that The radial basis function interpolation algorithm based on the determined coefficients estimates the elevation value of each grid vertex in the target two-dimensional terrain grid, including ; in, is the estimated elevation value of a grid vertex in the target two-dimensional terrain grid, is the first The coefficients corresponding to the mesh vertices are is the target basis function, is the actual position of the mesh vertex in the target two-dimensional terrain mesh on the target two-dimensional plane, is the first The actual position of the mesh vertices on the target two-dimensional plane, The grid vertex in the target two-dimensional terrain grid and the grid vertex in the target three-dimensional terrain grid The planar Euclidean distance between mesh vertices, , and are coefficients, and are respectively the real horizontal and vertical coordinate values of the grid vertex in the target two-dimensional terrain grid, is a positive integer, is the total number of all mesh vertices in the target 3D terrain mesh.
9. A terrain grid extension device, characterized in that: The device comprises: An acquisition module, used for acquiring a target terrain grid; wherein the target terrain grid includes a target three-dimensional terrain grid and a target two-dimensional terrain grid, the target two-dimensional terrain grid is located in a target two-dimensional plane and is connected to a first two-dimensional terrain grid obtained by projecting the target three-dimensional terrain grid onto the target two-dimensional plane; An estimation module, used for determining a target terrain change type of the target terrain grid, and estimating the elevation value of each grid vertex in the target two-dimensional terrain grid based on an interpolation algorithm associated with the target terrain change type; wherein each terrain change type is associated with an interpolation algorithm for estimating the elevation value of the grid vertex; The conversion module is used to convert the target two-dimensional terrain grid into a three-dimensional terrain grid based on the estimated elevation value of each grid vertex in the target two-dimensional terrain grid.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Cited By
Fine projection deformation calculation method based on three-dimensional traversal grid and program product
CN121582253A