Water depth identification method and device, electronic equipment and readable storage medium

By collecting images and point cloud data of accumulated water and using image overlay technology to identify the depth of accumulated water, the problem of lack of road markers or reference points is solved, and accurate identification of accumulated water depth without the need for markers or reference points is achieved, supporting urban flood control and traffic management.

CN117095178BActive Publication Date: 2026-01-06XINHUANET CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310848298.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2026-01-06
Estimated Expiration
2043-07-11

AI Technical Summary

Technical Problem

In existing technologies, the lack of scales or reference points on roads makes it impossible to accurately identify the depth of water accumulation, especially in urban roads where scales or reference points cannot be set up, making it impossible to effectively identify the depth of water accumulation.

Method used

By collecting images and point cloud data of water accumulation on roads, the edge contours and contour maps of water accumulation areas are obtained. Image overlay technology is used to identify the depth of water accumulation, including bounding box prediction, edge extraction, and contour difference calculation.

Benefits of technology

It can accurately identify the depth of road water accumulation without the need for rulers or reference objects, providing a fast and accurate method for identifying water accumulation depth, and supporting urban flood control and traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117095178B_ABST
    Figure CN117095178B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a water accumulation depth identification method and device, electronic equipment and a readable storage medium. The method comprises: collecting a water accumulation image of a road, and extracting a water accumulation edge contour of a water accumulation region in the water accumulation image; collecting point cloud data of the road, and obtaining a contour line topographic map in the same perspective as the water accumulation image based on the point cloud data, wherein the contour line topographic map is a map representing ground undulation and height conditions using contour lines; superimposing the contour line topographic map and the water accumulation image, and identifying water accumulation depth of the road in the water accumulation edge contour based on the superimposed image. Through the present application, the technical problem that water accumulation depth cannot be identified due to lack of a scale or reference object in the related art is solved, and the technical effect that water accumulation depth of the road can be accurately identified without a scale or reference object is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of road flooding depth identification technology, and in particular to a method, device, electronic device, and readable storage medium for identifying water depth. Background Technology

[0002] Due to factors such as road damage, subsidence, and years of disrepair, rainwater easily accumulates on roads, affecting not only the city's appearance but also potentially causing traffic accidents. Therefore, a method to detect road flooding and determine its depth is essential. Existing methods for identifying road flooding depth typically require additional markers or surrounding reference points. However, markers cannot be placed in all locations on urban roads, such as when the flooded area is in the center of the lane. Furthermore, reference points are not always readily available; without them in the image, flooding depth cannot be identified.

[0003] No effective solution has yet been proposed to address the above problems. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and readable storage medium for identifying water depth, in order to at least solve the technical problem in the related art that water depth cannot be identified due to the lack of road markers or reference objects.

[0005] According to one aspect of the embodiments of this application, a method for identifying water accumulation depth is provided, comprising: acquiring a water accumulation image of a road, extracting the water accumulation edge contour of the water accumulation area in the water accumulation image; acquiring point cloud data of the road, obtaining a contour map of the road from the same viewpoint as the water accumulation image based on the point cloud data, wherein the contour map of the road is a map that uses contour lines to represent ground undulations and elevation conditions; overlaying the contour map of the road with the water accumulation image, and identifying the water accumulation depth of the road within the water accumulation edge contour based on the overlaid image.

[0006] Optionally, extracting the water accumulation edge contour of the water accumulation area in the water accumulation image includes: determining a rectangular frame containing the water accumulation area in the water accumulation image, wherein each side of the rectangular frame intersects the water accumulation edge contour; and performing edge extraction on the water accumulation area within the rectangular frame to obtain the water accumulation edge contour.

[0007] Optionally, determining the bounding box containing the waterlogged area in the waterlogged image includes: identifying the waterlogged image based on a pre-trained waterlogged area bounding box prediction model to obtain a bounding box containing the waterlogged area; wherein the waterlogged area bounding box prediction model is trained using multiple sets of data through machine learning, and each set of data includes a waterlogged sample image and a bounding box containing the waterlogged area marked in the waterlogged sample image.

[0008] Optionally, the process of identifying the waterlogged image based on a pre-trained rectangular bounding box prediction model to obtain a rectangular bounding box containing the waterlogged area includes: adding grayscale bars to the waterlogged image and converting the waterlogged image into a waterlogged image of a predetermined size; extracting feature maps from the waterlogged image of the predetermined size; dividing the feature maps into multiple grids and predicting the bounding box coordinates for each grid to obtain prediction results; decoding the prediction results to obtain at least one set of bounding box coordinates; selecting a set of bounding box coordinates containing the waterlogged area from the at least one set of bounding box coordinates; removing the grayscale bars; and generating a rectangular bounding box containing the waterlogged area based on the bounding box coordinates containing the waterlogged area.

[0009] Optionally, selecting a set of rectangular frame coordinates containing the water accumulation area from the at least one set of rectangular frame coordinates includes: performing non-maximum suppression processing on the at least one set of rectangular frame coordinates, and determining the set of rectangular frame coordinates with the highest probability as the rectangular frame coordinates containing the water accumulation area.

[0010] Optionally, edge extraction is performed on the water accumulation area within the rectangular frame to obtain the water accumulation edge contour, including: converting the image within the rectangular frame into a grayscale image; performing noise reduction processing on the grayscale image to obtain a smooth image; calculating the gradient magnitude and gradient direction of each pixel in the smooth image; performing non-maximum suppression processing on the smooth image based on the gradient magnitude and gradient direction of each pixel to obtain the initial water accumulation edge contour of the water accumulation area; and removing the pseudo-edges of the initial water accumulation edge contour to obtain the water accumulation edge contour.

[0011] Optionally, acquiring a contour map from the same viewpoint as the water accumulation image based on the point cloud data includes: generating a contour map of the road based on the point cloud data; cropping the contour map of the road based on a predetermined viewpoint range to obtain a contour map within the predetermined viewpoint range; wherein the predetermined viewpoint range is determined based on the device parameters used to acquire the water accumulation image; and performing a perspective transformation on the contour map within the predetermined viewpoint range based on the viewpoint corresponding to the water accumulation image to obtain the contour map.

[0012] Optionally, generating a contour map of the road based on the point cloud data includes: triangulating the point cloud data to obtain an irregular triangular network; and extracting contour lines from the irregular triangular network from a top-down perspective to obtain the contour map of the road.

[0013] Optionally, identifying the water depth of the road within the water accumulation edge contour based on the superimposed image includes: obtaining the maximum and minimum contour values ​​within the water accumulation edge contour from the superimposed image; and calculating the difference between the maximum and minimum contour values ​​to obtain the water accumulation depth of the road.

[0014] According to another aspect of the embodiments of this application, a water depth recognition device is also provided, comprising: a first processing module, configured to acquire a water accumulation image of a road and extract the water accumulation edge contour of the water accumulation area in the water accumulation image; a second processing module, configured to acquire point cloud data of the road and obtain a contour map of the same viewpoint as the water accumulation image based on the point cloud data, wherein the contour map of the road is a map that uses contour lines to represent ground undulations and elevation conditions; and a third processing module, configured to overlay the contour map of the road with the water accumulation image and identify the water accumulation depth of the road within the water accumulation edge contour based on the overlaid image.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the steps of the method described above.

[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the steps of the method described above.

[0017] In this embodiment, by collecting images of water accumulation on the road and point cloud data, the edge contour of the water accumulation area in the water accumulation image and the contour map of the topography at the same viewpoint as the water accumulation image are obtained respectively. The contour map of the topography is superimposed on the water accumulation image, and the water accumulation depth of the road within the edge contour of the water accumulation is identified by the superimposed image. This solves the technical problem in related technologies that the water accumulation depth cannot be identified due to the lack of a ruler or reference object on the road, and achieves the technical effect of accurately identifying the water accumulation depth of the road without a ruler or reference object. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 A flowchart of the water depth identification method provided in the embodiments of this application;

[0020] Figure 2 A flowchart of a water depth identification method provided in an optional embodiment of this application;

[0021] Figure 3 A schematic diagram illustrating the calculation of the coordinates of a rectangular frame, provided as an optional embodiment of this application;

[0022] Figure 4 A simplified side view of a fixed camera provided for an optional embodiment of this application;

[0023] Figure 5 A simplified top view of a fixed camera provided for an optional embodiment of this application;

[0024] Figure 6 A schematic diagram of perspective transformation provided for an optional embodiment of this application;

[0025] Figure 7 A schematic diagram illustrating the overlay of a cropped road contour map with a water accumulation image, provided as an optional embodiment of this application;

[0026] Figure 8 This is a schematic diagram of the water depth identification device provided in the embodiments of this application. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to limit a specific order. The steps shown in the flowcharts of the drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0029] According to one aspect of the embodiments of this application, a method for identifying water depth is provided. Figure 1 A flowchart of the water depth identification method provided in the embodiments of this application is shown below. Figure 1 As shown, the method includes the following steps:

[0030] Step S102: Acquire images of water accumulation on the road and extract the edge contours of the water accumulation areas in the water accumulation images;

[0031] Step S104: Collect point cloud data of the road, and obtain a contour map based on the point cloud data from the same perspective as the water accumulation image. The contour map is a map that uses contour lines to represent the ground undulations and elevation conditions.

[0032] Step S106: Overlay the contour map with the water accumulation image, and identify the water depth of the road within the water accumulation edge contour based on the overlaid image.

[0033] The aforementioned roads include, but are not limited to, urban roads, highways, tunnels, and elevated expressways. The aforementioned images of flooded areas contain one or more flooded regions.

[0034] Optionally, the devices used to acquire images of road flooding include, but are not limited to, monocular cameras and binocular cameras. Taking a monocular camera, which is relatively low-cost and has a fixed viewing angle, as an example, images of road flooding are acquired from the perspective of this monocular camera.

[0035] Optionally, the devices for collecting point cloud data of roads include, but are not limited to, drones equipped with point cloud scanners, vehicles equipped with point cloud scanners, and point cloud scanners fixedly installed on street lampposts; for example, point cloud scanners can be used to scan and obtain point cloud data of roads, and then a contour map with the same viewpoint as a monocular camera can be obtained based on the point cloud data.

[0036] Through the above steps, by collecting images of water accumulation on roads and point cloud data, the edge contour of the water accumulation area in the water accumulation image and the contour map of the topography at the same viewpoint as the water accumulation image can be obtained respectively. The contour map of the topography and the water accumulation image are superimposed, and the water accumulation depth of the road within the edge contour of the water accumulation is identified by using the superimposed image. This solves the technical problem in related technologies that the water accumulation depth cannot be identified due to the lack of a ruler or reference object on the road, and achieves the technical effect of accurately identifying the water accumulation depth of the road without a ruler or reference object.

[0037] Figure 2 A flowchart of the water depth identification method provided in the optional embodiments of this application is shown below. Figure 2 As shown, the method includes the following steps:

[0038] Step 21: Obtain images of water accumulation on the road from the perspective of a fixed camera, and scan and obtain point cloud data using a point cloud scanner;

[0039] Step 22: Draw a contour map of the road based on the point cloud data;

[0040] Step 23: Calculate the field of view of the fixed camera based on its various parameters, and then crop the contour map of the road to obtain the contour map within the field of view of the camera.

[0041] Step 24: Using the image perspective transformation method, the contour map within the field of view of the camera is transformed to be the same as the view of the fixed camera, so as to obtain the contour map under the same view.

[0042] Step 25: Determine the bounding box containing the water accumulation area in the water accumulation image;

[0043] Step 26: Extract the edges of the water accumulation area within the rectangular frame to obtain the water accumulation edge contour;

[0044] Step 27: Overlay the contour map and the water accumulation image from the same viewpoint;

[0045] Step 28: Calculate the depth of water accumulation on the road based on the difference in contour lines within the water accumulation edge outline.

[0046] It should be noted that both the road contour maps and the contour maps within the camera's field of view are top-down view contour maps. Top-down view contour maps correspond to two-dimensional data, and the road contour maps include those within the camera's field of view. In practice, this water depth identification method relies solely on fixed cameras distributed throughout the city's streets and alleys, along with point cloud data, to identify road water depth.

[0047] As an optional embodiment, extracting the water accumulation edge contour of the water accumulation area in the water accumulation image includes: determining a rectangular frame containing the water accumulation area in the water accumulation image, wherein each side of the rectangular frame intersects the water accumulation edge contour; and performing edge extraction on the water accumulation area within the rectangular frame to obtain the water accumulation edge contour.

[0048] The bounding box described above is the rectangular border surrounding the water-filled area identified in the water accumulation image, used to identify the location and size of the water-filled area. The bounding box is typically represented by the coordinates of its four vertices.

[0049] Optionally, to ensure the accuracy of obtaining the rectangular bounding boxes containing the water accumulation area, intersection detection can be performed on each edge of the rectangular bounding box and the water accumulation edge contour. If a certain edge of the rectangular bounding box does not intersect with the water accumulation edge contour, the rectangular bounding box containing the water accumulation area needs to be recalculated, and edge extraction and intersection detection need to be performed again until all the edges of the rectangular bounding boxes intersect with the water accumulation edge contour.

[0050] In the embodiments of this application, by first determining the rectangular frame containing the water accumulation area in the water accumulation image, and then extracting the edge of the water accumulation area within the rectangular frame to obtain the water accumulation edge contour, the water accumulation edge contour of the water accumulation area in the water accumulation image can be extracted quickly and accurately.

[0051] As an optional embodiment, determining the bounding boxes containing the water accumulation area in the water accumulation image includes: identifying the water accumulation image based on a pre-trained water accumulation area bounding box prediction model to obtain the bounding boxes containing the water accumulation area. The water accumulation area bounding box prediction model is trained by machine learning using multiple sets of data, and each set of data includes a water accumulation sample image and bounding boxes containing the water accumulation area marked in the water accumulation sample image.

[0052] Optionally, a large number of waterlogged sample images captured by fixed cameras are labeled with rectangular bounding boxes to obtain the labeled rectangular bounding boxes containing the waterlogged areas in the waterlogged sample images. The waterlogged sample images and the labeled rectangular bounding boxes containing the waterlogged areas in the waterlogged sample images are used as training data to train a waterlogged area rectangular bounding box prediction model through machine learning until the model converges. Then, in practical applications, the pre-trained waterlogged area rectangular bounding box prediction model is used to identify waterlogged images and obtain the rectangular bounding boxes containing the waterlogged areas.

[0053] In the embodiments of this application, by using a water accumulation area bounding box prediction model to identify water accumulation images, the bounding boxes containing water accumulation areas can be obtained more accurately.

[0054] As an optional embodiment, the method involves identifying a water accumulation image based on a pre-trained rectangular bounding box prediction model for the water accumulation area to obtain a rectangular bounding box containing the water accumulation area. This includes: adding grayscale bars to the water accumulation image to convert it into a water accumulation image of a predetermined size; extracting feature maps from the water accumulation image of the predetermined size; dividing the feature maps into multiple grids and predicting the rectangular bounding box coordinates for each grid to obtain prediction results; decoding the prediction results to obtain at least one set of rectangular bounding box coordinates; selecting a set of rectangular bounding box coordinates containing the water accumulation area from the at least one set of rectangular bounding box coordinates; removing the grayscale bars; and generating a rectangular bounding box containing the water accumulation area based on the rectangular bounding box coordinates containing the water accumulation area.

[0055] The aforementioned predetermined dimensions can be set according to the needs of the application scenario.

[0056] First, the water accumulation image needs to be preprocessed to facilitate input into the water accumulation area bounding box prediction model. This can be achieved using the following steps: adding grayscale bars to the water accumulation image to make its aspect ratio the same as the predetermined size; converting the water accumulation image into a water accumulation image of the predetermined size, such as 224×224, 299×299, and 416×416, etc.

[0057] After obtaining a water accumulation image of a predetermined size, feature extraction is required. Deep learning algorithms such as Convolutional Neural Networks (CNNs) can be used to extract features from the water accumulation image, resulting in a feature map. A feature map is typically a multi-dimensional array where each element represents the value of a feature point.

[0058] After obtaining the feature map, it is necessary to predict its bounding box coordinates. This can be done by dividing the feature map into multiple grids and predicting the bounding box coordinates for each grid. The prediction result is typically a multi-dimensional array, where each element represents the bounding box coordinates of a grid cell.

[0059] After obtaining the prediction results, they need to be decoded to obtain at least one set of rectangle coordinates.

[0060] After obtaining at least one set of bounding box coordinates, it is necessary to filter out a set of bounding box coordinates that contain the water accumulation area. The Non-Maximum Suppression (NMS) algorithm can be used to filter the bounding box coordinates to obtain the bounding box coordinates that contain the water accumulation area. The bounding box containing the water accumulation area is then drawn using these bounding box coordinates.

[0061] Optionally, a grayscale bar is added to the input waterlogged image to prevent distortion during size conversion, and the image size is converted to 416×416; a feature map is obtained by extracting features from the input waterlogged image through a convolutional neural network; the feature map is divided into an N×N grid, and prediction is performed on each grid separately; the prediction results are then decoded.

[0062] Figure 3 A schematic diagram illustrating the calculation of the coordinates of the rectangular frame provided in an optional embodiment of this application, as shown below. Figure 3 As shown, the decoding process involves calculating the coordinates b of the final displayed rectangle. x b y and b w b h This allows us to determine the position and size of the rectangle. The calculation process is as follows:

[0063] b x =σ(t) x +c x )

[0064] b y =σ(t)y +c y )

[0065]

[0066]

[0067] Pr(object)*IoU(b, object)=σ(t o )

[0068] Among them, (c x c y (p) indicates the number of grid cells between the top-left corner and the top-leftmost corner of the grid where the point is located; w p h (t) represents the side length of the prior box; x , t y (t) represents the offset of the target center point relative to the top-left corner of the grid where that point is located; w , t h ) represents the width and height of the predicted bounding box; σ represents the activation function used to limit the output value to 0 to 1.

[0069] As an optional embodiment, selecting a set of rectangular frame coordinates containing the water accumulation area from at least one set of rectangular frame coordinates includes: performing non-maximum suppression processing on at least one set of rectangular frame coordinates, and determining the set of rectangular frame coordinates with the highest probability as the rectangular frame coordinates containing the water accumulation area.

[0070] Optionally, the Non-Maximum Suppression (NMS) method is used to filter out the set of rectangular box coordinates with the highest probability. The specific implementation steps are as follows: sort the rectangular box coordinates and scores that are greater than a predetermined threshold; perform non-maximum suppression processing using the rectangular box coordinates and scores; finally, the set of rectangular boxes with the highest probability can be obtained, which is the rectangular box coordinates containing the water accumulation area.

[0071] As an optional embodiment, edge extraction is performed on the water accumulation area within the rectangular frame to obtain the water accumulation edge contour, including: converting the image within the rectangular frame into a grayscale image; performing noise reduction processing on the grayscale image to obtain a smooth image; calculating the gradient magnitude and gradient direction of each pixel in the smooth image; performing non-maximum suppression processing on the smooth image based on the gradient magnitude and gradient direction of each pixel to obtain the initial water accumulation edge contour of the water accumulation area; and removing the pseudo-edges of the initial water accumulation edge contour to obtain the water accumulation edge contour.

[0072] Optionally, the Canny algorithm can be used to extract the edges of the water accumulation area within the rectangle to obtain the outline of the water accumulation. The steps are as follows:

[0073] 1) Since the Canny algorithm can only process single-channel grayscale images, the original image needs to be converted to grayscale before edge detection;

[0074] 2) Perform Gaussian filtering on the image to reduce noise. Gaussian filtering can filter out the noise in the image, preventing incorrect noise information from being mistakenly identified as edges during subsequent edge detection.

[0075] 3) Calculate the gradient magnitude and gradient direction for each pixel. The Canny algorithm uses the Sobel operator to calculate the gradient magnitude. The Sobel operator has x-direction and y-direction:

[0076]

[0077] The formula for calculating gradient magnitude is as follows:

[0078]

[0079]

[0080] Where I is the grayscale image matrix, and * represents the cross-correlation operation.

[0081] Optionally, the specific steps for performing non-maximum suppression processing on a smooth image are as follows: In the gradient direction of each pixel, check whether the pixel is a maximum pixel. If it is, retain the pixel; otherwise, set its value to 0. By performing non-maximum suppression processing on the smooth image, edges can be refined, transforming the wide edges in the original coarse edge detection image into true edges, thus better highlighting the object's contour.

[0082] Optionally, false edges can be removed using hysteresis thresholding. For example, a high threshold can be used to filter out pixels that are definitely edges, and then a low threshold can be used to extend the edges, ultimately obtaining the outline of the water accumulation edge. The high and low thresholds mentioned above can be set according to the needs of the application scenario.

[0083] As an optional embodiment, acquiring a contour map from the same viewpoint as the water accumulation image based on point cloud data includes: generating a contour map of the road based on the point cloud data; cropping the contour map of the road based on a predetermined viewpoint range to obtain a contour map within the predetermined viewpoint range; wherein, the predetermined viewpoint range is determined based on the device parameters used to acquire the water accumulation image; and performing a perspective transformation on the contour map within the predetermined viewpoint range based on the viewpoint corresponding to the water accumulation image to obtain the contour map.

[0084] The aforementioned equipment parameters include, but are not limited to, camera tilt angle, camera vertical viewing angle, camera height, camera horizontal rotation angle, film length, film width, and focal length.

[0085] The aforementioned predetermined viewing angle range refers to the field of view of the camera.

[0086] Optionally, based on the various equipment parameters of the fixed camera, the predetermined viewing angle range of the camera is calculated, and the two-dimensional contour map is cropped to retain only the predetermined viewing angle range that the camera can see. The specific steps are as follows:

[0087] Figure 4 A simplified side view of a fixed camera provided for an optional embodiment of this application, such as Figure 4 As shown, with the camera's mounting position on the ground as the origin O, where α represents the camera's pitch angle, β represents the camera's vertical viewing angle, h represents the camera's height, l1 represents the length of the sensor, and f represents the focal length, the distances from the two intersection points B and D of the camera's vertical field of view with the ground to the origin O can be calculated:

[0088] S1=h tanα

[0089] S2 = h tan(α + β)

[0090] The projected length of the focal length in the horizontal direction:

[0091] f′=f sin(α+β)

[0092] Figure 5 A simplified top view of a fixed camera provided for an optional embodiment of this application, such as... Figure 5 As shown, with the camera's installation position as the origin O, where l2 represents the width of the photosensitive film, f′ represents the projected length of the focal length in the horizontal direction, γ represents the horizontal rotation angle of the camera (with true north as the positive direction, assuming the current horizontal direction of the camera is true north, i.e., γ is 0), A, B, C, and D represent the four intersection points of the camera's field of view with the ground, and S1 and S2 represent the distances from the intersection points B and D of the camera's field of view with the ground to the origin O. The value of l can be calculated using the properties of similar triangles. AB , l CD Length:

[0093]

[0094] Furthermore, the coordinates of points A, B, C, and D can be obtained:

[0095]

[0096]

[0097] When the camera rotates horizontally by an angle γ, according to the rotation matrix:

[0098]

[0099] Furthermore, the coordinates of the four points A′, B′, C′, and D′ after rotation can be calculated:

[0100]

[0101] The two-dimensional contour map is cut into a trapezoid formed by the four points A′, B′, C′, and D′.

[0102] Furthermore, by using image perspective transformation, the topographic map viewed from above is converted to be the same as the view from a fixed camera.

[0103] Figure 6 A schematic diagram of perspective transformation provided in an optional embodiment of this application, such as... Figure 6 As shown, the topographic map from a top-down perspective is converted to a fixed camera perspective. The perspective transformation expression used is:

[0104]

[0105] The transformed coordinates x and y are as follows:

[0106] x = x′ / w′, y = y′ / w′

[0107] When unfolded, it is:

[0108]

[0109]

[0110] By substituting the coordinates of the four vertices A′, B′, C′, and D′ of the two-dimensional contour map into the input, the topographic map viewed from a bird's-eye view can be converted to the view from a fixed camera.

[0111] As an optional embodiment, generating a contour map of a road based on point cloud data includes: triangulating the point cloud data to obtain an irregular triangular network; and extracting contour lines from a top-down view based on the irregular triangular network to obtain a contour map of the road.

[0112] The above contour map includes two-dimensional contour lines viewed from above.

[0113] The aforementioned triangulation is the process of dividing a two-dimensional or three-dimensional convex or non-convex polygon into several triangles. In point cloud data, each point can be considered a vertex, and then an irregular triangular network is formed by connecting adjacent points. The Delaunay triangulation algorithm can be used in this process, effectively ensuring that the generated triangles are as close as possible to equilateral triangles, thereby improving the accuracy of subsequent contour line extraction.

[0114] The contour line extraction described above is the process of converting 3D point cloud data into a 2D contour map. From a top-down perspective, the point cloud data is projected onto a horizontal plane, and the plane is divided into several contour line levels based on elevation information. The elevation difference between contour line levels is called the contour interval, which can be flexibly set according to the needs of the application scenario.

[0115] Optionally, contour lines can be extracted from a top-down view based on an irregular triangular network to obtain a contour map of the road. This includes: sorting the triangular network according to its height information and processing each triangle sequentially from low to high; for each triangle, calculating the height values ​​of its three vertices, and determining whether the boundary of the triangle intersects with a contour line based on the relationship between the height values; if the boundary of the triangle intersects with a contour line, calculating the coordinates of the intersection point and adding it to the contour line's point set; generating contour line segments based on the contour line's point set and adding them to the contour line's segment set; and generating a contour map based on the contour line's segment set.

[0116] It should be noted that the accuracy of contour line extraction is affected by triangulation. Before performing contour line extraction, the point cloud data can be preprocessed to remove noise and outliers in order to improve the quality of triangulation.

[0117] As an optional embodiment, the method of identifying the water depth of a road within the water accumulation edge contour based on superimposed images includes: obtaining the maximum and minimum contour values ​​within the water accumulation edge contour from the superimposed images; and calculating the difference between the maximum and minimum contour values ​​to obtain the water accumulation depth of the road.

[0118] Figure 7 This is a schematic diagram illustrating the overlay of a cropped road contour map with a water accumulation image, provided as an optional embodiment of this application. Figure 7 As shown, the curves represent contour lines, the gray areas represent the outline or extent of the water accumulation, and the rectangles contain the water accumulation area. The smallest contour line within the water accumulation edge outline is 1 cm, i.e., l. min =1cm, the largest contour line is 2cm, i.e., I max =2cm, the depth of the water can be calculated:

[0119] depth = l max -l min =2cm-1cm=1cm

[0120] Optionally, the maximum and minimum contour values ​​within the water accumulation edge outline can be obtained from the topographic map. For example, the water accumulation edge outline can be projected onto the topographic map to obtain the contour lines of the water accumulation area; the contour lines of the water accumulation area can be traversed to find the highest and lowest contour lines and their height values ​​can be recorded respectively.

[0121] In the embodiments of this application, this method can quickly and accurately calculate the water depth of roads, providing important reference information for urban flood control and traffic management.

[0122] According to another aspect of the embodiments of this application, a water depth identification device is also provided. Figure 8 This is a schematic diagram of the water depth recognition device provided in the embodiments of this application, as shown below. Figure 8 As shown, the water depth identification device includes: a first processing module 82, a second processing module 84, and a third processing module 86. The water depth identification device will now be described in detail.

[0123] The first processing module 82 is used to acquire images of water accumulation on the road and extract the edge contours of the water accumulation area in the water accumulation image;

[0124] The second processing module 84 is used to collect point cloud data of the road and obtain a contour map from the same perspective as the water accumulation image based on the point cloud data. The contour map is a map that uses contour lines to represent the ground undulations and elevation conditions.

[0125] The third processing module 86 is used to overlay the contour map with the water accumulation image and identify the water accumulation depth of the road within the edge contour of the water accumulation based on the overlaid image.

[0126] In this embodiment, the water depth recognition device acquires water accumulation images and point cloud data of the road, obtains the water accumulation edge contour of the water accumulation area in the water accumulation image and the contour map of the topography at the same viewpoint as the water accumulation image, overlays the contour map of the topography with the water accumulation image, and uses the overlaid image to recognize the water accumulation depth of the road within the water accumulation edge contour. This solves the technical problem in related technologies that the water accumulation depth cannot be identified due to the lack of a ruler or reference object on the road, and achieves the technical effect of accurately identifying the water accumulation depth of the road without a ruler or reference object.

[0127] It should be noted that the first processing module 82, the second processing module 84 and the third processing module 86 mentioned above correspond to steps S102 to S106 in the method embodiment. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above method embodiment.

[0128] Optionally, the first processing module 82 includes: a first processing unit for determining a rectangular frame containing a water accumulation area in the water accumulation image, wherein each side of the rectangular frame intersects with the water accumulation edge contour; and a second processing unit for extracting the edges of the water accumulation area within the rectangular frame to obtain the water accumulation edge contour.

[0129] Optionally, the first processing unit includes: a recognition unit, used to recognize the water accumulation image based on a pre-trained water accumulation area bounding box prediction model to obtain a bounding box containing the water accumulation area; wherein, the water accumulation area bounding box prediction model is trained by machine learning using multiple sets of data, and each set of data includes a water accumulation sample image and a bounding box containing the water accumulation area marked in the water accumulation sample image.

[0130] Optionally, the aforementioned recognition unit includes: a first processing subunit, used to add grayscale bars to the water accumulation image and convert the water accumulation image into a water accumulation image of a predetermined size; a second processing subunit, used to extract feature maps from the water accumulation image of the predetermined size; a third processing subunit, used to divide the feature maps into multiple grids and perform bounding box coordinate prediction on each grid to obtain a prediction result; a fourth processing subunit, used to decode the prediction result to obtain at least one set of bounding box coordinates; a fifth processing subunit, used to filter out a set of bounding box coordinates containing the water accumulation area from the at least one set of bounding box coordinates; a sixth processing subunit, used to remove the grayscale bars; and a seventh processing subunit, used to generate a bounding box containing the water accumulation area based on the bounding box coordinates containing the water accumulation area.

[0131] Optionally, the fifth processing subunit includes: a determination subunit, used to perform non-maximum suppression processing on at least one set of rectangular frame coordinates, and determine the set of rectangular frame coordinates with the highest probability as the rectangular frame coordinates containing the water accumulation area.

[0132] Optionally, the second processing unit includes: an eighth processing subunit for converting the image within the rectangle into a grayscale image; a ninth processing subunit for performing noise reduction processing on the grayscale image to obtain a smooth image; a tenth processing subunit for calculating the gradient magnitude and gradient direction of each pixel in the smooth image; an eleventh processing subunit for performing non-maximum suppression processing on the smooth image based on the gradient magnitude and gradient direction of each pixel to obtain the initial water accumulation edge contour of the water accumulation area; and a twelfth processing subunit for removing the pseudo-edges of the initial water accumulation edge contour to obtain the water accumulation edge contour.

[0133] Optionally, the second processing module 84 includes: a third processing unit for generating a contour map of the road based on point cloud data; a fourth processing unit for cropping the contour map of the road based on a predetermined viewing angle range to obtain a contour map within the predetermined viewing angle range; wherein the predetermined viewing angle range is determined based on the equipment parameters used to collect the water accumulation image; and a fifth processing unit for performing perspective transformation on the contour map within the predetermined viewing angle range based on the viewing angle corresponding to the water accumulation image to obtain a contour map.

[0134] Optionally, the third processing unit includes: a thirteenth processing subunit for triangulating the point cloud data to obtain an irregular triangular network; and a fourteenth processing subunit for extracting contour lines from a top-down view based on the irregular triangular network to obtain a contour map of the road.

[0135] Optionally, the third processing module 86 includes: a fifteenth processing subunit, used to obtain the maximum and minimum contour values ​​within the water accumulation edge contour from the superimposed image; and a sixteenth processing subunit, used to calculate the difference between the maximum and minimum contour values ​​to obtain the water accumulation depth of the road.

[0136] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the steps of the method described above.

[0137] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the steps of the method described above.

[0138] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0140] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0141] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0142] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A water-accumulation depth identification method characterized by comprising: The method comprises the following steps: Collecting a water accumulation image of a road, and extracting a water accumulation edge contour of a water accumulation region in the water accumulation image; Collecting point cloud data of the road, and obtaining a contour line terrain map in the same perspective as the water accumulation image based on the point cloud data, wherein the contour line terrain map is a map representing ground undulation and height conditions using contour lines; Superimposing the contour line terrain map and the water accumulation image, and identifying water accumulation depth of the road in the water accumulation edge contour based on the superimposed image; Wherein, obtaining the contour line terrain map in the same perspective as the water accumulation image based on the point cloud data comprises: generating the contour line terrain map of the road according to the point cloud data; cropping the contour line terrain map of the road based on a predetermined perspective range to obtain the contour line terrain map in the predetermined perspective range; wherein the predetermined perspective range is determined according to the device parameters used to collect the water accumulation image; performing perspective transformation on the contour line terrain map in the predetermined perspective range based on the perspective corresponding to the water accumulation image to obtain the contour line terrain map; Generating the contour line terrain map of the road according to the point cloud data comprises: triangulating the point cloud data to obtain an irregular triangular mesh; and extracting contour lines in a top-down perspective based on the irregular triangular mesh to obtain the contour line terrain map of the road.

2. The method of claim 1, wherein, Extracting the water accumulation edge contour of the water accumulation region in the water accumulation image comprises: Determining a rectangular frame containing the water accumulation region in the water accumulation image, wherein each side of the rectangular frame intersects the water accumulation edge contour; Performing edge extraction on the water accumulation region in the rectangular frame to obtain the water accumulation edge contour.

3. The method of claim 2, wherein, Determining a rectangular frame containing the water accumulation region in the water accumulation image comprises: Identifying the water accumulation image based on a pre-trained water accumulation region rectangular frame prediction model to obtain a rectangular frame containing the water accumulation region; wherein the water accumulation region rectangular frame prediction model is trained by machine learning using multiple sets of data, and each set of data in the multiple sets of data includes a water accumulation sample image and a rectangular frame containing a water accumulation region labeled in the water accumulation sample image.

4. The method of claim 3, wherein, Identifying the water accumulation image based on a pre-trained water accumulation region rectangular frame prediction model to obtain a rectangular frame containing the water accumulation region comprises: Adding a gray bar to the water accumulation image to convert the water accumulation image into a water accumulation image of a predetermined size; Extracting a feature map in the water accumulation image of the predetermined size; Dividing the feature map into multiple grids, and predicting rectangular frame coordinates for each grid respectively to obtain a prediction result; Decoding the prediction result to obtain at least one set of rectangular frame coordinates; Selecting a set of rectangular frame coordinates containing the water accumulation region from the at least one set of rectangular frame coordinates; Removing the gray bar; Generating a rectangular frame containing the water accumulation region based on the rectangular frame coordinates containing the water accumulation region.

5. The method of claim 4, wherein, Selecting a set of rectangular frame coordinates containing the water accumulation region from the at least one set of rectangular frame coordinates comprises: The at least one group of rectangular frame coordinates is subjected to non-maximum suppression processing, and a group of rectangular frame coordinates with the maximum probability is determined as the rectangular frame coordinates containing the waterlogging area.

6. The method of claim 2, wherein, The waterlogging area in the rectangular frame is subjected to edge extraction to obtain the waterlogging edge contour, including: Converting an image in the rectangular frame into a gray-scale image; Performing noise reduction processing on the gray-scale image to obtain a smooth image; Calculating the gradient amplitude and gradient direction of each pixel point in the smooth image; Based on the gradient amplitude and gradient direction of each pixel point, performing non-maximum suppression processing on the smooth image to obtain an initial waterlogging edge contour of the waterlogging area; Removing false edges of the initial waterlogging edge contour to obtain the waterlogging edge contour.

7. The method according to any one of claims 1 to 6, characterized in that, Based on the superimposed images, identifying the waterlogging depth of the road in the waterlogging edge contour, including: Obtaining the maximum contour line value and the minimum contour line value in the waterlogging edge contour from the superimposed images; Performing difference calculation on the maximum contour line value and the minimum contour line value to obtain the waterlogging depth of the road.

8. A water-accumulation depth identification device characterized by comprising: Including: A first processing module configured to collect a waterlogging image of a road and extract a waterlogging edge contour of a waterlogging area in the waterlogging image; A second processing module configured to collect point cloud data of the road and obtain a contour line topographic map in the same perspective as the waterlogging image based on the point cloud data, wherein the contour line topographic map is a map representing ground undulation and height conditions using contour lines; A third processing module configured to superimpose the contour line topographic map and the waterlogging image and identify the waterlogging depth of the road in the waterlogging edge contour based on the superimposed images; The second processing module includes: a third processing unit configured to generate the contour line topographic map of the road based on the point cloud data; a fourth processing unit configured to crop the contour line topographic map of the road based on a predetermined perspective range to obtain the contour line topographic map in the predetermined perspective range; wherein the predetermined perspective range is determined according to device parameters used to collect the waterlogging image; and a fifth processing unit configured to perform perspective transformation on the contour line topographic map in the predetermined perspective range based on the perspective corresponding to the waterlogging image to obtain the contour line topographic map. The third processing unit includes: a thirteenth processing subunit configured to triangulate the point cloud data to obtain an irregular triangular mesh; and a fourteenth processing subunit configured to extract contour lines in a top-down perspective based on the irregular triangular mesh to obtain the contour line topographic map of the road.

9. An electronic device, comprising: Including: A processor; A memory for storing processor-executable instructions; wherein the processor is configured to perform the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein when the program runs, the device where the computer-readable storage medium is located performs the steps of the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Road ponding depth measuring and calculating method for generating road surface contour line based on point cloud

    CN118840405A