Urban inland inundation early warning method and device, electronic equipment and storage medium

Through image segmentation and water surface proportion analysis in the urban waterlogging early warning method, the problems of water level monitoring errors and false alarms in the existing technology are solved, more accurate waterlogging early warning is achieved, and equipment costs are reduced.

CN118628575APending Publication Date: 2024-09-10ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411116500.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing urban flood early warning methods rely on water level monitoring points, which have errors and false alarms, resulting in inaccurate early warnings.

Method used

By segmenting the original image, calculate the proportion of the water surface between the water surface area and the road water surface setting area, divide the water surface sub-areas, calculate the similarity and water level height, and comprehensively analyze and determine the waterlogging early warning results to improve the accuracy of early warning.

Benefits of technology

It improves the accuracy of urban flood warning, avoids measurement errors, reduces equipment costs, and does not require additional hardware intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628575A
    Figure CN118628575A
Patent Text Reader

Abstract

The invention discloses an urban waterlogging early warning method and device, electronic equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: firstly, carrying out segmentation processing on an original image to obtain a segmented gray level image, and calculating a water surface ratio between a water surface area and a water surface set area of a road according to the water surface area in the gray level image; then, when the water surface proportion is larger than a first threshold value, the water surface area is divided into T water surface sub-areas, the similarity between the T water surface sub-areas is calculated, W water surface sub-areas meeting the similarity threshold value are screened out from the T water surface sub-areas, and then the water level height of the water surface area is calculated according to the distance between the W water surface sub-areas; and finally, performing comprehensive analysis based on the water surface proportion and the water level height, and determining a waterlogging early warning result of the road, so as to improve the accuracy of urban waterlogging early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an urban waterlogging early warning method, device, electronic device and storage medium. Background Art

[0002] In order to ensure the normal operation of the city, urban waterlogging is an important link. If the waterlogging problem cannot be discovered in time, it will pose a serious threat to people’s lives. Therefore, waterlogging warning is indispensable.

[0003] At present, the main method for urban waterlogging warning is to set up water level monitoring points at specific locations on the road, obtain the water level information of the monitoring points through liquid level devices, and then judge the road waterlogging situation based on the water level information. If it is judged that there is waterlogging on the road, a waterlogging warning will be issued.

[0004] However, the water level information at the monitoring point can only superficially reflect the water level conditions near the monitoring point, and there is a certain error in the water level information measured by the liquid level device, resulting in an error between the final monitored water level conditions and the actual water accumulation conditions on the road, which leads to false alarms in waterlogging warnings. Summary of the invention

[0005] The present application provides an urban waterlogging early warning method, device, electronic device and storage medium to improve the accuracy of urban waterlogging early warning.

[0006] In a first aspect, a method for early warning of urban waterlogging is provided, comprising: Perform segmentation processing on the original image to obtain a segmented grayscale image; Calculating the water surface ratio between the water surface area and the water surface set area of ​​the road according to the water surface area in the grayscale image; When the water surface proportion is greater than a first threshold, the water surface area is divided into T water surface sub-areas, and the similarities between the T water surface sub-areas are calculated; wherein T is an integer greater than 1; Selecting W water surface sub-regions that meet the similarity threshold from the T water surface sub-regions, and calculating the water level of the water surface region according to the distances between the W water surface sub-regions; wherein W is less than or equal to T; The waterlogging warning result of the road is determined according to the water surface proportion and the water level.

[0007] In an embodiment of the present application, first, the original image is segmented to obtain a segmented grayscale image, and the water surface ratio between the water surface area and the water surface set area of ​​the road is calculated according to the water surface area in the grayscale image; then, when the water surface ratio is greater than a first threshold, the water surface area is divided into T water surface sub-areas, and the similarity between the T water surface sub-areas is calculated, and W water surface sub-areas that meet the similarity threshold are screened out from the T water surface sub-areas, and then the water level of the water surface area is calculated according to the distance between the W water surface sub-areas; finally, a comprehensive analysis is performed based on the water surface ratio and the water level to determine the waterlogging warning result of the road, thereby improving the accuracy of urban waterlogging warnings, and does not require the intervention of other hardware equipment, thus avoiding measurement errors and reducing equipment costs.

[0008] In some embodiments, the segmenting of the original image to obtain a segmented grayscale image includes: Converting the original image into a first original grayscale image according to the weighted coefficients of the three original colors; Using a top-hat transformation algorithm to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image; The second original grayscale image is segmented according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

[0009] Through the above method, the contrast between the background and the water surface area in the image is increased.

[0010] In some embodiments, segmenting the second original grayscale image according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image includes: Determining, according to the grayscale level of each pixel in the second original grayscale image, a grayscale setting range to which each pixel belongs; Calculating the probability distribution of pixels within each grayscale setting range, and determining the maximum entropy double threshold value according to the probability distribution of each grayscale setting range; According to the grayscale value of each pixel in the second original grayscale image and the maximum entropy double threshold, the second original grayscale image is segmented to obtain a segmented grayscale image.

[0011] Through the above method, the difference between the water surface area and the background in the image can be effectively highlighted, and in the process, noise interference can be effectively reduced, thereby improving the accuracy of subsequent waterlogging warning results.

[0012] In some embodiments, calculating the similarity between the T water surface sub-regions includes: Determine, according to the original image, respective grayscale value distribution functions of a first water surface sub-region and a second water surface sub-region; wherein the first water surface sub-region and the second water surface sub-region are any two water surface sub-regions among the T water surface sub-regions; Calculating the grayscale averages of the first water surface sub-region and the second water surface sub-region; The similarity between the first water surface sub-region and the second water surface sub-region is determined according to the respective gray value distribution functions and the respective gray value averages.

[0013] Through the above method, the amount of water accumulation in the water surface area can be determined from another dimension, thereby improving the accuracy of subsequent waterlogging warning results.

[0014] In some embodiments, the similarity satisfies the following expression:

[0015] Wherein, the f(x, y) represents the gray value distribution function of the first water surface sub-region, represents the grayscale average value of the first water surface sub-region, the g(x+m, y+n) represents the grayscale value distribution function of the second water surface sub-region, and the The grayscale average value of the second water surface sub-region is represented, the M represents the window length of the first water surface sub-region and the N represents the window length of the second water surface sub-region, and the m and n represent the moving step between the first water surface sub-region and the second water surface sub-region.

[0016] In some embodiments, determining the waterlogging warning result of the road according to the water surface proportion and the water level height includes: If it is determined that the water surface proportion is greater than or equal to the second threshold, and the water level is greater than or equal to the third threshold, the waterlogging warning result of the road is determined to be waterlogging, and warning information indicating the existence of waterlogging is output; wherein the warning information includes at least the waterlogging situation and the original image.

[0017] Through the above methods, relevant departments can be notified to take corresponding measures to prevent the impact and losses caused by natural disasters.

[0018] In a second aspect, an urban waterlogging early warning device is provided, comprising: A segmentation module is used to segment the original image to obtain a segmented grayscale image; A first calculation module, used for calculating the water surface ratio between the water surface area and the water surface set area of ​​the road according to the water surface area in the grayscale image; The second calculation module is used to divide the water surface area into T water surface sub-areas when the water surface proportion is greater than the first threshold value, and calculate the similarity between the T water surface sub-areas; wherein T is an integer greater than 1; select W water surface sub-areas that meet the similarity threshold from the T water surface sub-areas, and calculate the water level height of the water surface area according to the distance between the W water surface sub-areas; wherein W is less than or equal to T; The waterlogging warning module is used to determine the waterlogging warning result of the road according to the water surface proportion and the water level.

[0019] In some embodiments, the segmentation module is specifically used to: Converting the original image into a first original grayscale image according to the weighted coefficients of the three original colors; Using a top-hat transformation algorithm to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image; The second original grayscale image is segmented according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

[0020] According to a third aspect, an electronic device is provided, including: A memory for storing a computer program; a processor for implementing any one of the method steps in the first aspect when executing the computer program stored in the memory.

[0021] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any one of the first aspects are implemented.

[0022] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A schematic diagram of an application scenario applicable to the embodiments of the present application; Figure 2 A flow chart of an urban waterlogging early warning method provided in an embodiment of the present application; Figure 3 A flowchart of an image segmentation process provided in an embodiment of the present application; Figure 4 A flow chart of a complete urban waterlogging early warning method provided in an embodiment of the present application; Figure 5A schematic diagram of the structure of an urban waterlogging warning device provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0025] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0026] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0027] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are first explained below.

[0028] (1) The top hat transformation algorithm is an image morphological processing method, which is mainly used to correct the influence of uneven lighting. The basic operations of image morphological processing are dilation and erosion, which are then derived into opening and closing operations, as well as image subtraction combined with opening and closing operations, which will produce top hat transformation and bottom hat transformation; among them, the top hat transformation of a grayscale image is understood as the grayscale image minus its opening operation. (2) The dual threshold segmentation algorithm is an image segmentation technique that uses two thresholds to segment an image. This method is particularly suitable for images where the target and background occupy different grayscale ranges. By setting two thresholds, the pixels in the image can be divided into three categories: one is the pixels below the first threshold, one is the pixels between the two thresholds, and the other is the pixels above the second threshold.

[0029] (3) Grayscale refers to the color range from completely white to completely black, while grayscale value refers to the specific numerical value of these levels.

[0030] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0031] Figure 1 Schematic diagram of application scenarios applicable to the embodiments of this application. Figure 1 As shown, the application scenario mainly includes: a terminal 10, a server 11, and an image acquisition device 12. The server 11 interacts with the terminal 10 and the image acquisition device 12 through a communication network, and the communication mode adopted by the communication network may include: a wireless communication mode and a wired communication mode.

[0032] In some scenarios, the terminal 10 may access the network and communicate with the server 11 via cellular mobile communication technology, and the cellular mobile communication technology may include fifth generation mobile networks (5G) technology.

[0033] In some other scenarios, the terminal 10 may access the network and communicate with the server 11 through a short-range wireless communication method. The short-range wireless communication method may include Wireless Fidelity (Wi-Fi) technology.

[0034] The present application embodiment does not impose any restriction on the number of the above-mentioned devices. Figure 1 As shown, only the terminal 10, the server 11, and the image acquisition device 12 are described as examples, and the above-mentioned devices and their respective functions are briefly introduced below.

[0035] The terminal 10 is a device that can provide voice and / or data connectivity to the user, including: a handheld terminal device with a wireless connection function, a vehicle-mounted terminal device, etc.

[0036] In some scenarios, the terminal 10 includes but is not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.

[0037] In addition, a client for urban waterlogging warning may be installed on the terminal 10, and the client may be software (e.g., APP, browser, etc.), or a web page, applet, etc. In the embodiment of the present application, the terminal 10 may use the client related to urban waterlogging warning to interact with the server 11 about the waterlogging situation of the road.

[0038] In some scenarios, server 11 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0039] Furthermore, in an embodiment of the present application, the server 11 may be equipped with an urban waterlogging warning device corresponding to the client. The urban waterlogging warning device is used to analyze and process the original images collected in real time by the image acquisition device 12. If it is determined that there is waterlogging on the road, a warning message indicating the existence of waterlogging is sent to the terminal 10, so as to facilitate relevant departments to take measures in a timely manner to avoid the impact and losses caused by natural disasters.

[0040] It should be noted that there is no restriction on the specific type of the image acquisition device 12, and it can be flexibly selected and deployed according to the actual scenario.

[0041] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.

[0042] Figure 2 This is a flow chart of a method for early warning of urban waterlogging provided in an embodiment of the present application. This process can be executed by an early warning device for urban waterlogging, which is implemented by software and / or hardware to improve the accuracy of early warning of urban waterlogging. Figure 2 As shown, the process includes the following steps: 201: Perform segmentation processing on the original image to obtain a segmented grayscale image.

[0043] In this step, the original image can be an image acquisition device (such as Figure 1 The image acquisition device 12) shown is collected in rainy weather.

[0044] In some embodiments, the segmentation process of the original image may include grayscale conversion, brightness uniformization, pixel segmentation and other processes to determine the water surface area in the original image, so as to facilitate the subsequent analysis of the water accumulation situation on the road. Figure 3 FIG. 1 is a flowchart of an image segmentation process provided by an embodiment of the present application. The process includes the following steps: 301: Convert the original image into a first original grayscale image according to the weighting coefficients of the three original colors.

[0045] In some embodiments, the first original grayscale image satisfies the following calculation formula: … (1) Among them, I (x, y) represents the grayscale image coordinates of the first original grayscale image; R (x, y), G (x, y), and B (x, y) represent the red, green, and blue components in the original image, respectively; 0.3, 0.59, and 0.11 represent their respective weighting coefficients, which can be flexibly adjusted based on the user's brightness perception.

[0046] 302: Perform brightness uniformity processing on the first original grayscale image using a top-hat transformation algorithm to obtain a second original grayscale image.

[0047] In some embodiments, a top-hat transformation algorithm is used to perform brightness uniformity processing on the first original grayscale image. Specifically, the first original grayscale image may be first eroded and then dilated, and then the result of the dilation operation is subtracted from the first original grayscale image, thereby further increasing the contrast of the grayscale image and facilitating the subsequent distinction between the water surface area and the background area.

[0048] Furthermore, the erosion operation satisfies the following expression: … (2) Wherein, F(x,y) represents the first original grayscale image, M(x,y) and M(u,v) are different structural elements; is the domain of M(u,v) and M(x,y); the grayscale dilation of M(u,v) on F(x,y) is denoted as F+M, the grayscale erosion is denoted as FM, the opening operation is denoted as FM, and the top-hat transformation is denoted as FM.

[0049] Furthermore, the expansion operation satisfies the following expression: … (3) Further, the opening operation satisfies the following expression: … (4) Furthermore, the top-hat transformation satisfies the following expression: … (5) Wherein, FM(x,y) represents the second original grayscale image.

[0050] 303: Segment the second original grayscale image according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

[0051] In some embodiments, in order to reduce noise interference in the second original grayscale image, a dual threshold segmentation algorithm may be used to perform image segmentation processing, which may specifically include the following process: Firstly, according to the grayscale level of each pixel in the second original grayscale image, the grayscale setting range to which each pixel belongs is determined; secondly, the probability distribution of the pixels in each grayscale setting range is calculated, and the maximum entropy double threshold is determined according to the probability distribution of each grayscale setting range; finally, according to the grayscale value of each pixel in the second original grayscale image and the maximum entropy double threshold, the second original grayscale image is segmented to obtain a segmented grayscale image.

[0052] For example, first, an array (for example, an array of size 256) can be pre-set to store the number of pixels at each gray level, and each pixel in the second original gray image can be traversed, and the corresponding array element can be incremented according to its gray value, and then the number of pixels in each gray level can be divided by the total number of pixels in the second original gray image to obtain the probability of each gray level. At this time, the entropy of the second original gray image can be calculated based on the probability of each gray level, and the entropy satisfies the following expression: … (6) Among them, H represents the entropy of the second original grayscale image, represents different gray levels, and p(i) represents the probability of the i-th gray level.

[0053] Furthermore, based on the expression (6), two initial thresholds T1 and T2 can be defined, and three grayscale setting ranges (for example, 0~T1, T1~T2, T2~255, T1=85, T2=170) can be defined based on them. Then, the cumulative sum of the number of pixels within these three grayscale setting ranges is calculated ( ), obtain a new second original grayscale image, then normalize the new second original grayscale image to obtain the probability distribution of pixels within the three grayscale setting ranges, and recalculate the entropy of the new second original grayscale image.

[0054] Then, on this basis, continuous iteration is performed to determine the maximum entropy dual threshold; for example, a step value (assuming it is set to 5) is set to iteratively try different threshold combinations; using nested loops, the outer layer traverses the possible value range of T1 (0~255, step length is 5), and the inner layer loop traverses the possible value range of T2 (starting from T1 of the outer loop to 255, step length is 5), and under each (T1, T2) combination, a new second original grayscale image is continuously constructed according to the aforementioned logic, and its corresponding entropy is calculated; the entropy of the second original grayscale images under all (T1, T2) combinations is compared, and the threshold combination with the largest entropy is used as the maximum entropy dual threshold.

[0055] Finally, the maximum entropy double threshold is used for segmentation. The specific judgment formula is as follows: … (7) Based on the above formula (7), first determine whether the grayscale value of each pixel in the second original grayscale image is greater than or equal to T1, or less than or equal to T2; if so, the pixel is segmented as an edge pixel; if not, the pixel is segmented as a non-edge pixel; further, when the pixel belongs to (0~T1 or (0~T2), the pixel is segmented as an unknown pixel.

[0056] In some embodiments, for unknown pixels, they may be marked as noise and replaced with the average value of the surrounding pixels. The specific calculation formula is as follows: … (8) Among them, g(j) represents the pixel of noise, a ij for Grayscale values ​​of all pixels in the window. Based on g(j), edge detection is performed to determine whether it is an edge pixel or a non-edge pixel, thereby achieving accurate segmentation processing.

[0057] In the present application embodiment, through the above Figure 3 In the method shown, first, the original image is converted into a first original grayscale image according to the weighted coefficients of the three primary colors; then, the top-hat transformation algorithm is used to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image, so as to increase the contrast between the background and the water surface area in the image; finally, a double threshold segmentation algorithm is used to segment all pixels in the second original grayscale image into non-edge pixels and edge pixels, which can effectively highlight the difference between the water surface area and the background in the image, and in this process can effectively reduce noise interference, thereby improving the accuracy of subsequent waterlogging warning results.

[0058] 202: Calculate the water surface ratio between the water surface area and the set water surface area of ​​the road according to the water surface area in the grayscale image.

[0059] In this step, the size of the water surface setting area can be flexibly set according to the actual road conditions, and the embodiment of the present application does not limit this.

[0060] 203: When the water surface ratio is greater than the first threshold, the water surface area is divided into T water surface sub-areas, and similarities between the T water surface sub-areas are calculated.

[0061] In this step, when the water surface ratio is greater than the first threshold, it indicates that a certain amount of water has accumulated on the road and a deeper analysis is required; when the water surface ratio is less than or equal to the first threshold, subsequent images can be collected for analysis.

[0062] In other embodiments, before dividing the water surface area into T water surface sub-areas, a comparison can be made with the water surface area based on a set calibration line. If there is an intersection, the water surface area is divided into T water surface sub-areas. The amount of water accumulated in the water surface area can be determined from another dimension, thereby improving the accuracy of subsequent waterlogging warning results.

[0063] In some embodiments, the T water surface sub-areas may be divided according to a set number of pixels, for example, in groups of 8 pixels; or they may be divided according to a set window size; this embodiment of the present application does not impose any limitation thereto.

[0064] In some embodiments, the similarity between the T water surface sub-regions may be calculated as follows: Firstly, according to the original image, the grayscale value distribution functions of the first water surface sub-region and the second water surface sub-region are determined; wherein the first water surface sub-region and the second water surface sub-region are any two water surface sub-regions among the T water surface sub-regions; secondly, the grayscale average values ​​of the first water surface sub-region and the second water surface sub-region are calculated; finally, according to their respective grayscale value distribution functions and their respective grayscale average values, the similarity between the first water surface sub-region and the second water surface sub-region is determined.

[0065] Furthermore, the similarity satisfies the following expression: … (9) Among them, f(x, y) represents the gray value distribution function of the first water surface sub-region, represents the gray value average of the first water surface sub-region, g(x+m, y+n) represents the gray value distribution function of the second water surface sub-region, represents the grayscale average value of the second water surface sub-region, M represents the window length of the first water surface sub-region and N represents the window length of the second water surface sub-region, and m and n represent the moving step length between the first water surface sub-region and the second water surface sub-region.

[0066] In other embodiments, the similarities between the T water surface sub-regions are calculated by performing similarity calculations on the T water surface sub-regions and other water surface sub-regions one by one, or performing similarity calculations on adjacent water surface sub-regions in sequence; or the T water surface sub-regions may be divided into two groups, the water surface sub-regions in the two groups are sorted, and one-to-one similarity calculations are performed according to the sorted sequence numbers, etc.

[0067] 204: Select W water surface sub-regions that meet the similarity threshold from the T water surface sub-regions, and calculate the water level height of the water surface region according to the distances between the W water surface sub-regions.

[0068] In this step, if the similarity calculated above (C mm ) is larger, the higher the similarity between the two water surface sub-areas is. After selecting W (W is less than or equal to T) water surface sub-areas that meet the similarity threshold from T water surface sub-areas, the water level height of the water surface area can be calculated according to the distance between the W water surface sub-areas, so that the amount of water accumulation on the road can be reflected from the water level rise.

[0069] In some embodiments, two water surface sub-regions with the greatest similarity may be screened out from the T water surface sub-regions, and then the water level of the water surface region may be calculated based on the distance between the two water surface sub-regions.

[0070] In some embodiments, the water level satisfies the following expression: … (10) Among them, p represents the pixel resolution, Represents the average distance between them.

[0071] 205: Determine the waterlogging warning result of the road based on the above water surface proportion and the above water level height.

[0072] In this step, if it is determined that the water surface ratio is greater than or equal to the second threshold, and the water level is greater than or equal to the third threshold, then the waterlogging warning result of the road is determined to be waterlogging, and warning information indicating the existence of waterlogging is output; wherein the warning information includes at least the waterlogging situation and the original image, and may also include waterlogging prevention strategies, etc., so as to notify relevant departments to take corresponding measures to prevent the impact and losses caused by natural disasters; further, all parameters and original images collected in real time on site can be dynamically displayed on the user interface for real-time observation by relevant departments.

[0073] In an embodiment of the present application, first, the original image is segmented to obtain a segmented grayscale image, and the water surface ratio between the water surface area and the water surface set area of ​​the road is calculated according to the water surface area in the grayscale image; then, when the water surface ratio is greater than a first threshold, the water surface area is divided into T water surface sub-areas, and the similarity between the T water surface sub-areas is calculated, and W water surface sub-areas that meet the similarity threshold are screened out from the T water surface sub-areas, and then the water level of the water surface area is calculated according to the distance between the W water surface sub-areas; finally, a comprehensive analysis is performed based on the water surface ratio and the water level to determine the waterlogging warning result of the road, thereby improving the accuracy of urban waterlogging warnings, and does not require the intervention of other hardware equipment, thus avoiding measurement errors and reducing equipment costs.

[0074] Based on the above Figure 1 The method shown, Figure 4 A complete flowchart of the urban flood warning method provided for this application. Figure 4 As shown, the process includes the following steps: 401: Segment the original image to obtain a segmented grayscale image.

[0075] This step is similar to the above Figure 3 Similar, no further description is given here.

[0076] 402: Calculate the water surface ratio between the water surface area and a set water surface area of ​​the road according to the water surface area in the grayscale image.

[0077] This step is similar to the above Figure 2202 is similar and will not be described again here.

[0078] 403: Determine whether the water surface ratio is greater than a first threshold. If so, proceed to 404. If not, obtain the original image of the next frame and proceed to 401.

[0079] 404: Divide the water surface area into T water surface sub-areas, and calculate the similarities between the T water surface sub-areas.

[0080] This step is similar to the above Figure 2 203 is similar and will not be described again here.

[0081] 405: Select W water surface sub-regions that meet the similarity threshold from the T water surface sub-regions, and calculate the water level height of the water surface region according to the distances between the W water surface sub-regions.

[0082] This step is similar to the above Figure 2 204 is similar and will not be described again here.

[0083] 406: Determine whether the water surface ratio is greater than or equal to the second threshold, and whether the water level is greater than or equal to the third threshold; if so, proceed to 407; if not, obtain the original image of the next frame and proceed to 401.

[0084] 407: Output warning information indicating the presence of waterlogging.

[0085] Based on the same technical concept, an urban waterlogging warning device is also provided in an embodiment of the present application, and the device can implement the above-mentioned urban waterlogging warning method process in the embodiment of the present application.

[0086] Figure 5 The schematic diagram of the structure of a city waterlogging early warning device provided in an embodiment of the present application includes a segmentation module 501 , a first calculation module 502 , a second calculation module 503 , and a waterlogging early warning module 504 .

[0087] The segmentation module 501 is used to segment the original image to obtain a segmented grayscale image; A first calculation module 502 is used to calculate the water surface ratio between the water surface area and the water surface set area of ​​the road according to the water surface area in the grayscale image; The second calculation module 503 is used to divide the water surface area into T water surface sub-areas when the water surface proportion is greater than the first threshold, and calculate the similarity between the T water surface sub-areas; wherein T is an integer greater than 1; select W water surface sub-areas that meet the similarity threshold from the T water surface sub-areas, and calculate the water level height of the water surface area according to the distance between the W water surface sub-areas; wherein W is less than or equal to T; The waterlogging warning module 504 is used to determine the waterlogging warning result of the road according to the water surface proportion and the water level.

[0088] In some embodiments, the segmentation module 501 is specifically configured to: Converting the original image into a first original grayscale image according to the weighted coefficients of the three original colors; Using a top-hat transformation algorithm to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image; The second original grayscale image is segmented according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

[0089] In some embodiments, the segmentation module 501 is specifically configured to: Determining, according to the grayscale level of each pixel in the second original grayscale image, a grayscale setting range to which each pixel belongs; Calculating the probability distribution of pixels within each grayscale setting range, and determining the maximum entropy double threshold value according to the probability distribution of each grayscale setting range; According to the grayscale value of each pixel in the second original grayscale image and the maximum entropy double threshold, the second original grayscale image is segmented to obtain a segmented grayscale image.

[0090] In some embodiments, the second calculation module 503 is specifically configured to: Determine, according to the original image, respective grayscale value distribution functions of a first water surface sub-region and a second water surface sub-region; wherein the first water surface sub-region and the second water surface sub-region are any two water surface sub-regions among the T water surface sub-regions; Calculating the grayscale averages of the first water surface sub-region and the second water surface sub-region; The similarity between the first water surface sub-region and the second water surface sub-region is determined according to the respective gray value distribution functions and the respective gray value averages.

[0091] In some embodiments, the waterlogging warning module is specifically used to: If it is determined that the water surface proportion is greater than or equal to the second threshold, and the water level is greater than or equal to the third threshold, the waterlogging warning result of the road is determined to be waterlogging, and warning information indicating the existence of waterlogging is output; wherein the warning information includes at least the waterlogging situation and the original image.

[0092] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0093] Based on the same technical concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the functions of the aforementioned urban waterlogging warning device.

[0094] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0095] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. The bus 600 is Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.

[0096] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute the urban waterlogging early warning method discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 5 The functions of each module in the device shown.

[0097] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling the data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.

[0098] In the embodiment of the present application, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0099] The processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a method for early warning of urban waterlogging disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0100] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0101] By programming the processor 601, the code corresponding to the urban waterlogging early warning method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2The embodiment shown is a method for early warning of urban waterlogging. How to design and program the processor 601 is a technique known to those skilled in the art and will not be described in detail here.

[0102] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0103] Based on the same technical concept, the embodiment of the present application provides a computer storage medium, which includes: computer program code, when the computer program code is executed on a computer, the computer executes any one of the urban waterlogging early warning methods discussed above. Since the principle of solving the problem by the above computer storage medium is similar to that of an urban waterlogging early warning method, the implementation of the above computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0104] In a specific implementation process, computer storage media may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.

[0105] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any one of the urban waterlogging early warning methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of an urban waterlogging early warning method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0106] The computer program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0107] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0108] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.

[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.

[0111] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0113] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for early warning of urban waterlogging, characterized in that: include: Perform segmentation processing on the original image to obtain a segmented grayscale image; Calculating the water surface ratio between the water surface area and the water surface set area of ​​the road according to the water surface area in the grayscale image; When the water surface proportion is greater than a first threshold, the water surface area is divided into T water surface sub-areas, and the similarities between the T water surface sub-areas are calculated; wherein T is an integer greater than 1; Selecting W water surface sub-regions that meet the similarity threshold from the T water surface sub-regions, and calculating the water level of the water surface region according to the distances between the W water surface sub-regions; wherein W is less than or equal to T; The waterlogging warning result of the road is determined according to the water surface proportion and the water level.

2. The method according to claim 1, characterized in that The segmentation process of the original image to obtain a segmented grayscale image includes: Converting the original image into a first original grayscale image according to the weighted coefficients of the three original colors; Using a top-hat transformation algorithm to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image; The second original grayscale image is segmented according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

3. The method according to claim 2, characterized in that The step of segmenting the second original grayscale image according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image includes: Determining, according to the grayscale level of each pixel in the second original grayscale image, a grayscale setting range to which each pixel belongs; Calculating the probability distribution of pixels within each grayscale setting range, and determining the maximum entropy double threshold value according to the probability distribution of each grayscale setting range; According to the grayscale value of each pixel in the second original grayscale image and the maximum entropy double threshold, the second original grayscale image is segmented to obtain a segmented grayscale image.

4. The method according to claim 1, characterized in that The calculating the similarity between the T water surface sub-regions includes: Determine, according to the original image, respective grayscale value distribution functions of a first water surface sub-region and a second water surface sub-region; wherein the first water surface sub-region and the second water surface sub-region are any two water surface sub-regions among the T water surface sub-regions; Calculating the grayscale averages of the first water surface sub-region and the second water surface sub-region; The similarity between the first water surface sub-region and the second water surface sub-region is determined according to the respective gray value distribution functions and the respective gray value averages.

5. The method according to claim 4, characterized in that The similarity satisfies the following expression: ; Wherein, the f(x, y) represents the gray value distribution function of the first water surface sub-region, represents the grayscale average value of the first water surface sub-region, the g(x+m, y+n) represents the grayscale value distribution function of the second water surface sub-region, and the The grayscale average value of the second water surface sub-region is represented, the M represents the window length of the first water surface sub-region and the N represents the window length of the second water surface sub-region, and the m and n represent the moving step between the first water surface sub-region and the second water surface sub-region.

6. The method according to claim 1, characterized in that Determining the waterlogging warning result of the road according to the water surface proportion and the water level height includes: If it is determined that the water surface proportion is greater than or equal to the second threshold, and the water level is greater than or equal to the third threshold, the waterlogging warning result of the road is determined to be waterlogging, and warning information indicating the existence of waterlogging is output; wherein the warning information includes at least the waterlogging situation and the original image.

7. An urban waterlogging early warning device, characterized in that: include: A segmentation module is used to segment the original image to obtain a segmented grayscale image; A first calculation module, used for calculating the water surface ratio between the water surface area and the water surface set area of ​​the road according to the water surface area in the grayscale image; The second calculation module is used to divide the water surface area into T water surface sub-areas when the water surface proportion is greater than the first threshold value, and calculate the similarity between the T water surface sub-areas; wherein T is an integer greater than 1; select W water surface sub-areas that meet the similarity threshold from the T water surface sub-areas, and calculate the water level height of the water surface area according to the distance between the W water surface sub-areas; wherein W is less than or equal to T; The waterlogging warning module is used to determine the waterlogging warning result of the road according to the water surface proportion and the water level.

8. The device according to claim 7, characterized in that The segmentation module is specifically used for: Converting the original image into a first original grayscale image according to the weighted coefficients of the three original colors; Using a top-hat transformation algorithm to perform brightness uniformity processing on the first original grayscale image to obtain a second original grayscale image; The second original grayscale image is segmented according to the grayscale value of each pixel in the second original grayscale image to obtain a segmented grayscale image.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.