Road congestion detection method, device, electronic device and storage medium

By conducting vehicle detection and segmentation of road monitoring video streams, integrating vehicle detection frames and road segmentation areas, the problems of high error detection rate and low accuracy in the prior art are solved, and more efficient road congestion detection is achieved.

CN114445786BActive Publication Date: 2025-09-02SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111656928.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-09-02
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

The existing road congestion detection methods have high error detection rate and low accuracy, especially in the case of occlusion, and are difficult to accurately judge the congestion state, and the cost is high, making it difficult to meet the actual application needs.

Method used

By conducting vehicle detection and road segmentation on the road monitoring video stream, count the number of vehicle detection boxes, determine whether it is less than the preset number, if otherwise, the vehicle detection box and road segmentation area will be fused, congestion conditions will be analyzed, and the fusion and detection box merging technology of the area of ​​interest will be used to improve detection accuracy.

Benefits of technology

It reduces the false detection rate of road congestion, improves the accuracy of road congestion judgment, and ensures the accuracy of congestion state and detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445786B_ABST
    Figure CN114445786B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a road congestion detection method, device, electronic device and storage medium, the method comprising: performing vehicle detection on a road monitoring video stream to obtain multiple vehicle detection frames; counting the number of vehicle detection frames based on the multiple vehicle detection frames; performing road segmentation on the road monitoring video stream to obtain multiple road segmentation areas; determining whether the number of vehicle detection frames is less than a first preset number of vehicles; if so, determining that the road is in a non-congested state; if not, analyzing the congestion situation of the road based on the multiple vehicle detection frames and the multiple road segmentation areas. In this way, by fusing the road segmentation areas with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of road congestion detection, and in particular to a road congestion detection method, device, electronic device and storage medium. Background Art

[0002] With the continuous increase in the number of vehicles in cities, road traffic is becoming increasingly overwhelmed. During peak traffic hours, traffic police have to direct traffic at various intersections to alleviate the increasingly congested traffic problem. This is time-consuming, labor-intensive, and inefficient. Currently, most methods use surveillance cameras to obtain video stream data, perform multi-target detection and multi-target tracking algorithms, and calculate traffic flow to determine congestion status. Existing detection methods often consider all detected targets to be counted, resulting in a high error rate and difficulty meeting scenario requirements. When determining congestion through target detection and statistics, detected targets are merged, but it is impossible to fully determine whether these detected targets are within the scene, resulting in a high number of false positives in the output results. Existing algorithms also suffer from high costs and low efficiency. They can lose track in the presence of occlusion, resulting in a high number of false positives and low accuracy, making practical application more difficult. Summary of the Invention

[0003] The embodiments of the present application provide a road congestion detection method, device, electronic device and storage medium, which can reduce the false detection rate of road congestion and improve the accuracy of road congestion judgment.

[0004] A first aspect of an embodiment of the present application provides a road congestion detection method, the method comprising:

[0005] Performing vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and counting the number of vehicle detection frames based on the plurality of vehicle detection frames;

[0006] Performing road segmentation on the road monitoring video stream to obtain a plurality of road segmentation areas;

[0007] Determining whether the number of vehicle detection frames is less than a first preset number of vehicles;

[0008] If yes, it is determined that the road is in a non-congested state;

[0009] If not, the congestion condition of the road is analyzed according to the multiple vehicle detection frames and the multiple road segmentation areas.

[0010] A second aspect of an embodiment of the present application provides a road congestion detection device, the device comprising:

[0011] a detection unit, configured to perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and to count the number of vehicle detection frames based on the plurality of vehicle detection frames;

[0012] a segmentation unit, configured to segment the road monitoring video stream into multiple road segmentation areas;

[0013] a judging unit, configured to judge whether the number of the vehicle detection frames is less than a first preset number of vehicles; and if so, to judge that the road is in a non-congested state;

[0014] An analyzing unit is configured to analyze the congestion condition of the road according to the multiple vehicle detection frames and the multiple road segmentation areas if the number of the vehicle detection frames is not less than a first preset number of vehicles.

[0015] A third aspect of the present application provides an electronic device comprising: a processor and a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for some or all of the steps described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program enables a computer to execute instructions of some or all of the steps described in the first aspect of the embodiment of the present application.

[0017] In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.

[0018] The implementation of the embodiments of the present application has the following beneficial effects:

[0019] It can be seen that through the road congestion detection method, device, electronic device and storage medium described in the embodiments of the present application, vehicle detection is performed on the road monitoring video stream to obtain multiple vehicle detection frames; the number of vehicle detection frames is counted based on the multiple vehicle detection frames; the road monitoring video stream is segmented to obtain multiple road segmentation areas; it is determined whether the number of vehicle detection frames is less than the first preset number of vehicles; if so, it is determined that the road is in a non-congested state; if not, the congestion situation of the road is analyzed based on the multiple vehicle detection frames and the multiple road segmentation areas. In this way, by fusing the road segmentation areas with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 This is a schematic diagram of an embodiment of a road congestion detection method provided in an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of determining the distance between a first ROI fusion detection frame and a second ROI fusion detection frame provided in an embodiment of the present application;

[0023] Figure 3 This is another schematic diagram of determining the distance between the first ROI fusion detection frame and the second ROI fusion detection frame provided in an embodiment of the present application;

[0024] Figure 4 This is a flow chart of another method for detecting road congestion provided in an embodiment of the present application;

[0025] Figure 5 This is a flow chart of another method for detecting road congestion provided in an embodiment of the present application;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 7 This is a schematic diagram of the structure of an embodiment of a road congestion detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0029] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0030] Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] See also Figure 1 , is a flow chart of an embodiment of a road congestion detection method provided in an embodiment of the present application. The road congestion detection method described in this embodiment includes the following steps:

[0032] 101. Perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and count the number of vehicle detection frames based on the plurality of vehicle detection frames.

[0033] Among them, the road monitoring video collected by the surveillance camera can be obtained, and each video image in the road monitoring video stream can be input into the preset target detection model to output the vehicle detection frame. The video image is used to detect vehicles through the target detection model to obtain multiple vehicle detection frames. The multiple vehicle detection frames can also be counted to obtain the number of vehicle detection frames.

[0034] 102. Perform road segmentation on the road monitoring video stream to obtain multiple road segmentation areas.

[0035] In an embodiment of the present application, the road monitoring video stream can be segmented, and partition processing can be performed on each road segmentation area. Specifically, each video image in the road monitoring video stream can be input into a preset segmentation model to output a road segmentation area. The video image entering and exiting the road can be segmented through a target detection model to obtain multiple road segmentation areas.

[0036] 103. Determine whether the number of vehicle detection frames is less than a first preset number of vehicles.

[0037] The first preset number of vehicles is a threshold for the number of vehicles in a preset detection scenario. Specifically, after obtaining the number of vehicle detection frames, the number of vehicle detection frames can be compared with the first preset number of vehicles. If the number of vehicle detection frames is less than the first preset number of vehicles, it indicates that the number of vehicles in the monitored road area is small. If the number of vehicle detection frames is not less than the first preset number of vehicles, it indicates that the number of vehicles in the monitored road area is large and there may be congestion, which can then be further analyzed and determined. By setting the first preset number of vehicles, filtering and screening can be performed based on the number of detected vehicle detection frames, thereby improving detection efficiency.

[0038] 104. If yes, determine that the road is in a non-congested state.

[0039] If the number of vehicle detection frames is less than the first preset number of vehicles, it indicates that the number of vehicles in the monitored road area is small, and it can be determined that the road is in a non-congested state.

[0040] 105. If not, analyze the congestion situation of the road according to the multiple vehicle detection frames and the multiple road segmentation areas.

[0041] Among them, if the number of vehicle detection frames is not less than the first preset number of vehicles, it indicates that the number of vehicles in the monitored road area is large and there may be congestion. The congestion situation of the road can be analyzed based on the multiple vehicle detection frames and the multiple road segmentation areas. For example, a detection vehicle set frame detect_car_sets that meets the first preset vehicle number requirement can be obtained. The detection vehicle set frame includes multiple vehicle detection frames. The congestion situation in different areas of the road can be analyzed based on the number of vehicles in each vehicle detection frame and the positioning information of multiple road segmentation areas road_regions.

[0042] Optionally, in step 105, analyzing the road congestion according to the multiple vehicle detection frames and the multiple road segmentation areas includes:

[0043] 51. Fusing the multiple vehicle detection frames and the multiple road segmentation regions to obtain multiple region of interest (ROI) fused detection frames;

[0044] 52. Merge the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames;

[0045] 53. Determine whether the area corresponding to each of the area boxes is in a congested state based on the multiple area boxes and the second preset number of vehicles.

[0046] Among them, a detection vehicle set frame detect_car_sets including multiple vehicle detection frames can be fused with multiple road segmentation regions road_regions to obtain a ROI fused region detection frame set roi_car_sets including multiple ROI fused detection frames. Specifically, based on the position information corresponding to each vehicle detection frame and the positioning information (e.g., longitude and latitude) of each road segmentation region, the image data of the vehicle detection frame whose position information corresponding to the vehicle detection frame is consistent with the positioning information of the road segmentation region can be fused with the image data of the road segmentation region, and the image data is processed to analyze the area to be processed in the image in the form of a square, circle, ellipse, irregular polygon, etc., as the region of interest (ROI). The region of interest can then be annotated with a frame of the corresponding shape to obtain the ROI fused detection frame. By fusing the multiple road segmentation regions of the road segmentation with the detection vehicle set frame including the multiple vehicle detection frames, the accuracy of the detection area can be improved, thereby improving the judgment effect of the road congestion status.

[0047] Then, multiple ROI fused detection frames are merged to obtain a collection of region sets, merged_car_sets. The collection of region sets includes multiple region frames, i.e., the region frame merged_cars belongs to a region frame in the collection of region sets, merged_car_sets. Detection frame merging of multiple ROI fused detection frames in the region fusion ensures the accuracy of the congestion status.

[0048] Finally, whether the area corresponding to each area box is in a congested state can be determined based on multiple area boxes merged_cars and a second preset number of vehicles, where the second preset number of vehicles is a preset vehicle number threshold. Specifically, if the number of vehicles in the area box merged_cars is greater than the second preset number of vehicles, it indicates that the area corresponding to the area box merged_cars is congested; otherwise, it indicates that the area corresponding to the area box merged_cars is not congested.

[0049] Optionally, in step 53, judging whether the area corresponding to each area frame is in a congested state according to the multiple area frames and the second preset number of vehicles includes:

[0050] A1. Obtain the number of vehicles in each area frame;

[0051] A2. If the number of vehicles in the area is greater than the second preset number of vehicles, it is determined that the area corresponding to the area frame is in a congested state.

[0052] In a specific implementation, after merging to form a merged region set frame (merged_car_sets) comprising multiple merged_cars regions, the number of vehicles in each merged_cars region can be counted. This number of vehicles in each region can then be compared with a second preset number of vehicles. If the number of vehicles in the merged_cars region is greater than the second preset number of vehicles, the region corresponding to the merged_cars region can be determined to be congested. By performing a secondary filtering of the merged region frames based on the second preset number of vehicles, the accuracy of the congestion status can be ensured.

[0053] Optionally, in step 52, merging the multiple ROI fusion detection frames to obtain a clustered region set frame includes:

[0054] Obtain the number of vehicles in the ROI area of ​​each ROI fusion detection frame;

[0055] If the number of vehicles in the ROI area is greater than the second preset number of vehicles, the ROI fusion detection frame is merged with other ROI fusion detection frames that meet the second preset number of vehicles.

[0056] In a specific implementation, in the process of merging multiple ROI fusion detection frames, the number of vehicles in the ROI area of ​​each ROI fusion detection frame roi_car_sets can be obtained. If the number of vehicles in the ROI area is greater than the second preset number of vehicles, the ROI fusion detection frame is merged with other ROI fusion detection frames that meet the second preset number of vehicles. That is to say, if the number of vehicles in the ROI area of ​​the ROI fusion detection frame is not greater than the second preset number of vehicles, the ROI fusion detection frame will not be merged.

[0057] Optionally, merging the ROI fusion detection frame with other ROI fusion detection frames that meet the second preset vehicle quantity requirement includes:

[0058] Determining the distances between the ROI fusion detection frames that meet the second preset vehicle quantity requirement to obtain a plurality of distances;

[0059] The ROI fusion detection frames are merged according to the multiple distances.

[0060] Among them, the distance between each ROI fusion detection frame can be calculated for the ROI fusion region detection frame set roi_car_sets, and different ROI fusion detection frames can be merged according to the distance. Specifically, a preset distance threshold can be set, and the distance between each ROI fusion detection frame is compared with the preset distance threshold. If the distance between any two ROI fusion detection frames is less than the preset distance threshold, the two ROI fusion detection frames are merged. Thus, adjacent and overlapping different ROI fusion detection frames can be merged to obtain a clustered region set frame including multiple region frames.

[0061] Optionally, determining the distance between each ROI fusion detection frame that meets the second preset vehicle quantity requirement includes:

[0062] If there is no overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, determining, for the first ROI fusion detection frame and the second ROI fusion detection frame, vertex coordinates of each vertex of the first ROI fusion detection frame and the second ROI fusion detection frame in a preset coordinate system, and determining a distance between the first ROI fusion detection frame and the second ROI fusion detection frame based on the vertex coordinates of each vertex in the preset coordinate system; wherein the first ROI fusion detection frame and the second ROI fusion detection frame are any two ROI fusion detection frames that meet the second preset vehicle number requirement;

[0063] If there is overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, the distance between the first ROI fusion detection frame and the second ROI fusion detection frame is determined to be 0.

[0064] Among them, a coordinate system can be constructed, and for the first ROI fusion detection frame and the second ROI fusion detection frame, the vertex coordinates of each vertex of the first ROI fusion detection frame can be determined; the vertex coordinates of each vertex of the second ROI fusion detection frame are determined, specifically, for the first ROI fusion detection frame and the second ROI fusion detection frame, the first vertex coordinates and the second vertex coordinates of the first ROI fusion detection frame are determined, and the first vertex and the second vertex are located on the diagonal; the third vertex coordinates and the fourth vertex coordinates of the second ROI fusion detection frame are determined, and the third vertex and the fourth vertex are located on the diagonal; then the distance between the first ROI fusion detection frame and the second ROI fusion detection frame can be determined according to the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates.

[0065] Optionally, the determining the distance between the first ROI fusion detection frame and the second ROI fusion detection frame according to the vertex coordinates of each vertex in a preset coordinate system includes:

[0066] Determining x-axis coordinate differences and y-axis coordinate differences between the coordinates of a first vertex and a second vertex of the first ROI fusion detection frame and the coordinates of a third vertex and a fourth vertex of the second ROI fusion detection frame, to obtain a plurality of x-axis coordinate differences and y-axis coordinate differences; wherein the first vertex and the second vertex are two vertices on a diagonal line, and the third vertex and the fourth vertex are two vertices on a diagonal line;

[0067] Determine a minimum non-negative coordinate difference among the multiple x-axis coordinate differences and the y-axis coordinate differences, and determine a distance between the first ROI fusion detection frame and the second ROI fusion detection frame according to the minimum non-negative coordinate difference.

[0068] Specifically, the x-axis coordinate difference and the y-axis coordinate difference between the first vertex coordinate (x1, y1), the second vertex coordinate (x2, y2), the third vertex coordinate (x3, y3), and the fourth vertex coordinate (x4, y4) can be determined to obtain multiple x-axis coordinate differences and y-axis coordinate differences; Figure 2 , which is a schematic diagram illustrating a method of determining the distance between the first ROI fusion detection frame and the second ROI fusion detection frame, wherein the distances between the first vertex and the fourth vertex and the vertices of the target outer frame are greater than the distances between the vertices of other fusion detection frames and the vertices of the target outer frame. The target outer frame refers to a boundary outer frame that can include each ROI fusion detection frame. In a specific implementation, Figure 2 As shown, the minimum non-negative coordinate difference y3-y2 among multiple x-axis coordinate differences and y-axis coordinate differences can be determined, and the minimum non-negative coordinate difference is used as the distance d=y3-y2 between the first ROI fusion detection frame and the second ROI fusion detection frame.

[0069] like Figure 3 As shown, if there is overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, it can be determined that the distance d between the first ROI fusion detection frame and the second ROI fusion detection frame is 0.

[0070] It can be seen that the road congestion detection method provided in the embodiment of the present application obtains multiple vehicle detection frames by performing vehicle detection on the road monitoring video stream; counts the number of vehicle detection frames based on the multiple vehicle detection frames; performs road segmentation on the road monitoring video stream to obtain multiple road segmentation areas; determines whether the number of vehicle detection frames is less than the first preset number of vehicles; if so, determines that the road is in a non-congested state; if not, analyzes the congestion situation of the road based on the multiple vehicle detection frames and the multiple road segmentation areas. In this way, by fusing the road segmentation areas with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.

[0071] Consistent with the above, see Figure 4 , is a schematic diagram of an embodiment of a road congestion detection method provided in an embodiment of the present application. The road congestion detection method described in this embodiment includes the following steps:

[0072] 201. Perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and count the number of vehicle detection frames based on the plurality of vehicle detection frames.

[0073] 202. Perform road segmentation on the road monitoring video stream to obtain multiple road segmentation areas.

[0074] 203. Determine whether the number of vehicle detection frames is less than a first preset number of vehicles.

[0075] 204. If yes, determine that the road is in a non-congested state.

[0076] 205. If not, fuse the multiple vehicle detection frames and the multiple road segmentation regions to obtain multiple region of interest (ROI) fused detection frames.

[0077] 206 . Merge the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames.

[0078] 207. Obtain the number of regional vehicles in each of the regional frames.

[0079] 208. If the number of vehicles in the area is greater than the second preset number of vehicles, determine that the area corresponding to the area frame is in a congested state.

[0080] The detailed description of the above steps 201 to 208 can be found in Figure 1 The corresponding steps of step 101 to step 105 of the described road congestion detection method are not repeated here.

[0081] It can be seen that, through the road congestion detection method provided by the embodiment of the present application, a plurality of vehicle detection frames are obtained by performing vehicle detection on the road monitoring video stream; the number of vehicle detection frames is counted according to the plurality of vehicle detection frames; the road monitoring video stream is segmented to obtain a plurality of road segmentation areas; it is determined whether the number of vehicle detection frames is less than a first preset number of vehicles; if so, it is determined that the road is in a non-congested state; if not, the plurality of vehicle detection frames are fused with the plurality of road segmentation areas to obtain a plurality of region of interest (ROI) fusion detection frames, by merging the plurality of road segmentation areas of the road segmentation with the detection vehicle set including the plurality of vehicle detection frames. The fusion processing of the combined frames can improve the accuracy of the detection area, thereby improving the judgment effect of the road congestion status; the detection frames of the multiple ROI fusion detection frames are merged to obtain the clustered area set frame, and the detection frames are merged by merging the multiple ROI fusion detection frames for regional fusion to ensure the accuracy of the congestion status; the number of regional vehicles of each regional frame is obtained; if the number of regional vehicles is greater than the second preset number of vehicles, it is determined that the area corresponding to the regional frame is in a congested state. In this way, by fusing the road segmentation area with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.

[0082] Consistent with the above, see Figure 5 , is a schematic diagram of an embodiment of a road congestion detection method provided in an embodiment of the present application. The road congestion detection method described in this embodiment includes the following steps:

[0083] 301. Perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and count the number of vehicle detection frames based on the plurality of vehicle detection frames.

[0084] 302. Perform road segmentation on the road monitoring video stream to obtain multiple road segmentation areas.

[0085] 303. Determine whether the number of vehicle detection frames is less than a first preset number of vehicles.

[0086] 304. If yes, determine that the road is in a non-congested state.

[0087] 305. If not, fuse the multiple vehicle detection frames and the multiple road segmentation regions to obtain multiple region of interest (ROI) fused detection frames.

[0088] 306. Obtain the number of vehicles in the ROI area of ​​each ROI fusion detection frame.

[0089] 307. If the number of vehicles in the ROI area is greater than the second preset number of vehicles, merge the ROI fusion detection frame with other ROI fusion detection frames that meet the second preset number of vehicles to obtain a clustered area set frame.

[0090] The aggregation area set frame includes multiple area frames.

[0091] 308. Obtain the number of regional vehicles in each of the regional boxes.

[0092] 309. If the number of vehicles in the area is greater than the second preset number of vehicles, determine that the area corresponding to the area frame is in a congested state.

[0093] The detailed description of the above steps 301 to 309 can be found in Figure 1 The corresponding steps of step 101 to step 105 of the described road congestion detection method are not repeated here.

[0094] It can be seen that, through the road congestion detection method provided by the embodiment of the present application, a plurality of vehicle detection frames are obtained by performing vehicle detection on the road monitoring video stream; the number of vehicle detection frames is counted according to the plurality of vehicle detection frames; the road monitoring video stream is segmented to obtain a plurality of road segmentation areas; it is determined whether the number of vehicle detection frames is less than a first preset number of vehicles; if so, it is determined that the road is in a non-congested state; if not, the plurality of vehicle detection frames are fused with the plurality of road segmentation areas to obtain a plurality of region of interest (ROI) fusion detection frames, by merging the plurality of road segmentation areas of the road segmentation with the detection vehicle set including the plurality of vehicle detection frames. The fusion processing of the combined frames can improve the accuracy of the detection area, thereby improving the judgment effect of the road congestion status; the detection frames of the multiple ROI fusion detection frames are merged to obtain the clustered area set frame, and the detection frames are merged by merging the multiple ROI fusion detection frames for regional fusion to ensure the accuracy of the congestion status; the number of regional vehicles of each regional frame is obtained; if the number of regional vehicles is greater than the second preset number of vehicles, it is determined that the area corresponding to the regional frame is in a congested state. In this way, by fusing the road segmentation area with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.

[0095] Consistent with the above, the following is a device for implementing the above road congestion detection method, specifically as follows:

[0096] See also Figure 6, is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 400 described in this embodiment includes: at least one input device 1000; at least one output device 2000; at least one processor 3000, such as a CPU; and memory 4000. The input device 1000, output device 2000, processor 3000, and memory 4000 are connected via a bus 5000.

[0097] The input device 1000 may be a touch panel, a physical button or a mouse.

[0098] The output device 2000 may specifically be a display screen.

[0099] The memory 4000 may be a high-speed RAM memory or a non-volatile memory, such as a disk memory. The memory 4000 is used to store a set of program codes. The input device 1000, the output device 2000, and the processor 3000 are used to call the program codes stored in the memory 4000 and perform the following operations:

[0100] The processor 3000 is configured to:

[0101] Performing vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and counting the number of vehicle detection frames based on the plurality of vehicle detection frames;

[0102] Performing road segmentation on the road monitoring video stream to obtain a plurality of road segmentation areas;

[0103] Determining whether the number of vehicle detection frames is less than a first preset number of vehicles;

[0104] If yes, it is determined that the road is in a non-congested state;

[0105] If not, the congestion condition of the road is analyzed according to the multiple vehicle detection frames and the multiple road segmentation areas.

[0106] In one possible example, in analyzing the road congestion condition according to the multiple vehicle detection frames and the multiple road segmentation areas, the processor 3000 is specifically configured to:

[0107] Fusing the multiple vehicle detection frames with the multiple road segmentation regions to obtain multiple region of interest (ROI) fusion detection frames;

[0108] Merging the detection frames of the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames;

[0109] It is determined according to the plurality of area frames and the second preset number of vehicles whether the area corresponding to each of the area frames is in a congested state.

[0110] In one possible example, in determining whether the area corresponding to each of the area boxes is in a congested state according to the multiple area boxes and the second preset number of vehicles, the processor 3000 is specifically configured to:

[0111] Obtain the number of vehicles in each area frame;

[0112] If the number of vehicles in the area is greater than the second preset number of vehicles, it is determined that the area corresponding to the area frame is in a congested state.

[0113] In a possible example, in the aspect of merging the detection frames of the multiple ROI fusion detection frames to obtain the aggregation region set frame, the processor 3000 is specifically configured to:

[0114] Obtain the number of vehicles in the ROI area of ​​each ROI fusion detection frame;

[0115] If the number of vehicles in the ROI area is greater than the second preset number of vehicles, the ROI fusion detection frame is merged with other ROI fusion detection frames that meet the second preset number of vehicles to obtain a clustered area set frame.

[0116] In a possible example, in terms of merging the ROI fusion detection frame with other ROI fusion detection frames that meet the second preset vehicle quantity requirement, the processor 3000 is specifically configured to:

[0117] Determining the distances between the ROI fusion detection frames that meet the second preset vehicle quantity requirement to obtain a plurality of distances;

[0118] The ROI fusion detection frames are merged according to the multiple distances.

[0119] In a possible example, in determining the distance between each ROI fusion detection frame that meets the second preset vehicle quantity requirement, the processor 3000 is further specifically configured to:

[0120] If there is no overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, determining, for the first ROI fusion detection frame and the second ROI fusion detection frame, vertex coordinates of each vertex of the first ROI fusion detection frame and the second ROI fusion detection frame in a preset coordinate system, and determining a distance between the first ROI fusion detection frame and the second ROI fusion detection frame based on the vertex coordinates of each vertex in the preset coordinate system; wherein the first ROI fusion detection frame and the second ROI fusion detection frame are any two ROI fusion detection frames that meet the second preset vehicle number requirement;

[0121] If there is overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, the distance between the first ROI fusion detection frame and the second ROI fusion detection frame is determined to be 0.

[0122] In a possible example, in determining the distance between the first ROI fused detection frame and the second ROI fused detection frame according to the vertex coordinates of the vertices in the preset coordinate system, the processor 3000 is further configured to:

[0123] Determining x-axis coordinate differences and y-axis coordinate differences between the coordinates of a first vertex and a second vertex of the first ROI fusion detection frame and the coordinates of a third vertex and a fourth vertex of the second ROI fusion detection frame, to obtain a plurality of x-axis coordinate differences and y-axis coordinate differences; wherein the first vertex and the second vertex are two vertices on a diagonal line, and the third vertex and the fourth vertex are two vertices on a diagonal line;

[0124] Determine a minimum non-negative coordinate difference among the multiple x-axis coordinate differences and the y-axis coordinate differences, and use the minimum non-negative coordinate difference as the distance between the first ROI fusion detection frame and the second ROI fusion detection frame.

[0125] It can be seen that through the electronic device described in the embodiment of the present application, a plurality of vehicle detection frames are obtained by performing vehicle detection on a road monitoring video stream; the number of vehicle detection frames is counted based on the plurality of vehicle detection frames; the road monitoring video stream is segmented to obtain a plurality of road segmentation areas; it is determined whether the number of vehicle detection frames is less than a first preset number of vehicles; if so, it is determined that the road is in a non-congested state; if not, the congestion situation of the road is analyzed based on the plurality of vehicle detection frames and the plurality of road segmentation areas. In this way, by fusing the road segmentation areas with the plurality of vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.

[0126] See also Figure 7, is a schematic diagram of the structure of an embodiment of a road congestion detection device provided in an embodiment of the present application. The road congestion detection device 500 described in this embodiment includes: a detection unit 501, a segmentation unit 502, a judgment unit 503 and an analysis unit 504, specifically as follows:

[0127] The detection unit 501 is configured to perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and to count the number of vehicle detection frames based on the plurality of vehicle detection frames;

[0128] A segmentation unit 502 is configured to segment the road monitoring video stream into multiple road segmentation areas;

[0129] A judging unit 503 is configured to judge whether the number of vehicle detection frames is less than a first preset number of vehicles; if so, determining that the road is in a non-congested state;

[0130] The analyzing unit 504 is configured to analyze the congestion condition of the road according to the plurality of vehicle detection frames and the plurality of road segmentation areas if the number of the vehicle detection frames is not less than a first preset number of vehicles.

[0131] Optionally, in analyzing the road congestion condition according to the multiple vehicle detection frames and the multiple road segmentation areas, the analyzing unit 504 is specifically configured to:

[0132] Fusing the multiple vehicle detection frames with the multiple road segmentation regions to obtain multiple region of interest (ROI) fusion detection frames;

[0133] Merging the detection frames of the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames;

[0134] It is determined according to the plurality of area frames and the second preset number of vehicles whether the area corresponding to each of the area frames is in a congested state.

[0135] Optionally, in determining whether the area corresponding to each of the area boxes is in a congested state based on the multiple area boxes and the second preset number of vehicles, the analyzing unit 504 is specifically configured to:

[0136] Obtain the number of vehicles in each area frame;

[0137] If the number of vehicles in the area is greater than the second preset number of vehicles, it is determined that the area corresponding to the area frame is in a congested state.

[0138] Optionally, in the aspect of merging the detection frames of the multiple ROI fusion detection frames to obtain the clustered region set frame, the analyzing unit 504 is specifically configured to:

[0139] Obtain the number of vehicles in the ROI area of ​​each ROI fusion detection frame;

[0140] If the number of vehicles in the ROI area is greater than the second preset number of vehicles, the ROI fusion detection frame is merged with other ROI fusion detection frames that meet the second preset number of vehicles to obtain a clustered area set frame.

[0141] Optionally, in the aspect of merging the ROI fusion detection frame with other ROI fusion detection frames that meet the second preset vehicle quantity requirement, the analyzing unit 504 is specifically configured to:

[0142] Determining the distances between the ROI fusion detection frames that meet the second preset vehicle quantity requirement to obtain a plurality of distances;

[0143] The ROI fusion detection frames are merged according to the multiple distances.

[0144] Optionally, in determining the distance between each ROI fusion detection frame that meets the second preset vehicle quantity requirement, the analyzing unit 504 is specifically configured to:

[0145] For the first ROI fusion detection frame and the second ROI fusion detection frame, determining vertex coordinates of each vertex of the first ROI fusion detection frame and the second ROI fusion detection frame in a preset coordinate system; wherein the first ROI fusion detection frame and the second ROI fusion detection frame are any two ROI fusion detection frames that meet the second preset vehicle number requirement;

[0146] The distance between the first ROI fusion detection frame and the second ROI fusion detection frame is determined according to the vertex coordinates of the respective vertices in a preset coordinate system.

[0147] Optionally, in determining the distance between the first ROI fusion detection frame and the second ROI fusion detection frame according to the vertex coordinates of each vertex in the preset coordinate system, the analyzing unit 504 is specifically configured to:

[0148] If there is no overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, determining, for the first ROI fusion detection frame and the second ROI fusion detection frame, vertex coordinates of each vertex of the first ROI fusion detection frame and the second ROI fusion detection frame in a preset coordinate system, and determining a distance between the first ROI fusion detection frame and the second ROI fusion detection frame based on the vertex coordinates of each vertex in the preset coordinate system; wherein the first ROI fusion detection frame and the second ROI fusion detection frame are any two ROI fusion detection frames that meet the second preset vehicle number requirement;

[0149] If there is overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, the distance between the first ROI fusion detection frame and the second ROI fusion detection frame is determined to be 0.

[0150] It can be seen that the road congestion detection device described in the embodiment of the present application obtains multiple vehicle detection frames by performing vehicle detection on the road monitoring video stream; counts the number of vehicle detection frames based on the multiple vehicle detection frames; performs road segmentation on the road monitoring video stream to obtain multiple road segmentation areas; determines whether the number of vehicle detection frames is less than the first preset number of vehicles; if so, determines that the road is in a non-congested state; if not, analyzes the congestion situation of the road based on the multiple vehicle detection frames and the multiple road segmentation areas. In this way, by fusing the road segmentation areas with the multiple vehicle detection frames obtained by vehicle detection, the false detection rate of road congestion can be reduced and the accuracy of road congestion judgment can be improved.

[0151] It can be understood that the functions of each program module of the road congestion detection device of this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment and will not be repeated here.

[0152] An embodiment of the present application further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program includes part or all of the steps of any one of the road congestion detection methods described in the above method embodiments.

[0153] The present invention provides a computer program product, including a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps described in any of the road congestion detection methods described in the present invention. The computer program product may be a software installation package.

[0154] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art can understand and implement other changes to the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0155] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices (equipment), or computer program products. Therefore, the application can adopt the form of complete hardware embodiment, complete software embodiment, or the embodiment in combination with software and hardware. Moreover, the application can adopt 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.) that include computer-usable program code. The computer program is stored / distributed in a suitable medium, provided together with other hardware or as a part for hardware, or other distribution forms can be adopted, such as by the Internet or other wired or wireless telecommunication systems.

[0156] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (equipment) and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable monitoring area backtracking judgment device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device for counting the number of people in and out generate instructions for implementing the process 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.

[0157] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable human-vehicle trajectory analysis device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0158] These computer program instructions can also be loaded onto a computer or other programmable human-vehicle trajectory analysis 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 executing on the computer or other programmable device to implement 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.

[0159] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.

Claims

1. A road congestion detection method, characterized in that: The method comprises: Performing vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and counting the number of vehicle detection frames based on the plurality of vehicle detection frames; Performing road segmentation on the road monitoring video stream to obtain a plurality of road segmentation areas; Determining whether the number of vehicle detection frames is less than a first preset number of vehicles; If yes, it is determined that the road is in a non-congested state; If not, analyzing the congestion condition of the road according to the multiple vehicle detection frames and the multiple road segmentation areas; Analyzing the road congestion according to the multiple vehicle detection frames and the multiple road segmentation areas includes: Fusing the multiple vehicle detection frames with the multiple road segmentation regions to obtain multiple region of interest (ROI) fused detection frames; Merging the detection frames of the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames; It is determined according to the plurality of area frames and the second preset number of vehicles whether the area corresponding to each of the area frames is in a congested state.

2. The method according to claim 1, characterized in that The determining, based on the plurality of area frames and the second preset number of vehicles, whether the area corresponding to each of the area frames is in a congested state includes: Obtain the number of vehicles in each area frame; If the number of vehicles in the area is greater than the second preset number of vehicles, it is determined that the area corresponding to the area frame is in a congested state.

3. The method according to claim 1 or 2, characterized in that Merging the detection frames of the multiple ROI fusion detection frames to obtain a clustered region set frame includes: Obtain the number of vehicles in the ROI area of ​​each ROI fusion detection frame; If the number of vehicles in the ROI area is greater than the second preset number of vehicles, the ROI fusion detection frame is merged with other ROI fusion detection frames that meet the second preset number of vehicles to obtain a clustered area set frame.

4. The method according to claim 3, characterized in that The merging of the ROI fusion detection frame with other ROI fusion detection frames that meet the second preset vehicle quantity requirement includes: Determining the distances between the ROI fusion detection frames that meet the second preset vehicle quantity requirement to obtain a plurality of distances; The ROI fusion detection frames are merged according to the multiple distances.

5. The method according to claim 4, characterized in that The determining of the distance between each ROI fusion detection frame that meets the second preset vehicle quantity requirement includes: If there is no overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, determining, for the first ROI fusion detection frame and the second ROI fusion detection frame, vertex coordinates of each vertex of the first ROI fusion detection frame and the second ROI fusion detection frame in a preset coordinate system, and determining a distance between the first ROI fusion detection frame and the second ROI fusion detection frame based on the vertex coordinates of each vertex in the preset coordinate system; wherein the first ROI fusion detection frame and the second ROI fusion detection frame are any two ROI fusion detection frames that meet the second preset vehicle number requirement; If there is overlap between the first ROI fusion detection frame and the second ROI fusion detection frame, the distance between the first ROI fusion detection frame and the second ROI fusion detection frame is determined to be 0.

6. The method according to claim 5, characterized in that The determining the distance between the first ROI fusion detection frame and the second ROI fusion detection frame according to the vertex coordinates of each vertex in a preset coordinate system includes: Determining x-axis coordinate differences and y-axis coordinate differences between the coordinates of a first vertex and a second vertex of the first ROI fusion detection frame and the coordinates of a third vertex and a fourth vertex of the second ROI fusion detection frame, to obtain a plurality of x-axis coordinate differences and y-axis coordinate differences; wherein the first vertex and the second vertex are two vertices on a diagonal line, and the third vertex and the fourth vertex are two vertices on a diagonal line; Determine a minimum non-negative coordinate difference among the multiple x-axis coordinate differences and the y-axis coordinate differences, and determine a distance between the first ROI fusion detection frame and the second ROI fusion detection frame according to the minimum non-negative coordinate difference.

7. A road congestion detection device, characterized in that: The device comprises: a detection unit, configured to perform vehicle detection on a road monitoring video stream to obtain a plurality of vehicle detection frames; and to count the number of vehicle detection frames based on the plurality of vehicle detection frames; a segmentation unit, configured to segment the road monitoring video stream into multiple road segmentation areas; a judging unit, configured to judge whether the number of the vehicle detection frames is less than a first preset number of vehicles; and if so, to judge that the road is in a non-congested state; an analyzing unit, configured to analyze a congestion condition of the road according to the plurality of vehicle detection frames and the plurality of road segmentation areas if the number of the vehicle detection frames is not less than a first preset number of vehicles; The analysis unit is specifically used for: Fusing the multiple vehicle detection frames with the multiple road segmentation regions to obtain multiple region of interest (ROI) fused detection frames; Merging the detection frames of the multiple ROI fusion detection frames to obtain a clustered region set frame, where the clustered region set frame includes multiple region frames; It is determined according to the plurality of area frames and the second preset number of vehicles whether the area corresponding to each of the area frames is in a congested state.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the programs include instructions for executing the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Traffic jam analysis method, device and equipment

    CN113269768A