Tunnel water level over-limit early warning method, device and electronic equipment based on real-time video

By installing a camera with backup power in the tunnel and using the BisenetV2 model for real-time video segmentation, the problem of easy damage to the tunnel water level warning equipment is solved, and high-precision water level exceeding the limit warning is achieved to ensure the safety of the tunnel.

CN115388977BActive Publication Date: 2025-08-26CHANGSHA HISENSE INTELLIGENT SYST RES INST CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211147091.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-08-26
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

The existing tunnel water level warning technology is prone to damage during heavy rainstorms/floods, and cannot provide effective early warnings, resulting in the inability to evacuate the tunnel trains and personnel in time.

Method used

The real-time video-based method is adopted. By installing a camera with backup power in the tunnel, the tunnel scene video is captured in real time, and the image semantic segmentation is used to obtain the water flow profile and water level line, and the water level exceeding the limit is determined in combination with the configuration parameters to achieve early warning.

Benefits of technology

It realizes high-precision and real-time early warning of tunnel water levels under heavy rain/flood conditions, avoids equipment damage, ensures the safety of tunnel operations, and provides traceable early warning information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115388977B_ABST
    Figure CN115388977B_ABST
Patent Text Reader

Abstract

The present invention discloses a tunnel water level over-limit warning method, device and electronic equipment based on real-time video, which are used for tunnel water level over-limit warning. The present invention relates to the field of rail transit technology. The present invention adopts the Bisenetv2 model to segment the tunnel water flow to obtain the water flow contour, inputs the water flow contour into a mathematical model to calculate the water level line, and then adopts a water level warning judgment model to judge whether the water level exceeds the warning line. If an over-limit event occurs, an early warning is issued, and an early warning picture and the corresponding water level over-limit level are output. The present invention collects pictures through a camera, which can be collected from multiple angles and postures. The picture segmentation method can obtain the water flow contour more accurately, configure the water level early warning line, and issue an early warning corresponding to the water level early warning level, thereby improving the accuracy of the water level early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] A tunnel water level overrun warning method, device and electronic equipment based on real-time video are used for tunnel water level overrun warning, and the present invention relates to the field of rail transit technology. Background Art

[0002] Torrential rain and floods frequently occur in various parts of my country. Urban subway tunnels are prone to rainwater backflow due to their low terrain, causing tunnel water levels to exceed the limit, seriously threatening the normal operation of the tunnel and causing serious consequences. Therefore, a scientific and reasonable emergency warning plan will provide a strong guarantee for the safety of tunnel operations. Urban subway tunnels are important transportation hubs in the city. Analysis shows that the main reason why rainwater cannot be discharged from tunnels in time during torrential rain and floods is the lack of an intelligent tunnel water level over-limit warning system, which causes tunnel trains and personnel to be submerged and unable to evacuate in time. Searching for the keyword "tunnel water level" reveals that existing technologies are basically based on liquid level gauges or water level sensors to achieve water level detection. Existing tunnel water level warning technologies are easily damaged or burned due to torrential rain / flooding, making it impossible to provide warnings. Summary of the Invention

[0003] The purpose of the present invention is to solve the technical problem that the existing tunnel water level warning technology is very easy to cause equipment damage or burning due to heavy rain / flooding, and it is impossible to provide an early warning. The present invention provides a tunnel water level over-limit early warning method, device and electronic equipment based on real-time video. By installing a camera with a backup power supply at a high position in the tunnel, real-time video of the tunnel scene is captured, and the real-time video stream is input into the image semantic segmentation model + water level warning judgment, the purpose of timely early warning of tunnel water level over-limit is achieved.

[0004] The technical solution adopted by the present invention is as follows: a tunnel water level overrun warning method based on real-time video, comprising the following steps:

[0005] S1. Information Collection: This includes configuration parameters and video frame capture. The configuration parameters are used to obtain n warning lines and their corresponding warning levels for water level overrun determination; a water level measurement scale is set to intercept the water level line; and the video frame capture is used to read a real-time video stream or offline video and capture it at a specified frame rate to obtain an input image frame.

[0006] S2. Obtaining water level segments: Input the input image frame obtained in step S1 into the constructed BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then input the y-axis equation obtained from the water flow contour and configuration parameters into the mathematical model to obtain the water level; wherein, the BisenetV2 water flow segmentation model uses image semantic segmentation to obtain the contour information of the tunnel water flow area, and calculates the water level based on the contour information and configuration parameters;

[0007] S3. Water level overlimit warning judgment: traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger the warning when the conditions are met. In the water level warning judgment process, the water flow area and angle under different cameras are different. By configuring parameters and mathematical methods, the water level level to which the actual tunnel water level line belongs can be estimated to achieve the purpose of warning.

[0008] The algorithm flow of the BisenetV2 water flow segmentation model described in step S2 is as follows:

[0009] a. Collect images with and without water flow in different tunnel scenarios to ensure sample diversity;

[0010] b. Use semi-automatic annotation method to annotate the dataset;

[0011] c. Use the labeled image set to train and optimize the BisenetV2 model;

[0012] d. Input the tunnel water level scene image frame into the BisenetV2 segmentation model to perform water flow segmentation and obtain the water flow mask;

[0013] e. Use OpenCV's built-in contour function cv2.findContours to obtain the water flow contour corresponding to the water flow mask.

[0014] Water flowing in subway tunnels has unclear edge boundaries due to factors such as shadows, lighting, and ripples, necessitating a network with strong edge feature extraction capabilities. Furthermore, semantic segmentation requires pixel-by-pixel classification of input images, which is computationally intensive. Therefore, achieving high model accuracy while minimizing computational effort and parameter usage is crucial. Taking all of this into account, the present invention employs the BisenetV2 network for semantic segmentation. This bilateral segmentation network (BiSeNetV2) separates low-level spatial details from high-level classification semantics to achieve high-precision and efficient real-time semantic segmentation. The detail branch, with wide channels and shallow layers, captures low-level details and generates high-resolution feature representations. The semantic branch (a lightweight branch with reduced channel capacity and a fast downsampling strategy) has narrow channels and deep layers to capture high-level semantic context. Furthermore, a guided aggregation layer is designed to enhance the interconnectedness and fusion of these two types of feature representations. An enhanced training strategy is employed to improve segmentation performance without increasing inference cost.

[0015] The configuration parameters described in step S1 mark all water level warning lines under the camera location and assign corresponding water level levels. For example, in the "Water Level Image Coordinate System," Line-1, Line-2, ..., Line-n represent the n configured water level warning lines, and Y1, Y2, ..., Yn represent the corresponding warning level names for these n configured water level warning lines. When configuring water level warning lines, the principle of two points forming a straight line is used. Therefore, each water level warning line has two endpoints. For example, for the nth warning line, the coordinates of the 0th endpoint are (Xn0, Yn0), and the coordinates of the 1st endpoint are (Xn1, Yn1).

[0016] The configuration parameters in step S1 also mark two water level measurement scale reference lines under the camera point for intercepting the water level line.

[0017] The specific steps of obtaining the water level segment in step S2 are as follows:

[0018] a. Calculate the equation of the line between the two y-axis lines: y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable.

[0019] b. Calculate the intersection of the two y-axis lines and the water flow profile:

[0020] I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A + B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. Here, the general formula for a line is Ax+By+C=0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable.

[0021] II. Point NMS, performs non-maximum suppression on intersection points;

[0022] III. Obtain the coordinates (x_water, y_water) of the center point of the water level line formed by the two intersection points.

[0023] The water level over-limit warning determination process in step S3 is as follows:

[0024] a. Calculate the intersection of the two y-axis lines and the n warning lines (traversal method), thereby obtaining the coordinates of the center points of the k warning line segments;

[0025] b. Determine whether the current water level has reached a certain warning line: that is, whether the ordinate y_water of the center point of the water level segment is less than or equal to the ordinate of the center point of the i-th warning line. If the condition is met, the current tunnel water level is equal to the warning level of the i-th warning line.

[0026] If the water level reaches a new water level warning level and a new over-limit event occurs, an early warning will be issued and the corresponding early warning image will be output.

[0027] A tunnel water level overrun warning device based on real-time video, comprising:

[0028] The input module is used to determine the water level exceeding the limit by obtaining n warning lines and their corresponding warning levels; intercept the water level line by obtaining two y-axis segments; and read the real-time video stream or offline video, intercept the frame at a specified frame rate, and obtain the input image frame;

[0029] An algorithm module is used to input the input image frame obtained in step S1 into the trained BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then, the water flow contour and the y-axis equation obtained by the configuration parameters are input into the mathematical model to obtain the water level line;

[0030] The logic judgment module and output module are used to traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger an alarm when the conditions are met.

[0031] An electronic device includes: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0032] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0033] 1. The water flow area is irregular. For example, the target recognition method detects the water flow area as a rectangle. However, the bilateral segmentation network (BiSeNet V2) can separate low-level details and high-level semantics to achieve high-precision and high-efficiency real-time semantic segmentation, thereby obtaining a more detailed water flow contour.

[0034] 2. Using the water level warning judgment model, the water level line obtained by the BiSeNet V2 segmentation model is compared with the positions of the n configured warning lines, and the one with the highest warning level among the warning lines that are greater than or equal to the water level is output, thereby realizing the tunnel water level over-limit warning.

[0035] 3. The camera has few installation constraints and can be installed at any position above the tunnel. It can be viewed from multiple angles and postures, as long as the water flow area is within the field of view.

[0036] 4. If no alarm level is reached, no alarm picture will be output. When the warning level is reached, the alarm picture will be output to the monitoring system, and the warning information such as the location, water level and reaching a certain level will be pushed to the front end of the monitoring system. The monitoring personnel can view the real-time monitoring of the section and review the video to achieve traceability and review. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The present invention will now be described by way of example with reference to the accompanying drawings, in which:

[0038] Figure 1 It is a flowchart of the workflow of the present invention;

[0039] Figure 2 It is a flowchart of the input module of the present invention;

[0040] Figure 3 It is a flowchart of the algorithm module of the present invention;

[0041] Figure 4 It is a flow chart of the logic judgment module and output module of the present invention;

[0042] Figure 5 It is a schematic diagram of the camera parameter configuration of the present invention;

[0043] Figure 6 This is the output of an alarm picture when reaching the warning level in Example 1 of the present invention;

[0044] Figure 7 This is the output of an alarm picture when reaching the warning level in Example 2 of the present invention;

[0045] Figure 8 This is the output of an alarm picture when reaching the warning level in Example 3 of the present invention. DETAILED DESCRIPTION

[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0047] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0048] like Figure 1-5As shown, this embodiment provides a tunnel water level overrun warning method based on real-time video, comprising the following steps:

[0049] S1. Information Collection: This includes configuration parameters and video frame capture. The configuration parameters are used to obtain n warning lines and their corresponding warning levels for water level overrun determination; a water level measurement scale is set to intercept the water level line; and the video frame capture is used to read a real-time video stream or offline video and capture it at a specified frame rate to obtain an input image frame.

[0050] S2. Obtaining water level segments: Input the input image frame obtained in step S1 into the constructed BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then input the y-axis equation obtained from the water flow contour and configuration parameters into the mathematical model to obtain the water level; wherein, the BisenetV2 water flow segmentation model uses image semantic segmentation to obtain the contour information of the tunnel water flow area, and calculates the water level based on the contour information and configuration parameters;

[0051] S3. Water level overlimit warning judgment: traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger the warning when the conditions are met. In the water level warning judgment process, the water flow area and angle under different cameras are different. By configuring parameters and mathematical methods, the water level level to which the actual tunnel water level line belongs can be estimated to achieve the purpose of warning. After the warning is triggered, the judged warning event is output, and the warning time, camera point information, warning description, water level warning level and other information are recorded, and the alarm picture is saved.

[0052] The algorithm flow of the BisenetV2 water flow segmentation model described in step S2 is as follows:

[0053] a. Collect images with and without water flow in different tunnel scenarios to ensure sample diversity;

[0054] b. Use semi-automatic annotation method to annotate the dataset;

[0055] c. Use the labeled image set to train and optimize the BisenetV2 model;

[0056] d. Input the tunnel water level scene image frame into the BisenetV2 segmentation model to perform water flow segmentation and obtain the water flow mask;

[0057] e. Use OpenCV's built-in contour function cv2.findContours to obtain the water flow contour corresponding to the water flow mask.

[0058] Water flowing in subway tunnels has unclear edge boundaries due to factors such as shadows, lighting, and ripples, necessitating a network with strong edge feature extraction capabilities. Furthermore, semantic segmentation requires pixel-by-pixel classification of input images, which is computationally intensive. Therefore, achieving high model accuracy while minimizing computational effort and parameter usage is crucial. Taking all of this into account, the present invention employs the BisenetV2 network for semantic segmentation. This bilateral segmentation network (BiSeNetV2) separates low-level spatial details from high-level classification semantics to achieve high-precision and efficient real-time semantic segmentation. The detail branch, with wide channels and shallow layers, captures low-level details and generates high-resolution feature representations. The semantic branch (a lightweight branch with reduced channel capacity and a fast downsampling strategy) has narrow channels and deep layers to capture high-level semantic context. Furthermore, a guided aggregation layer is designed to enhance the interconnectedness and fusion of these two types of feature representations. An enhanced training strategy is employed to improve segmentation performance without increasing inference cost.

[0059] The configuration parameters described in step S1 mark all water level warning lines under the camera location and assign corresponding water level levels. For example, in the "Water Level Image Coordinate System," Line-1, Line-2, ..., Line-n represent the n configured water level warning lines, and Y1, Y2, ..., Yn represent the corresponding warning level names for these n configured water level warning lines. When configuring water level warning lines, the principle of two points forming a straight line is used. Therefore, each water level warning line has two endpoints. For example, for the nth warning line, the coordinates of the 0th endpoint are (Xn0, Yn0), and the coordinates of the 1st endpoint are (Xn1, Yn1).

[0060] The configuration parameters in step S1 also mark two water level measurement scale reference lines under the camera point for intercepting the water level line.

[0061] The specific steps of obtaining the water level segment in step S2 are as follows:

[0062] a. Calculate the equation of the line between the two y-axis lines: y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable.

[0063] b. Calculate the intersection of the two y-axis lines and the water flow profile:

[0064] I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A + B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. Here, the general formula for a line is Ax+By+C=0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable.

[0065] II. Point NMS, performs non-maximum suppression on intersection points;

[0066] III. Obtain the coordinates (x_water, y_water) of the center point of the water level line formed by the two intersection points.

[0067] The water level over-limit warning determination process in step S3 is as follows:

[0068] a. Calculate the intersection of the y-axis lines of the two water level measurement scales and the n warning lines (traversal method), thereby obtaining the coordinates of the center points of the k warning line segments;

[0069] b. Determine whether the current water level has reached a certain warning line: that is, whether the ordinate y_water of the center point of the water level segment is less than or equal to the ordinate of the center point of the i-th warning line. If the condition is met, the current tunnel water level is equal to the warning level of the i-th warning line.

[0070] If the water level reaches a new water level warning level and a new over-limit event occurs, an early warning will be issued and the corresponding early warning image will be output.

[0071] A tunnel water level overrun warning device based on real-time video, comprising:

[0072] The input module is used to determine the water level exceeding the limit by obtaining n warning lines and their corresponding warning levels; intercept the water level line by obtaining two y-axis segments; and read the real-time video stream or offline video, intercept the frame at a specified frame rate, and obtain the input image frame;

[0073] An algorithm module is used to input the input image frame obtained in step S1 into the trained BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then, the water flow contour and the y-axis equation obtained by the configuration parameters are input into the mathematical model to obtain the water level line;

[0074] The logic judgment module and output module are used to traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger an alarm when the conditions are met.

[0075] An electronic device includes: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0076] To sum up, the present invention adopts the Bisenetv2 model to segment the tunnel water flow to obtain the water flow contour, inputs the water flow contour into the mathematical model to calculate the water level line, and then uses the water level warning judgment to determine whether the water level exceeds the warning line. If it exceeds the warning line, a warning will be issued. If a new over-limit event occurs, a warning will be issued again, and a warning picture and the corresponding water level over-limit level will be output.

[0077] Example 1

[0078] like Figure 6 As shown, S1, frame cutting is performed at a specified frame rate, and a camera shoots the portion of the water level measuring scale above the water level to obtain an image of the scale above the water level, thereby obtaining an input picture frame;

[0079] S2. Obtaining water level segments: Input the input image frame obtained in step S1 into the constructed BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then input the y-axis equation obtained from the water flow contour and configuration parameters into the mathematical model to obtain the water level; wherein, the BisenetV2 water flow segmentation model uses image semantic segmentation to obtain the contour information of the tunnel water flow area, and calculates the water level based on the contour information and configuration parameters;

[0080] See Figure 6 The specific calculation steps for obtaining the water level segment are as follows:

[0081] a. Calculate the equation of the line between the two y-axis lines: y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable.

[0082] b. Calculate the intersection of the two y-axis lines and the water flow profile:

[0083] I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A + B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. Here, the general formula for a line is Ax+By+C=0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable.

[0084] II. Point NMS, performs non-maximum suppression on intersection points;

[0085] III. Obtain the coordinates of the center point of the water level line formed by the two intersection points (536, 306).

[0086] S3, water level overlimit warning judgment: traverse the vertical coordinates of the center points of the four configured water level warning lines {'1':332.492, '2': 318.855, '3': 298.485, '4': 272.896}, obtain the vertical coordinate of the center point of the tunnel water level line 306, determine whether the current water level reaches the warning level of the '2' warning line, that is, '2' level, meet the conditions to trigger the warning, and output the warning Figure 6 To the supervision system.

[0087] Example 2

[0088] like Figure 7 As shown, calculate the equation of the line between the two y-axis lines y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable;

[0089] b. Calculate the intersection of the two y-axis lines and the water flow profile:

[0090] I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A + B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. Here, the general formula for a line is Ax+By+C=0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable.

[0091] II. Point NMS, performs non-maximum suppression on intersection points;

[0092] III. Obtain the coordinates of the center point of the water level line formed by the two intersection points (392, 325).

[0093] S3, water level over limit warning judgment: traverse the vertical coordinates of the center points of the four configured water level warning lines {'1':331.696, '2': 291.323, '3': 245.36, '4': 228.901}, obtain the vertical coordinate of the center point of the tunnel water level line 325, and judge that the current water level reaches the warning level of the '1' warning line, that is, the '1' warning line. class , meet the conditions to trigger the warning, output warning Figure 7 To the supervision system.

[0094] Example 3

[0095] like Figure 8 As shown, calculate the equation of the line between the two y-axis lines y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable;

[0096] b. Calculate the intersection of the two y-axis lines and the water flow profile:

[0097] I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A + B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. Here, the general formula for a line is Ax+By+C=0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable.

[0098] II. Point NMS, performs non-maximum suppression on intersection points;

[0099] III. Obtain the coordinates of the center point of the water level line formed by the two intersection points (360.0, 388.5).

[0100] S3, water level overlimit warning judgment: traverse the vertical coordinates of the center points of the three configured water level warning lines {'1':421.226, '2': 401.548, '3': 342.194}, obtain the vertical coordinate of the center point of the tunnel water level line 388.5, determine whether the current water level reaches the warning level of the '2' warning line, that is, '2' level, meets the conditions to trigger the warning, and output the warning Figure 8 To the supervision system.

[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. The scope of patent protection of the present invention shall be based on the claims. Any equivalent structural changes made using the description and drawings of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A tunnel water level overrun warning method based on real-time video, characterized in that: The steps include: S1. Information Collection: This includes configuration parameters and video frame capture. The configuration parameters are used to obtain n warning lines and their corresponding warning levels for water level overrun determination; a water level measurement scale is set to intercept the water level line; and the video frame capture is used to read a real-time video stream or offline video and capture it at a specified frame rate to obtain an input image frame. S2. Obtaining water level line segments: Input the input image frame obtained in step S1 into the constructed BisenetV2 water flow segmentation model to obtain the segmentation result and obtain the water flow contour; then input the water flow contour and the y-axis equation obtained from the configuration parameters into the mathematical model to obtain the water level line; The specific steps of obtaining the water level segment in step S2 are as follows: a. Calculate the equation of the line between the two y-axis lines: y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable. b. Calculate the intersection of the two y-axis lines and the water flow profile: I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A+B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. In this formula, the general formula for a line is Ax+By+C = 0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable. II. Point NMS, performs non-maximum suppression on intersection points; III. Obtain the coordinates (x_water, y_water) of the center point of the water level line formed by the two intersection points. S3. Water level overlimit warning judgment: traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger the warning if the conditions are met.

2. The method for early warning of tunnel water level exceeding limit based on real-time video according to claim 1, characterized in that: The algorithm flow of the BisenetV2 water flow segmentation model described in step S2 is as follows: a. Collect images with and without water flow in different tunnel scenarios to ensure sample diversity; b. Use semi-automatic annotation method to annotate the dataset; c. Use the labeled image set to train and optimize the BisenetV2 model; d. Input the tunnel water level scene image frame into the BisenetV2 segmentation model to perform water flow segmentation and obtain the water flow mask; e. Use OpenCV's built-in contour function cv2.findContours to obtain the water flow contour corresponding to the water flow mask.

3. The method for early warning of tunnel water level exceeding limit based on real-time video according to claim 1, characterized in that: The configuration parameters in step S1 mark all water level warning lines under the camera points and give the corresponding water level levels.

4. The method for early warning of tunnel water level exceeding limit based on real-time video according to claim 3 is characterized in that: The configuration parameters in step S1 also mark two water level measurement scale reference lines under the camera point, wherein the water level measurement scale reference lines are drawn vertically.

5. The method for early warning of tunnel water level exceeding limit based on real-time video according to claim 1, characterized in that: The water level over-limit warning determination process in step S3 is as follows: a. Calculate the intersection of the y-axis on the water level measurement scale and the n warning lines, thereby obtaining the coordinates of the center points of the k warning line segments; b. Determine whether the current water level has reached a certain warning line: that is, whether the ordinate y_water of the center point of the water level segment is less than or equal to the ordinate of the center point of the i-th warning line. If the condition is met, the current tunnel water level is equal to the warning level of the i-th warning line.

6. The method for early warning of tunnel water level exceeding limit based on real-time video according to claim 1, characterized in that: If the water level reaches a new water level warning level and a new over-limit event occurs, an early warning will be issued and the corresponding early warning image will be output.

7. A tunnel water level over-limit warning device based on real-time video, characterized in that: include: The input module is used to determine the water level exceeding the limit by obtaining n warning lines and their corresponding warning levels; Set up a water level measuring scale and intercept the water level line; And read the real-time video stream or offline video, cut the frame at the specified frame rate, and get the input picture frame; The algorithm module is used to input the input image frame into the constructed BisenetV2 water flow segmentation model to obtain the segmentation result and the water flow contour. The y-axis equation obtained from the water flow contour and configuration parameters is then input into the mathematical model to obtain the water level line. The specific steps are as follows: a. Calculate the equation of the line between the two y-axis lines: y = ax + b, where a represents the slope of the line, b represents the intercept of the line with the y-axis, x represents the independent variable, and y represents the dependent variable. b. Calculate the intersection of the two y-axis lines and the water flow profile: I. Use the point-to-line distance formula, d = |Ax+By+C| / sqrt(A*A+B*B), to calculate the distance from a point (x, y) to the line Ax+By+c. In this formula, the general formula for a line is Ax+By+C = 0, A and B are real numbers that are not simultaneously zero, C is a constant, x represents the independent variable, and y represents the dependent variable. II. Point NMS, performs non-maximum suppression on intersection points; III. Obtain the coordinates (x_water, y_water) of the center point of the water level line formed by the two intersection points. The logic judgment module and output module are used to traverse the vertical coordinates of the center points of n water level warning lines to obtain the warning level of the tunnel water level; determine whether the current water level has reached a certain warning line, and trigger an alarm when the conditions are met.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • River water level intelligent identification algorithm based on deep learning

    CN114677594A