A method, device and medium for predicting road waterlogging trend based on machine vision
Machine vision technology is used in road water detection, using video stream data and contour masks for panoramic segmentation, which solves the problem of traditional methods requiring specific equipment or manual deployment, and achieves real-time and accurate water depth monitoring and prediction. , reducing costs and false alarm rates.
Patent Information
- Application Number
- CN202410978543.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Traditional road water detection methods require specific equipment or a large amount of manual deployment, resulting in poor applicability and high maintenance costs, making it difficult to be widely promoted.
A road water accumulation trend prediction method based on machine vision is used to perform panoramic segmentation through real-time video stream data and pre-annotated contour mask data to detect water accumulation depth, and use a pre-generated water depth prediction model to predict water accumulation depth. Achieve real-time monitoring and prediction.
It can accurately identify the depth of water accumulation without additional equipment and markers, reduce detection costs, improve applicability and accuracy, respond to road water accumulation conditions in real time, and reduce the risk of traffic accidents.
Smart Images

Figure CN118505732B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision technology, and in particular to a method, device and medium for predicting road waterlogging trends based on machine vision. Background Art
[0002] In the field of urban safety, road water depth detection and trend prediction can not only effectively prevent traffic accidents and improve traffic flow, but also provide early warning for urban waterlogging, thereby improving urban infrastructure and enhancing emergency response capabilities. Currently, there are two main directions for road water detection algorithms: one is the video-based water depth detection method, which uses video for water depth detection, and the other is the use of specific sensors.
[0003] There are two methods for water depth detection based on video. One is an algorithm based on water accumulation segmentation. It uses a deep learning model to perform pixel-level fine segmentation on road images, which can distinguish the road surface from the water accumulation area. However, although this method can accurately identify the water accumulation area, it has limitations in calculating the water accumulation depth. In order to make up for this deficiency, the existing technology establishes a correlation model between the water accumulation area and the water accumulation depth through specific road modeling, thereby estimating the water accumulation depth. The application scope of the specific road modeling method is limited and it is difficult to promote it widely. Another method is the water accumulation depth detection based on specific markers. It relies on a pre-established specific color band sample library. By training the reference objects in the library, in actual applications, the water accumulation depth is calculated by comparing the exposed part of the reference object captured by the camera with the proportional relationship in the sample library. However, this method requires that there must be a known reference object in the camera's field of view, or the reference object needs to be placed manually. The water accumulation detection method based on special sensors uses specific sensors and relies on the change of sensor signals to detect water accumulation. It requires special configuration of corresponding hardware equipment, and the deployment and maintenance costs are high.
[0004] Therefore, when detecting the depth of water accumulation in traditional methods, either specific equipment needs to be purchased, or a large amount of manual deployment costs are required, resulting in problems such as poor applicability and high deployment and maintenance costs in water accumulation trend prediction methods. Summary of the invention
[0005] One or more embodiments of the present specification provide a method, device and medium for predicting road waterlogging trends based on machine vision, which are used to solve the following technical problems: When detecting the depth of waterlogging in the traditional way, either it is necessary to purchase specific equipment or a large amount of manual deployment costs are required, resulting in poor applicability of the waterlogging trend prediction method and high deployment and maintenance costs.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] One or more embodiments of the present specification provide a method for predicting road waterlogging trends based on machine vision, the method comprising: collecting real-time video stream data corresponding to a target road area, and obtaining pre-annotated contour mask data in the target road area, wherein the annotated contour mask data includes auxiliary contour annotation information; performing panoramic segmentation on a real-time image in the real-time video stream data, and determining current segmentation mask information of the target road area, wherein the current segmentation mask information includes current road waterlogging segmentation mask data and current contour marker mask data; and determining the current road waterlogging segmentation mask data and current contour marker mask data according to the labeled contour mask data. Annotate the contour mask data and the current segmentation mask information, detect the contour occlusion situation, determine the mask data of the intersection between the current waterlogging and the auxiliary contour, and determine the current waterlogging depth data corresponding to the real-time image through the intersection mask data and the annotated contour mask data; based on the current waterlogging depth data corresponding to the real-time image, determine the waterlogging depth change information corresponding to the real-time video stream data, so as to predict the waterlogging in the target road area and generate waterlogging prediction information, wherein the waterlogging prediction information includes waterlogging depth prediction information and waterlogging prediction peak information.
[0008] Furthermore, before obtaining the pre-annotated annotated contour mask data in the target road area, the method also includes: obtaining a pre-trained road panoramic segmentation model, and collecting regional image data of the target road area through a designated acquisition device; performing panoramic segmentation on the target road area according to the regional image data through the road panoramic segmentation model, and determining panoramic segmentation result information of the target road area, wherein the panoramic segmentation result information includes marker semantic information of multiple road markers; among the multiple road markers in the panoramic segmentation result information, determining at least one designated fixed marker that meets preset requirements; extending the contour line scale in the pre-set surveying and mapping template to obtain extended contour lines, determining the intersection of the extended contour lines and the designated fixed markers, so as to perform contour line annotation through the intersection, and determining auxiliary contour line annotation information, wherein the auxiliary contour line annotation information includes contour actual height information; generating annotated contour line mask data through the marker semantic information and the auxiliary contour line annotation information.
[0009] Furthermore, based on the annotated contour mask data and the current segmentation mask information, the contour occlusion situation is judged to determine the mask data of the intersection between the current waterlogging and the auxiliary contour, specifically including: taking the intersection of the current contour marker mask data in the current segmentation mask information and the annotated contour mask data to generate the current visible contour range mask data corresponding to the real-time image; expanding the current road waterlogging segmentation mask data, taking the intersection with the current visible contour range mask data to determine the mask data of the intersection.
[0010] Furthermore, the current water depth data corresponding to the real-time image is determined through the junction mask data and the annotated contour mask data, specifically including: traversing the junction mask data and the annotated contour mask data column by column to determine the current water column mask ratio data corresponding to each current water column in the real-time image; obtaining auxiliary contour line annotation information in the annotated contour line mask data, wherein the auxiliary contour line annotation information includes contour line actual height information; calculating the current column water depth data of each current water column in the real-time image through the current water column mask ratio data and the contour line actual height information; based on the current column water depth data of each current water column, generating the current water depth data corresponding to the real-time image, wherein the current water depth data includes average water depth data and current maximum water depth data.
[0011] Furthermore, the junction mask data and the annotated contour mask data are traversed column by column to determine the current water column mask ratio data corresponding to each current water column in the real-time image, specifically including: synchronously traversing the junction mask data and the annotated contour mask data column by column to determine the pixel value of each column in the junction mask data, and based on the pixel value of each column, determining multiple reference columns, wherein the pixel value of each reference column in the junction mask data has a non-zero pixel position; obtaining the currently visible contour corresponding to the pre-generated real-time image Range mask data, starting from the highest point of the current reference column in the current visible contour range mask data, perform a valid pixel search, determine the first valid pixel found in the current reference column, and determine the current pixel position data; according to the annotated contour mask data, determine the starting pixel position data and the ending pixel position data corresponding to the current reference column in the annotated contour mask data; based on the current pixel position data, the starting pixel position data and the ending pixel position data, determine the current water accumulation column mask proportion data corresponding to the current reference column.
[0012] Further, the current column water depth data of each current water column in the real-time image is calculated by using the mask proportion data of each current water column and the actual height information of the contour line, specifically including: determining the contour bottom height data and the contour top height data in the actual height information of the contour line; when the mask proportion data of the current water column is 0, determining that the current column water depth is not greater than the contour bottom height data; when the mask proportion data of the current water column is 1, determining that the current column water depth is not less than the contour top height data; when the mask proportion data of the current water column is greater than 0 and less than 1, calculating the current column water depth data of the current water column according to the mask proportion data of the current water column and the actual height information of the contour line by a formula; wherein the formula is H y =R pixel *(T top -T bottom )+ T bottom , H y is the water depth data of the current column, R pixel is the current water column mask ratio data, T bottom is the bottom height data of the contour line, T top It is the height data of the top of the contour line.
[0013] Furthermore, waterlogging in the target road area is predicted to generate waterlogging prediction information, specifically including: obtaining waterlogging depth change information corresponding to the real-time video stream data to construct a waterlogging depth detection result sequence based on the waterlogging depth change information, wherein the waterlogging depth detection result sequence includes timestamp information and waterlogging depth data under the corresponding timestamp information; generating waterlogging prediction information according to the waterlogging depth detection result sequence and a pre-generated water depth prediction model, wherein the waterlogging prediction information includes multiple waterlogging depth prediction information and waterlogging prediction peak information, and the waterlogging prediction peak information includes predicted water level peak moment.
[0014] Furthermore, waterlogging prediction information is generated based on the waterlogging depth detection result sequence and a pre-generated water depth prediction model, specifically including: fitting the water depth prediction model based on the waterlogging depth detection result sequence, determining model parameters of the water depth prediction model, so as to generate a fitted water depth prediction model; predicting the change of waterlogging depth through the fitted water depth prediction model, generating multiple waterlogging depth prediction information, so as to generate waterlogging depth prediction trend information based on the multiple waterlogging depth prediction information; taking a first-order derivative of the fitted water depth prediction model, determining the first-order derivative of the fitted water depth prediction model, so as to determine the predicted water level peak moment through the first-order derivative; and determining the predicted water level peak data corresponding to the predicted water level peak moment based on the fitted water depth prediction model and the predicted water level peak moment.
[0015] One or more embodiments of this specification provide a device for predicting road waterlogging trends based on machine vision, including:
[0016] at least one processor; and,
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.
[0019] One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above method.
[0020] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: through the above-mentioned technical solution, by performing panoramic segmentation on the real-time image in the real-time video stream data, combined with the pre-annotated contour mask data, the waterlogged area and contour markers in the target road area can be accurately identified, and the junction between the current waterlogging and the auxiliary contour lines can be accurately determined, and then the current waterlogging depth data corresponding to the real-time image can be calculated; the processing of real-time video stream data makes the acquisition of waterlogging depth data real-time, allowing the system to respond quickly to road waterlogging conditions; based on the real-time acquired waterlogging depth data, waterlogging depth change information can be constructed, and this information can be used to predict waterlogging; using existing urban surveillance cameras and other monitoring equipment, after a manual contour line annotation, the waterlogging depth information in the picture collected by the current equipment can be calculated, without the need to deploy additional equipment or certain specific markers, thereby improving the applicability of waterlogging depth detection scenarios; through the annotation of auxiliary contour lines, a reference is provided for waterlogging, thereby improving the accuracy of waterlogging depth detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0022] Figure 1 A flowchart of a method for predicting road waterlogging trends based on machine vision provided in an embodiment of this specification;
[0023] Figure 2 An example diagram of panoramic segmentation of a target road area provided in an embodiment of this specification;
[0024] Figure 3 A schematic diagram of a surveying and mapping template provided in an embodiment of this specification;
[0025] Figure 4 A schematic diagram of a panoramic segmentation result of a target road area under road flooding provided in an embodiment of this specification;
[0026] Figure 5 An example diagram of contour occlusion of a target road area under road flooding provided in an embodiment of this specification;
[0027] Figure 6 A schematic diagram of a fitting curve provided in an embodiment of this specification;
[0028] Figure 7 A schematic diagram of the structure of a road waterlogging trend prediction device based on machine vision provided in an embodiment of this specification. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0030] In the field of urban safety, road water depth detection and trend prediction can not only effectively prevent traffic accidents and improve traffic flow, but also provide early warning for urban waterlogging, thereby improving urban infrastructure and enhancing emergency response capabilities. Currently, there are two main directions for road water detection algorithms: one is the video-based water depth detection method, which uses video for water depth detection, and the other is the use of specific sensors.
[0031] There are two methods for water depth detection based on video. One is an algorithm based on water accumulation segmentation. It uses a deep learning model to perform pixel-level fine segmentation on road images, which can distinguish the road surface from the water accumulation area. However, although this method can accurately identify the water accumulation area, it has limitations in calculating the water accumulation depth. In order to make up for this deficiency, the existing technology establishes a correlation model between the water accumulation area and the water accumulation depth through specific road modeling, thereby estimating the water accumulation depth. The application scope of the specific road modeling method is limited and it is difficult to promote it widely. Another method is the water accumulation depth detection based on specific markers. It relies on a pre-established specific color band sample library. By training the reference objects in the library, in actual applications, the water accumulation depth is calculated by comparing the exposed part of the reference object captured by the camera with the proportional relationship in the sample library. However, this method requires that there must be a known reference object in the camera's field of view, or the reference object needs to be placed manually. The water accumulation detection method based on special sensors uses specific sensors and relies on the change of sensor signals to detect water accumulation. It requires special configuration of corresponding hardware equipment, and the deployment and maintenance costs are high.
[0032] Therefore, when detecting the depth of water accumulation in traditional methods, either specific equipment needs to be purchased, or a large amount of manual deployment costs are required, resulting in problems such as poor applicability and high deployment and maintenance costs in water accumulation trend prediction methods.
[0033] The embodiment of this specification provides a method for predicting road waterlogging trends based on machine vision. It should be noted that the execution subject in the embodiment of this specification can be a server or any device with data processing capabilities. Figure 1 A flowchart of a method for predicting road waterlogging trends based on machine vision is provided in an embodiment of this specification, such as Figure 1 As shown, it mainly includes the following steps:
[0034] Step S101 : collecting real-time video stream data corresponding to the target road area, and obtaining the pre-annotated contour mask data in the target road area.
[0035] Wherein, the annotated contour mask data includes auxiliary contour annotation information;
[0036] Before obtaining the pre-annotated annotated contour mask data in the target road area, the method also includes: obtaining a pre-trained road panoramic segmentation model, and collecting regional image data of the target road area through a designated acquisition device; performing panoramic segmentation on the target road area according to the regional image data through the road panoramic segmentation model, and determining panoramic segmentation result information of the target road area, wherein the panoramic segmentation result information includes marker semantic information of multiple road markers; among the multiple road markers in the panoramic segmentation result information, determining at least one designated fixed marker that meets preset requirements, extending the contour scale in the pre-set surveying and mapping template to obtain extended contour lines, determining the intersection of the extended contour lines and the designated fixed marker, so as to perform contour annotation through the intersection, and determining auxiliary contour annotation information, wherein the auxiliary contour annotation information includes actual contour height information; generating annotated contour mask data through the marker semantic information and the auxiliary contour annotation information.
[0037] In one embodiment of the present specification, an existing video acquisition device, such as a city surveillance camera, is used to collect real-time video stream data corresponding to a target road area. Auxiliary contour lines are marked in advance within the target road area prone to waterlogging based on the camera shooting content. For a fixed video acquisition device, it only needs to be set up once.
[0038] First, a road panorama segmentation model is trained, and the regional image data of the target road area is collected through a designated acquisition device. Contour lines are marked based on the captured image and the panorama segmentation results to obtain the captured image, i.e., the regional image data. Figure 2 This is an example of a panoramic segmentation diagram of a target road area provided in an embodiment of this specification. After performing panoramic segmentation on the image data, the following can be obtained: Figure 2 The segmentation results shown include semantic information of multiple road signs, such as walls, traffic lights, and other road signs and their corresponding semantic information. For scenes such as bridges, tunnels, and narrow alleys, walls are good fixed signs. Therefore, walls can be used as designated fixed signs in this target road area example. Figure 2 The segmentation result is marked within the range of the landmark wall. The contour line can be set to 0~160cm. 0~160cm is the actual height information of the contour line. You can use T bottom =0, T top=160 indicates the actual height information of the contour line. In the process of setting auxiliary contour lines, a customized surveying and mapping template is used in conjunction with the observation image information of the background video surveillance. When placing the surveying and mapping template of the contour line, it should be placed at the lowest point in the target area perpendicular to it, and the contour line scale should be visible in the camera's line of sight, and it should be ensured that the visual extension of the drawing line intersects with the selected fixed markers on the roadside. Figure 3 A schematic diagram of a surveying and mapping template provided in an embodiment of this specification, such as Figure 3 As shown, in the customized surveying and mapping template, the surveying and mapping template can be 0~200cm, with a contour scale every 10cm. Extend the contour scale, and determine the contour position by the intersection of the extended contour and the fixed reference object on the roadside. For example, extend the scale line of 0cm in the contour scale to obtain the contour line 0cm extension line, and use the intersection of the contour line 0cm extension line and the fixed reference object on the roadside as the starting point of the contour line, that is, the lowest point. Depending on the different fixed markers selected in the actual application scenario, you can use Figure 3 (a) and Figure 3 (b) The two methods of flexibly setting contour lines greatly improve the marking efficiency and reliability.
[0039] For some complex scenes, it may be necessary to mark multiple contour lines of different height ranges. Repeat the above operation to mark multiple contour lines of different height ranges, and then perform each independent contour line in turn. The specific operation is the same as that of one contour line. The location of the landmark and its corresponding semantic information are obtained according to the marked contour line information, and the marked contour mask M is generated according to the marking. mark Specifically, according to Figure 2 The semantic information in and the annotated contour information can be used to obtain the contour mask M with the semantic meaning of "wall". mark .
[0040] In one embodiment of the present specification, real-time video stream data corresponding to the target road area is collected by an existing video acquisition device, where the real-time video stream data includes multiple real-time images, and the labeled contour mask data pre-labeled for the video acquisition device is obtained, where the labeled contour mask data includes auxiliary contour labeling information.
[0041] Step S102, performing panoramic segmentation on the real-time image in the real-time video stream data to determine current segmentation mask information of the target road area.
[0042] In one embodiment of the present specification, a real-time image in a real-time video stream is panorama segmented according to a pre-built deep road panorama segmentation model to obtain current segmentation mask information of a target road area, including current road water accumulation segmentation mask data and current contour marker mask data. Figure 4A schematic diagram of a panoramic segmentation result of a target road area under road flooding provided in an embodiment of this specification, such as Figure 4 As shown in the figure, the segmentation result includes the current road water accumulation mask, vehicle and person non-mask, contour marker mask, etc. If there is no water accumulation on the current road, the water accumulation depth 0 is directly returned.
[0043] Through the above technical solutions, the panoramic segmentation model can quickly and accurately extract the target road area from the real-time video stream, and distinguish different elements such as road waterlogging, pedestrians and non-motorized vehicles (pedestrians and non-motorized vehicles), contour markers, etc. The efficient detection method can quickly determine whether the current road is flooded and take corresponding measures accordingly; by detecting the road waterlogging situation in real time, it can timely warn and guide pedestrians and vehicles to avoid the waterlogged area, reduce traffic accidents and personal injuries caused by waterlogging, and improve the safety of road use; compared with relying only on a single sensor or simple image recognition technology, the panoramic segmentation model can more accurately identify and distinguish different elements, thereby reducing the false alarm rate and improving the accuracy of waterlogging detection; this method is based on deep learning technology, has the characteristics of automation and intelligence, can automatically learn features from a large amount of image data, continuously optimize the segmentation effect, and adapt to the needs of waterlogging detection in different environments and scenarios. For the current situation where there is no waterlogging on the road, the detection result of the waterlogging depth of 0 is directly returned, which simplifies the processing flow and improves the adaptability and robustness of the system.
[0044] Step S103, based on the annotated contour mask data and the current segmentation mask information, the contour occlusion situation is detected to determine the mask data at the junction between the current waterlogging and the auxiliary contour lines, so as to determine the current waterlogging depth data corresponding to the real-time image through the mask data at the junction and the annotated contour mask data.
[0045] According to the annotated contour mask data and the current segmentation mask information, the contour occlusion situation is judged to determine the mask data of the intersection between the current waterlogging and the auxiliary contour, specifically including: taking the intersection of the current contour marker mask data in the current segmentation mask information and the annotated contour mask data to generate the current visible contour range mask data corresponding to the real-time image; expanding the current road waterlogging segmentation mask data, taking the intersection with the current visible contour range mask data to determine the mask data of the intersection.
[0046] In one embodiment of this specification, Figure 5 This is an example diagram of contour occlusion of a target road area under road flooding provided in an embodiment of this specification, such as Figure 5 As shown, the contour marker mask and the annotated contour mask data M obtained according to the above steps mark Take the intersection and get the contour range M visible on the current screen mark_visible, that is, the mask data of the currently visible contour range. After the current road water segmentation mask data is expanded with a 5*5 kernel, the intersection is taken with the contour range visible in the current screen (the mask data of the currently visible contour range) to obtain the intersection mask M of the contour range affected by the spread of water. submerged_border , that is, the mask data at the junction.
[0047] The current water depth data corresponding to the real-time image is determined through the junction mask data and the annotated contour mask data, specifically including: traversing the junction mask data and the annotated contour mask data column by column to determine the current water column mask ratio data corresponding to each current water column in the real-time image; obtaining the auxiliary contour line annotation information in the annotated contour line mask data, wherein the auxiliary contour line annotation information includes the actual height information of the contour line; calculating the current column water depth data of each current water column in the real-time image through the mask ratio data of each current water column and the actual height information of the contour line; based on the current column water depth data of each current water column, generating the current water depth data corresponding to the real-time image, wherein the current water depth data includes the average water depth data and the current maximum water depth data.
[0048] In one embodiment of the present specification, the mask data of the junction and the mask data of the marked contour lines are traversed synchronously column by column, the proportion of the water accumulation in the marked contour line mask is calculated, and the mask proportion data of the current water accumulation column corresponding to each current water accumulation column in the real-time image is obtained. The contour height information of the auxiliary contour line annotation is obtained in the auxiliary contour line annotation information, and the depth of the water accumulation in the current column is calculated according to the contour height information. According to the current column water accumulation depth data of each current water accumulation column, the water accumulation depth of the entire image is counted, and the average depth of the water accumulation and the maximum depth of the water accumulation in the current image are calculated.
[0049] The mask data of the junction and the mask data of the marked contour lines are traversed column by column to determine the mask proportion data of the current waterlogged column corresponding to each current waterlogged column in the real-time image, specifically including: synchronously traversing the mask data of the junction and the mask data of the marked contour lines column by column to determine the pixel value of each column in the mask data of the junction, and determining a plurality of reference columns based on the pixel value of each column, wherein the pixel value of each reference column in the mask data of the junction has a non-zero pixel position; obtaining the currently visible contour line range corresponding to the pre-generated real-time image Mask data, starting from the highest point of the current reference column in the mask data of the current visible contour range, perform a search for valid pixel points, determine the first valid pixel found in the current reference column, and determine the current pixel position data; according to the annotated contour mask data, determine the starting pixel position data and the ending pixel position data corresponding to the current reference column in the annotated contour mask data; based on the current pixel position data, the starting pixel position data and the ending pixel position data, determine the current water accumulation column mask proportion data corresponding to the current reference column.
[0050] In one embodiment of the present specification, the intersection mask data and the marked contour mask data are traversed column by column synchronously to calculate the proportion of the accumulated water to the marked contour mask. If the current column M submerged_border If all pixels in are 0, it means that there is no directly observable situation in the current column where the contour markers are directly blocked by the rising water, and the column is not included in the calculation result; if the current column M submerged_border If there are valid pixels in the current visible contour range mask data M mark_visible Starting from the highest point of the current column, search to the first M submerged_border The valid pixels of the current column in the image are recorded, and the position of the current pixel (P x , P y ); According to the marked contour mask data, determine the bottom height data T of the contour line in the marked contour mask data bottom and the contour top height data T top According to the current pixel position (P x , P y ), contour bottom height data T bottom and the contour top height data T top , determine the starting pixel position (P top , P y ) and the ending pixel position (P bottom , P y ). Through the current column M mark The starting pixel position (P top ,P y ) and the ending pixel position (P bottom , Py ), the proportion of the current column water accumulation to the contour mask is: R pixel =( P x -P bottom ) / ( P top -P bottom ).
[0051] The current column water depth data of each current water column in the real-time image is calculated by using the mask proportion data of each current water column and the actual height information of the contour line, specifically including: determining the contour bottom height data and the contour top height data in the actual height information of the contour line; when the mask proportion data of the current water column is 0, determining that the current column water depth is not greater than the contour bottom height data; when the mask proportion data of the current water column is 1, determining that the current column water depth is not less than the contour top height data; when the mask proportion data of the current water column is greater than 0 and less than 1, calculating the current column water depth data of the current water column according to the mask proportion data of the current water column and the actual height information of the contour line through a formula; wherein the formula is H y =R pixel *(T top -T bottom )+ T bottom , H y is the water depth data of the current column, R pixel is the current water column mask ratio data, T bottom is the bottom height data of the contour line, T top It is the height data of the top of the contour line.
[0052] In one embodiment of the present specification, when calculating the current column water depth data of each current column water in the real-time image, the current column water depth data is first determined based on the current column water depth data. pixel When it is 0, it means P x Equal to P bottom , M submerged_border If the first valid pixel point in the current column is the marked position at the bottom of the contour line, it means that the water depth in the current column is not greater than the height data of the bottom of the contour line, that is, the output H y ≤T bottom . In the current water column mask proportion data R pixel When it is 1, it means P x Equal to P top , that is to say, the water depth of the current water column, that is, the water depth of the current column is not less than the top height data of the contour line, output H y ≥T top . In the current water column mask proportion data R pixelWhen it is greater than 0 and less than 1, it means that the water depth of the current water column is between the height data of the bottom of the contour line and the height data of the top of the contour line. In this case, according to the formula H y =R pixel *(T top -T bottom )+ T bottom Calculate the water depth corresponding to the current water column, where T bottom is the bottom height data of the contour line, T top It is the height data of the top of the contour line.
[0053] In one embodiment of the present specification, the depth of water accumulation in the entire image is counted, and the average depth of water accumulation and the maximum depth of water accumulation in the current image are calculated. For each independent contour mask, the depth of water accumulation in each column can be calculated according to the above method, and the average of the depth of water accumulation in each column of multiple columns can be obtained to obtain the water depth value H obtained based on this independent contour. mean_depth If there are multiple annotated contour lines, the water depths of different contour lines are summarized, giving priority to the results that can give accurate values, and then according to H y ≤T bottom and H y ≥T top It should be noted that the result that can give an accurate value here refers to H y For specific data, suppose two contour lines are set, namely contour line A and contour line B. Assuming the water depth is 6 cm, the height of contour line A is 0-5 cm, and the height of contour line B is 0-10 cm, then the result H obtained by contour line A is y ≥T top That is, it is greater than or equal to 5, and the result obtained by contour line B is a specific value of 6 cm. Therefore, select the result obtained by contour line B and use the H in contour line A. y ≥T top Verify that 6 cm is greater than 5 cm. Similarly, when calculating the maximum value, the maximum value of the water depth in all columns is calculated based on each independent contour mask, and the maximum water depth H of the current picture based on this independent contour can be obtained. max_depth .
[0054] Through the above technical scheme, after manual contour marking using existing urban surveillance cameras and other monitoring equipment, the water depth information in the picture collected by the current equipment can be calculated, without the need to deploy additional equipment or certain specific markers, thereby improving the applicability of water depth detection scenarios; by ancillary contour marking, a reference is provided for water accumulation, thereby improving the accuracy of water depth detection; in addition, the process of deploying equipment is reduced, thereby reducing the cost of water accumulation detection; by utilizing contour mask data and segmentation mask information, the junction between water accumulation and contour lines can be more accurately detected, thereby obtaining more accurate water depth data, which has higher accuracy and reliability than traditional manual observation or simple sensor measurement; based on real-time image processing and analysis, the method can obtain water depth data in real time and dynamically update it as the water situation changes; by utilizing mask technology and image processing methods, a large amount of image data can be quickly processed to extract useful water depth information.
[0055] Step S104, based on the current water depth data corresponding to the real-time image, determine the water depth change information corresponding to the real-time video stream data to predict the water accumulation in the target road area and generate water accumulation prediction information.
[0056] The waterlogging prediction information includes waterlogging depth prediction information and waterlogging prediction peak value information.
[0057] Predicting waterlogging in the target road area and generating waterlogging prediction information specifically includes: obtaining waterlogging depth change information corresponding to the real-time video stream data to construct a waterlogging depth detection result sequence based on the waterlogging depth change information, wherein the waterlogging depth detection result sequence includes timestamp information and waterlogging depth data under the corresponding timestamp information; generating waterlogging prediction information according to the waterlogging depth detection result sequence and a pre-generated water depth prediction model, wherein the waterlogging prediction information includes multiple waterlogging depth prediction information and waterlogging prediction peak information, and the waterlogging prediction peak information includes predicted water level peak moment.
[0058] In one embodiment of the present specification, water depth detection is performed on real-time images in a real-time video stream to obtain water depth data corresponding to each real-time image. Since the water depth changes over time, the real-time video stream data corresponds to water depth change information. A water depth result sequence is generated using the water depth data corresponding to each real-time image and the moment corresponding to the real-time image. The water depth result sequence includes the timestamp corresponding to the real-time image and the water depth data detected by the real-time image. It should be noted that the water depth data here can be average water depth data or maximum water depth data. The water depth detection result sequence and a pre-generated water depth prediction model are used to generate water prediction information.
[0059] Generate waterlogging prediction information based on the waterlogging depth detection result sequence and a pre-generated water depth prediction model, specifically including: fitting the water depth prediction model based on the waterlogging depth detection result sequence, determining the model parameters of the water depth prediction model, so as to generate a fitted water depth prediction model; predicting the change of waterlogging depth through the fitted water depth prediction model, generating multiple waterlogging depth prediction information, and generating waterlogging depth prediction trend information based on the multiple waterlogging depth prediction information; taking a first-order derivative of the fitted water depth prediction model, determining the first-order derivative of the fitted water depth prediction model, and determining the predicted water level peak moment through the first-order derivative; and determining the predicted water level peak data corresponding to the predicted water level peak moment based on the fitted water depth prediction model and the predicted water level peak moment.
[0060] In one embodiment of the present specification, a water depth prediction model is designed according to the water level growth dynamics: bathymetry (t)=a*t*t + b*t + c, where t is the time axis, f bathymetry (t) represents the water depth at time t. It should be noted that the expression of the water depth prediction model here is based on the historical water depth change data. The water depth change trend of the current point is calculated based on the real-time input video stream data, and the water depth prediction model is fitted:
[0061] self.poly_features=PolynomialFeatures(degree=2, include_bias=False)
[0062] self.model=make_pipeline(self.poly_features, LinearRegression())
[0063] Determine the sequence of water depth detection results within a certain time period before the current moment. For example, the time period here can be the sequence of water depth detection results obtained within 3 minutes before the current moment [t,H mean_deptht ], where the water depth is the average water depth data. This water depth detection result sequence is input into the water depth prediction model to obtain f bathymetry (t) The specific parameters of the expression, that is, the specific values of a, b, and c, Figure 6 This is a schematic diagram of a fitting curve provided in the embodiment of this specification. According to the water depth prediction model f bathymetry(t) Predict the water depth change in the future, input the time data of the future moment, and obtain the corresponding water depth prediction value at the future time point. By inputting multiple future time data into the fitting water depth prediction model, multiple water depth prediction information is generated, and the water depth prediction trend information is generated through multiple water depth prediction information. According to f bathymetry (t) The first derivative of the expression f bathymetry '(t) Predict when the water level depth reaches its peak, e.g. Figure 6 As shown in the figure, the position of the five-pointed star is the predicted peak time and peak value. At this time, let f bathymetry '(t)=2a*t+b=0, we get t=-b / 2a, which is the time when the water level reaches its peak. We predict the peak water level time and input this peak water level time into the fitted water depth prediction model to get the peak value f bathymetry (-b / 2a).
[0064] When determining the maximum depth prediction model, the water depth detection result sequence [t, H mean_deptht ], replaced by the water depth detection result sequence corresponding to the maximum depth [t, H max_deptht ] to calculate the prediction model of the maximum depth. Water depth prediction information can provide early warning to relevant departments and help formulate countermeasures before the waterlogging problem becomes serious; accurate waterlogging prediction can more effectively allocate and dispatch resources; and by continuously collecting comparative feedback between actual data and prediction results, the water depth prediction model can be continuously optimized and improved to improve prediction accuracy and robustness.
[0065] Through the above technical scheme, by performing panoramic segmentation on the real-time image in the real-time video stream data and combining it with the pre-annotated contour mask data, the waterlogged area and contour markers in the target road area can be accurately identified, and the junction between the current waterlogging and the auxiliary contour lines can be accurately determined, and then the current waterlogging depth data corresponding to the real-time image can be calculated; the processing of real-time video stream data makes the acquisition of waterlogging depth data real-time, allowing the system to respond quickly to road waterlogging conditions; based on the real-time acquired waterlogging depth data, waterlogging depth change information can be constructed, and this information can be used to predict waterlogging; using existing urban surveillance cameras and other monitoring equipment, after a manual contour line annotation, the waterlogging depth information in the picture collected by the current equipment can be calculated, without the need to deploy additional equipment or certain specific markers, thereby improving the applicability of waterlogging depth detection scenarios; through the annotation of auxiliary contour lines, a reference is provided for waterlogging, thereby improving the accuracy of waterlogging depth detection.
[0066] The embodiment of this specification also provides a device for predicting road waterlogging trend based on machine vision, such as Figure 7As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0067] The embodiments of the present specification also provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above method.
[0068] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0069] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0070] The devices and media provided in the embodiments of this specification correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0071] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification 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, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0072] This specification 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 this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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 provides the functions specified in a block or multiple blocks.
[0073] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.
[0074] 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.
[0075] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0076] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0077] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0078] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0079] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for predicting road waterlogging trend based on machine vision. It is characterized in that The method comprises: Collecting real-time video stream data corresponding to the target road area, and obtaining the pre-annotated contour mask data in the target road area, wherein the annotated contour mask data includes auxiliary contour annotation information, and the auxiliary contour annotation information includes contour actual height information; Performing panoramic segmentation on the real-time image in the real-time video stream data to determine current segmentation mask information of the target road area, wherein the current segmentation mask information includes current road water accumulation segmentation mask data and current contour marker mask data; According to the annotated contour mask data and the current segmentation mask information, the contour occlusion situation is detected to determine the mask data of the junction between the current waterlogging and the auxiliary contour, so as to determine the current waterlogging depth data corresponding to the real-time image through the mask data of the junction and the annotated contour mask data; Based on the current water depth data corresponding to the real-time image, determine the water depth change information corresponding to the real-time video stream data to predict the water accumulation in the target road area and generate water accumulation prediction information, wherein the water accumulation prediction information includes water accumulation depth prediction information and water accumulation prediction peak information; According to the annotated contour mask data and the current segmentation mask information, the contour masking situation is judged to determine the mask data of the junction between the current waterlogging and the auxiliary contour, specifically including: Taking the intersection of the current contour marker mask data and the annotated contour mask data in the current segmentation mask information to generate the current visible contour range mask data corresponding to the real-time image; The current road water segmentation mask data is expanded, and an intersection is taken with the current visible contour range mask data to determine the junction mask data.
2. According to the method for predicting road waterlogging trend based on machine vision in claim 1, It is characterized in that Before obtaining the pre-annotated contour mask data in the target road area, the method further includes: Acquire a pre-trained road panorama segmentation model, and collect regional image data of the target road area through a designated collection device; Performing panoramic segmentation on the target road area according to the regional image data through the road panoramic segmentation model to determine panoramic segmentation result information of the target road area, wherein the panoramic segmentation result information includes landmark semantic information of a plurality of road landmarks; Determining at least one designated fixed marker that meets preset requirements among the multiple road markers in the panoramic segmentation result information; Extending the contour line ruler in the preset surveying and mapping template to obtain extended contour lines, determining the intersection of the extended contour lines and the designated fixed markers, marking the contour lines through the intersection points, and determining auxiliary contour line marking information; The labeled contour line mask data is generated through the landmark semantic information and the auxiliary contour line labeling information.
3. According to the method for predicting road waterlogging trend based on machine vision in claim 1, It is characterized in that Determining the current water depth data corresponding to the real-time image by using the interface mask data and the annotated contour mask data specifically includes: Traversing the junction mask data and the marked contour mask data column by column, and determining the current waterlogging column mask proportion data corresponding to each current waterlogging column in the real-time image; Acquire auxiliary contour line annotation information in the annotated contour line mask data, wherein the auxiliary contour line annotation information includes contour line actual height information; Calculating the current column water depth data of each current water column in the real-time image through the mask proportion data of each current water column and the actual height information of the contour line; Based on the current column water depth data of each current water column, current water depth data corresponding to the real-time image is generated, wherein the current water depth data includes average water depth data and current maximum water depth data.
4. According to the method for predicting road waterlogging trend based on machine vision in claim 3, It is characterized in that Traversing the boundary mask data and the marked contour mask data column by column to determine the current waterlogging column mask proportion data corresponding to each current waterlogging column in the real-time image, specifically includes: Synchronously traversing the junction mask data and the annotated contour mask data column by column, determining the pixel value of each column in the junction mask data, and determining a plurality of reference columns based on the pixel value of each column, wherein the pixel value of each reference column in the junction mask data has a non-zero pixel position; Obtaining the currently visible contour line range mask data corresponding to the real-time image generated in advance, starting from the highest point of the current reference column in the currently visible contour line range mask data, searching for valid pixels, determining the first valid pixel found in the current reference column, and determining the current pixel position data; Determining, according to the labeled contour mask data, the starting pixel position data and the ending pixel position data corresponding to the current reference column in the labeled contour mask data; Based on the current pixel position data, the starting pixel position data and the ending pixel position data, current water accumulation column mask proportion data corresponding to the current reference column is determined.
5. According to the method for predicting road waterlogging trend based on machine vision in claim 3, It is characterized in that Calculating the current column water depth data of each current water column in the real-time image by using the mask proportion data of each current water column and the actual height information of the contour line, specifically includes: Determine the contour line bottom height data and the contour line top height data in the contour line actual height information; When the mask proportion data of the current waterlogging column is 0, it is determined that the waterlogging depth of the current column is not greater than the bottom height data of the contour line; When the mask proportion data of the current waterlogging column is 1, it is determined that the waterlogging depth of the current column is not less than the top height data of the contour line; When the mask proportion data of the current waterlogging column is greater than 0 and less than 1, the current column waterlogging depth data of the current waterlogging column is calculated according to the mask proportion data of the current waterlogging column and the actual height information of the contour line by using a formula; Wherein, the formula is H y =R pixel *(T top -T bottom )+ T bottom , H y is the water depth data of the current column, R pixel is the current water column mask ratio data, T bottom is the bottom height data of the contour line, T top It is the height data of the top of the contour line.
6. The method for predicting road waterlogging trend based on machine vision according to claim 1, It is characterized in that Predicting the waterlogging in the target road area and generating waterlogging prediction information specifically includes: Acquire water depth change information corresponding to the real-time video stream data, so as to construct a water depth detection result sequence based on the water depth change information, wherein the water depth detection result sequence includes timestamp information and water depth data corresponding to the timestamp information; The waterlogging prediction information is generated according to the waterlogging depth detection result sequence and a pre-generated water depth prediction model, wherein the waterlogging prediction information includes a plurality of waterlogging depth prediction information and waterlogging prediction peak information, and the waterlogging prediction peak information includes a predicted water level peak moment.
7. The method for predicting road waterlogging trend based on machine vision according to claim 6, It is characterized in that Generate waterlogging prediction information according to the waterlogging depth detection result sequence and the pre-generated water depth prediction model, specifically including: According to the sequence of water accumulation depth detection results, the water depth prediction model is fitted to determine the model parameters of the water depth prediction model to generate a fitted water depth prediction model; Predicting the change of waterlogging depth by using the fitted water depth prediction model to generate a plurality of waterlogging depth prediction information, and generating waterlogging depth prediction trend information based on the plurality of waterlogging depth prediction information; Taking a first-order derivative of the fitted water depth prediction model to determine a first-order derivative of the fitted water depth prediction model, so as to determine a predicted water level peak moment through the first-order derivative; According to the fitted water depth prediction model and the predicted water level peak moment, the predicted water level peak data corresponding to the predicted water level peak moment is determined.
8. A device for predicting road waterlogging trends based on machine vision. It is characterized in that The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.
9. A non-volatile computer storage medium storing computer executable instructions, It is characterized in that The computer executable instructions are configured to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method, device, server, terminal, and system for water depth information acquisition
CN104426943A
Road water-logging area identification method based on three-dimensional line laser technology
CN107092803A
Road accumulated water depth detection method and electronic equipment
CN110411366A
Prediction method for long-wall fully mechanized coal mining face goaf ponding area
CN111237015A
Method, system and device for processing waterlogging prevention monitoring information and electronic equipment
CN114092295A
