Expressway traffic jam event identification method and device, electronic equipment and storage medium
Through the drone equipped with cameras and vehicle detection models, the highway traffic video stream is monitored in real time, the vehicle center coordinates and European distance are calculated, and the traffic jams are directly judged, which solves the problems of limited detection range, high cost and slow response speed of traditional methods. A more accurate and timely detection of traffic jam incidents has been achieved.
Patent Information
- Application Number
- CN202411318367.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional highway traffic jam incident identification methods have problems such as limited detection range, high cost and slow response speed.
Use a drone to carry a camera to obtain real-time traffic video streams on the highway, use the vehicle detection model to detect the video frame images, calculate the vehicle center coordinates and European distances, determine whether there is traffic jam, and directly use the relationship between the average body length and European distances. Determine traffic jams and provide more comprehensive traffic conditions information.
It realizes more accurate and timely detection of traffic jam events, reduces false alarms and missed reports, and has faster response speed, saves costs, and alleviates the problems of limited detection scope, high costs and slow response speed.
Smart Images

Figure CN119207087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method, device, electronic equipment and storage medium for identifying a highway traffic jam. Background Art
[0002] As an important transportation infrastructure in my country, highways play a key role in ensuring the rapid and safe flow of people and goods. However, due to factors such as population growth and rising vehicle ownership, congestion often occurs on highways, seriously affecting driving efficiency and traffic safety. In response to the problem of traffic congestion on highways, traffic management departments usually rely on traditional methods such as manual inspections and surveillance cameras for real-time monitoring and control. The surveillance cameras deployed along the highways are usually scattered and have limited coverage, making it difficult to achieve continuous monitoring of the entire highway. In addition, surveillance cameras can only capture vehicle driving conditions statically, and congestion can only be detected by manual analysis of video data, making it difficult to detect and respond to sudden congestion events in a timely manner. These methods have defects such as limited detection range and slow response speed, and are unable to detect and handle congestion events on highways in a timely manner.
[0003] At present, other highway traffic jam monitoring technologies mainly include the following solutions: a) Traffic jam detection based on roadside surveillance cameras. By analyzing the changes in vehicle speed and movement trajectory, it is possible to timely detect signs of slow traffic or congestion in local sections, give early warnings and take countermeasures to avoid the occurrence of congestion events. This method of monitoring traffic jams cannot fully cover the highway due to its limited monitoring range, so it cannot track the vehicle movement trajectory and speed information in real time; b) Traffic jam detection technology based on vehicle-mounted GPS devices. Since the method of using vehicle-mounted GPS devices to detect traffic jams requires large-scale deployment of vehicle-mounted devices, and there are problems such as high cost, reliance on the installation of vehicle-mounted devices and user willingness to use, and incomplete coverage, the current technology based on vehicle-mounted GPS devices cannot be well popularized in all scenarios; c) Traffic jam warning based on roadside traffic guidance screens. This method mainly uses historical traffic jam data to manually summarize experience or make predictions, but it cannot detect the occurrence of traffic jams in time, and can only issue warnings based on historical data, and the response speed is slow.
[0004] In summary, the traditional method of identifying highway traffic jams has technical problems such as limited detection range, high cost and slow response speed. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, electronic device and storage medium for identifying highway traffic jams, so as to alleviate the technical problems of traditional methods for identifying highway traffic jams, such as limited detection range, high cost and slow response speed.
[0006] In a first aspect, an embodiment of the present invention provides a method for identifying a highway traffic jam event, comprising:
[0007] Acquire a real-time traffic video stream of the highway through a camera carried by the drone, and acquire a video frame image of the real-time traffic video stream;
[0008] Performing vehicle detection on the video frame image using a vehicle detection model to obtain information about the vehicle contained in the video frame image;
[0009] If the number of vehicles in the vehicle information is greater than a preset number threshold, the average body length of the vehicles in the video frame image is calculated according to the vehicle center coordinates in the vehicle information, and the Euclidean distance between any two vehicles is calculated according to the vehicle center coordinates;
[0010] Determine whether there is a traffic jam between two vehicles corresponding to each Euclidean distance based on the average vehicle body length and the Euclidean distance, and determine whether there is a traffic jam in the video frame image based on the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
[0011] Further, calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information includes:
[0012] Calculation formula based on average vehicle length The average body length of the vehicles in the video frame image is calculated, wherein: represents the average body length of the vehicle in the video frame image, x i represents the center coordinates of the vehicle, and n represents the number of vehicles.
[0013] Further, determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance includes:
[0014] If the target Euclidean distance in the Euclidean distance is not greater than the average vehicle body length, it is determined that a traffic jam exists between two vehicles corresponding to the target Euclidean distance.
[0015] Further, determining whether there is a traffic jam in the video frame image according to the number of vehicles in the traffic jam and a target number threshold includes:
[0016] If the number of vehicles in the traffic jam is not less than the target number threshold, it is determined that there is a traffic jam in the video frame image, wherein the target number threshold is a preset multiple of the number of vehicles;
[0017] If the number of vehicles in a traffic jam is less than the target number threshold, it is determined that there is no traffic jam in the video frame image.
[0018] Furthermore, the method further comprises:
[0019] If the number of vehicles is not greater than the preset number threshold, determining a ratio of vehicles to resolution in the video frame image;
[0020] If the ratio is greater than the preset ratio, it is determined that the video frame image is enlarged, and the process returns to the step of calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information;
[0021] If the ratio is not greater than the preset proportion, it is determined that the video frame image is not magnified and there is no traffic jam in the video frame image.
[0022] Furthermore, the pixel area of the vehicle in the real-time traffic video stream is larger than a preset area range.
[0023] Furthermore, the vehicle detection model is a context feature pyramid network.
[0024] In a second aspect, an embodiment of the present invention further provides a device for identifying a highway traffic jam event, comprising:
[0025] An acquisition unit, used to acquire a real-time traffic video stream of the highway through a camera carried by the drone, and to acquire a video frame image of the real-time traffic video stream;
[0026] A vehicle detection unit, configured to perform vehicle detection on the video frame image using a vehicle detection model to obtain information about the vehicle contained in the video frame image;
[0027] a calculation unit, configured to calculate an average body length of the vehicles in the video frame image according to the center coordinates of the vehicles in the vehicle information if the number of vehicles in the vehicle information is greater than a preset number threshold, and calculate a Euclidean distance between any two vehicles according to the center coordinates of the vehicles;
[0028] A determination unit is used to determine whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance, and to determine whether there is a traffic jam in the video frame image according to the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
[0029] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0030] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute any method described in the first aspect above.
[0031] In an embodiment of the present invention, a method for identifying highway traffic jams is provided, comprising: obtaining a real-time traffic video stream of the highway through a camera carried by a drone, and obtaining a video frame image of the real-time traffic video stream; performing vehicle detection on the video frame image using a vehicle detection model to obtain information about vehicles contained in the video frame image; if the number of vehicles in the vehicle information is greater than a preset number threshold, calculating the average body length of the vehicles in the video frame image according to the vehicle center coordinates in the vehicle information, and calculating the Euclidean distance between any two vehicles according to the vehicle center coordinates; determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average body length and the Euclidean distance, and determining whether there is a traffic jam in the video frame image according to the number of vehicles with traffic jams and a target number threshold, wherein the target number threshold is determined based on the number of vehicles. From the above description, it can be seen that in the method for identifying highway traffic jams of the present invention, a camera carried by an unmanned aerial vehicle is used to collect real-time traffic video streams of the highway, so that a wider road view can be captured at high altitudes. Compared with ground monitoring cameras, more comprehensive traffic condition information can be obtained, and the overall traffic jam situation of the highway can be perceived more accurately, providing a better data basis for subsequent analysis and early warning. Compared with vehicle-mounted GPS equipment, costs are saved. In addition, the average body length and the Euclidean distance between any two vehicles are calculated through the information of the detected vehicles, and then the relationship between the average body length and each Euclidean distance is directly judged whether there is a traffic jam between the two vehicles, and then whether there is a traffic jam in the video frame image is determined, which is closer to the physical characteristics of the actual traffic jam, so that the actual traffic jam can be detected more accurately and timely, reducing the occurrence of false alarms and missed alarms, and responding faster, alleviating the technical problems of the traditional method for identifying highway traffic jams, such as limited detection range, high cost, and slow response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of a method for identifying a highway traffic jam event provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of the training and application process of the vehicle detection model provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of the structure of a CFPN provided in an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of a device for identifying a highway traffic jam event provided by an embodiment of the present invention;
[0037] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] Traditional methods for identifying highway traffic jams have technical problems such as limited detection range, high cost and slow response speed.
[0040] Based on this, in the method for identifying highway traffic jams of the present invention, a camera carried by an unmanned aerial vehicle is used to collect real-time traffic video streams of the highway, so that a wider road view can be captured at high altitudes. Compared with ground monitoring cameras, more comprehensive traffic condition information can be obtained, and the overall traffic jam situation on the highway can be perceived more accurately, providing a better data basis for subsequent analysis and early warning. Compared with vehicle-mounted GPS equipment, costs are saved. In addition, the average body length and the Euclidean distance between any two vehicles are calculated through the information of the detected vehicles, and then the relationship between the average body length and each Euclidean distance is directly used to determine whether there is a traffic jam between the two vehicles, and then determine whether there is a traffic jam in the video frame image, which is closer to the physical characteristics of the actual traffic jam, so that the actual traffic jam can be detected more accurately and timely, reducing the occurrence of false alarms and missed alarms, and responding faster.
[0041] To facilitate understanding of this embodiment, a method for identifying a highway traffic jam event disclosed in an embodiment of the present invention is first introduced in detail.
[0042] Embodiment 1:
[0043] According to an embodiment of the present invention, an embodiment of a method for identifying a traffic jam on a highway is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] Figure 1 is a flow chart of a method for identifying a highway traffic jam according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0045] Step S102, obtaining a real-time traffic video stream of the highway through a camera carried by the drone, and obtaining a video frame image of the real-time traffic video stream;
[0046] In recent years, with the rapid development of UAV technology, UAVs have gradually become an emerging tool for highway traffic monitoring due to their advantages such as mobility, flexibility and low cost. By using UAVs to patrol and collect dynamic videos over highways, combined with computer vision and other technical means, real-time monitoring and analysis of vehicle operation conditions on the entire highway can be achieved. Based on this, an automatic detection (or recognition) method for highway traffic jams based on UAV dynamic videos was developed, which is of great significance for improving the efficiency and safety of highway traffic management.
[0047] Specifically, real-time traffic video streams of highways are collected through cameras carried by drones. Multiple cameras can be carried on a drone, and there can be multiple drones in the sky above the highway. The specific number can be determined according to the size of the highway to achieve the purpose of detecting the entire highway.
[0048] After obtaining the real-time traffic video stream of the highway captured by each camera, each video frame image in each real-time traffic video stream is obtained, which can be obtained by extracting frames.
[0049] The pixel area of the vehicle in the real-time traffic video stream is larger than the preset area range, that is, by adjusting the flight altitude of the drone and the camera magnification and other parameters, the pixel area of the vehicle is ensured to be larger than 120*120.
[0050] Step S104, using a vehicle detection model to perform vehicle detection on the video frame image to obtain information about the vehicle contained in the video frame image;
[0051] Specifically, a vehicle detection model is used to detect vehicles in the video frame image to obtain a set of vehicles CAR, that is, information about the vehicles contained in the video frame image, which may include: vehicle size, vehicle center coordinates, vehicle color and model, etc. Here, only one video frame image is used as an example for explanation, and the traffic jam event recognition process is performed for each video frame image.
[0052] The training and application process of the vehicle detection model is as follows: Figure 2 As shown, the vehicle detection model of the present invention (ie, YOLOv5) is a context feature pyramid network.
[0053] The inventors took into account the differences in the flying altitude of the drone and the camera magnification, which lead to the appearance of small target vehicles, and an effective way to improve the detection accuracy is multi-scale feature fusion. YOLOv5 uses the Path Aggregation Feature Pyramids Network (PAFPN) to achieve multi-scale feature fusion. However, it only performs feature fusion in a simple bottom-up manner, and its multi-scale feature fusion capability is insufficient. In order to improve the multi-scale feature fusion capability of YOLOv5, the present invention designs a context feature pyramid network (CFPN), which effectively improves the fusion effect of multi-scale features without significantly increasing the number of parameters. Figure 3 As shown in Figure 1, CFPN adopts a multi-scale structure. First, features of different resolutions are fused to obtain multi-scale features. The calculation formula is as follows:
[0054] Where (F3, F4, F5, F6, F7} is the multi-scale feature layer P3-P7 output by the YOLOv5 backbone network.
[0055] Then, the convolutional layer is used to replace the query matrix (query) and the queried matrix (key) in the self-attention mechanism, and the contextual text information is obtained through a method similar to the self-attention mechanism. The calculation formula is as follows:
[0056] In the formula, and They are the output and input feature maps of the i∈{F3, F4, F5, F6, F7}th feature layer, and each feature map contains N i pixels, with j, m∈{1, N i} represents each pixel; w q 、w k 、w v is the linear transformation matrix after the 1x1 convolution layer. In addition, CFPN also applies the same i and Q i The weight matrix a of the same shape i , to balance the global spatial context aggregation level of each pixel. The calculation formula is as follows:
[0057] In the formula, is the output value of the i-th node in the i-th multi-scale feature layer; N i is the total number of nodes.
[0058] Step S106, if the number of vehicles in the vehicle information is greater than a preset number threshold, the average body length of the vehicles in the video frame image is calculated according to the vehicle center coordinates in the vehicle information, and the Euclidean distance between any two vehicles is calculated according to the vehicle center coordinates;
[0059] Specifically, the number of elements in the set CAR is determined. If the number of elements is greater than a preset threshold value (which can be 10), the vehicle center coordinates of each vehicle target are obtained, and then the average body length of the vehicle in the video frame image is calculated, and the Euclidean distance between any two vehicles is calculated based on the vehicle center coordinates to obtain the Euclidean distance set DIS. The expression of DIS is as follows: DIS = {d ij |i=1,2,...,n;j=1,2,...,n;i≠j},where d ij represents the Euclidean distance between vehicle i and vehicle j, and n represents the number of vehicles in the video frame image.
[0060] Step S108, determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance based on the average vehicle body length and the Euclidean distance, and determining whether there is a traffic jam in the video frame image based on the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
[0061] In an embodiment of the present invention, a method for identifying highway traffic jams is provided, comprising: obtaining a real-time traffic video stream of the highway through a camera carried by a drone, and obtaining a video frame image of the real-time traffic video stream; performing vehicle detection on the video frame image using a vehicle detection model to obtain information about vehicles contained in the video frame image; if the number of vehicles in the vehicle information is greater than a preset number threshold, calculating the average body length of the vehicles in the video frame image according to the vehicle center coordinates in the vehicle information, and calculating the Euclidean distance between any two vehicles according to the vehicle center coordinates; determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average body length and the Euclidean distance, and determining whether there is a traffic jam in the video frame image according to the number of vehicles with traffic jams and a target number threshold, wherein the target number threshold is determined based on the number of vehicles. From the above description, it can be seen that in the method for identifying highway traffic jams of the present invention, a camera carried by an unmanned aerial vehicle is used to collect real-time traffic video streams of the highway, so that a wider road view can be captured at high altitudes. Compared with ground monitoring cameras, more comprehensive traffic condition information can be obtained, and the overall traffic jam situation of the highway can be perceived more accurately, providing a better data basis for subsequent analysis and early warning. Compared with vehicle-mounted GPS equipment, costs are saved. In addition, the average body length and the Euclidean distance between any two vehicles are calculated through the information of the detected vehicles, and then the relationship between the average body length and each Euclidean distance is directly judged whether there is a traffic jam between the two vehicles, and then whether there is a traffic jam in the video frame image is determined, which is closer to the physical characteristics of the actual traffic jam, so that the actual traffic jam can be detected more accurately and timely, reducing the occurrence of false alarms and missed alarms, and responding faster, alleviating the technical problems of the traditional method for identifying highway traffic jams, such as limited detection range, high cost, and slow response speed.
[0062] The above content briefly introduces the method for identifying highway traffic jam events of the present invention. The specific contents involved are described in detail below.
[0063] In an optional embodiment of the present invention, calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information specifically includes the following steps:
[0064] Calculation formula based on average vehicle length Calculate the average body length of the vehicles in the video frame image, where represents the average body length of the vehicle in the video frame image, x i represents the center coordinates of the vehicle, and n represents the number of vehicles.
[0065] Specifically, x i Represents the vehicle center coordinates of each vehicle stored in the CAR set
[0066] In an optional embodiment of the present invention, determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance specifically includes the following steps:
[0067] If the target Euclidean distance in the Euclidean distance is not greater than the average vehicle body length, it is determined that there is a traffic jam between the two vehicles corresponding to the target Euclidean distance.
[0068] Specifically, judge d ij and relationship, if Then the two vehicles are considered to be in a traffic jam and added to set A. ij Traverse and judge, count the number of elements in A, and get the number of vehicles in traffic jam.
[0069] In an optional embodiment of the present invention, determining whether there is a traffic jam in a video frame image according to the number of vehicles in the traffic jam and a target number threshold specifically includes the following steps:
[0070] (1) If the number of vehicles in the traffic jam is not less than a target number threshold, it is determined that there is a traffic jam in the video frame image, wherein the target number threshold is a preset multiple of the number of vehicles;
[0071] Specifically, the number of elements in A (ie, the number of vehicles in a traffic jam) is compared with 0.4*the number of vehicles (ie, a preset multiple of the number of vehicles). If the former is not less than the latter, it is determined that there is a traffic jam in the video frame image.
[0072] (2) If the number of vehicles in a traffic jam is less than the target number threshold, it is determined that there is no traffic jam in the video frame image.
[0073] In an optional embodiment of the present invention, the method further comprises the following steps:
[0074] (1) If the number of vehicles is not greater than a preset number threshold, determining a ratio of vehicles in the video frame image to a resolution;
[0075] Specifically, the number of elements in the set CAR (i.e., the number of vehicles) is determined. If the number of elements (i.e., the number of vehicles) is not greater than a preset threshold value (which can be 10), the ratio of vehicles in the video frame image to the resolution is calculated, i.e., the pixel area of all vehicles / the resolution of the video frame image.
[0076] (2) If the ratio is greater than the preset ratio, it is determined that the video frame image is enlarged, and the process returns to the step of calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information;
[0077] It should be noted that if the camera status can be directly read (eg, querying the camera's focal length, zoom status and other parameters), the camera status is read to obtain the result of whether there is a zoomed-in picture.
[0078] (3) If the ratio is not greater than the preset ratio, it is determined that the video frame image does not have any magnification, the number of vehicles in the video frame image is small, and there is no traffic jam in the video frame image.
[0079] The method for identifying highway traffic jams of the present invention has the following advantages:
[0080] (1) UAVs have the characteristics of strong mobility and wide coverage, and can monitor the vehicle operation status of the entire highway in real time;
[0081] (2) By detecting and tracking vehicles in video frames, we can obtain information related to vehicle motion trajectories. We can use the motion trajectories to obtain the position information and distance of all vehicles in the video frames. We can determine the occurrence of traffic jams based on the distances, thus providing data support for the intelligent identification of traffic jams.
[0082] (3) Traffic jam detection based on vehicle number and vehicle distance, without hovering, can detect and report traffic jams in real time, with faster response speed;
[0083] (4) There is no need to deploy roadside equipment or vehicle-mounted equipment on a large scale, and the system cost is relatively low.
[0084] Therefore, the solution proposed in the present invention can overcome the limitations of existing traffic jam monitoring solutions, realize comprehensive and real-time monitoring of highway traffic conditions, provide timely and effective support for traffic management departments, and has strong technical advantages and application value.
[0085] The present invention has the following effects:
[0086] The present invention uses real-time drone video as a data source. The drone can capture a wider road view from a high altitude and obtain more comprehensive traffic information than ground surveillance cameras. In addition, it can more accurately perceive the overall traffic jam situation on the highway, providing a better data basis for subsequent analysis and early warning.
[0087] Traffic jams are detected during inspections by using a method that uses target detection (i.e., vehicle detection model) and vehicle-to-vehicle distance analysis. By identifying vehicles and calculating the distance relationship between adjacent vehicles, it is possible to more directly determine whether a traffic jam has occurred. Compared with traditional methods that rely solely on traffic flow or average vehicle speed, this method is closer to the physical characteristics of actual traffic jams, and can more accurately detect actual traffic jams, reducing false positives and false negatives.
[0088] Considering the algorithm's universality and robustness, flexible threshold parameters are set. The vehicle quantity threshold (i.e., preset quantity threshold) and vehicle-to-resolution ratio threshold (i.e., preset ratio) are set, which can be flexibly adjusted according to actual conditions. This configurability is conducive to the algorithm's application in different road environments and traffic conditions. It improves the algorithm's robustness, can better adapt to various complex highway scenarios, and enhances the feasibility of practical applications.
[0089] The key technical points of the present invention include:
[0090] 1. In order to enhance the detection performance of small ground targets of UAVs at high altitudes, the present invention improves the detection efficiency of small targets by introducing multi-scale training and designing an asymptotic feature pyramid network during the implementation of the target detection algorithm (i.e., vehicle detection model).
[0091] 2. Different from the traditional way of detecting vehicle speed and flow, the present invention can better meet the needs of real scenes by identifying vehicle targets and calculating the distance relationship between adjacent vehicles. It can have a higher accuracy rate and a lower misjudgment rate.
[0092] Embodiment 2:
[0093] The embodiment of the present invention also provides a device for identifying highway traffic jam events. The device for identifying highway traffic jam events is mainly used to execute the method for identifying highway traffic jam events provided in the first embodiment of the present invention. The following is a specific introduction to the device for identifying highway traffic jam events provided in the embodiment of the present invention.
[0094] Figure 4 is a schematic diagram of a device for identifying a highway traffic jam according to an embodiment of the present invention. Figure 4 As shown, the device includes: an acquisition unit 10, a vehicle detection unit 20, a calculation unit 30 and a determination unit 40, wherein:
[0095] An acquisition unit, used for acquiring a real-time traffic video stream of the highway through a camera carried by the drone, and acquiring a video frame image of the real-time traffic video stream;
[0096] A vehicle detection unit, used to perform vehicle detection on the video frame image using a vehicle detection model to obtain information about the vehicle contained in the video frame image;
[0097] a calculation unit, configured to calculate an average body length of the vehicles in the video frame image according to the center coordinates of the vehicles in the vehicle information if the number of vehicles in the vehicle information is greater than a preset number threshold, and calculate a Euclidean distance between any two vehicles according to the center coordinates of the vehicles;
[0098] A determination unit is used to determine whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance, and to determine whether there is a traffic jam in the video frame image according to the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
[0099] In an embodiment of the present invention, a device for identifying highway traffic jams is provided, comprising: obtaining a real-time traffic video stream of the highway through a camera carried by a drone, and obtaining a video frame image of the real-time traffic video stream; performing vehicle detection on the video frame image using a vehicle detection model to obtain information about vehicles contained in the video frame image; if the number of vehicles in the vehicle information is greater than a preset number threshold, calculating the average body length of the vehicles in the video frame image according to the vehicle center coordinates in the vehicle information, and calculating the Euclidean distance between any two vehicles according to the vehicle center coordinates; determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average body length and the Euclidean distance, and determining whether there is a traffic jam in the video frame image according to the number of vehicles with traffic jams and a target number threshold, wherein the target number threshold is determined based on the number of vehicles. From the above description, it can be seen that in the identification device for highway traffic jams of the present invention, a camera carried by a drone is used to collect real-time traffic video streams of the highway, so that a wider road view can be captured at high altitudes. Compared with ground monitoring cameras, more comprehensive traffic condition information can be obtained, and the overall traffic jam situation of the highway can be perceived more accurately, providing a better data basis for subsequent analysis and early warning. Compared with vehicle-mounted GPS equipment, costs are saved. In addition, the average body length and the Euclidean distance between any two vehicles are calculated through the information of the detected vehicles, and then the relationship between the average body length and each Euclidean distance is directly judged whether there is a traffic jam between the two vehicles, and then whether there is a traffic jam in the video frame image is determined, which is closer to the physical characteristics of the actual traffic jam, so that the actual traffic jam can be detected more accurately and timely, reducing the occurrence of false alarms and missed alarms, and responding faster, alleviating the technical problems of the traditional method for identifying highway traffic jams, such as limited detection range, high cost, and slow response speed.
[0100] Optionally, the calculation unit is further used to: calculate the formula according to the average vehicle body length Calculate the average body length of the vehicles in the video frame image, where represents the average body length of the vehicle in the video frame image, x i represents the center coordinates of the vehicle, and n represents the number of vehicles.
[0101] Optionally, the determining unit is further configured to: if the target Euclidean distance in the Euclidean distance is not greater than the average vehicle body length, determine that a traffic jam exists between two vehicles corresponding to the target Euclidean distance.
[0102] Optionally, the determination unit is also used to: if the number of vehicles in a traffic jam is not less than a target number threshold, determine that there is a traffic jam in the video frame image, wherein the target number threshold is a preset multiple of the number of vehicles; if the number of vehicles in a traffic jam is less than the target number threshold, determine that there is no traffic jam in the video frame image.
[0103] Optionally, the device is also used to: if the number of vehicles is not greater than a preset number threshold, determine the ratio of vehicles to resolution in the video frame image; if the ratio is greater than a preset proportion, determine that the video frame image is enlarged, and return to execute the step of calculating the average body length of the vehicle in the video frame image based on the vehicle center coordinates in the vehicle information; if the ratio is not greater than a preset proportion, determine that the video frame image is not enlarged, and there is no traffic jam in the video frame image.
[0104] Optionally, the pixel area of the vehicle in the real-time traffic video stream is larger than a preset area range.
[0105] Optionally, the vehicle detection model is a context feature pyramid network.
[0106] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0107] like Figure 5 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the method for identifying highway traffic jams as described above.
[0108] Specifically, the memory 602 and the processor 601 can be general-purpose memories and processors, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, the above-mentioned method for identifying highway traffic jams can be executed.
[0109] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.
[0110] Corresponding to the above-mentioned method for identifying highway traffic jams, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned method for identifying highway traffic jams.
[0111] The device for identifying highway traffic jams provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0113] For another example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0115] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0116] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or partly contribute to the prior art or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the vehicle marking method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0117] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0118] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solution of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solution recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiment of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for identifying a traffic jam on a highway, characterized in that: include: Acquire a real-time traffic video stream of the highway through a camera carried by the drone, and acquire a video frame image of the real-time traffic video stream; Performing vehicle detection on the video frame image using a vehicle detection model to obtain information about the vehicle contained in the video frame image; If the number of vehicles in the vehicle information is greater than a preset number threshold, the average body length of the vehicles in the video frame image is calculated according to the vehicle center coordinates in the vehicle information, and the Euclidean distance between any two vehicles is calculated according to the vehicle center coordinates; Determine whether there is a traffic jam between two vehicles corresponding to each Euclidean distance based on the average vehicle body length and the Euclidean distance, and determine whether there is a traffic jam in the video frame image based on the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
2. The method according to claim 1, characterized in that Calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information includes: Calculation formula based on average vehicle length The average body length of the vehicles in the video frame image is calculated, wherein: represents the average body length of the vehicle in the video frame image, x i represents the center coordinates of the vehicle, and n represents the number of vehicles.
3. The method according to claim 1, characterized in that Determining whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance includes: If the target Euclidean distance in the Euclidean distance is not greater than the average vehicle body length, it is determined that a traffic jam exists between two vehicles corresponding to the target Euclidean distance.
4. The method according to claim 1, characterized in that: Determining whether there is a traffic jam in the video frame image according to the number of vehicles in the traffic jam and a target number threshold includes: If the number of vehicles in the traffic jam is not less than the target number threshold, it is determined that there is a traffic jam in the video frame image, wherein the target number threshold is a preset multiple of the number of vehicles; If the number of vehicles in a traffic jam is less than the target number threshold, it is determined that there is no traffic jam in the video frame image.
5. The method according to claim 1, characterized in that The method further comprises: If the number of vehicles is not greater than the preset number threshold, determining a ratio of vehicles to resolution in the video frame image; If the ratio is greater than the preset ratio, it is determined that the video frame image is enlarged, and the process returns to the step of calculating the average body length of the vehicle in the video frame image according to the vehicle center coordinates in the vehicle information; If the ratio is not greater than the preset proportion, it is determined that the video frame image is not magnified and there is no traffic jam in the video frame image.
6. The method according to claim 1, characterized in that The pixel area of the vehicle in the real-time traffic video stream is larger than a preset area range.
7. The method according to claim 1, characterized in that The vehicle detection model is a context feature pyramid network.
8. A device for identifying traffic jams on highways, characterized in that: include: An acquisition unit, used to acquire a real-time traffic video stream of the highway through a camera carried by the drone, and to acquire a video frame image of the real-time traffic video stream; A vehicle detection unit, configured to perform vehicle detection on the video frame image using a vehicle detection model to obtain information about the vehicle contained in the video frame image; a calculation unit, configured to calculate an average body length of the vehicles in the video frame image according to the center coordinates of the vehicles in the vehicle information if the number of vehicles in the vehicle information is greater than a preset number threshold, and calculate a Euclidean distance between any two vehicles according to the center coordinates of the vehicles; A determination unit is used to determine whether there is a traffic jam between two vehicles corresponding to each Euclidean distance according to the average vehicle body length and the Euclidean distance, and to determine whether there is a traffic jam in the video frame image according to the number of vehicles in the traffic jam and a target number threshold, wherein the target number threshold is determined based on the number of vehicles.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Emergency traffic scheduling management method and system based on unmanned aerial vehicle monitoring
CN119992840A
An Emergency Traffic Dispatching and Management Method and System Based on UAV Surveillance
CN119992840B
