Traffic jam detection method and device, electronic equipment and nonvolatile storage medium

By collecting video images through drones and applying target detection and tracking algorithms, the problem of poor flexibility and insufficient coverage of traditional traffic monitoring methods is solved, all-round, real-time traffic monitoring and analysis is achieved, and the efficiency and applicability of traffic congestion detection are improved. sex.

CN118865696APending Publication Date: 2024-10-29CHINA TELECOM UNMANNED TECHNOLOGY (JIANGSU) CO LTD +1

Patent Information

Application Number
CN202411359863.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Due to the fixed positions and narrow monitoring range of ground sensors and cameras, traditional traffic monitoring methods cannot adapt to complex traffic environment changes and road reconstruction, resulting in poor monitoring flexibility and insufficient coverage.

Method used

UAVs are used to collect video images, and through the target detection algorithm and target tracking algorithm, the vehicle target frame is determined and assigned an identifier, the vehicle flow speed is calculated, the road traffic status is judged, and all-round, real-time traffic monitoring is achieved.

Benefits of technology

It improves the flexibility and coverage of traffic congestion monitoring, realizes all-round monitoring and real-time analysis of traffic flow, overcomes the shortcomings of traditional methods, and can quickly adjust the monitoring position to avoid obstacles and achieve monitoring without blind spots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865696A_ABST
    Figure CN118865696A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic jam detection method and device, electronic equipment and a nonvolatile storage medium. The method comprises the steps that a video image of a monitoring area is acquired, a vehicle target frame in each image frame in the video image is determined, and the video image is a road image, acquired by an unmanned aerial vehicle, of the monitoring area; identifiers corresponding to the vehicle target frames are determined, each vehicle target frame in the same image frame corresponds to one identifier, and the identifiers of the vehicle target frames corresponding to the same vehicle in different image frames are the same; according to the positions of the vehicle target frames with the same identifier in the different image frames, the flow speed of each vehicle passing through the monitoring area is determined; and determining the traffic state of the road corresponding to the monitoring area according to the flowing speed of each vehicle. The technical problems of narrow monitoring range and poor flexibility of a traditional monitoring mode in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent transportation technology, and in particular, to a traffic congestion detection method, device, electronic device and non-volatile storage medium. Background Art

[0002] With the continuous increase in urban traffic flow, intelligent traffic management has become a key task to improve road traffic efficiency and alleviate traffic congestion. The traditional traffic monitoring method in the relevant technology relies on ground-mounted sensors and cameras, which are subject to various limitations. For example, ground sensors can only be fixed in specific locations, with poor flexibility and unable to adapt to complex traffic environment changes and road reconstruction. At the same time, the monitoring range of ground cameras is relatively narrow and is easily blocked by obstacles such as trees and buildings, resulting in monitoring blind spots and inability to achieve full coverage. That is, the traditional monitoring method has technical problems such as narrow monitoring range and poor flexibility.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a traffic congestion detection method, device, electronic device and non-volatile storage medium to at least solve the technical problems of narrow monitoring range and poor flexibility of traditional monitoring methods in related technologies.

[0005] According to one aspect of an embodiment of the present application, a traffic congestion detection method is provided, including: acquiring a video image of a monitoring area, and determining a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to frame the vehicle in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame; determining an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of the vehicle target frames corresponding to the same vehicle in different image frames are the same; determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frames with the same identifier in different image frames; determining the traffic state of the road corresponding to the monitoring area based on the flow speed of each vehicle, wherein the traffic state includes: congested and not congested.

[0006] Optionally, determining the vehicle target frame in each image frame in the video image includes: determining a vehicle detection frame in the first image frame in the video image, wherein the vehicle detection frame is a frame obtained by neural network detection and used to select the area where the vehicle is located in the first image frame; determining a vehicle prediction frame corresponding to each vehicle in the first image frame and a state covariance corresponding to the vehicle prediction frame based on the vehicle target frame corresponding to each vehicle in the second image frame, wherein the second image frame is the previous image frame immediately preceding the first image frame in the video image, and the covariance is used to characterize the credibility of the vehicle prediction frame; matching the vehicle detection frame in the first image frame with the vehicle prediction frame based on the intersection-and-union ratio between the vehicle detection frame and the vehicle prediction frame, and determining the vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and vehicle prediction frame.

[0007] Optionally, determining the vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and vehicle prediction frame includes: generating an observation matrix based on the vehicle detection frame, and determining the Kalman gain value based on the observation matrix, the covariance matrix of the observation noise, and the state covariance corresponding to the vehicle prediction frame; and correcting the vehicle prediction frame based on the Kalman gain value and the vehicle detection frame to obtain the vehicle target frame and the state covariance corresponding to the vehicle target frame.

[0008] Optionally, determining the identifier corresponding to the vehicle target frame includes: when the vehicle detection frame in the first image frame successfully matches the vehicle prediction frame, determining the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the second image frame as the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the first image frame; when the vehicle detection frame in the first image frame does not successfully match the vehicle prediction frame, determining the vehicle detection frame as the vehicle target frame corresponding to the vehicle in the first image frame, and adding a new identifier for the vehicle target frame.

[0009] Optionally, determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frame with the same identifier in different image frames includes: determining a first distance between a first boundary and a second boundary in the image frame, and determining an actual second distance between the first boundary and the second boundary on the road based on the first distance, wherein the first boundary and the second boundary are two boundary lines on the road in the monitoring area that are perpendicular to the driving direction of the vehicle; determining a first moment corresponding to the third image frame and a second moment corresponding to the fourth image frame, wherein the third image frame is an image frame corresponding to when the vehicle target frame is located at the first boundary, and the fourth image frame is an image frame corresponding to when the vehicle target frame with the same identifier is located at the second boundary; determining the flow speed of the vehicle corresponding to the vehicle target frame passing through the monitoring area based on the second distance, the first moment and the second moment.

[0010] Optionally, determining the actual second distance between the first boundary and the second boundary on the road based on the first distance includes: determining the flight altitude of the drone when collecting video images, and the focal length of the drone's lens; determining the spatial resolution based on the flight altitude, the focal length, and the pixel spacing in the image frame; determining the second distance based on the spatial resolution and the first distance.

[0011] Optionally, determining the traffic status of the road corresponding to the monitoring area based on the flow speed of each vehicle includes: counting the number of vehicle target boxes with different identifiers that appear in the monitoring area in the image frame within a preset time length, and determining the number as the number of vehicles passing through the monitoring area within the preset time length; determining a speed threshold and a quantity threshold corresponding to the type of road in the monitoring area; when the number of vehicles is greater than the quantity threshold and the flow speed is less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is congested; when the number of vehicles is not greater than the quantity threshold, or the flow speed is not less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is not congested.

[0012] According to another aspect of an embodiment of the present application, a traffic congestion detection device is also provided, including: a vehicle detection module, used to obtain a video image of a monitoring area, and determine a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select the vehicle in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame; a vehicle matching module, used to determine an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of the vehicle target frames corresponding to the same vehicle in different image frames are the same; a vehicle parameter calculation module, used to determine the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frame with the same identifier in different image frames; a traffic status judgment module, used to determine the traffic status of the road corresponding to the monitoring area based on the flow speed of each vehicle, wherein the traffic status includes: congested and not congested.

[0013] According to another aspect of the embodiment of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the traffic congestion detection method is executed when the program is run.

[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the traffic congestion detection method by running the computer program.

[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps of the traffic congestion detection method when the computer program is executed by a processor.

[0016] In an embodiment of the present application, a video image of a monitoring area is obtained, and a vehicle target frame in each image frame in the video image is determined, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select the vehicle in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame; an identifier corresponding to the vehicle target frame is determined, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of the vehicle target frames corresponding to the same vehicle in different image frames are the same; the flow speed of each vehicle passing through the monitoring area is determined based on the position of the vehicle target frame with the same identifier in different image frames; the traffic state of the road corresponding to the monitoring area is determined based on the flow speed of each vehicle, wherein the traffic state includes: congestion and non-congestion. Based on the real-time traffic video transmitted back by the drone, vehicle information is obtained through the target detection algorithm and the target tracking algorithm, and the congestion situation is judged by calculating the vehicle flow and speed, thereby achieving the purpose of improving the flexibility and coverage of traffic congestion monitoring, and realizing the purpose of all-round monitoring and real-time analysis of traffic flow, thereby solving the technical problems of narrow monitoring range and poor flexibility of traditional monitoring methods in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for detecting traffic congestion according to an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of a method flow for detecting traffic congestion provided according to an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of a method flow of intelligent traffic congestion detection based on drone target tracking provided in an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of a method flow of target tracking and identifier determination provided according to an embodiment of the present application;

[0022] Figure 5 is a schematic diagram of monitoring area division provided according to an embodiment of the present application;

[0023] Figure 6 is a schematic diagram of calculating actual ground distance provided according to an embodiment of the present application;

[0024] Figure 7 It is a structural schematic diagram of a traffic congestion detection device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] With the continuous increase in urban traffic flow, intelligent traffic management has become a key task to improve road traffic efficiency and alleviate traffic congestion. In related technologies, traditional traffic monitoring methods rely on ground-mounted sensors and cameras. However, these methods are subject to various limitations. For example, ground sensors can only be fixed in specific locations, with poor flexibility and unable to adapt to complex traffic environment changes and road reconstruction. At the same time, the monitoring range of ground cameras is relatively narrow and is easily blocked by obstacles such as trees and buildings, resulting in monitoring blind spots and inability to achieve full coverage. That is, traditional monitoring methods have technical problems such as narrow monitoring range and poor flexibility.

[0028] In order to solve the above problems, the embodiments of the present application provide relevant solutions, which realize all-round monitoring and real-time analysis of traffic flow by introducing drone technology. Drones have the advantages of flexibility and high maneuverability, and can quickly adjust the monitoring position to cover a wide range of traffic sections. In addition, drones can easily fly over obstacles, avoid blind spots, and realize all-round and no-dead-angle traffic monitoring. Therefore, applying drone technology to traffic management can effectively overcome the shortcomings of traditional methods and has important research significance, which is described in detail below.

[0029] According to an embodiment of the present application, a method embodiment of traffic congestion detection 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.

[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or electronic device) for implementing a traffic congestion detection method. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0031] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the traffic congestion detection method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned traffic congestion detection method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0033] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0034] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).

[0035] Under the above operating environment, the embodiment of the present application provides a traffic congestion detection method. Figure 2 is a schematic diagram of a method flow for detecting traffic congestion provided in accordance with an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0036] Step S202, obtaining a video image of the monitoring area, and determining a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select a vehicle in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame;

[0037] Step S204, determining an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the vehicle target frames corresponding to the same vehicle in different image frames have the same identifier;

[0038] Step S206, determining the flow speed of each vehicle passing through the monitoring area according to the position of the vehicle target frame with the same identifier in different image frames;

[0039] Step S208, determining the traffic status of the road corresponding to the monitoring area according to the flow speed of each vehicle, wherein the traffic status includes: congested and not congested.

[0040] Through the above steps, based on the real-time traffic video sent back by the drone, the target detection algorithm and the target tracking algorithm are used to obtain vehicle information, and the congestion situation is judged by calculating the traffic volume and speed, thereby improving the flexibility and coverage of traffic congestion monitoring, and realizing the purpose of all-round monitoring and real-time analysis of traffic flow, thereby solving the technical problems of narrow monitoring range and poor flexibility of traditional monitoring methods in related technologies.

[0041] The following is a further introduction to the traffic congestion detection method in steps S202 to S208 of the embodiment of the present application.

[0042] Figure 3 is a schematic diagram of a method flow for intelligent traffic congestion detection based on drone target tracking provided in an embodiment of the present application, such as Figure 3 shown.

[0043] First, the video images sent back by the drone are obtained and divided into frames to obtain image frames for subsequent processing. Then, the vehicle detection algorithm can be used to detect the vehicle in the divided images to obtain the vehicle target frame. The Kalman filter and Hungarian algorithm are used to track the vehicle target frame and assign a unique identifier to each vehicle. The specific steps are as follows.

[0044] In some embodiments of the present application, determining a vehicle target frame in each image frame in a video image includes the following steps: determining a vehicle detection frame in a first image frame in the video image, wherein the vehicle detection frame is a frame obtained by neural network detection and used to select an area where the vehicle is located in the first image frame; determining a vehicle prediction frame corresponding to each vehicle in the first image frame and a state covariance corresponding to the vehicle prediction frame based on a vehicle target frame corresponding to each vehicle in the second image frame, wherein the second image frame is an image frame immediately preceding the first image frame in the video image, and the covariance is used to characterize the credibility of the vehicle prediction frame; matching the vehicle detection frame in the first image frame with the vehicle prediction frame based on an intersection-and-union ratio between the vehicle detection frame and the vehicle prediction frame, and determining a vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and vehicle prediction frame.

[0045] Specifically, Figure 4 As shown, the above vehicle detection frame can be determined by using the YOLOv7 neural network for target detection, wherein the YOLOv7 network framework includes a backbone network (backbone) and a detection head (head), and the output of the network includes the type of target and the bounding box of the target.

[0046] In the first image frame of the video image, the target tracker can be initialized based on the target detection results. Each detected target is regarded as a new tracking target, a unique identifier ID is assigned, and the initial state is set. After that, Kalman filtering is used for multi-target tracking, which provides the optimal estimate of the target state by continuously fusing the predicted state (vehicle prediction box) and the actual observation (vehicle detection box). Kalman filtering involves two stages: prediction and update.

[0047] In the prediction stage, the current state (vehicle prediction frame in the first image frame) can be predicted by the previous image frame state (vehicle target frame in the second image frame), that is, the state estimation of the previous moment is converted to the state transfer matrix F. Predict the current moment , as shown in the following formula:

[0048]

[0049]

[0050] in, is the predicted state at time t, i.e., the vehicle prediction box in the first image frame, is the state at time t-1, i.e., the vehicle target frame in the second image frame, and F is the state transfer matrix; is the state covariance corresponding to the predicted state at time t, which reflects the uncertainty of the predicted state. is the state covariance corresponding to the state at time t-1, and Q is the covariance matrix of the observation noise.

[0051] In the update phase, the vehicle detection value of the current frame (the first image frame) can be used (Vehicle detection box) for the predicted state (Vehicle Prediction Box) is corrected, the specific steps are as follows.

[0052] In some embodiments of the present application, determining the vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and the vehicle prediction frame includes the following steps: generating an observation matrix based on the vehicle detection frame, and determining the Kalman gain value based on the observation matrix, the covariance matrix of the observation noise, and the state covariance corresponding to the vehicle prediction frame; correcting the vehicle prediction frame based on the Kalman gain value and the vehicle detection frame to obtain the vehicle target frame and the state covariance corresponding to the vehicle target frame.

[0053] Specifically, the vehicle detection value can be transformed into Map to state space and calculate Kalman gain Then, according to the Kalman gain value and the vehicle detection frame, the vehicle prediction frame is corrected to obtain the vehicle target frame and the state covariance corresponding to the vehicle target frame, as shown in the following formula:

[0054]

[0055]

[0056]

[0057] in, is the Kalman gain value, is the observation matrix, is the covariance matrix of the measurement noise, is the target estimation state, that is, the corresponding vehicle target frame in the first image frame, is the state covariance corresponding to the vehicle target frame in the first image frame, which is used to reflect the uncertainty after fusion of observation data. is the identity matrix.

[0058] In an embodiment of the present application, the Hungarian algorithm can be used to match the vehicle detection frame in the first image frame with the vehicle prediction frame. Specifically, first, the intersection over union (IOU) of the vehicle detection frame and the vehicle prediction frame of the current frame is calculated: , where T represents the detection box (vehicle detection box) and S represents the tracking box (vehicle prediction box). Then, the cost matrix M is generated as shown in the following formula:

[0059]

[0060] Among them, each element in M represents the cost value corresponding to the IOU between the vehicle detection box i and the vehicle prediction box j. Finally, the total cost Minimize as the best match. If the match is successful, the ID is passed to the current frame target and the Kalman filter is updated. That is, when the vehicle detection frame in the first image frame successfully matches the vehicle prediction frame, the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the second image frame is determined as the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the first image frame.

[0061] When the match is unsuccessful, if the target disappears from the current frame detection frame, the target ID is deleted. If a new target appears in the vehicle detection frame and the target ID does not exist in the vehicle prediction frame, a new ID is created and put into the Kalman filter for prediction, that is, if the vehicle detection frame in the first image frame does not successfully match the vehicle prediction frame, the vehicle detection frame is determined as the vehicle target frame corresponding to the vehicle in the first image frame, and a new identifier is added to the vehicle target frame.

[0062] Afterwards, the number of vehicles and vehicle speeds in the monitoring area can be calculated by combining the tracking identifiers corresponding to the vehicles, the flight altitude of the drone, the spatial resolution of the drone camera, and other information. The specific steps are as follows.

[0063] In some embodiments of the present application, determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frame with the same identifier in different image frames includes the following steps: determining a first distance between a first boundary and a second boundary in the image frame, and determining an actual second distance between the first boundary and the second boundary on the road based on the first distance, wherein the first boundary and the second boundary are two boundary lines on the road in the monitoring area that are perpendicular to the driving direction of the vehicle; determining a first moment corresponding to the third image frame and a second moment corresponding to the fourth image frame, wherein the third image frame is an image frame corresponding to when the vehicle target frame is located at the first boundary, and the fourth image frame is an image frame corresponding to when the vehicle target frame with the same identifier is located at the second boundary; determining the flow speed of the vehicle corresponding to the vehicle target frame passing through the monitoring area based on the second distance, the first moment and the second moment.

[0064] Specifically, Figure 5 As shown in FIG. 1 , the area that needs to be monitored for traffic congestion can be divided according to the images obtained by the drone. For example, two boundaries are drawn on the road where vehicles are traveling, namely the first boundary and the second boundary, and the areas on the road that meet the traffic congestion monitoring requirements are divided into the first boundary and the second boundary. The area is determined as the monitoring area, where y is the pixel ordinate in the drone image, and the upper left corner is set to (0, 0). and Decibel represents the lower and upper limits of the monitoring area y, that is, the coordinate values ​​corresponding to the first boundary and the second boundary.

[0065] Afterwards, the actual ground distance (ie, the second distance) between the first boundary and the second boundary on the road is determined, and the specific steps are as follows.

[0066] In some embodiments of the present application, determining the actual second distance between the first boundary and the second boundary on the road based on the first distance includes the following steps: determining the flight altitude of the drone when collecting video images, and the focal length of the drone's lens; determining the spatial resolution based on the flight altitude, the focal length, and the pixel spacing in the image frame; determining the second distance based on the spatial resolution and the first distance.

[0067] Specifically, Figure 6 As shown, in the scenario of vertical shooting by drone, there is a proportional relationship between the ground distance and the image plane distance. By calculating the spatial resolution of the drone camera and based on the proportional principle of similar triangles, the actual ground distance can be determined by the distance between the targets on the photo (image frame) and the spatial resolution of the photo, as shown in the following formula:

[0068]

[0069]

[0070] Among them, ratio refers to spatial resolution, s refers to pixel pitch, H refers to flight altitude, f refers to the focal length of the focal lens, S refers to the actual ground demarcated area distance (i.e., the second distance), and l refers to the distance between y_min and y_max on the photo (i.e., the first distance).

[0071] Then, by recording the vehicles passing through the designated areas and The average speed of vehicles in the area (i.e., the flow speed of vehicles passing through the monitoring area) can be calculated by using the time t1 (i.e., the first moment mentioned above) and t2 (i.e., the second moment mentioned above): .

[0072] In addition, the number of vehicles N in the monitoring area can be planned according to the vehicle target frame (xa, ya, w, h), that is, the following conditions can be met at the same time: and When , the vehicle is considered to be in the designated monitoring area, where (xa, ya) is the coordinate of the upper left corner of the vehicle target frame, and w and h are the width and height of the vehicle target frame, respectively.

[0073] Finally, the road congestion situation can be determined based on the number of vehicles and vehicle speeds within the designated monitoring area. The specific steps are as follows.

[0074] In some embodiments of the present application, determining the traffic status of the road corresponding to the monitoring area based on the flow speed of each vehicle includes the following steps: counting the number of vehicle target boxes with different identifiers that appear in the monitoring area in the image frame within a preset time length, and determining the number as the number of vehicles passing through the monitoring area within the preset time length; determining a speed threshold and a quantity threshold corresponding to the type of road in the monitoring area; when the number of vehicles is greater than the quantity threshold and the flow speed is less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is congested; when the number of vehicles is not greater than the quantity threshold, or the flow speed is not less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is not congested.

[0075] Specifically, different speed ranges can be set according to different road types. ,in, This is the speed threshold mentioned above. For example, the normal vehicle flow speed on urban roads is between 30 and 60 kilometers per hour. The normal vehicle flow speed on highways is between 60 and 120 kilometers per hour. On roads in rural areas or small towns, the vehicle flow speed is between 40 and 80 kilometers per hour. At the same time, set the maximum number of vehicles allowed to travel normally in the monitoring area. (i.e. the quantity threshold mentioned above).

[0076] When the vehicle speed is less than the minimum allowed speed And the number of vehicles N is greater than the maximum allowed number When , the traffic state is congested, as shown in the following formula:

[0077]

[0078] When the vehicle speed is greater than or equal to the minimum allowed speed Or the number of vehicles N is less than or equal to the maximum allowed number When , the traffic status is not congested, as shown in the following formula:

[0079]

[0080] This application scheme realizes real-time monitoring of traffic conditions through drone target tracking technology, greatly improving the timeliness of traffic congestion detection. By quickly and accurately capturing the dynamic information of vehicles on the road, it can quickly reflect the situation of traffic congestion, which helps to take timely countermeasures. At the same time, drones can flexibly and efficiently cover a large area, including areas that are difficult to monitor by traditional means. This makes the traffic congestion detection system more widely applicable and can achieve comprehensive monitoring in cities, suburbs or other geographical environments. In addition, the combination of drones and computer vision can automatically analyze traffic flows and trigger corresponding alarms when congestion is detected, reducing dependence on manual intervention and improving the autonomy and efficiency of traffic congestion detection.

[0081] According to an embodiment of the present application, an embodiment of a traffic congestion detection device is also provided. Figure 7 Schematic diagram of a traffic congestion detection device provided according to an embodiment of the present application. Figure 7 As shown, the device comprises:

[0082] The vehicle detection module 70 is used to obtain a video image of the monitoring area and determine a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by the drone, and the vehicle target frame is used to select the vehicle in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame;

[0083] A vehicle matching module 72, used to determine an identifier corresponding to a vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of vehicle target frames corresponding to the same vehicle in different image frames are the same;

[0084] The vehicle parameter calculation module 74 is used to determine the flow speed of each vehicle passing through the monitoring area according to the position of the vehicle target frame with the same identifier in different image frames;

[0085] The traffic status determination module 76 is used to determine the traffic status of the road corresponding to the monitoring area according to the flow speed of each vehicle, wherein the traffic status includes: congestion and non-congestion.

[0086] Optionally, determining the vehicle target frame in each image frame in the video image includes: determining a vehicle detection frame in the first image frame in the video image, wherein the vehicle detection frame is a frame obtained by neural network detection and used to select the area where the vehicle is located in the first image frame; determining a vehicle prediction frame corresponding to each vehicle in the first image frame and a state covariance corresponding to the vehicle prediction frame based on the vehicle target frame corresponding to each vehicle in the second image frame, wherein the second image frame is the previous image frame immediately preceding the first image frame in the video image, and the covariance is used to characterize the credibility of the vehicle prediction frame; matching the vehicle detection frame in the first image frame with the vehicle prediction frame based on the intersection-and-union ratio between the vehicle detection frame and the vehicle prediction frame, and determining the vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and vehicle prediction frame.

[0087] Optionally, determining the vehicle target frame corresponding to each vehicle in the first image frame based on the successfully matched vehicle detection frame and vehicle prediction frame includes: generating an observation matrix based on the vehicle detection frame, and determining the Kalman gain value based on the observation matrix, the covariance matrix of the observation noise, and the state covariance corresponding to the vehicle prediction frame; and correcting the vehicle prediction frame based on the Kalman gain value and the vehicle detection frame to obtain the vehicle target frame and the state covariance corresponding to the vehicle target frame.

[0088] Optionally, determining the identifier corresponding to the vehicle target frame includes: when the vehicle detection frame in the first image frame successfully matches the vehicle prediction frame, determining the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the second image frame as the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the first image frame; when the vehicle detection frame in the first image frame does not successfully match the vehicle prediction frame, determining the vehicle detection frame as the vehicle target frame corresponding to the vehicle in the first image frame, and adding a new identifier for the vehicle target frame.

[0089] Optionally, determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frame with the same identifier in different image frames includes: determining a first distance between a first boundary and a second boundary in the image frame, and determining an actual second distance between the first boundary and the second boundary on the road based on the first distance, wherein the first boundary and the second boundary are two boundary lines on the road in the monitoring area that are perpendicular to the driving direction of the vehicle; determining a first moment corresponding to the third image frame and a second moment corresponding to the fourth image frame, wherein the third image frame is an image frame corresponding to when the vehicle target frame is located at the first boundary, and the fourth image frame is an image frame corresponding to when the vehicle target frame with the same identifier is located at the second boundary; determining the flow speed of the vehicle corresponding to the vehicle target frame passing through the monitoring area based on the second distance, the first moment and the second moment.

[0090] Optionally, determining the actual second distance between the first boundary and the second boundary on the road based on the first distance includes: determining the flight altitude of the drone when collecting video images, and the focal length of the drone's lens; determining the spatial resolution based on the flight altitude, the focal length, and the pixel spacing in the image frame; determining the second distance based on the spatial resolution and the first distance.

[0091] Optionally, determining the traffic status of the road corresponding to the monitoring area based on the flow speed of each vehicle includes: counting the number of vehicle target boxes with different identifiers that appear in the monitoring area in the image frame within a preset time length, and determining the number as the number of vehicles passing through the monitoring area within the preset time length; determining a speed threshold and a quantity threshold corresponding to the type of road in the monitoring area; when the number of vehicles is greater than the quantity threshold and the flow speed is less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is congested; when the number of vehicles is not greater than the quantity threshold, or the flow speed is not less than the speed threshold, determining that the traffic status of the road corresponding to the monitoring area is not congested.

[0092] It should be noted that the various modules in the above-mentioned traffic congestion detection device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0093] It should be noted that the traffic congestion detection device provided in this embodiment can be used to perform Figure 2 The traffic congestion detection method shown, therefore, the relevant explanations and descriptions of the above-mentioned traffic congestion detection method are also applicable to the embodiments of the present application and will not be repeated here.

[0094] An embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following traffic congestion detection method by running the computer program: obtaining a video image of a monitoring area, and determining a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select vehicles in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame; determining an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of vehicle target frames corresponding to the same vehicle in different image frames are the same; determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frame with the same identifier in different image frames; determining the traffic state of the road corresponding to the monitoring area based on the flow speed of each vehicle, wherein the traffic state includes: congested and not congested.

[0095] The embodiments of the present application also provide a computer program product, including a computer program, which, when executed by a processor, implements the steps of the traffic congestion detection method described in each embodiment of the present application: obtaining a video image of a monitoring area, and determining a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select vehicles in the image frame, and each vehicle in each image frame corresponds to a vehicle target frame; determining an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to an identifier, and the identifiers of vehicle target frames corresponding to the same vehicle in different image frames are the same; determining the flow speed of each vehicle passing through the monitoring area based on the position of the vehicle target frames with the same identifier in different image frames; determining the traffic state of the road corresponding to the monitoring area based on the flow speed of each vehicle, wherein the traffic state includes: congested and not congested.

[0096] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0097] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0098] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0099] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0100] In addition, each functional unit in each embodiment of 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0101] If the integrated unit 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, or the part that contributes to the prior art, or all 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 several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.

[0102] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A traffic congestion detection method, characterized in that: include: Acquire a video image of the monitoring area, and determine a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select the vehicle in the image frame, and each vehicle in each image frame corresponds to one vehicle target frame; Determine an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to one identifier, and the vehicle target frames corresponding to the same vehicle in different image frames have the same identifier; Determine the flow speed of each vehicle passing through the monitoring area according to the position of the vehicle target frame having the same identifier in different image frames; The traffic status of the road corresponding to the monitoring area is determined according to the flow speed of each vehicle, wherein the traffic status includes: congestion and no congestion.

2. The traffic congestion detection method according to claim 1, characterized in that: Determining the vehicle target frame in each image frame in the video image includes: Determine a vehicle detection frame in a first image frame in the video image, wherein the vehicle detection frame is a frame obtained by neural network detection and used to frame an area where the vehicle is located in the first image frame; Determine, based on the vehicle target frame corresponding to each vehicle in the second image frame, a vehicle prediction frame corresponding to each vehicle in the first image frame, and a state covariance corresponding to the vehicle prediction frame, wherein the second image frame is an image frame immediately preceding the first image frame in the video image, and the covariance is used to characterize the credibility of the vehicle prediction frame; According to the intersection-and-union ratio between the vehicle detection frame and the vehicle prediction frame, the vehicle detection frame in the first image frame is matched with the vehicle prediction frame, and the vehicle target frame corresponding to each vehicle in the first image frame is determined based on the successfully matched vehicle detection frame and the vehicle prediction frame.

3. The traffic congestion detection method according to claim 2, characterized in that: Determining the vehicle target frame corresponding to each vehicle in the first image frame according to the successfully matched vehicle detection frame and the vehicle prediction frame includes: Generate an observation matrix according to the vehicle detection frame, and determine a Kalman gain value according to the observation matrix, a covariance matrix of observation noise, and the state covariance corresponding to the vehicle prediction frame; The vehicle prediction frame is corrected according to the Kalman gain value and the vehicle detection frame to obtain the vehicle target frame and the state covariance corresponding to the vehicle target frame.

4. The traffic congestion detection method according to claim 2, characterized in that: Determining the identifier corresponding to the vehicle target frame includes: In a case where the vehicle detection frame in the first image frame successfully matches the vehicle prediction frame, determining the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the second image frame as the identifier of the vehicle target frame corresponding to the vehicle prediction frame in the first image frame; When the vehicle detection frame in the first image frame fails to match the vehicle prediction frame, the vehicle detection frame is determined as the vehicle target frame corresponding to the vehicle in the first image frame, and a new identifier is added to the vehicle target frame.

5. The traffic congestion detection method according to claim 1, characterized in that: Determining the flow speed of each vehicle passing through the monitoring area according to the position of the vehicle target frame having the same identifier in different image frames includes: Determine a first distance between a first boundary and a second boundary in the image frame, and determine an actual second distance between the first boundary and the second boundary on the road based on the first distance, wherein the first boundary and the second boundary are two boundary lines on the road in the monitoring area that are perpendicular to the driving direction of the vehicle; Determine a first moment corresponding to a third image frame and a second moment corresponding to a fourth image frame, wherein the third image frame is an image frame corresponding to when the vehicle target frame is located at the first boundary, and the fourth image frame is an image frame corresponding to when the vehicle target frame having the same identifier is located at the second boundary; The flow speed of the vehicle corresponding to the vehicle target frame passing through the monitoring area is determined according to the second distance, the first moment and the second moment.

6. The traffic congestion detection method according to claim 5, characterized in that: Determining, based on the first distance, an actual second distance between the first boundary and the second boundary on the road comprises: Determining the flight altitude of the drone when collecting the video image and the focal length of the lens of the drone; Determining a spatial resolution according to the flight altitude, the focal length, and a pixel spacing in the image frame; The second distance is determined according to the spatial resolution and the first distance.

7. The traffic congestion detection method according to claim 1, characterized in that: Determining the traffic state of the road corresponding to the monitoring area according to the flow speed of each vehicle includes: Counting the number of the vehicle target frames with different identifiers that appear in the monitoring area in the image frames within a preset time period, and determining the number of vehicles that pass through the monitoring area within the preset time period; Determining a vehicle speed threshold and a vehicle quantity threshold corresponding to the type of road in the monitoring area; When the number of vehicles is greater than the number threshold and the flow speed is less than the vehicle speed threshold, determining that the traffic state of the road corresponding to the monitoring area is congested; When the number of vehicles is not greater than the number threshold, or the flow speed is not less than the vehicle speed threshold, it is determined that the traffic state of the road corresponding to the monitoring area is not congested.

8. A traffic congestion detection device, characterized in that: include: A vehicle detection module is used to obtain a video image of a monitoring area and determine a vehicle target frame in each image frame in the video image, wherein the video image is a road image of the monitoring area collected by a drone, and the vehicle target frame is used to select the vehicle in the image frame, and each vehicle in each image frame corresponds to one vehicle target frame; A vehicle matching module, used to determine an identifier corresponding to the vehicle target frame, wherein each vehicle target frame in the same image frame corresponds to one identifier, and the vehicle target frames corresponding to the same vehicle in different image frames have the same identifier; A vehicle parameter calculation module, used to determine the flow speed of each vehicle passing through the monitoring area according to the position of the vehicle target frame having the same identifier in different image frames; The traffic status judgment module is used to determine the traffic status of the road corresponding to the monitoring area according to the flow speed of each vehicle, wherein the traffic status includes: congestion and non-congestion.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the traffic congestion detection method according to any one of claims 1 to 7 when running.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the traffic congestion detection method according to any one of claims 1 to 7 by running the computer program.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the traffic congestion detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Vehicle velocity measurement method based on image characteristics

    CN102136196A

  • Traffic jam alarming system and traffic jam alarming method

    CN105469612A

  • Vehicle forward collision pre-warning method based on deep learning

    CN107972662A

  • Traffic monitoring method and device

    CN109087510A

  • Road congestion detection method and device, computer device and storage medium

    CN109767030A

Cited By

  • Speed measurement method and inspection system based on dynamic zooming of unmanned aerial vehicle

    CN120722002A

  • Traffic flow statistical method and system based on unmanned aerial vehicle vision technology

    CN120747885A

  • Vehicle speed measurement method, device and equipment based on unmanned aerial vehicle inspection and medium

    CN121640724A

  • Road congestion detection method and related equipment

    CN121661825A

  • Road congestion analysis method and device under view angle of low-altitude unmanned aerial vehicle, and electronic equipment

    CN122090329A