DEM-based depression multi-dimensional information and vector boundary extraction method
Through the secondary convolution sampling and depression filling method of DEM data, combined with multi-threaded parallel processing and morphological processing, the accuracy and efficiency problems of multi-dimensional information extraction of depressions in large-scale DEM data are solved, and refined risk assessment of the power industry is realized.
Patent Information
- Application Number
- CN202510863277.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-11-01
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Existing technologies make it difficult to accurately extract multidimensional information of depressions and conduct inundation risk assessment in large-scale DEM data. In particular, feature extraction in complex scenarios is not detailed and accurate enough, and cannot meet the refined risk assessment needs of the power industry.
The secondary convolution sampling and depression filling methods are used to convert DEM data into Mercator plane projection. The depression depth distribution map is generated through depression filling and morphological processing. The depression contours are accurately extracted and multi-dimensional attribute information is calculated. Combined with multi-threaded parallel processing and log recovery mechanism, vector surface data files are generated.
It significantly improves the efficiency of large-scale DEM data processing, suppresses the influence of data noise, enhances the fault tolerance of the method, can effectively respond to the multi-dimensional analysis needs in complex power grid scenarios, and expands its application potential.
Smart Images

Figure CN120635129A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of DEM data processing, in particular to a method for extracting multi-dimensional information and vector boundaries of depressions based on DEM. Background Art
[0002] Low-lying areas are areas with lower elevations than surrounding areas and lack drainage points, resulting in water accumulation after rainfall. Depression extraction is crucial in the power industry. It not only aids in grid planning and design, avoids potential flooding, and ensures the safety of power facilities, but also plays a key role in infrastructure construction, disaster management, and environmental protection. Accurately identifying depression locations can optimize construction plans, reduce risks and costs, and improve the resilience of power facilities to natural disasters. However, simply knowing the location of depressions is insufficient. Extracting multidimensional information about depressions, such as area, depth, volume, and the ranges corresponding to different volumes, supports data-driven scientific decision-making and significantly improves decision-makers' ability to obtain high-precision geographic information, enhancing the safety and reliability of power infrastructure and effectively responding to potential natural disasters and environmental changes. Therefore, extracting multidimensional depression information is crucial for risk management and planning in the power industry.
[0003] Although the spatial analysis tool in the commercial software ArcGIS can extract the corresponding depression area according to the depth specified by the user, the function of this tool is relatively simple and can only perform basic depression extraction, lacking the ability to conduct in-depth analysis of complex scenes. The domestic Supermap has developed a tool that can achieve dynamic simulation of three-dimensional flooding through basic parameter settings, mainly used to provide intuitive visual effects. These existing tools have limitations and cannot perform customized multi-dimensional information analysis of flooded areas, making it difficult to meet the needs of refined flooding risk assessment in complex scenarios. In addition, large-scale DEM data is huge in volume. Whether it is reading and loading, or processing and analysis, it is necessary to develop efficient algorithms and optimization technologies to ensure the real-time and accuracy of data processing. The existing related extraction algorithms are more suitable for small-scale data processing.
[0004] In the prior art CN115839707A, a method for accurately identifying farmland depression features based on a digital terrain model is disclosed. The method includes establishing a centimeter-level high-precision farmland digital terrain model based on drone aerial images, and establishing an inverted digital terrain model based on the average elevation of the DTM; extracting the maximum elevation points of the farmland in the RDTM environment; selecting three terrain factors, namely elevation, terrain undulation and slope, and determining the weights of the above terrain factors through the entropy weight method; obtaining the comprehensive membership of the terrain factors through the weighted method, and determining the threshold value through the comprehensive membership of the multi-window terrain factors to locate the position of the farmland depression features; and using the contour analysis method to identify the outer contours of the farmland depression features and calculate the fill volume of each depression feature.
[0005] Existing techniques for extracting features from farmland depressions typically focus on processing data from a small area, using methods tailored to that area. This approach presents challenges when extracting and processing data from larger areas. In complex target scenarios, the extracted features are not detailed or accurate enough, and the resulting depression data and flooding risk assessments are also inaccurate. Summary of the Invention
[0006] In order to solve the above problems in the prior art, the present invention proposes a method for extracting multi-dimensional information and vector boundaries of depressions based on DEM.
[0007] The technical solutions of the present invention are as follows:
[0008] On the one hand, the present invention proposes a method for extracting multidimensional information and vector boundaries of depressions based on DEM, which specifically includes the following steps:
[0009] The DEM data was converted into Mercator plane projection using the secondary convolution sampling method, and then the depression location was calculated and the depression depth distribution map was generated using the depression filling method.
[0010] The depression depth distribution map is processed using preset rules to obtain a binary image of the depression distribution. Morphological processing is then performed on the binary image of the depression distribution to fill small holes in the depression area and remove the fragmented depression surface while retaining its main shape.
[0011] Accurately extract the outline of each depression from the binary image of depression distribution and generate vector surface data files of each depression;
[0012] Multiply the corresponding pixel values of the depression depth distribution map and the binary image of the depression distribution to remove the depression depth values at locations not involved in the calculation; then calculate the volume of each depression based on the vector surface data of each depression location and classify the depression volumes;
[0013] Calculate the water storage volume of different depth levels in each depression and accumulate it layer by layer to generate a binary image of the corresponding range of water storage volume of each depression;
[0014] The calculated multi-dimensional attribute information of each depression is integrated into the vector surface data file of each depression. The multi-dimensional attribute information of the depression includes the depth, outline, area, total volume and the corresponding range of water storage volume at different depth levels of the depression; and the boundary of the vector surface is simplified.
[0015] As a preferred embodiment, the steps of calculating and determining the depression location and generating the depression depth distribution map are specifically as follows:
[0016] By calculating the height relationship between each pixel and all pixels in its neighborhood, the depressions that are lower than the surrounding pixels are identified;
[0017] Find the pour point closest to each sink point, that is, the boundary pixel with the lowest elevation in the confluence area;
[0018] The height value of each depression pixel is raised to the height of the nearest pour point until all depressions are filled. The height data obtained by filling the depressions is subtracted from the original DEM data to obtain the height data of the depressions and generate a depression depth distribution map.
[0019] As a preferred embodiment, the step of processing the depression depth distribution map using preset rules to obtain a binary image of the depression distribution is specifically as follows:
[0020] The height data of the depression is the depth of the depression. The pixels with a depth less than or equal to 1 meter are eliminated, and the pixels with a depth greater than 1 meter are set to 1, and the pixels with a depth less than or equal to 1 meter are set to 0 to obtain a binary image of the depression distribution.
[0021] As a preferred embodiment, the steps of performing morphological processing on the binary image of the depression distribution, filling the small holes in the depression area, and removing the fragmented depression surface while retaining its main shape are specifically as follows:
[0022] Invert the input binary image, changing pixel value 0 to 1 and 1 to 0;
[0023] Apply a dilation operation to the inverted image to construct a 3×3 structure element with each pixel value 1. Move the structure element so that the center of the structure element is aligned with each foreground pixel. If any part of the structure element covers a foreground pixel, set the pixel and its neighborhood to 1.
[0024] Perform an erosion operation on the expanded image, also using a 3×3 structure element. For each foreground pixel, check whether the structure element falls completely within the foreground area. If so, keep the pixel as the foreground pixel; otherwise, set it to the background.
[0025] The processed image is inverted again to convert the background area into holes, thereby generating a filled binary image;
[0026] Finally, the opening operation is performed, that is, the filled image is first expanded and then eroded.
[0027] As a preferred embodiment, the steps of accurately extracting the outline of each depression from the binary image of the depression distribution and generating a vector surface data file of each depression are specifically as follows:
[0028] Gridding the image, dividing the binary image of depression distribution into uniform grids to ensure the integrity of each pixel;
[0029] Contour line generation: For each grid, check the pixel values at both ends of its four sides. If the pixel values on both sides of an edge are different, record the edge index and the coordinates of the two endpoints. When processing adjacent grids, use the shared boundary status information to reduce repeated calculations. For the outer edges of grids located at the edge of the image, if one side has a pixel value of 1, record the relevant information to prevent loss of contour information. Finally, connect the adjacent points in all grids according to the recorded edge index to form a complete contour line.
[0030] Process the inner and outer contours and calculate the area and center of gravity of each contour. When the area of contour A is smaller than that of contour B and the center of gravity of contour A is within the area enclosed by contour B, contour B is judged to be the outer contour and contour A is its corresponding inner contour. The coordinates of the outer contour are stored in a clockwise direction, and the coordinates of the inner contour are stored in a counterclockwise direction. Finally, the result is output as a vector surface data file.
[0031] As a preferred embodiment, the step of calculating the volume of each depression based on the vector surface data of each depression location is specifically as follows:
[0032] Multi-threaded parallel computation of vector surfaces is implemented using a partial reading method. When processing each vector surface, the depth data of the corresponding depression is first extracted based on its bounding box. The bounding box is the minimum rectangular box containing the vector surface. Then, a mask of the same range is created. Each pixel is traversed to determine its spatial relationship with the vector surface, and only the pixels within the vector surface are retained. Finally, the valid pixels within the range are calculated to obtain the volume of the corresponding depression. The specific calculation formula is as follows:
[0033]
[0034] Where V A represents the volume corresponding to the Ath vector surface; i represents the i-th pixel; n represents the number of pixels in the Ath vector surface; h i represents the depth value corresponding to the i-th pixel; S represents the area of each pixel.
[0035] As a preferred embodiment, the steps of calculating the water storage volume of different depth levels in each depression and accumulating them layer by layer to generate a binary image of the corresponding range of the water storage volume of each depression are specifically as follows:
[0036] Traverse each depression vector surface data file, first obtain the depression depth value of the range corresponding to its bounding box, then create a mask of the same range, sort it from large to small by depth value, and the pixels with larger values will be flooded first. The number of unique values is recorded as l;
[0037] Get the adjacent values of the depression depth value and Calculate the volume of each layer And the calculation is carried out in the order of the depth of the depression from small to large. The specific calculation formula is as follows:
[0038]
[0039] Where, is the volume of each depth level, is the number of pixels corresponding to each depth value, and is the depth value of each depth level and its adjacent levels;
[0040] The volume of each depth level is accumulated to obtain and judge The volume of the depression is classified and the pixel location and level information is stored in the database. At the same time, the information of the processed data is recorded by establishing a transaction log to ensure that the data can be smoothly restored after the processing is interrupted.
[0041] Finally, several zero-value images with the same range and pixel size as the original image are created, and the corresponding level pixel positions stored in the database are assigned a value of 1, thereby generating binary images of the corresponding range of the step-by-step water storage volume.
[0042] As a preferred embodiment, the steps of integrating the calculated multi-dimensional attribute information of each depression into the vector surface data file of each depression and simplifying the boundary of the vector surface are as follows:
[0043] Based on each vector surface data file, calculate the area of each triangle formed by three consecutive points. i , calculate the triangle (P i-1 ,P i ,P i+1 ) and associate each point with its corresponding area. The specific calculation formula is as follows;
[0044]
[0045] Sort by area from small to large, find the point with the smallest area and remove it, then update the area of the adjacent triangles. Continue this process until the minimum area is greater than the set threshold S T ;
[0046] Finally, the vector surface is updated to the simplified point set.
[0047] On the other hand, the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, it implements a method for extracting multi-dimensional information and vector boundaries of a depression based on DEM as described in any embodiment of the present invention.
[0048] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for extracting multi-dimensional information and vector boundaries of a depression based on a DEM as described in any embodiment of the present invention.
[0049] The present invention has the following beneficial effects:
[0050] 1. The present invention improves data processing efficiency by applying a multi-threaded parallel processing strategy to multiple steps of depression multidimensional information extraction, especially significantly improving the processing efficiency of large-scale data;
[0051] 2. This invention introduces morphological processing methods to effectively suppress the influence of data noise and significantly improve the performance of depression morphology;
[0052] 3. By combining the log recovery mechanism, the present invention can trace back to the error node through the log and continue processing when an error or system failure occurs, thereby significantly enhancing the fault tolerance of the method;
[0053] 4. The present invention constructs a method for extracting multidimensional information of depressions to generate a vector surface file that collects various data of the depressions. It can efficiently respond to the multidimensional analysis needs in complex power grid scenarios. With its customized processing capabilities and applicability to large-scale data, it greatly expands the application potential of this method. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0056] It should be understood that the step numbers used herein are only for convenience of description and are not intended to limit the order in which the steps are to be executed.
[0057] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0058] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0059] The term "and / or" refers to and includes any and all possible combinations of one or more of the associated listed items.
[0060] Example 1:
[0061] See also Figure 1 A method for extracting multidimensional information and vector boundaries of depressions based on DEM, comprising the following steps:
[0062] The DEM data was converted into Mercator plane projection using the secondary convolution sampling method, and then the depression location was calculated and the depression depth distribution map was generated using the depression filling method.
[0063] The depression depth distribution map is processed using preset rules to obtain a binary image of the depression distribution. Morphological processing is then performed on the binary image of the depression distribution to fill small holes in the depression area and remove the fragmented depression surface while retaining its main shape.
[0064] Accurately extract the outline of each depression from the binary image of depression distribution and generate vector surface data files of each depression;
[0065] Multiply the corresponding pixel values of the depression depth distribution map and the binary image of the depression distribution to remove the depression depth values at locations not involved in the calculation; then calculate the volume of each depression based on the vector surface data of each depression location and classify the depression volumes;
[0066] In this embodiment, the calculated depression volume is classified according to the actual application requirements. According to the distribution of national data, the depression volume is divided into the following four levels: less than 20000m 3 20000-50000m 3 50000-100000m 3 , greater than 100,000m 3 .
[0067] Calculate the water storage volume of different depth levels in each depression and accumulate it layer by layer to generate a binary image of the corresponding range of water storage volume of each depression;
[0068] In this embodiment, in order to efficiently calculate the corresponding range of each depression in the aforementioned four water storage volume levels, a multi-threaded parallel computing strategy is adopted. When traversing each depression vector surface, the depression depth value of the corresponding range of its bounding box is first obtained; for vector surfaces with smaller areas, the time to traverse each pixel therein is relatively short, while for vector surfaces with very large areas, the traversal operation takes a long time. Given that the accuracy requirement for calculating the volume level is lower than that for calculating the volume, and the depression depth value of the position not involved in the calculation has been assigned to 0, the interference encountered when calculating the volume level is relatively small. In addition, under normal circumstances, the volume level corresponding to the complete range of this type of depression is mostly level 4, and the range extraction of the first few levels is generally not affected by the fourth level. Therefore, for vector surfaces with very large areas (the threshold is set to be greater than 10,000,000 square meters in this scheme), a fast judgment method is adopted: ① The image corresponding to the range of the vector surface bounding box is divided into four parts according to half of the horizontal and vertical axis spans; ② Determine whether the four vertices of each part are all within the range of the vector surface: if so, all pixels of the part are considered to be within the vector surface; otherwise, the part is further subdivided into four parts for recursive judgment; ③ When the length or width of a part is less than 6 pixels, the branch stops recursion.
[0069] The calculated multi-dimensional attribute information of each depression is integrated into the vector surface data file of each depression. The multi-dimensional attribute information of the depression includes the depth, outline, area, total volume and the corresponding range of water storage volume at different depth levels of the depression; and the boundary of the vector surface is simplified.
[0070] As a preferred implementation of this embodiment, the steps of calculating and determining the depression location and generating the depression depth distribution map are specifically as follows:
[0071] By calculating the height relationship between each pixel and all pixels in its neighborhood, the depressions that are lower than the surrounding pixels are identified;
[0072] Find the pour point closest to each sink point, that is, the boundary pixel with the lowest elevation in the confluence area;
[0073] The height value of each depression pixel is raised to the height of the nearest pour point until all depressions are filled, the height data of the depressions is obtained, and a depression depth distribution map is generated.
[0074] In this embodiment, the inclined point is the water overflow point in the depression.
[0075] As a preferred implementation of this embodiment, the steps of processing the depression depth distribution map using preset rules to obtain a binary image of the depression distribution are specifically as follows:
[0076] The height data of the depression is the depth of the depression. The pixels with a depth less than or equal to 1 meter are eliminated, and the pixels with a depth greater than 1 meter are set to 1, and the pixels with a depth less than or equal to 1 meter are set to 0 to obtain a binary image of the depression distribution.
[0077] As a preferred implementation of this embodiment, the steps of performing morphological processing on the binary image to fill small holes in the depression area and remove the fragmented depression area while retaining its main shape are specifically as follows:
[0078] Invert the input binary image, changing pixel value 0 to 1 and 1 to 0;
[0079] Apply a dilation operation to the inverted image to construct a 3×3 structure element with each pixel value 1. Move the structure element so that the center of the structure element is aligned with each foreground pixel. If any part of the structure element covers a foreground pixel, set the pixel and its neighborhood to 1.
[0080] Perform an erosion operation on the expanded image, also using a 3×3 structure element. For each foreground pixel, check whether the structure element falls completely within the foreground area. If so, keep the pixel as the foreground pixel; otherwise, set it to the background.
[0081] The processed image is inverted again to convert the background area into holes, thereby generating a filled binary image;
[0082] Finally, the opening operation is performed, that is, the filled image is first expanded and then eroded.
[0083] As a preferred implementation of this embodiment, the steps of accurately extracting the outline of each depression from the binary image of the depression distribution and generating a vector surface data file of each depression are specifically as follows:
[0084] Gridding the image, dividing the binary image of depression distribution into uniform grids to ensure the integrity of each pixel;
[0085] Contour line generation: For each grid, check the pixel values at both ends of its four sides. If the pixel values on both sides of an edge are different, record the edge index and the coordinates of the two endpoints. When processing adjacent grids, use the shared boundary status information to reduce repeated calculations. For the outer edges of grids located at the edge of the image, if one side has a pixel value of 1, record the relevant information to prevent loss of contour information. Finally, connect the adjacent points in all grids according to the recorded edge index to form a complete contour line.
[0086] Process the inner and outer contours and calculate the area and center of gravity of each contour. When the area of contour A is smaller than that of contour B and the center of gravity of contour A is within the area enclosed by contour B, contour B is judged to be the outer contour and contour A is its corresponding inner contour. The coordinates of the outer contour are stored in a clockwise direction, and the coordinates of the inner contour are stored in a counterclockwise direction. Finally, the result is output as a vector surface data file.
[0087] In this embodiment, the original DEM data has been resampled to a resolution of 30 meters, so the grid size is set to 30m×30m to ensure the integrity of each pixel.
[0088] As a preferred implementation of this embodiment, the steps of calculating the volume of each depression based on the vector surface data of each depression location are specifically as follows:
[0089] Multi-threaded parallel computation of vector surfaces is implemented using a partial reading method. When processing each vector surface, the depth data of the corresponding depression is first extracted based on its bounding box. The bounding box is the minimum rectangular box containing the vector surface. Then, a mask of the same range is created. Each pixel is traversed to determine its spatial relationship with the vector surface, and only the pixels within the vector surface are retained. Finally, the valid pixels within the range are calculated to obtain the volume of the corresponding depression. The specific calculation formula is as follows:
[0090]
[0091] Where V A represents the volume corresponding to the Ath vector surface; i represents the i-th pixel; n represents the number of pixels in the Ath vector surface; h i represents the depth value corresponding to the i-th pixel; S represents the area of each pixel.
[0092] As a preferred implementation of this embodiment, the steps of calculating the water storage volume of different depth levels in each depression and accumulating them layer by layer to generate a binary image of the corresponding range of the water storage volume of each depression are specifically as follows:
[0093] Traverse each depression vector surface data file, first obtain the depression depth value of the range corresponding to its bounding box, then create a mask of the same range, sort it from large to small by depth value, and the pixels with larger values will be flooded first. The number of unique values is recorded as l;
[0094] Get the adjacent values of the depression depth value and Calculate the volume of each layer And the calculation is carried out in the order of the depth of the depression from small to large. The specific calculation formula is as follows:
[0095]
[0096] Wherein, is the volume of each depth level, is the number of pixels corresponding to each depth value, and are the depth values of each depth level and its adjacent levels;
[0097] In this embodiment, considering that in most cases, the difference in depression depth between adjacent levels is small, while the difference between each volume level is large, the efficiency of traversing level by level is low. Therefore, in this solution, the next level of the i-th level is not i + 1 but i + a (a ∈ [1, 10, 100, 1000], and the value of a is determined by the following conditions: i + a < l and . Meanwhile, indicates that the highest volume level has been reached. At this time, all pixels in the subsequent levels meet this condition, and the traversal process stops, completing the operation on the depression depth values within the vector surface.
[0098] Accumulate the volume of each depth level to obtain and judge the classified depression volume to which it belongs, and store the pixel position and level information in the database; meanwhile, record the information of the processed data by establishing a transaction log to ensure that the data can be successfully restored after the processing is interrupted;
[0099] In this embodiment, this step selects to store in the database rather than output as a raster image because when processing a large amount of data, the operation is likely to be interrupted due to various accidents. Directly writing out the result usually requires waiting for all data processing to complete, and if interrupted, the result may be lost.
[0100] Finally, create several zero-value images with the same range and pixel size as the original image, and assign the value of 1 to the corresponding level pixel positions stored in the database, thereby generating a binary image corresponding to the range of the water storage volume level by level.
[0101] In this embodiment, since the volume range of the depression is divided into four, the number of zero-value images created during the creation is also four.
[0102] As a preferred implementation manner of this embodiment, the step of integrating the calculated multi-dimensional attribute information of each depression into the vector surface data file of each depression and simplifying the boundary of the vector surface is specifically as follows:
[0103] Based on each vector surface data file, calculate the area of each triangle formed by three consecutive points. For point P i , calculate the area of triangle (P i-1 , P i , P i+1 ) ), and associate each point with its corresponding area. The specific calculation formula is as follows;
[0104]
[0105] Sort by area from small to large, find the point with the smallest area and remove it, then update the area of the adjacent triangles. Continue this process until the minimum area is greater than the set threshold S T ;
[0106] Finally, the vector surface is updated to the simplified point set.
[0107] In this example, a multi-threaded parallel processing method is also used to extract vector surfaces corresponding to each level of water storage. Combined with the depression depth image, the maximum depth within each vector surface is determined, and the area of each vector surface is calculated. Thus, through the above steps, multi-dimensional information such as the depression area, depth, volume level, and the corresponding range of different water storage levels is obtained.
[0108] In order to improve the efficiency of data storage and slice publishing while maintaining the integrity of surface features, the Visvalingam-Whyatt algorithm is used to simplify each vector surface and extract the boundary conditions of the vector surface.
[0109] Example 2:
[0110] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a method for extracting multidimensional information and vector boundaries of a depression based on a DEM as described in any embodiment of the present invention is implemented.
[0111] Example 3:
[0112] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a method for extracting multidimensional information and vector boundaries of a depression based on a DEM as described in any embodiment of the present invention.
[0113] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structures or equivalent process changes made using the contents of the present invention's description and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for extracting multidimensional information and vector boundaries of depressions based on DEM, characterized in that: The specific steps include: The DEM data was converted into Mercator plane projection using the secondary convolution sampling method, and then the depression location was calculated and the depression depth distribution map was generated using the depression filling method. The depression depth distribution map is processed using preset rules to obtain a binary image of the depression distribution. Morphological processing is then performed on the binary image of the depression distribution to fill small holes in the depression area and remove the fragmented depression surface while retaining its main shape. Accurately extract the outline of each depression from the binary image of depression distribution and generate vector surface data files of each depression; Multiply the corresponding pixel values of the depression depth distribution map and the binary image of the depression distribution to remove the depression depth values at locations not involved in the calculation; then calculate the volume of each depression based on the vector surface data of each depression location and classify the depression volumes; Calculate the water storage volume of different depth levels in each depression and accumulate it layer by layer to generate a binary image of the corresponding range of water storage volume of each depression; The calculated multi-dimensional attribute information of each depression is integrated into the vector surface data file of each depression. The multi-dimensional attribute information of the depression includes the depth, outline, area, total volume and the corresponding range of water storage volume at different depth levels of the depression; and the boundary of the vector surface is simplified.
2. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of calculating and determining the depression location and generating the depression depth distribution map are specifically as follows: By calculating the height relationship between each pixel and all pixels in its neighborhood, the depressions that are lower than the surrounding pixels are identified; Find the pour point closest to each sink point, that is, the boundary pixel with the lowest elevation in the confluence area; The height value of each depression pixel is raised to the height of the nearest pour point until all depressions are filled. The height data obtained by filling the depressions is subtracted from the original DEM data to obtain the height data of the depressions and generate a depression depth distribution map.
3. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The specific steps of processing the depression depth distribution map using preset rules to obtain a binary image of the depression distribution are: The height data of the depression is the depth of the depression. The pixels with a depth less than or equal to 1 meter are eliminated, and the pixels with a depth greater than 1 meter are set to 1, and the pixels with a depth less than or equal to 1 meter are set to 0 to obtain a binary image of the depression distribution.
4. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of performing morphological processing on the binary image of the depression distribution, filling the small holes in the depression area, and removing the fragmented depression surface while retaining its main shape are as follows: Invert the input binary image, changing pixel value 0 to 1 and 1 to 0; Apply a dilation operation to the inverted image to construct a 3×3 structure element with each pixel value 1. Move the structure element so that the center of the structure element is aligned with each foreground pixel. If any part of the structure element covers a foreground pixel, set the pixel and its neighborhood to 1. Perform an erosion operation on the expanded image, also using a 3×3 structure element. For each foreground pixel, check whether the structure element falls completely within the foreground area. If so, keep the pixel as the foreground pixel; otherwise, set it to the background. The processed image is inverted again to convert the background area into holes, thereby generating a filled binary image; Finally, the opening operation is performed, that is, the filled image is first expanded and then eroded.
5. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of accurately extracting the outline of each depression from the binary image of the depression distribution and generating the vector surface data file of each depression are specifically as follows: Gridding the image, dividing the binary image of depression distribution into uniform grids to ensure the integrity of each pixel; Contour line generation: For each grid, check the pixel values at both ends of its four sides. If the pixel values on both sides of an edge are different, record the edge index and the coordinates of the two endpoints. When processing adjacent grids, use the shared boundary status information to reduce repeated calculations. For the outer edges of grids located at the edge of the image, if one side has a pixel value of 1, record the relevant information to prevent loss of contour information. Finally, connect the adjacent points in all grids according to the recorded edge index to form a complete contour line. Process the inner and outer contours and calculate the area and center of gravity of each contour. When the area of contour A is smaller than that of contour B and the center of gravity of contour A is within the area enclosed by contour B, contour B is judged to be the outer contour and contour A is its corresponding inner contour. The coordinates of the outer contour are stored in a clockwise direction, and the coordinates of the inner contour are stored in a counterclockwise direction. Finally, the result is output as a vector surface data file.
6. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of calculating the volume of each depression based on the vector surface data of each depression location are specifically as follows: Multi-threaded parallel computation of vector surfaces is implemented using a partial reading method. When processing each vector surface, the depth data of the corresponding depression is first extracted based on its bounding box. The bounding box is the minimum rectangular box containing the vector surface. Then, a mask of the same range is created. Each pixel is traversed to determine its spatial relationship with the vector surface, and only the pixels within the vector surface are retained. Finally, the valid pixels within the range are calculated to obtain the volume of the corresponding depression. The specific calculation formula is as follows: Where V A represents the volume corresponding to the Ath vector surface; i represents the i-th pixel; n represents the number of pixels in the Ath vector surface; h i represents the depth value corresponding to the i-th pixel; S represents the area of each pixel.
7. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of calculating the water storage volume at different depth levels in each depression and accumulating the water storage volume at each level to generate a binary image corresponding to the water storage volume at each level of the depression are as follows: Traverse each depression vector surface data file, first obtain the depression depth value of the range corresponding to its bounding box, then create a mask of the same range, sort it from large to small by depth value, and the pixels with larger values will be flooded first. The number of unique values is recorded as l; Get the adjacent values of the depression depth value and Calculate the volume of each layer And the calculation is carried out in the order of the depth of the depression from small to large. The specific calculation formula is as follows: Where, is the volume of each depth level, is the number of pixels corresponding to each depth value, and is the depth value of each depth level and its adjacent levels; The volume of each depth level is accumulated to obtain and judge The volume of the depression is classified and the pixel location and level information is stored in the database. At the same time, the information of the processed data is recorded by establishing a transaction log to ensure that the data can be smoothly restored after the processing is interrupted. Finally, several zero-value images with the same range and pixel size as the original image are created, and the corresponding level pixel positions stored in the database are assigned a value of 1, thereby generating binary images of the corresponding range of the step-by-step water storage volume.
8. The method for extracting multidimensional information and vector boundaries of depressions based on DEM according to claim 1, characterized in that: The steps of integrating the calculated multi-dimensional attribute information of each depression into the vector surface data file of each depression and simplifying the boundary of the vector surface are specifically as follows: Based on each vector surface data file, calculate the area of each triangle formed by three consecutive points. i , calculate the triangle (P i-1 ,P i ,P i+1 ) and associate each point with its corresponding area. The specific calculation formula is as follows; Sort by area from small to large, find the point with the smallest area and remove it, then update the area of the adjacent triangles. Continue this process until the minimum area is greater than the set threshold S T ; Finally, the vector surface is updated to the simplified point set.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for extracting multi-dimensional information and vector boundaries of depressions based on DEM is implemented as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for extracting multi-dimensional information and vector boundaries of a depression based on a DEM is implemented as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method for accurately identifying farmland depression features based on digital terrain model
CN115839707A
Expressway ultrahigh transition section ponding depth distribution model and construction method thereof
CN111143998A
Inland lake basin extraction method and system based on digital elevation model
CN115359221A
Interflow zone lake hydrological connectivity modeling method based on mathematical morphology
CN116415318A
DEM data fusion method based on multi-source data and machine learning
CN117521005A