An automatic mapping method based on underwater contour lines
Through automated processing and innovative algorithms, the problems of low efficiency and unstable accuracy in traditional underwater contour mapping have been solved, achieving efficient and accurate contour mapping that adapts to complex terrain and multi-scale requirements, and meets the data support needs of water conservancy projects.
Patent Information
- Application Number
- CN202411753398.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Traditional underwater contour mapping methods are inefficient, have unstable accuracy, are difficult to process large-scale data, cannot adapt to complex terrain and multi-scale requirements, and cannot reflect underwater topographic changes in a timely manner, thus failing to meet the needs of modern water conservancy projects.
By extracting 3D coordinate data from data files, generating threshold sequences and dividing the primary curve and the calculation curve, constructing a triangular network using bilinear interpolation and Delaunay triangulation, generating isobath segments, and automatically drawing isobaths by iteratively optimizing control points and polygon smoothing algorithms.
It improves the efficiency and quality of contour line mapping, can adapt to different scales and complex terrains, maintains the accuracy of terrain features, provides reliable data support, and provides technical support for water conservancy project construction.
Smart Images

Figure CN119888006B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water conservancy engineering, and specifically to an automatic mapping method based on underwater contour lines. Background Technology
[0002] Underwater contour lines are an indispensable tool in hydraulic engineering, widely used in water surveying, waterway planning, and other fields. Traditional methods of drawing underwater contour lines mainly rely on manual operation, which suffers from low efficiency, inconsistent accuracy, and difficulty in processing large-scale data. With the advancement of surveying technology, the amount of underwater topographic data collected has increased dramatically, and manual processing methods can no longer meet the needs of modern hydraulic engineering.
[0003] In recent years, computer technology has been increasingly used in underwater contour mapping. The emergence of some computer-aided mapping software has improved the efficiency and accuracy of contour mapping to some extent. However, these software programs still require significant human intervention and cannot achieve true automation. Furthermore, existing automation methods often struggle to adapt to complex underwater terrain, resulting in insufficient accuracy or inaccuracies in understanding actual terrain features.
[0004] The dynamic changes in underwater topography also present new challenges to the drawing of contour lines. Due to factors such as natural erosion and human engineering, underwater topography may continuously change. Traditional contour line drawing methods are unable to reflect these changes in a timely manner, resulting in insufficient timeliness of contour maps and an inability to provide accurate and timely basis for water conservancy project decisions.
[0005] Furthermore, different application scenarios have different requirements for contour maps. For example, waterway planning may require large-scale, detailed contour maps, while reservoir management may require small-scale, overview contour maps. Existing drawing methods are difficult to flexibly handle such multi-scale requirements and often require repeated, tedious manual adjustments.
[0006] Therefore, developing a method for automatically, accurately, and efficiently drawing underwater contour lines can not only improve the efficiency of water conservancy projects but also provide more reliable data support for their planning, design, and management. This has significant practical importance and application value for enhancing the overall level of water conservancy projects and promoting the sustainable development of water conservancy. Summary of the Invention
[0007] To address the technical problems mentioned above, this invention provides an automatic mapping method based on underwater contour lines, comprising the following steps:
[0008] S1. Extract three-dimensional coordinate data from the data file, generate a threshold sequence by determining the range of water depth elevation values and the spacing of isobaths, and divide the primary curve and the calculation curve in the threshold sequence.
[0009] S2. Convert the preprocessed data points in step 1 into continuous grid data through bilinear interpolation. Connect the intersections with the same elevation value in the constructed triangular network to form isobath segments. Connect these segments end to end to obtain the complete initial isobath.
[0010] S3. For each point on the triangulation network of each contour line, calculate and generate the control points on both sides and the center point.
[0011] S4. Construct the outer polygon using all control points A generated in step 3, the inner polygon using all control points B, and the central polygon using the center point. Iterate and optimize the central polygon, ensuring through multiple iterations that the smooth curve remains within the boundary polygons while preserving the original terrain features.
[0012] In the preferred embodiment, step S1 specifically includes the following steps:
[0013] S11. Read the raw data line by line from the data file, use the string splitting function to parse each line of data into numerical X, Y, Z coordinate values, and store them in the corresponding data structure;
[0014] S12. Traverse all data points, continuously update the current maximum and minimum value records, and determine the threshold range required for the generation of contour lines;
[0015] S13. By increasing the given isobath spacing within the range of minimum and maximum Z values, the threshold sequence can be obtained.
[0016] S14. When generating the threshold sequence, mark the values at every 5 intervals in the sequence as the counting curves, and the rest as the first curves.
[0017] In the preferred embodiment, step S2 further includes the following steps:
[0018] S21. Use bilinear interpolation to interpolate discrete data points into continuous grid data;
[0019] S22. Using the continuous grid data obtained in step S21, perform Delaunay triangulation using the point-by-point insertion method to generate a triangular mesh;
[0020] S23. Optimize the insertion of new points into the triangular mesh based on the given maximum side length threshold;
[0021] S24. By connecting the intersections with the same elevation value inside each triangle to form isobaths, and then connecting these isobaths end to end in adjacent triangles, the initial isobaths are finally formed.
[0022] In the preferred embodiment, the bilinear interpolation method in step S21 is specifically as follows:
[0023] Assuming the target point's coordinates are P(x,y), find the four integer coordinates closest to point P:
[0024] Z11(x1,y1), Z12(x1,y2), Z21(x2,y1), Z22(x2,y2).
[0025] Calculate the interpolation in the X direction:
[0026]
[0027]
[0028] Calculate the interpolation in the Y direction to obtain the final result:
[0029]
[0030] Repeat the above method to perform bilinear interpolation on all discrete points in the data file to obtain continuous grid data.
[0031] In the preferred embodiment, the Delaunay triangulation operation in step S22 includes the following steps:
[0032] Assume a new node D is inserted;
[0033] S221. For each triangle, construct its circumcircle and find the triangle whose circumcircle includes point D.
[0034] S222. Delete the common edge of the triangle containing point D in the circumcircle to form the Delaunay cavity;
[0035] S223. Connect point D to each vertex of the Delaunay cavity to insert point D into the Delaunay triangle list, forming a new set of Delaunay triangles.
[0036] In the preferred embodiment, step S23 further includes:
[0037] Assume the coordinates of the two endpoints of the triangle's side are (x1, y1, z1) and (x2, y2, z2).
[0038] x = x1 + ((x2 - x1) / count) * j;
[0039] y = y1 + ((y2 - y1) / count) * j;
[0040] z = z1 + ((z2 - z1) / count) * j;
[0041] In the formula, count represents the total number of points to be inserted, and j represents the index of the current insertion point.
[0042] In the preferred embodiment, step S3 specifically includes the following steps:
[0043] For each point on the triangulation network of the contour line, two control points are generated.
[0044] Assuming the original triangular mesh is triangle ABC, traverse each isobath polygon to obtain the three vertices A, B, and C of the original triangular mesh;
[0045] When point C does not coincide with A or B, calculate the movable control points newPointA and newPointB.
[0046] distance=canMoveDistance / (zDiff / originalDistance)
[0047] newPoint=destination(from,distance,bearing)
[0048] Wherein, canMoveDistance represents the maximum allowable movement distance determined by a custom residual value, zDiff represents the elevation difference between two points, originalDistance represents the original distance between the two points, and the destination function calculates the control point position based on the starting point, distance, and azimuth.
[0049] Calculate the coordinates of the center point:
[0050] X_center = (X_A + X_B) / 2
[0051] Y_center = (Y_A + Y_B) / 2
[0052] Where (X_A,Y_A) and (X_B,Y_B) represent the x and y coordinates of newPointA and newPointB, respectively.
[0053] In the preferred scheme, when C coincides with A or B, the coincidence point is directly used as the control point and center point;
[0054] Add the calculated control points and center points to the corresponding polygon array.
[0055] In the preferred embodiment, step S4 specifically includes the following steps:
[0056] Construct polygon A using all control points A, construct polygon B using all control points B, and construct the central polygon using all center points.
[0057] The central polygon is first smoothed using the Chaikin algorithm. For each edge of the polygon, new vertices are generated at 1 / 4 and 3 / 4 distances from the starting point. These two points trisect one of the original edges of the polygon. Assuming the newly generated vertices are P1 and P2, and the polygon edge is AB, the newly generated vertices are calculated using the following formula:
[0058]
[0059] Detect the intersection points of the newly generated smooth polygon and the original center polygon;
[0060] Find the nearest point on the central polygon to each detected intersection point and use it as a new control point. The formula for generating the new control points is:
[0061] P_nearest=nearestPointOnLine(L_center,P_intersect);
[0062] The nearest point is calculated using the nearest point function in the turf.js library, where P_nearest represents the new control point on the central polygon, L_center represents the line segment of the central polygon, and P_intersect represents the detected intersection point.
[0063] Update the center polygon using the newly generated control points.
[0064] In the preferred embodiment, the step of generating new control points in step S4 is repeated several times, and the current iteration number is continuously compared with the maximum allowed iteration number to determine whether to continue iterating, until the preset iteration limit is reached.
[0065] The beneficial effects of this invention are as follows: The automatic underwater contour mapping method proposed in this invention improves the efficiency and quality of contour mapping through automated processing and innovative algorithms. It has good adaptability and can handle different scales and complex terrain conditions. It strictly maintains the fixed point positions to ensure accurate reflection of terrain features. Furthermore, it can be integrated into a visualization software system for practical application, providing reliable technical support for water conservancy engineering construction. Attached Figure Description
[0066] Figure 1 This is a schematic diagram of the Delaunay triangulation in an embodiment of the present invention.
[0067] Figure 2 This is a schematic diagram of the initial contour lines in an embodiment of the present invention.
[0068] Figure 3 This is a schematic diagram of contour lines automatically generated according to an embodiment of the present invention.
[0069] Figure 4 This is a contour line comparison diagram automatically generated according to an embodiment of the present invention. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0071] Example 1
[0072] To achieve automated contour mapping, three key issues need to be addressed: first, how to process complex underwater topographic data and construct an irregular triangular mesh model that accurately represents topographic features; second, how to ensure the smoothness and accuracy of contour lines, eliminating irregular protrusions while preserving important topographic features; and third, how to adapt to different scales and application requirements to achieve multi-scale representation of contour lines. This invention proposes a complete solution to these problems, comprising four key steps: first, data preprocessing, extracting 3D coordinate data from the data file and generating a threshold sequence; second, constructing initial contour lines through bilinear interpolation; third, generating two control points for each contour line point, and then constructing a polygon structure and iteratively smoothing the polygons; and finally, optimizing the contour lines through control point movement and polygon smoothing. The combination of these four steps not only achieves high-quality automated mapping of underwater contour lines but also solves problems such as insufficient accuracy and inaccurate mapping effects in existing technologies. The detailed principles of each step are explained below:
[0073] Step 1: The core of data preprocessing lies in ensuring the quality of the raw data through normalization. Outliers are removed by setting thresholds. This improves the quality of the raw data and provides a reliable data foundation for subsequent contour line generation.
[0074] In step 1, raw data is read line by line from the data file. A string splitting function is used to parse each line of data into numerical X, Y, and Z coordinates, which are then stored in the corresponding data structure. All data points are traversed, and the current maximum and minimum value records are continuously updated to determine the threshold range required for contour line generation, improving data reliability. The threshold sequence is obtained by increasing the given contour line spacing within the range of minimum and maximum Z values. To improve the readability of the contour map, a first-curve-count curve representation is adopted. When generating the threshold sequence, values at every 5 intervals in the sequence are marked as count curves. That is, starting from the starting point, every four contour lines are selected as count curves and marked in red, while the rest are first curves, thus forming a clearly defined contour line effect. This systematic preprocessing method lays the foundation for the accurate generation and clear visualization of subsequent contour lines.
[0075] Step 2: Convert the discrete data into a continuous grid using bilinear interpolation, then generate a triangular network using Delaunay triangulation and optimize it. Finally, connect the contour points inside the triangles and connect them end to end to form a complete contour line.
[0076] Step 2 uses bilinear interpolation to interpolate discrete data points into continuous grid data, providing the necessary continuous data source for constructing the triangular mesh. Assuming the target point's coordinates are P(x,y), find the four integer coordinate points closest to point P: Z11(x1,y1), Z12(x1,y2), Z21(x2,y1), and Z22(x2,y2).
[0077] Calculate the interpolation in the X direction:
[0078]
[0079] Calculate the interpolation in the Y direction to obtain the final result:
[0080]
[0081] Repeat the above method to perform bilinear interpolation on all discrete points in the data file to obtain continuous grid data.
[0082] Using these continuous grid data, a Delaunay triangulation is performed using the point-by-point interpolation method to generate a triangular network.
[0083] Assuming a new node D is inserted, the partitioning steps are as follows:
[0084] 1. For each triangle, construct its circumcircle and find the triangle whose circumcircle includes point D.
[0085] 2. Delete the common edge of the triangle containing point D in the circumcircle to form the Delaunay cavity.
[0086] 3. Connect point D to each vertex of the Delaunay cavity, thus completing the insertion of point D into the list of Delaunay triangles and forming a new set of Delaunay triangles.
[0087] To improve the quality of the triangulation network, new points are inserted into the network based on a given maximum side length threshold. Assume the coordinates of the two endpoints of the triangle's sides are (x1, y1, z1) and (x2, y2, z2).
[0088] x=x1+((x2-x1) / count)*j (4)
[0089] y = y1 + ((y2 - y1) / count) * j (5)
[0090] z = z1 + ((z2 - z1) / count) * j (6)
[0091] In the formula, count represents the total number of points to be inserted, and j represents the index of the current insertion point.
[0092] By connecting the intersections with the same elevation value inside each triangle to form isobaths, and then connecting these isobaths end to end in adjacent triangles, the initial isobaths are finally formed.
[0093] Step 3: Generation of contour line control points: Traverse the contour line polygons in the triangular network, calculate the position of the control points based on the vertex overlap, determine the movable distance using the residual value and elevation difference, and finally calculate the control points and center points.
[0094] In step 3, for each point of the contour line on the triangulation network, two control points are calculated and generated.
[0095] Assuming the original triangular mesh is triangle ABC, traverse each contour polygon to obtain the three vertices A, B, and C of the original triangular mesh.
[0096] Determine whether point C coincides with point A or point B, and calculate the control points according to different situations:
[0097] If point C does not coincide with A or B, calculate the movable control points newPointA and newPointB.
[0098] distance=canMoveDistance / (zDiff / originalDistance) (7)
[0099] newPoint=destination(from,distance,bearing) (8)
[0100] Wherein, canMoveDistance represents the maximum allowable movement distance determined by a custom residual value, zDiff represents the elevation difference between two points, originalDistance represents the original distance between the two points, and the destination function calculates the control point position based on the starting point, distance, and azimuth.
[0101] Calculate the coordinates of the center point:
[0102] X_center=(X_A+X_B) / 2 (9)
[0103] Y_center=(Y_A+Y_B) / 2 (10)
[0104] Where (X_A,Y_A) and (X_B,Y_B) represent the x and y coordinates of newPointA and newPointB, respectively.
[0105] If C coincides with A or B, then the coincident point is used directly as the control point and center point.
[0106] Add the calculated control points and center points to the corresponding polygon array.
[0107] Step 4: Final smoothing process of contour lines: Construct polygons using control points, then perform preliminary smoothing of the central polygon using the Chaikin algorithm, detect the intersections between the smoothed polygon and the original polygon, and generate new control points based on these intersections to update the central polygon. Repeat this process until the preset number of iterations is reached to complete the contour line drawing.
[0108] In step 4, polygon A is constructed using all control points A, polygon B is constructed using all control points B, and the center polygon is constructed using all center points.
[0109] The smoothing process of the central polygon is an iterative optimization process. The central polygon is first smoothed using the Chaikin algorithm. For each edge of the polygon, new vertices are generated at 1 / 4 and 3 / 4 distances from the starting point, respectively. These two points trisect one of the original edges of the polygon. Assuming the newly generated vertices are P1 and P2, and the polygon edge is AB, the newly generated vertices are calculated using the following formula:
[0110]
[0111] Detect the intersection points of the newly generated smooth polygon and the original center polygon.
[0112] New control point generation for the central polygon: For each detected intersection, find its nearest point on the central polygon as the new control point. The formula for generating the new control point is as follows:
[0113] P_nearest=nearestPointOnLine(L_center,P_intersect) (13)
[0114] This functionality is achieved using the `nearestPointOnLine` function from the `turf.js` library. Here, `P_nearest` represents the new control point on the central polygon, `L_center` represents the line segment of the central polygon, and `P_intersect` represents the detected intersection point.
[0115] Update the center polygon using the newly generated control points.
[0116] The above process is repeated as needed, constantly comparing the current iteration number with the maximum allowed iteration number to determine whether to continue iterating, until the preset iteration limit is reached.
[0117] At this point, the automatic plotting of underwater contour lines is complete.
[0118] Example 2
[0119] The method of this invention was verified in a waterway near the Yichang section of the Yangtze River. The specific implementation steps are as follows:
[0120] (1) Select the contour line file to be drawn, set the spacing of the contour lines to equal intervals, and distinguish and label the first curve and the calculation curve to ensure that the contour lines of different depths are clearly expressed.
[0121] (2) Set the maximum side length threshold of the triangular network to 50, and construct the triangular network of underwater terrain based on this parameter and generate the initial isobaths.
[0122] (3) Set the error range to 0.5, calculate the movable range of each underwater elevation point, generate corresponding control points, and ensure accurate water depth expression.
[0123] (4) Perform underwater contour smoothing iterations based on the set maximum number of iterations to optimize the contour morphology.
[0124] (5) At this point, the automatic mapping of underwater contour lines is completed, forming an accurate and aesthetically pleasing representation of underwater topography.
[0125] The automatic underwater contour mapping method proposed in this invention has two advantages: firstly, it improves the efficiency and quality of contour mapping through automated processing and innovative algorithms; secondly, it has good adaptability and can handle different scales and complex terrain conditions. The automatically mapped contour lines of this invention are shown in [reference needed]. Figure 3 As shown; secondly, strictly maintaining the fixed point position ensures the accurate reflection of terrain features, and integrating it into the visualization software system facilitates practical application, providing reliable technical support for water conservancy project construction.
[0126] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automatic mapping method based on underwater contour lines, characterized by: Includes the following steps: S1. Extract three-dimensional coordinate data from the data file, generate a threshold sequence by determining the range of water depth elevation values and the spacing of isobaths, and divide the primary curve and the calculation curve in the threshold sequence. S2. Convert the preprocessed data points in step S1 into continuous grid data through bilinear interpolation. Connect the intersections with the same elevation value in the constructed triangular network to form isobath segments. Connect the isobath segments end to end to obtain the complete initial isobath. S3. For each point on the triangulation network of the contour line, calculate and generate two control points; Assuming the original triangular mesh is triangle ABC, traverse each isobath polygon to obtain the three vertices A, B, and C of the original triangular mesh; Calculate the movable control points when point C does not coincide with point A or B. and ; ; ; Wherein, canMoveDistance represents the maximum allowable movement distance determined by the custom residual value, zDiff represents the elevation difference between two points, originalDistance represents the original distance between the two points, and the destination function calculates the control point position based on the starting point, distance, and azimuth. Calculate the coordinates of the center point: ; ; in, and They represent and The x and y coordinates; S4. Construct polygon A using all control points A, construct polygon B using all control points B, and construct the central polygon using all center points. The central polygon is first smoothed using the Chaikin algorithm. For each edge of the polygon, new vertices are generated at 1 / 4 and 3 / 4 distances from the starting point. These two points trisect one of the original edges of the polygon. Assuming the newly generated vertices are P1 and P2, and the polygon edge is AB, the newly generated vertices are calculated using the following formula: ; ; Detect the intersection points of the newly generated smooth polygon and the original center polygon; Find the nearest point on the central polygon to each detected intersection point and use it as a new control point. The formula for generating the new control points is: ; The nearest point is calculated using the nearest point function from the turf.js library, where P_nearest represents the new control point on the central polygon, L_center represents the line segment of the central polygon, and P_intersect represents the detected intersection point. Update the center polygon using the newly generated control points.
2. The automatic mapping method based on underwater contour lines according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Read the raw data line by line from the data file, use the string splitting function to parse each line of data into numerical X, Y, Z coordinate values, and store them in the corresponding data structure; S12. Traverse all data points, update the current maximum and minimum value records, and determine the threshold range required for generating contour lines; S13. Increase the threshold sequence by the given isobath spacing within the range of minimum and maximum Z values; S14. When generating the threshold sequence, mark the values at every 5 intervals in the sequence as the counting curves, and the rest as the first curves.
3. The automatic mapping method based on underwater contour lines according to claim 1, characterized in that: Step S2 also includes the following steps: S21. Use bilinear interpolation to interpolate discrete data points into continuous grid data; S22. Using the continuous grid data obtained in step S21, perform Delaunay triangulation using the point-by-point insertion method to generate a triangular mesh; S23. Optimize the insertion of new points into the triangular mesh based on the given maximum side length threshold; S24. By connecting the intersections with the same elevation value inside each triangle to form isobaths, and then connecting these isobaths end to end in adjacent triangles, the initial isobaths are finally formed.
4. The automatic mapping method based on underwater contour lines according to claim 3, characterized in that: The bilinear interpolation method in step S21 is as follows: Assuming the target point's coordinates are P(x,y), find the four integer coordinates closest to point P: Z11(x1,y1), Z12(x1,y2), Z21(x2,y1), Z22(x2,y2); Calculate the interpolation in the X direction: , ; Calculate the interpolation in the Y direction to obtain the final result: ; Repeat the above method to perform bilinear interpolation on all discrete points in the data file to obtain continuous grid data.
5. The automatic mapping method based on underwater contour lines according to claim 3, characterized in that: The Delaunay triangulation operation in step S22 includes the following steps: Assume a new node D is inserted; S221. For each triangle, construct its circumcircle and find the triangle whose circumcircle includes point D. S222. Delete the common edge of the triangle containing point D in the circumcircle to form the Delaunay cavity; S223. Connect point D to each vertex of the Delaunay cavity to insert point D into the Delaunay triangle list, forming a new set of Delaunay triangles.
6. The automatic mapping method based on underwater contour lines according to claim 3, characterized in that: Step S23 also includes: Assume the coordinates of the two endpoints of the triangle are , , ; ; ; In the formula, This indicates the total number of points to be inserted. Indicates the index of the current insertion point.
7. The automatic mapping method based on underwater contour lines according to claim 1, characterized in that: When C coincides with A or B, the coincident point is directly used as the control point and center point; Add the calculated control points and center points to the corresponding polygon array.
8. The automatic mapping method based on underwater contour lines according to claim 1, characterized in that: The step of generating new control points in step S4 is repeated several times, and the current iteration number is continuously compared with the maximum allowed iteration number to determine whether to continue iterating, until the preset iteration limit is reached.
Citation Information
Patent Citations
Multi-scale isobath automatic extraction method based on submarine topography model
CN112035429A
Ocean unstructured grid automatic subdivision optimization method based on unsupervised machine learning
CN114417951A