Vision-based road water detection method, electronic equipment and vehicle alarm system

Through visual detection methods, the accurate detection of road water accumulation has been solved, and the problem of insufficient accuracy in low-light environments in the prior art has been solved, and driving safety has been improved.

CN114219791BActive Publication Date: 2025-01-03SHENZHEN MAXVISION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111552664.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-01-03
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The existing non-contact night road area water detection system is insufficient in low-light environments, resulting in an increase in traffic safety accidents.

Method used

The visual-based road water accumulation detection method is adopted, and the road scene image is preprocessed and identified model detection is performed. The segmentation result map of the water distribution in the road area is output, and images with brightness higher than the set threshold are filtered, and the water accumulation distribution profile is found and drawn. Rectangular frame to improve detection accuracy.

Benefits of technology

Accurately detect road water accumulation in low-light environments, improve drivers' perception of road water accumulation areas, and enhance driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219791B_ABST
    Figure CN114219791B_ABST
Patent Text Reader

Abstract

The present application provides a vision-based road water detection method, electronic device and vehicle alarm system, the vision-based road water detection method comprising the steps of: preprocessing road scene images collected at intervals to obtain a preprocessed image; inputting the preprocessed image into a trained road water recognition model for detection, and outputting a segmentation result map of road water distribution; detecting the brightness of the road water distribution area in the segmentation result map, and filtering images with brightness higher than a set threshold; performing contour search on the water distribution in the segmentation result map to obtain a water distribution contour; performing coordinate search on the corner points around the rectangular frame of the water distribution contour, and drawing a minimum rectangular frame of the water distribution; mapping the minimum rectangular frame of the water distribution on the initial road scene image; the vision-based road water detection method, electronic device and vehicle alarm system of the present application can accurately detect road water in a weak light environment, thereby improving driving safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of traffic safety technology, and more specifically, to a vision-based road water detection method, electronic equipment and vehicle alarm system. Background Art

[0002] With the improvement of social economy, the field of road transportation has also continued to flourish. When the wheels are driving on a road covered with water, the road adhesion coefficient is greatly reduced compared to a dry road surface. A layer of water film will form between the wheels and the ground, reducing the frictional resistance of the two contact surfaces. The friction between the original road surface texture and the tire texture is reduced, and the car's operating stability and braking performance are greatly reduced. The vehicle is prone to slipping, losing control, rolling over, and colliding during driving, which has a great impact on traffic safety.

[0003] Especially when driving at night or in tunnels, the most accidents are caused by water on the road. At night or in tunnels, the ambient light is weak, and the headlights are often turned on. Since the water on the road is equivalent to a plane mirror, the headlights will form a mirror reflection when shining on the water on the road. The light reflected by the mirror cannot be reflected to the human eye, and the driver sees the water area as black. Therefore, traffic accidents often occur because of the lack of preparation for deceleration in advance.

[0004] Existing nighttime road waterlogging detection systems usually include four main core parts: data acquisition module, data transmission module, control module and application center. According to the detection principle, they can be roughly divided into contact method and non-contact method. The contact method mainly uses water gauge measurement and sensor measurement, such as setting a water level sensor on the wheel. Therefore, this method cannot provide early warning; the non-contact method mainly includes wireless sensors and infrared sensors. These traditional methods are costly, have a low degree of automation, and often have false detections in weak light environments. This is also the main reason why this technology has not been widely used. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a vision-based road water accumulation detection method, electronic equipment and vehicle alarm system to solve the technical problem of insufficient accuracy in the process of detecting road water accumulation at night by existing non-contact methods.

[0006] To achieve the above purpose, the technical solution adopted by the present application is: to provide a road water accumulation detection method based on vision, the road water accumulation detection method based on vision comprises the following steps:

[0007] Preprocessing the road scene images collected at alternate frames to obtain preprocessed images;

[0008] The pre-processed image is input into the trained road waterlogging recognition model for detection, and the segmentation result map of road waterlogging distribution is output;

[0009] Detect the brightness of the water distribution area on the road in the segmentation result image, and filter out images with brightness higher than the set threshold;

[0010] Perform contour search on the water accumulation distribution in the segmentation result image to obtain the water accumulation distribution contour;

[0011] Find the coordinates of the corner points around the rectangular box of the water distribution contour and draw the minimum rectangular box of the water distribution;

[0012] Map the minimum rectangular box of water accumulation distribution onto the initial road scene image.

[0013] Preferably, after outputting the segmentation result map of road surface water distribution, the method further includes the following steps:

[0014] Perform road segmentation on the preprocessed image and output the road segmentation mask;

[0015] The road surface water distribution area in the road segmentation result image is mapped to the road segmentation mask. If at least one pixel intersects, the next step is performed. If not, the road scene image of this frame is filtered.

[0016] Preferably, after filtering the images whose brightness is higher than the set threshold, the method further comprises the following steps:

[0017] Detect the brightness around the waterlogged area on the road and filter out images with brightness below the set threshold.

[0018] Preferably, after obtaining the water distribution profile, the method further comprises the following steps:

[0019] Fill the area within the water distribution contour with color;

[0020] The water distribution contour after color filling is mapped onto the initial road scene image.

[0021] Preferably, before preprocessing the road scene images collected at alternate frames, the method further includes the following steps:

[0022] Train a road waterlogging recognition model;

[0023] The method for training a road waterlogging recognition model comprises the following steps:

[0024] Collect road surface water image dataset;

[0025] Preprocessing is performed based on the image dataset;

[0026] The preprocessed image dataset is input into the bisenetv2 network for training.

[0027] Preferably, the method for preprocessing according to the image data set comprises the following steps:

[0028] The images are first cropped to a uniform size of 640×480 and converted into 24-bit RGB images;

[0029] Label the RGB image;

[0030] Batch convert the json files generated after annotation to generate mask label images;

[0031] Perform data augmentation on the mask label image;

[0032] Generate a dataset image training set and a validation set from the dataset of mask label images.

[0033] Preferably, the method of inputting the preprocessed image data set into the bisenetv2 network for training comprises the following steps:

[0034] Focal Loss is used as the loss function for training, where the Focal Loss calculation formula is as follows:

[0035]

[0036] In the formula: N is the number of label categories; and γ are constants; y i Indicates the label value; p i Represents the network output prediction value.

[0037] Preferably, the method of inputting the preprocessed image data set into the bisenetv2 network for training comprises the following steps:

[0038] Set the learning rate decay formula l r :

[0039]

[0040] The formula: l r represents the decaying learning rate; l ro represents the initial learning rate; S d Indicates the decay rate; N i Represents the number of iterations; R d Represents the attenuation coefficient.

[0041] The present application also provides an electronic device, the electronic device comprising a processor and a memory;

[0042] The memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the above-mentioned vision-based road water detection method.

[0043] The present application also provides a vehicle alarm system, which includes an alarm, a vehicle central control system and the electronic device as described above, wherein the alarm is connected to the vehicle central control system, and the vehicle central control system is connected to the electronic device.

[0044] The beneficial effects of the vision-based road water accumulation detection method, electronic device and vehicle alarm system provided by the present application are as follows: compared with the prior art, the principle of light reflection in a weak light environment is utilized to detect the brightness of the road water accumulation distribution area in the segmentation result map of the road water accumulation distribution, and road water accumulation in a weak light environment is accurately detected, and the perception and generalization capabilities of the actual scene are possessed; by drawing the minimum rectangular frame of the water accumulation distribution contour, the driver can obtain accurate road water accumulation area information, thereby improving driving safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0046] Figure 1 A schematic diagram of a flow chart of a visual-based road water detection method provided in an embodiment of the present application;

[0047] Figure 2 The preprocessed image provided by the embodiment of the present application;

[0048] Figure 3 A segmentation result diagram provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a scene showing a water distribution profile provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of a scene for drawing a minimum rectangular frame of water accumulation distribution provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of a module of an electronic device provided in an embodiment of the present application;

[0052] Figure 7 A schematic diagram of the modules of a vehicle alarm system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0055] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0056] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0057] Please also read Figures 1 to 5 Now, the vision-based road water detection method provided in the embodiment of the present application is described. The vision-based road water detection method comprises:

[0058] Step S1, preprocessing the road scene image collected at alternate frames to obtain a preprocessed image;

[0059] Step S2, inputting the preprocessed image into the trained road waterlogging recognition model for detection, and outputting a segmentation result map of road waterlogging distribution;

[0060] Step S3, detecting the brightness of the road surface water distribution area in the segmentation result image, and filtering images with brightness higher than a set threshold;

[0061] Step S4, performing contour search on the water accumulation distribution in the segmentation result image to obtain the water accumulation distribution contour;

[0062] Step S5, searching for the coordinates of the corner points around the rectangular frame of the water accumulation distribution contour, and drawing the minimum rectangular frame of the water accumulation distribution;

[0063] Step S6, mapping the minimum rectangular frame of water accumulation distribution onto the initial road scene image.

[0064] It is worth noting that in step S1, when the vehicle is driving, the camera located at the front of the vehicle can continuously obtain driving monitoring video. In order to improve the detection efficiency, the driving monitoring video is usually subjected to a method of capturing road scene images at alternate frames, for example, capturing one frame every 0.1 seconds or one frame every 0.5 seconds.

[0065] In step S2, the road water recognition model is a trained model. When training the road water recognition model, it is necessary not only to add the road water data set but also to add related data sets that are similar to the road water data set, such as wet road surfaces, road surface marking patterns, distant lakes, etc., to reduce the probability of misidentification.

[0066] If the road water accumulation recognition model does not detect road water accumulation, the next frame of road scene image will be directly collected; if the road water accumulation recognition model detects road water accumulation, the segmentation result map of the road water accumulation distribution will be output.

[0067] In step S3, since the driver can directly observe the waterlogging on the road very conveniently without being reminded when driving in a well-lit environment. However, when driving in a weak light environment, the headlights are often turned on. Since the waterlogging on the road is equivalent to a plane mirror, the headlights will form a mirror reflection when shining on the waterlogging on the road. The light reflected by the mirror cannot be reflected to the vehicle monitoring camera, and the light irradiated by the headlights on the periphery of the waterlogging area on the road mainly forms diffuse reflection. The diffuse reflection light can be reflected to the vehicle monitoring camera, resulting in the brightness of the waterlogging area on the road being lower than the brightness of the periphery of the waterlogging area in the road scene image obtained by the vehicle monitoring camera.

[0068] That is, if the brightness of the waterlogging distribution area in the segmentation result image is higher than the set threshold image, it means that either the vehicle is driving in a well-lit environment, at which time the driver can easily and directly observe the waterlogging situation on the road without reminders, reducing driving interference; or it is a misidentification. The road scene images obtained during driving in a weak-light environment are not clear at present, and the road waterlogging recognition model is prone to misidentification.

[0069] In this way, by detecting the brightness of the road water distribution area in the segmentation result image and filtering images with brightness values ​​higher than the set threshold, images of road water in low-light driving environments can be screened out to achieve the function of assisted driving prompt safety warning.

[0070] It is worth noting that the brightness of the waterlogged area in the segmentation result image can refer to the average brightness of each pixel in the waterlogged area, or can be the average value of multiple pixels uniformly extracted according to a set rule. In addition, the brightness of the waterlogged area in the segmentation result image can be understood as obtaining the position of the waterlogged area from the segmentation result image, and then obtaining the brightness parameter based on the position mapping in the preprocessed image or the initial road scene image.

[0071] In step S4, by performing contour search on the water accumulation distribution in the segmentation result image, the water accumulation distribution contour is obtained, and the shape of the road water accumulation area can be further accurately determined.

[0072] When the vehicle's safety system is also equipped with a road water depth monitoring system that collaborates with big data analysis and mechanism models, the depth of road water can also be calculated based on big data such as the shape and area of ​​the road waterlogging area and the amount of rainfall on that day, to provide a safety warning to the driver.

[0073] In step S5, the minimum rectangular frame of water accumulation distribution can be drawn by searching the coordinates of the corner points around the rectangular frame of water accumulation distribution contour, so that in step S6, the most accurate minimum rectangular frame of water accumulation distribution can be mapped on the initial road scene image, so that the driver can obtain accurate road water accumulation area information.

[0074] Compared with the existing technology, the vision-based road water accumulation detection method provided by the present application utilizes the principle of light reflection in a weak light environment to detect the brightness of the road water accumulation distribution area in the segmentation result map of the road water accumulation distribution, accurately detects road water accumulation in a weak light environment, and has the perception and generalization capabilities of actual scenes; by drawing the minimum rectangular frame of the water accumulation distribution contour, the driver can obtain accurate road water accumulation area information and improve driving safety.

[0075] In another embodiment of the present application, in step S2, after outputting the segmentation result map of road surface water distribution, the method further includes:

[0076] Step S2.1, performing road segmentation on the preprocessed image and outputting a road segmentation mask;

[0077] Step S2.2, mapping the road surface water distribution area in the road segmentation result image to the road segmentation mask, if there is at least one pixel intersecting, then executing the next step, if not, then filtering the frame of road scene image.

[0078] It can be understood that by outputting the road segmentation mask, the road area can be detected. After mapping the road surface water distribution area in the road segmentation result image to the road segmentation mask, if there is at least one intersecting pixel point, it means that there is water on the road. If there is no intersecting pixel point, the water is outside the road and has no effect on vehicle driving, thereby further filtering irrelevant information.

[0079] In another embodiment of the present application, in step S3, after filtering images with brightness higher than a set threshold, the process further includes:

[0080] Step S3.1, detecting the brightness around the waterlogged area on the road, and filtering images with brightness lower than a set threshold.

[0081] It is understandable that in the actual scene of vehicles at night, there will be special factors that affect the accuracy of filtering. For example, when a vehicle is about to enter a downhill section at night, the monitoring camera at the front of the vehicle cannot capture the road. The road scene image is a distant view image of the vehicle's driving direction. The road water accumulation recognition model is prone to misidentification during detection, and the output is an erroneous segmentation result map of the road water accumulation distribution. At this time, in step S3, since the brightness of the entire image is lower than the set threshold, it will not be filtered.

[0082] Therefore, through step S3.1, by combining the brightness of the surrounding area of ​​waterlogged road, filtering images with brightness lower than the set threshold, it is possible to filter out special cases of misidentification due to the brightness of the entire image being lower than the set threshold, thereby avoiding providing erroneous warning information to the driver.

[0083] It is worth noting that the brightness around the waterlogged area should refer to the average brightness of each pixel in the remaining area of ​​the preprocessed image excluding the waterlogged area in the segmentation result image, or it can be the average value of multiple pixels uniformly extracted according to a set rule.

[0084] In another embodiment of the present application, in step S4, after obtaining the water accumulation distribution profile, the method further includes:

[0085] Step S4.1, filling the area within the water distribution contour with color;

[0086] Step S4.2, mapping the water distribution contour after color filling onto the initial road scene image.

[0087] It can be understood that after the color-filled water distribution outline is mapped onto the initial road scene image, the road scene image seen by the driver through the vehicle's display screen will be prompted with the color-filled water distribution outline, thereby improving the user experience.

[0088] In another embodiment of the present application, before preprocessing the road scene images collected at alternate frames, the method further includes:

[0089] Step S0, training a road waterlogging recognition model;

[0090] The method for training a road waterlogging recognition model comprises the following steps:

[0091] Step S0.1, collecting a road surface water image dataset;

[0092] Step S0.2, preprocessing according to the image data set;

[0093] Step S0.3, the preprocessed image data set is input into the bisenetv2 network for training.

[0094] Furthermore, the method for preprocessing the image data set comprises the following steps:

[0095] Step S0.21, first crop the image to a uniform size of 640×480 and convert it into a 24-bit RGB image;

[0096] Step S0.22, labeling the RGB image;

[0097] Step S0.23, batch convert the json files generated after the annotation to generate mask label images;

[0098] Step S0.24, performing data enhancement expansion processing on the mask label image;

[0099] Step S0.25, generating a dataset image training set and a validation set from the dataset of mask label images.

[0100] It can be understood that the labelme deep learning labeling tool is used to label the image, which is mainly divided into two categories, namely background and water accumulation; the json file generated after the labeling is batch converted, the background pixels are set to 0, and the water pixels are set to 1, where pixels with the same pixel value are represented as pixels of the same type, and finally a mask label image is generated; the image is expanded by data enhancement. The data enhancement mainly uses python's PIL image processing library to expand the sample data. The main operations are horizontal mirroring, resizing, and image flipping for five times random probability enhancement, expanding the data set from the original 500 to 2500, and keeping the original image and the corresponding mask label image expanded synchronously to increase the generalization ability of the model.

[0101] Further, in step S0.3, the method of inputting the preprocessed image data set into the bisenetv2 network for training includes the following steps:

[0102] In step S0.31, Focal Loss is used as the loss function for training. The calculation formula of Focal Loss is as follows:

[0103]

[0104] In the formula: N is the number of label categories; and γ are constants; y i Indicates the label value; p i Represents the network output prediction value.

[0105] It is understandable that in order to solve the problem of sample label imbalance in training image data, Focal Loss is used as the loss function for training; and γ represent constants taking the values ​​as 0.21 and 2 respectively.

[0106] Further, in step S0.3, the method of inputting the preprocessed image data set into the bisenetv2 network for training includes the following steps:

[0107] Step S0.32, set the learning rate attenuation formula l r :

[0108]

[0109] The formula: l r represents the decaying learning rate; l ro represents the initial learning rate; S d Indicates the decay rate; N i Represents the number of iterations; R d Represents the attenuation coefficient.

[0110] It is understandable that in order for gradient descent to achieve good performance, too high a learning rate will lead to an unstable training process, and too low a threshold will lead to excessively extended training time. In order to ensure a stable training process, a learning rate attenuation formula is set.

[0111] See also Figure 6 The present application also provides an electronic device, which includes a processor and a memory; wherein the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the above-mentioned vision-based road water detection method.

[0112] The electronic device also includes a bus and a communication interface, and the processor, the communication interface and the memory are connected via the bus.

[0113] The memory may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the drawings, but it does not mean that there is only one bus or one type of bus.

[0114] The communication interface is used to connect to at least one user terminal and other network units through a network interface, and send the road water accumulation information to the user terminal through the network interface.

[0115] The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the method of the above embodiment in combination with its hardware.

[0116] See also Figure 7 The present application also provides a vehicle alarm system, which includes an alarm, a vehicle central control system and the electronic device as described above, wherein the alarm is connected to the vehicle central control system, and the vehicle central control system is connected to the electronic device.

[0117] After the electronic device detects water accumulation ahead on the road, it uploads water accumulation warning information ahead on the road to the vehicle central control system, and the vehicle central control system controls the alarm to remind the driver to improve driving safety.

[0118] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0120] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0121] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0122] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A road water detection method based on vision, characterized in that: The following steps are involved: Train a road waterlogging recognition model; The method for training a road waterlogging recognition model comprises the following steps: Collect road surface water image dataset; Preprocessing is performed based on the image dataset; The preprocessed image dataset is input into the BiseNetV2 network for training; The method for preprocessing according to the image data set comprises the following steps: The images are first cropped to a uniform size of 640×480 and converted into 24-bit RGB images; Label the 24-bit RGB image with the labels of background and water. The json files generated after the annotation are batch converted, the background pixels are set to 0, the water pixels are set to 1, and the pixels with the same pixel value are represented as the same type of pixels, and finally a mask label image is generated; Perform data augmentation on the mask label image; Generate a dataset image training set and a validation set from the dataset of mask label images; Preprocessing the road scene images collected by night interval frames to obtain preprocessed images; The pre-processed image is input into the trained road waterlogging recognition model for detection, and the segmentation result map of road waterlogging distribution is output; Perform road segmentation on the preprocessed image and output the road segmentation mask; map the road surface water distribution area in the segmentation result image to the road segmentation mask. If at least one pixel intersects, perform the next step; if not, filter the road scene image of the current frame; Detect the brightness of the waterlogged area in the segmentation result image, and filter the images with brightness higher than the set threshold; detect the brightness around the waterlogged area, and filter the images with brightness lower than the set threshold; perform contour search on the waterlogged distribution in the segmentation result image to obtain the waterlogged distribution contour; perform color filling on the area within the waterlogged distribution contour; map the waterlogged distribution contour after color filling on the initial road scene image; perform coordinate search on the corner points of the rectangular box around the waterlogged distribution contour, and draw the minimum rectangular box of the waterlogged distribution; Map the minimum rectangular box of water accumulation distribution onto the initial road scene image.

2. The method for detecting water accumulation on a road based on vision as claimed in claim 1, characterized in that: The method of inputting the preprocessed image data set into the BiseNetV2 network for training includes the following steps: Focal Loss is used as the loss function for training, where the Focal Loss calculation formula is as follows: In the formula: N is the number of label categories; and γ are constants; y i Indicates the label value; p i Represents the network output prediction value, and i is the label category index.

3. The method for detecting water accumulation on a road based on vision as claimed in claim 1, characterized in that: The method of inputting the preprocessed image data set into the BiseNetV2 network for training includes the following steps: Set the learning rate decay formula l r : The formula: l r represents the decaying learning rate; l ro represents the initial learning rate; S d Indicates the decay rate; N i Represents the number of iterations; R d Represents the attenuation coefficient.

4. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement any one of the vision-based road water detection methods of claims 1 to 3.

5. A vehicle alarm system, characterized in that: The vehicle alarm system comprises an alarm, a vehicle central control system and the electronic device as claimed in claim 4, wherein the alarm is connected to the vehicle central control system, and the vehicle central control system is connected to the electronic device.