Highway scene understanding and traffic incident judgment method and system

By detecting and clustering vehicle targets in the spherical surveillance camera scene, identifying approximate lane areas and lane directions, and dynamically generating traffic flow statistical lines, it solves the problem of determining traffic events in unfixed monitoring areas and improves the efficiency and accuracy of determination. It is suitable for a variety of highway scenarios.

CN113705356BActive Publication Date: 2024-09-20INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110879193.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-02
Publication Date
2024-09-20
Estimated Expiration
2041-08-02

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively determine traffic events in unfixed monitoring areas on highways in the scenario of spherical surveillance cameras, resulting in reduced traffic operation and management efficiency.

Method used

By detecting, tracking and clustering vehicle targets in the monitoring scene, identifying approximate lane areas, calculating lane direction vectors, and dynamically generating traffic flow statistics lines based on this information, it is possible to study and judge traffic events such as reverse driving, illegal parking and accidents.

Benefits of technology

It improves the convenience and accuracy of traffic incident determination, reduces the workload of staff, is suitable for a variety of highway scenarios, and improves operation and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113705356B
    Figure CN113705356B
Patent Text Reader

Abstract

The invention discloses a method and system for understanding a highway scene and determining a traffic event, and belongs to the field of image processing. The technical problem to be solved by the invention is how to provide a traffic event determination suitable for a non-fixed monitoring area, and realize the analysis and judgment of traffic events in a spherical monitoring camera scene. The technical scheme is as follows: specifically: performing target detection and target tracking on vehicle targets that appear within a set time in a monitoring scene, and saving the vehicle target detection results and tracking results; clustering the target detection results, and selecting the classes whose element data in the clustering results reaches a threshold; analyzing the vehicle target tracking results, selecting the tracking results whose tracking trajectory length reaches a threshold in each approximate lane area, and calculating the vehicle's driving direction as the lane direction vector of the approximate lane area; and realizing traffic event judgment of vehicle flow statistics, reverse driving, illegal parking and accidents based on the approximate lane area and the lane direction vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent traffic and image processing of highway and bridge scenes, and in particular to a method and system for understanding highway scenes and determining traffic events. Background Art

[0002] In recent years, with the rapid development of the economy, the construction of provincial highways, national highways, high-speed bridges and other highways has made great progress, and transportation has become an indispensable part of people's daily life. Along with this, there are also a large number of traffic incidents such as wrong-way driving, illegal parking, occupying emergency lanes, congestion, accidents, etc. At the same time, due to technical limitations, traffic operation management has problems such as "cannot see", "cannot see clearly", and "cannot understand".

[0003] In the process of intelligent transportation construction over the years, the problem of "not being able to see" has been solved by installing surveillance cameras at various sections and intersections; the emergence of high-definition surveillance cameras and bayonet cameras has solved the problem of "not being able to see clearly"; a large number of security and computer vision companies, including France's Citilog and Hikvision, have developed a variety of image recognition and video analysis technologies, which can achieve a certain degree of analysis and judgment of traffic events such as reverse driving, illegal parking, and occupying emergency lanes, solving some of the problems of "not being able to understand". However, since early video surveillance systems mostly used gun-type surveillance cameras, the traditional analysis and judgment of traffic events such as reverse driving and illegal parking were all oriented to fixed monitoring areas, that is, on the screen of the area monitored by the gun-type surveillance camera, the lane lines, lane directions, speed measurement lines and other rules were set, and then based on the rules, it was determined whether traffic events such as reverse driving and illegal parking occurred.

[0004] However, as more and more highway video surveillance systems are upgraded, gun-type surveillance cameras are replaced with dome-type surveillance cameras with larger and wider monitoring ranges. Since dome-type surveillance cameras can change monitoring scenes by rotating left and right and up and down, the monitoring area will be changed, causing the rules set in fixed monitoring areas to become invalid, thus making the function of traffic event judgment based on rules almost completely invalid. The problem of "not being able to understand" has intensified, and the judgment of traffic events has returned to the mode of "human eyes staring at video", which has seriously reduced the efficiency of traffic operation management and cannot meet the actual needs of traffic operation management.

[0005] In conclusion, how to provide traffic event determination applicable to non-fixed monitoring areas and realize the analysis and judgment of traffic events in the scene of spherical monitoring cameras is a technical problem that needs to be solved urgently. Summary of the invention

[0006] The technical task of the present invention is to provide a method and system for understanding highway scenes and judging traffic events, so as to solve the problem of how to provide traffic event judgment applicable to non-fixed monitoring areas and realize the analysis and judgment of traffic events in the scene of spherical monitoring cameras.

[0007] The technical task of the present invention is achieved in the following way: a method for understanding a highway scene and determining a traffic event, the method is specifically as follows:

[0008] Perform target detection and target tracking on vehicle targets that appear within a set time in the monitoring scene, and save the vehicle target detection and tracking results;

[0009] Cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area;

[0010] Analyze the vehicle target tracking results, select the tracking results whose tracking track length reaches the threshold in each approximate lane area, and calculate the vehicle's driving direction as the lane direction vector of the approximate lane area;

[0011] The traffic flow statistics line is generated by approximating the maximum and minimum values ​​of the lane area, and the traffic flow statistics, wrong-way driving, illegal parking and accident traffic event analysis are realized based on the approximate lane area and lane direction vector.

[0012] As a preferred method, target detection and target tracking are performed on vehicle targets that appear within a set time in the monitoring scene, and the vehicle target detection results and tracking results are saved as follows:

[0013] Obtain the video code stream from the traffic video surveillance system and decode a frame of image. At the same time, determine the detection mode threshold DN according to the time of the traffic video surveillance system; the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows:

[0014] When DN=1, the vehicle target detection is performed based on the deep learning target detection method, and the results are optimized;

[0015] When DN=2, vehicle target detection is performed based on vehicle light characteristics, and the result is optimized, and the vehicle target detection result is saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame;

[0016] The target tracking algorithm is used to track the vehicle target detection results, and the same target in the current frame and the previous frame is marked as the same target. The coordinates of the target center point are calculated and saved as the vehicle target queue T j ((xj,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected); Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results;

[0017] Among them, the target detection algorithm based on deep learning is as follows:

[0018] Offline model training includes image acquisition, vehicle target labeling, training sample preprocessing, model training and model testing.

[0019] Reasoning detection is to divide the monitoring area into distant view area and near view area, retain a large-sized anchor frame for the distant view area, and retain a small-sized anchor frame for the near view area;

[0020] The model obtained by model training is used to detect vehicle targets in distant and near view areas respectively.

[0021] Preferably, the target detection results are clustered, and the class whose element data reaches the threshold in the clustering results is selected; wherein the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area as follows:

[0022] Define the vehicle target center coordinate set P and the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the jth target queue T j The kth element in ;

[0023] Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum;

[0024] For the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Among them, each Rect i A polygonal area composed of several vertices, Rect i The elements are two-dimensional vectors (x, y); x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex.

[0025] Preferably, the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class is calculated. t , as follows:

[0026] Find a class C i The element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ;

[0027] Choose C i The vertical coordinate is between y up and right Between and the horizontal axis is between x up and x right The selected elements have the following conditions:

[0028] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0029] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0030] Choose C i The vertical coordinate is between y right and down Between and the horizontal axis is between x rightand x down The selected elements have the following conditions:

[0031] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0032] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0033] Choose C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions:

[0034] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0035] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;

[0036] Choose C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions:

[0037] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0038] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i .

[0039] As a preference, the lane direction vector is obtained by calculating the vehicle motion trajectory and lane area Rect in the frame within the cycle. i After analysis and calculation, the lane direction vector Direct i (x1, y1, x2, y2); as follows:

[0040] Calculate the target queue T using angle and discriminant methodj The element (x j,Frame-1 , y j,Frame-1 ) and the positional relationship with the approximate lane area Rec ti ; among them, if (x j,Frame-1 , y j,Frame-1 ) is inside or on the edge of Rect i , it is determined that the target queue T j belongs to the approximate lane area Rect i ;

[0041] For each approximate lane area Rect i , select the Num_d target queues with the most elements from the target queues belonging to this approximate lane area;

[0042] For each selected target queue T i of the approximate lane area Rect i ((x i,0 , y i,0 ), (x i,1 , y i,1 ), …, (x i,Frame-1 , y i,Frame-1 )) of the approximate lane area Rect k , define the vector a i,0 ((x i,0 , y i,k ), (x i,k )); and calculate the angle θ between a1 and each a kk (kk ∈ [2, Frame - 1]); and count the number of θ < Angle as the direction cumulative value of the target queue Ti; where k ∈ [1, Frame - 1]);

[0043] Select the target queue T i with the highest direction cumulative value, and use the vector a Frame-1 as the lane direction vector of the approximate lane area Rect i , and assign values as follows:

[0044] Direct i (x1) = x i,0 ;

[0045] Direct i (y1) = y i,0 ;

[0046] Direct i (x2) = x i,Frame-1 ;

[0047] Direct i (y2) = y i,Frame-1 .

[0048] As a preferred method, a traffic flow statistics line is generated based on the maximum and minimum values ​​of the approximate lane area, and traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis are realized based on the approximate lane area and lane direction vector as follows:

[0049] Dynamically generate approximate lane area Rect i Traffic flow statistics line L i , set status to 2 and enter traffic event determination mode;

[0050] Based on the approximate lane area, lane direction vector and the traffic flow statistics line of the approximate lane area, the traffic flow passing through the monitoring area is counted, and the traffic events of wrong-way driving, illegal parking and accidents are analyzed and judged. The situation is as follows:

[0051] ① If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1;

[0052] ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic;

[0053] ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked;

[0054] Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1];

[0055] ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Recti and meets the following conditions:

[0056]

[0057]

[0058]

[0059] It is determined that the two vehicles have an accident behavior;

[0060] Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold;

[0061] Upload traffic flow statistics and traffic incident warning information to the management module of the traffic video surveillance system.

[0062] More preferably, dynamically generate the traffic flow statistics line L of the approximate lane area Recti i The details are as follows:

[0063] For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down );

[0064] Calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them;

[0065] Calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) has an angle θ2 between them; the situation is as follows:

[0066] ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right ));

[0067] ② When θ1<θ2, the traffic flow statistics line L of the approximate lane area Recti i is ((x i,up ,y i,up ),(x i,down ,y i,down )).

[0068] A highway scene understanding and traffic incident determination system, the system comprising:

[0069] The detection and tracking module is used to detect and track vehicle targets that appear within a set time in the monitoring scene, and save the vehicle target detection results and tracking results;

[0070] The clustering module is used to cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area;

[0071] An analysis module is used to analyze the vehicle target tracking results, select the tracking results whose tracking track length reaches a threshold in each approximate lane area, and calculate the driving direction of the vehicle as the lane direction vector of the approximate lane area;

[0072] The analysis module is used to generate traffic flow statistics lines through the maximum and minimum values ​​of the approximate lane area, and to realize traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis based on the approximate lane area and lane direction vector.

[0073] As a preferred embodiment, the working process of the system is as follows:

[0074] (1) Set the parameters for building the system, as follows:

[0075] The running status variable status is set to an initial value of 0; the scene understanding cycle Frame is used to determine the number of video frames that store vehicle target detection results and tracking results; the clustering effective threshold Class_rate is used to select the class with more elements in the clustering results; the number of direction determination sets Num_d is used to select the Num_d target queues with the most elements in each approximate lane area; the direction angle Angle is used to determine whether the vector directions composed of the elements in the target queue are approximately consistent; the video frame statistics Frame_num is set to an initial value of 0;

[0076] (2) Obtain a video code stream from the traffic video surveillance system and decode a frame of image. At the same time, determine the detection mode threshold DN according to the time of the traffic video surveillance system; the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows:

[0077] When DN=1, the vehicle target detection is performed based on the deep learning target detection method, and the results are optimized;

[0078] When DN=2, vehicle target detection is performed based on vehicle light characteristics, and the result is optimized, and the vehicle target detection result is saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame;

[0079] (3) Use the target tracking algorithm to track the vehicle target detection results, mark the same target in the current frame and the previous frame as the same target, calculate the coordinates of the target center point, and save it as the vehicle target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected); Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results;

[0080] (4) Cluster the vehicle target detection results within the periodic Frame, and identify the approximate lane areas Rect1, Rect2, ..., Rect based on the clustering results. t ; Among them, each Rect i Rect is a polygonal area composed of several vertices. i The elements are two-dimensional vectors (x, y); x is the horizontal coordinate of the vertex, and y is the vertical coordinate of the vertex; the details are as follows:

[0081] (I) Define the vehicle target center coordinate set P and the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the jth target queue Tj The kth element in ;

[0082] (II) Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum;

[0083] (III) For the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Among them, each Rect i A polygonal area composed of several vertices, Rect i The elements are two-dimensional vectors (x, y), where x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex. The details are as follows:

[0084] (i) Find a class C i The elements with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ;

[0085] (ii) Select C i The vertical coordinate is between y up and right Between and the horizontal axis is between x up and x right The selected elements have the following conditions:

[0086] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0087] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0088] (ⅲ) Select C i The vertical coordinate is between y right and down Between and the horizontal axis is between x right and x downThe selected elements have the following conditions:

[0089] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0090] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0091] (iv) Select C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions:

[0092] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0093] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;

[0094] (v) Select C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions:

[0095] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0096] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;;

[0097] (5) Analyze the vehicle motion trajectory within the frame within the cycle and calculate the lane area Rect i Lane direction vector Direct i (x1,y1,x2,y2);

[0098] (6) Based on the dynamic generation of approximate lane area Rect i Traffic flow statistics line Li , set status to 2 and enter traffic event determination mode; the details are as follows:

[0099] For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down );

[0100] Calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them;

[0101] Calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) has an angle θ2 between them; the situation is as follows:

[0102] ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right ));

[0103] ② When θ1<θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,up ,y i,up ),(x i,down ,y i,down ));

[0104] (7) Based on the approximate lane area obtained in step (4), the lane direction vector obtained in step (5), and the traffic flow statistics line of the approximate lane area obtained in step (6), the traffic flow passing through the monitoring area is counted, and traffic events such as wrong-way driving, illegal parking, and accidents are analyzed and judged; the situation is as follows:

[0105] ① If the target queue T of any vehicle c Belongs to the approximate lane area Recti , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1;

[0106] ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic;

[0107] ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked;

[0108] Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1];

[0109] ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Rect i , and the following conditions are met:

[0110]

[0111]

[0112]

[0113] It is determined that the two vehicles have an accident behavior;

[0114] Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold;

[0115] (8) Upload traffic flow statistics and traffic incident warning information to the management module of the traffic video monitoring system.

[0116] A computer-readable storage medium stores a computer program, which can be executed by a processor to implement the highway scene understanding and traffic event determination method as described above.

[0117] The highway scene understanding and traffic incident determination method and system of the present invention have the following advantages:

[0118] (1) The present invention detects and tracks vehicle targets based on deep learning technology and machine learning technology, and creatively analyzes the consistency of vehicle behavior to autonomously identify the approximate lane area of ​​the highway scene, calculate the lane direction vector, and dynamically generate the traffic flow statistics line. Based on the existing rule lines such as the approximate lane area, lane direction and traffic flow statistics line, the present invention performs traffic flow statistics in the highway scene and analyzes and judges traffic events such as wrong-way driving, illegal parking and accidents. This can solve the problem that the rules set in the fixed monitoring area of ​​the highway video monitoring system become invalid after the monitoring area changes after the gun-type monitoring camera is replaced with a dome-type monitoring camera, and the judgment function of common traffic events such as wrong-way driving, illegal parking and accidents becomes invalid after the rules become invalid. This improves the convenience and accuracy of traffic event judgment, reduces the workload of workers, and improves work efficiency at the same time.

[0119] (ii) The present invention has strong scene adaptability and fast calculation speed, and can be applied to various road scenes such as provincial and national highways, bridges, and viaducts. BRIEF DESCRIPTION OF THE DRAWINGS

[0120] The present invention is further described below in conjunction with the accompanying drawings.

[0121] Attached Figure 1 A flowchart of the highway scene understanding and traffic incident determination method;

[0122] Attached Figure 2 A flowchart for identifying approximate lane areas based on density clustering;

[0123] Attached Figure 3 Flow chart for lane direction vector calculation;

[0124] Attached Figure 4 A schematic diagram of the approximate lane area recognition result;

[0125] Attached Figure 5 This is a schematic diagram of the lane direction vector partial results.

[0126] Among them, Figure 5 The blue line in the middle is the final lane direction vector, and the direction is from the blue line to the vertex of the blue circle. DETAILED DESCRIPTION

[0127] The highway scene understanding and traffic event determination method and system of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments.

[0128] Embodiment 1:

[0129] As attached Figure 1 As shown, the highway scene understanding and traffic incident determination method of the present invention is specifically as follows:

[0130] S1. Detect and track the vehicle targets that appear in the monitoring scene within a set time, and save the vehicle target detection results and tracking results;

[0131] S2. Cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; wherein the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area;

[0132] S3, analyzing the vehicle target tracking results, selecting the tracking results whose tracking track length reaches the threshold in each approximate lane area, and calculating the driving direction of the vehicle as the lane direction vector of the approximate lane area;

[0133] S4. Generate traffic flow statistics lines through the maximum and minimum values ​​of the approximate lane area, and realize traffic flow statistics, wrong-way driving, illegal parking and accident traffic event analysis based on the approximate lane area and lane direction vector.

[0134] In this embodiment, step S1 performs target detection and target tracking on vehicle targets that appear in the monitoring scene within a set time, and saves the vehicle target detection results and tracking results as follows:

[0135] S101, obtain a video code stream from the traffic video monitoring system, and decode a frame of image, and determine the detection mode threshold DN according to the time of the traffic video monitoring system; wherein the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows:

[0136] ① When DN=1, the target detection method based on deep learning is used to detect vehicle targets and optimize the results;

[0137] ② When DN = 2, vehicle target detection is performed based on vehicle light characteristics, and the results are optimized, and the vehicle target detection results are saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame;

[0138] S102, using the target tracking algorithm to track the vehicle target detection results, and marking the same target in the current frame and the previous frame as the same target, calculating the target center point coordinates, and saving them as the vehicle target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected); Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results;

[0139] Among them, the target detection algorithm based on deep learning is as follows:

[0140] Offline model training includes image acquisition, vehicle target labeling, training sample preprocessing, model training and model testing.

[0141] Reasoning detection is to divide the monitoring area into distant view area and near view area, retain a large-sized anchor frame for the distant view area, and retain a small-sized anchor frame for the near view area;

[0142] The model obtained by model training is used to detect vehicle targets in distant and near view areas respectively.

[0143] In this embodiment, step S2 clusters the target detection results and selects the class whose element data reaches the threshold in the clustering results; Figure 2 As shown, the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area. The details are as follows:

[0144] S201, define the vehicle target center coordinate set P, and set the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the jth target queue T j The kth element in ;

[0145] S202, clustering the elements in the vehicle target center coordinate set P into K classes by using a density clustering algorithm, and finding t classes containing the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum;

[0146] S203, for the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Among them, each Rect i A polygonal area composed of several vertices, Rect i The elements are two-dimensional vectors (x, y); x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex.

[0147] In this embodiment, the calculation of the approximate lane area Rect1, Rect2, ..., Rect3 composed of the elements contained in each class in step S203 is as follows: t , as follows:

[0148] S20301, find a class C i The elements with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ;

[0149] S20302, Select C i The vertical coordinate is between y up and right Between and the horizontal axis is between x up and x right The selected elements have the following conditions:

[0150] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0151] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0152] S20303, Select Ci The vertical coordinate is between y right and down Between and the horizontal axis is between x right and x down The selected elements have the following conditions:

[0153] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0154] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0155] S20304, Select C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions:

[0156] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0157] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;

[0158] S20305, Select C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions:

[0159] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0160] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i .

[0161] As attached Figure 3 As shown, in this embodiment, the lane direction vector of step S4 is obtained by comparing the vehicle motion trajectory and lane area Rect in the cycle Frame iAnalysis and calculation are performed to obtain the lane direction vector Direct i (x1, y1, x2, y2); specifically as follows:

[0162] (1) Calculate the elements (x j , y j,Frame-1 ) in the target queue T j,Frame-1 and the positional relationship with the approximate lane area Rec ti using the angle and discrimination method; among them, if (x j,Frame-1 , y j,Frame-1 ) is inside or on the edge of Rect i , it is determined that the target queue T j belongs to the approximate lane area Rect i ;

[0163] (2) For each approximate lane area Rect i , select the Num_d target queues with the most elements from the target queues belonging to this approximate lane area;

[0164] (3) For each selected target queue T i of the approximate lane area Rect i ((x i,0 , y i,0 ), (x i,1 , y i,1 ), …, (x i,Frame-1 , y i,Frame-1 ))), define the vector a k ((x i,0 , y i,0 ), (x i,k , y i,k )); and calculate the angle θ between a1 and each a kk (kk ∈ [2, Frame - 1]); and count the number of θ < Angle as the direction cumulative value of this target queue Ti; where k ∈ [1, Frame - 1]);

[0165] (4) Select the target queue T i with the highest direction cumulative value, and use the vector a Frame-1 as the lane direction vector of the approximate lane area Rect i , and assign values as follows:

[0166] Direct i (x1) = x i,0 ;

[0167] Direct i (y1) = y i,0 ;

[0168] Direct i (x2) = x i,Frame-1 ;

[0169] Direct i (y2) = y i,Frame-1 .

[0170] In this embodiment, step S4 generates a traffic flow statistics line based on the maximum and minimum values ​​of the approximate lane area, and implements traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis based on the approximate lane area and lane direction vector as follows:

[0171] S401, dynamically generate approximate lane area Rect i Traffic flow statistics line L i , set status to 2 and enter traffic event determination mode;

[0172] S402: Based on the approximate lane area, the lane direction vector and the traffic flow statistics line of the approximate lane area, the traffic flow passing through the monitoring area is counted, and the traffic events of wrong-way driving, illegal parking and accidents are analyzed and judged. The situation is as follows:

[0173] ① If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1;

[0174] ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic;

[0175] ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked;

[0176] Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1];

[0177] ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Rect i , and the following conditions are met:

[0178]

[0179]

[0180]

[0181] It is determined that the two vehicles have an accident behavior;

[0182] Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold;

[0183] S403, uploading traffic flow statistics information and traffic event warning information to the management module of the traffic video monitoring system.

[0184] In this embodiment, the dynamic generation of the approximate lane area Rect in step S401 i Traffic flow statistics line L i The details are as follows:

[0185] S40101. For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down );

[0186] S40102, calculate lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them;

[0187] S40103, calculate lane direction vector Direct i and vector ((x i,up ,y i,up ),(xi,down ,y i,down )) has an angle θ2 between them; the situation is as follows:

[0188] ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right ));

[0189] ② When θ1<θ2, the traffic flow statistics line L of the approximate lane area Recti i is ((x i,up ,y i,up ),(x i,down ,y i,down )).

[0190] Embodiment 2:

[0191] The highway scene understanding and traffic incident determination system of the present invention comprises:

[0192] The detection and tracking module is used to detect and track vehicle targets that appear within a set time in the monitoring scene, and save the vehicle target detection results and tracking results;

[0193] The clustering module is used to cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area;

[0194] An analysis module is used to analyze the vehicle target tracking results, select the tracking results whose tracking track length reaches a threshold in each approximate lane area, and calculate the driving direction of the vehicle as the lane direction vector of the approximate lane area;

[0195] The analysis module is used to generate traffic flow statistics lines through the maximum and minimum values ​​of the approximate lane area, and to realize traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis based on the approximate lane area and lane direction vector.

[0196] The working process of the system is as follows:

[0197] (1) Set the parameters for building the system, as follows:

[0198] The running status variable status is set to an initial value of 0; the scene understanding cycle Frame is used to determine the number of video frames that store vehicle target detection results and tracking results; the clustering effective threshold Class_rate is used to select the class with more elements in the clustering results; the number of direction determination sets Num_d is used to select the Num_d target queues with the most elements in each approximate lane area; the direction angle Angle is used to determine whether the vector directions composed of the elements in the target queue are approximately consistent; the video frame statistics Frame_num is set to an initial value of 0;

[0199] (2) Obtain a video code stream from the traffic video surveillance system and decode a frame of image. At the same time, determine the detection mode threshold DN according to the time of the traffic video surveillance system; the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows:

[0200] When DN=1, the vehicle target detection is performed based on the deep learning target detection method, and the results are optimized;

[0201] When DN=2, vehicle target detection is performed based on vehicle light characteristics, and the result is optimized, and the vehicle target detection result is saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame;

[0202] (3) Use the target tracking algorithm to track the vehicle target detection results, mark the same target in the current frame and the previous frame as the same target, calculate the coordinates of the target center point, and save it as the vehicle target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected); Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results;

[0203] (4) Cluster the vehicle target detection results within the periodic Frame, and identify the approximate lane areas Rect1, Rect2, ..., Rect based on the clustering results.t ; Among them, each Rect i Rect is a polygonal area composed of several vertices. i The elements are two-dimensional vectors (x, y); x is the horizontal coordinate of the vertex, and y is the vertical coordinate of the vertex; the details are as follows:

[0204] (I) Define the vehicle target center coordinate set P and the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the jth target queue T j The kth element in ;

[0205] (II) Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum;

[0206] (III) For the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Among them, each Rect i A polygonal area composed of several vertices, Rect i The elements are two-dimensional vectors (x, y), where x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex. The details are as follows:

[0207] (i) Find a class C i The element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ;

[0208] (ii) Select C i The vertical coordinate is between y up and right Between and the horizontal axis is between xup and x right The selected elements have the following conditions:

[0209] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0210] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0211] (ⅲ) Select C i The vertical coordinate is between y right and down Between and the horizontal axis is between x right and x down The selected elements have the following conditions:

[0212] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0213] ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ;

[0214] (iv) Select C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions:

[0215] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0216] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;

[0217] (v) Select C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions:

[0218] ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ;

[0219] ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ;;

[0220] (5) Analyze the vehicle motion trajectory within the frame within the cycle and calculate the lane area Rect i Lane direction vector Direct i (x1, y1, x2, y2); (6) Based on the dynamic generation of approximate lane area Rect i Traffic flow statistics line L i , set status to 2 and enter traffic event determination mode; the details are as follows:

[0221] For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down );

[0222] Calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them;

[0223] Calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) has an angle θ2 between them; the situation is as follows:

[0224] ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right ));

[0225] ② When θ1<θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,up ,y i,up ),(x i,down ,y i,down ));

[0226] (7) Based on the approximate lane area obtained in step (4), the lane direction vector obtained in step (5), and the traffic flow statistics line of the approximate lane area obtained in step (6), the traffic flow passing through the monitoring area is counted, and traffic events such as wrong-way driving, illegal parking, and accidents are analyzed and judged; the situation is as follows:

[0227] ①、If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1;

[0228] ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic;

[0229] ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked;

[0230] Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1];

[0231] ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Rect i , and the following conditions are met:

[0232]

[0233]

[0234]

[0235] It is determined that the two vehicles have an accident behavior;

[0236] Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold;

[0237] (8) Upload traffic flow statistics and traffic incident warning information to the management module of the traffic video monitoring system.

[0238] Embodiment 3:

[0239] As attached Figure 1 As shown in the figure, according to the actual scenario, the specific implementation steps are as follows:

[0240] (1) Set the necessary parameters for system construction as follows:

[0241] The system runs the status variable status, and sets the initial value to 0. In particular, when status = 0, the system detects and tracks the vehicle target in the current frame in the monitoring area, and saves the vehicle target detection results and tracking results; when status = 1, the system enters the highway scene understanding mode, identifies the approximate lane area based on the saved vehicle target detection results and the target queue generated by tracking, calculates the lane direction vector, and generates the traffic flow statistics line of the approximate lane area; when status = 2, the system completes the highway scene understanding, and based on the approximate lane area, lane direction vector, and traffic flow statistics line obtained in the highway scene understanding process, counts the traffic flow in the current frame in the monitoring area, and analyzes and judges the traffic events in the current frame in the monitoring area, including wrong-way driving, illegal parking, and accidents;

[0242] Scene understanding cycle Frame = 3000, used to determine the number of video frames for saving vehicle target detection results and tracking results;

[0243] The clustering effective threshold Class_rate = 0.75 is used to select the class with more elements in the clustering results;

[0244] The number of direction determination sets Num_d=5 is used to select the Num_d target queues with the most elements in each approximate lane area;

[0245] The direction angle Angle = π / 12 is used to determine whether the vector directions of the elements in the target queue are approximately consistent;

[0246] Video frame statistics Frame_num, and set the initial value to 0.

[0247] (2) Obtain the video code stream from the traffic video monitoring system and decode a frame of image. At the same time, determine the detection mode threshold DN (1 during the day and 2 at night) according to the system time; the details are as follows:

[0248] ① If DN = 1, the vehicle target detection is performed based on the target detection method based on deep learning, and the results are optimized;

[0249] ② If DN = 0, detect the vehicle target based on the vehicle light characteristics, optimize the results, and save the vehicle target detection results O i (x, y, w, h) (x, y, w, h represent the horizontal coordinate, vertical coordinate, width and height of the upper left corner of the target detection box respectively, and i represents the i-th vehicle target detected in the frame).

[0250] (3) Use the target tracking algorithm to track the vehicle target detection results, mark the same target in the current frame and the previous frame as the same target, calculate the coordinates of the target center point, and save it as the target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 ))(where j represents the jth target queue, (x j,0 ,y j,0 ) is the center point coordinate of the vehicle target when it is detected for the first time), Frame_num=Frame_num+1; if Frame_num=3000, assign status to 1, enter the highway scene understanding mode, and continue with step (four); otherwise, continue with step (two).

[0251] (4) When status = 1, cluster the vehicle target detection results within the period Frame, and identify the approximate lane areas Rect1, Rect2, ..., Rect based on the clustering results. t (where each Rect i Rect is a polygonal area composed of several vertices. i The elements are two-dimensional vectors (x, y), where x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex), as shown in the following figure. Figure 2 As shown, the specific steps are as follows:

[0252] (4.1), define the vehicle target center coordinate set P (the elements in P are two-dimensional vectors (x, y), where x is the horizontal coordinate of the vehicle target center and y is the vertical coordinate of the vehicle target center), and set the target queue Tj The coordinates of the center points of all vehicle targets in (x j,k ,y j,k ) is stored in the vehicle target center coordinate set P, and the total number of elements of P is calculated as Sum; where (x j,k ,y j,k ) represents the jth target queue T j The kth element in ;

[0253] (4.2) Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than: 0.75*Sum, and the total number of elements contained in t-1 classes is less than 0.75*Sum;

[0254] (4.3) For the t classes found in step (5.2), calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t The elements contained in each class here are coordinate points (x, y). If these coordinate points are projected onto the image, the corresponding approximate lane area Rect contains elements that are the outermost coordinate points in this class.

[0255] The specific calculation of the approximate lane area composed of elements contained in each class in step (4.3) is:

[0256] ①. Find a class C i The element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ;

[0257] ②, choose C i The vertical coordinate is between y up and right Between, and the horizontal axis is between x up and x right Furthermore, among the selected elements, if the ordinates of each element are different, all the selected elements are added to the approximate lane area Rect i ; If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among these elements, and add the remaining elements to the approximate lane area Rect i ;

[0258] ③. Select C i The vertical coordinate is between y right and down Between, and the horizontal axis is between x right and x down Furthermore, among the selected elements, if the ordinates of each element are different, all the selected elements are added to the approximate lane area Rect i ; If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among these elements, and add the remaining elements to the approximate lane area Rect i ;

[0259] ④. Select C i The vertical coordinate is between y down and left Between, and the horizontal axis is between x down and x left Furthermore, among the selected elements, if the ordinates of each element are different, all the selected elements are added to the approximate lane area Rect i ; If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among these elements, and add the remaining elements to the approximate lane area Rect i ;

[0260] ⑤. Select C i The vertical coordinate is between y left and up Between, and the horizontal axis is between x left and x up Furthermore, among the selected elements, if the ordinates of each element are different, all the selected elements are added to the approximate lane area Rect i ; If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among these elements, and add the remaining elements to the approximate lane area Rect i .

[0261] The specific effect diagram of the result of executing step (4) is shown in the attached figure. Figure 4 As shown in the figure, the monitoring scene is divided into 5 approximate lanes in total, among which the left lane is merged into an approximate lane area due to the camera angle problem.

[0262] (5) When status = 1, analyze the vehicle motion trajectory within 3000 frames collected in step 4 and calculate the lane direction vectors Direct1(x1, y1, x2, y2), Direct2(x1, y1, x2, y2), …, Direct t(x1,y1,x2,y2); see the flowchart of this step Figure 3 , the specific steps are as follows:

[0263] (5.1) Calculate the target queue T using the angle and discrimination method j The elements in (x j,Frame-1) ,y j,Frame-1 ) and the approximate lane area Rect i The position relationship, if (x j,Frame-1 ,y j,Frame-1 ) in Rect i , then the target queue T is determined. j Belongs to the approximate lane area Rect i ;

[0264] (5.2), for each approximate lane area Rect i , select Num_d target queues with the most elements from the target queues belonging to the approximate lane area;

[0265] (5.3) For the approximate lane area Rect in step (5.3) i Each selected target queue T i ((x i,0 ,y i,0 ),(x i,1 ,y i,1 ),…,(x i,Frame-1 ,y i,Frame-1 )), define vector a k ((x i,0 ,y i,0 ),(x i,k ,y i,k ))(where k∈[1,Frame-1]), and calculate a1 and each a kk (kk∈[2,Frame-1]); and count the number of θ<π / 12 as the target queue T i The cumulative value of the direction;

[0266] (5.4) Select the target queue T with the highest cumulative value in the direction i , and vector a Frame-1 As the approximate lane area Rect i The lane direction vector is assigned as follows:

[0267] Direct i (x1) = x i,0 ;

[0268] Direct i (y1)=y i,0 ;

[0269] Direct i (x2) = x i,Frame-1 ;

[0270] Direct i (y2) = y i,Frame-1 ;

[0271] The specific effect diagram of the result of executing step (5) is shown in the attached figure. Figure 5 As shown, the blue line segment with a circular vertex is the final lane direction vector, and the direction is from the blue line to the blue circle.

[0272] (6) When status = 1, based on the approximate lane area and lane direction information, the traffic flow statistics lines L1, L2, ..., L t , and count the traffic volume passing through the monitoring area, and analyze and judge traffic incidents such as wrong-way driving, illegal parking, and accidents; set status to 2.

[0273] Wherein, step (6) specifically comprises the following steps:

[0274] (6.1), for each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate in the region, respectively denoted as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down ), and calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right )) and calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) angle θ2, if θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right )); Otherwise, the approximate lane area Rect i Traffic flow statistics line L i is ((xi,up ,y i,up ),(x i,down ,y i,down ));

[0275] (6.2) Set status to 2. This means that the highway scene understanding mode has been completed and the traffic event determination process has begun.

[0276] (6.3) When status = 2, upload traffic flow statistics and traffic event alarm information to the system management module.

[0277] The specific process of traffic incident determination in step (6.2) is as follows:

[0278] (6.2.1), for a target queue T c ((x c,0 ,y c,0 ),(x c,1 ,y c,1 ),…,(x c,Frame-1 ,y c,Frame-1 )) , use the angle and discriminant method to calculate the target queue T c The elements in (x c,Frame-1) ,y c,Frame-1 ) and the approximate lane area Rect i The position relationship, if (x c,Frame-1 ,y c,Frame-1 ) in Rect i , then the target queue T is determined. j Belongs to the approximate lane area Rect i ;

[0279] (6.2.2), if the target queue T c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1;

[0280] (6.2.3), if the target queue T c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic;

[0281] (6.2.4), if the target queue T c Belongs to the approximate lane area Rect i , and the following conditions are met:

[0282]

[0283] Among them, Stop_value is the effective displacement judgment threshold, k∈[1,Frame-1];

[0284] Then it is determined that the vehicle has illegally parked;

[0285] (6.2.5) If the target queue T c 、T d Belongs to the approximate lane area Rect i , and the following conditions are met:

[0286]

[0287]

[0288]

[0289] Among them, Stop_value is the effective displacement judgment threshold, Accident_value is the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold;

[0290] Then it is determined that the two vehicles have an accident.

[0291] Embodiment 4:

[0292] The embodiment of the present invention further provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are loaded by a processor, so that the processor executes the highway scene understanding and traffic event determination method in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0293] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0294] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0295] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0296] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0297] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for understanding highway scenes and determining traffic incidents, characterized in that: The method is as follows: Perform target detection and target tracking on vehicle targets that appear within a set time in the monitoring scene, and save the vehicle target detection and tracking results; Cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area; Analyze the vehicle target tracking results, select the tracking results whose tracking track length reaches the threshold in each approximate lane area, and calculate the vehicle's driving direction as the lane direction vector of the approximate lane area; The vehicle flow statistics line is generated by approximating the maximum and minimum values ​​of the lane area, and the traffic event analysis of vehicle flow statistics, reverse driving, illegal parking and accidents is realized based on the approximate lane area and lane direction vector; Among them, the target detection results are clustered, and the class whose element data reaches the threshold in the clustering results is selected; among them, the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area as follows: Define the vehicle target center coordinate set P and the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the kth element in the jth target queue Tj; Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum; For the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Each Rect i Rect is a polygonal area composed of several vertices. i The element is a two-dimensional vector (x, y); where x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex; Calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t , as follows: Find a class C i The element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ; Choose C i The vertical coordinate is between y up and right Between and the horizontal axis is between x up and x right The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ; Choose C i The vertical coordinate is between y right and down Between and the horizontal axis is between x right and x down The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ; Choose C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ; Choose C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ; The lane direction vector is obtained by calculating the vehicle motion trajectory and lane area Rect in the frame within the cycle. i After analysis and calculation, the lane direction vector Direct i (x1, y1, x2, y2); as follows: Calculate the target queue T using angle and discriminant method j The elements in (x j,Frame-1 ,y j,Frame-1 ) and the approximate lane area Rec ti The position relationship of j,Frame-1 ,y j,Frame-1 ) in Rect i , then the target queue T is determined. j Belongs to the approximate lane area Rect i ; For each approximate lane area Rect i , select Num_d target queues with the most elements from the target queues belonging to the approximate lane area; For the approximate lane area Rect i For each selected target queue T i ((x i,0 , y i,0 ), (x i,1 , y i,1 ), …, (x i,Frame-1 , y i,Frame-1 )) of it, define the vector a k ((x i,0 , y i,0 ), (x i,k , y i,k )); and calculate the included angle θ between a1 and each a kk (kk ∈ [2, Frame - 1]); and count the number of θ < Angle as the direction cumulative value of the target queue Ti; where, k ∈ [1, Frame - 1]); Select the target queue T with the highest cumulative value in the direction i , and vector a Frame-1 As the approximate lane area Rect i The lane direction vector is assigned as follows: Direct i (x1)=x i,0 ; Direct i (y1)=y i,0 ; Direct i (x2)=x i,Frame-1 ; Direct i (y2)=y i,Frame-1 ; Based on the maximum and minimum values ​​of the approximate lane area, the traffic flow statistics line is generated, and based on the approximate lane area and lane direction vector, the traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis are realized as follows: Dynamically generate approximate lane area Rect i Traffic flow statistics line L i , set status to 2 and enter traffic event determination mode; Based on the approximate lane area, lane direction vector and the traffic flow statistics line of the approximate lane area, the traffic flow passing through the monitoring area is counted, and the traffic events of wrong-way driving, illegal parking and accidents are analyzed and judged. The situation is as follows: ① If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1; ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic; ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked; Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1]; ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the two vehicles have an accident behavior; Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold; Upload traffic flow statistics and traffic incident warning information to the management module of the traffic video monitoring system; Dynamically generate approximate lane area Rect i Traffic flow statistics line L i The details are as follows: For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down ); Calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them; Calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) has an angle θ2 between them; the situation is as follows: ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right )); ② When θ1<θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,up ,y i,up ),(x i,down ,y i,down )).

2. The highway scene understanding and traffic incident determination method according to claim 1, characterized in that: Perform target detection and target tracking on vehicle targets that appear within the set time in the monitoring scene, and save the vehicle target detection results and tracking results as follows: Obtain the video code stream from the traffic video surveillance system and decode a frame of image. At the same time, determine the detection mode threshold DN according to the time of the traffic video surveillance system; the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows: When DN=1, the vehicle target detection is performed based on the deep learning target detection method, and the results are optimized; When DN=2, vehicle target detection is performed based on vehicle light characteristics, and the result is optimized, and the vehicle target detection result is saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame; The target tracking algorithm is used to track the vehicle target detection results, and the same target in the current frame and the previous frame is marked as the same target. The coordinates of the target center point are calculated and saved as the vehicle target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected; Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results; Among them, the target detection algorithm based on deep learning is as follows: Offline model training includes image acquisition, vehicle target labeling, training sample preprocessing, model training and model testing. Reasoning detection is to divide the monitoring area into distant view area and near view area, retain a large-sized anchor frame for the distant view area, and retain a small-sized anchor frame for the near view area; The model obtained by model training is used to detect vehicle targets in distant and near view areas respectively.

3. A highway scene understanding and traffic incident determination system, characterized in that: The system is used to implement the highway scene understanding and traffic incident determination method described in claim 1 or 2; The system includes, The detection and tracking module is used to detect and track vehicle targets that appear within a set time in the monitoring scene, and save the vehicle target detection results and tracking results; The clustering module is used to cluster the target detection results and select the class whose element data reaches the threshold in the clustering results; the area covered by the elements in the class whose element data reaches the threshold is the approximate lane area; An analysis module is used to analyze the vehicle target tracking results, select the tracking results whose tracking track length reaches a threshold in each approximate lane area, and calculate the driving direction of the vehicle as the lane direction vector of the approximate lane area; The analysis module is used to generate traffic flow statistics lines through the maximum and minimum values ​​of the approximate lane area, and to realize traffic flow statistics, reverse driving, illegal parking and accident traffic event analysis based on the approximate lane area and lane direction vector.

4. The highway scene understanding and traffic incident determination system according to claim 3, characterized in that: The working process of the system is as follows: (1) Set the parameters for building the system, as follows: The running status variable status is set to an initial value of 0; the scene understanding cycle Frame is used to determine the number of video frames that store vehicle target detection results and tracking results; the clustering effective threshold Class_rate is used to select the class with more elements in the clustering results; the number of direction determination sets Num_d is used to select the Num_d target queues with the most elements in each approximate lane area; the direction angle Angle is used to determine whether the vector directions composed of the elements in the target queue are approximately consistent; the video frame statistics Frame_num is set to an initial value of 0; (2) Obtain a video code stream from the traffic video surveillance system and decode a frame of image. At the same time, determine the detection mode threshold DN according to the time of the traffic video surveillance system; the daytime threshold DN is 1, and the nighttime threshold DN is 2; the details are as follows: When DN=1, the vehicle target detection is performed based on the deep learning target detection method, and the results are optimized; When DN=2, vehicle target detection is performed based on vehicle light characteristics, and the result is optimized, and the vehicle target detection result is saved. i (x, y, w, h); x, y, w, h represent the upper left corner abscissa, ordinate, width and height of the target detection frame respectively; i represents the i-th vehicle target detected in the frame; (3) Use the target tracking algorithm to track the vehicle target detection results, mark the same target in the current frame and the previous frame as the same target, calculate the coordinates of the target center point, and save it as the vehicle target queue T j ((x j,0 ,y j,0 ),(x j,1 ,y j,1 ),…,(x j,Frame-1 ,y j,Frame-1 )); where j represents the jth target queue; (x j,0 ,y j,0 ) represents the center point coordinates of the vehicle target when it is first detected); Frame_num represents the video frame statistics, and the initial value is set to 0; Frame_num = Frame_num + 1; when Frame_num = Frame, set status to 1, highway scene understanding mode; Frame represents the scene understanding cycle, which is used to determine the number of video frames for saving vehicle target detection results and tracking results; (4) Cluster the vehicle target detection results within the periodic Frame, and identify the approximate lane areas Rect1, Rect2, ..., Rect based on the clustering results. t ; Each Rect i Rect is a polygonal area composed of several vertices. i The elements are two-dimensional vectors (x, y); x is the horizontal coordinate of the vertex, and y is the vertical coordinate of the vertex; the details are as follows: (I) Define the vehicle target center coordinate set P and the target queue T j The coordinates of the center points of all vehicle targets in (x j ,k,y j ,k) are stored in the vehicle target center coordinate set P, and the total number of elements in P is calculated as Sum; where the elements in P are two-dimensional vectors (x, y); x represents the horizontal coordinate of the vehicle target center; y represents the vertical coordinate of the vehicle target center; (x j ,k,y j ,k) represents the jth target queue T j The kth element in ; (II) Cluster the elements in the vehicle target center coordinate set P into K classes through the density clustering algorithm, and find the t classes with the most elements, so that the total number of elements contained in these t classes is greater than Class_rate*Sum, and the total number of elements contained in t-1 classes is less than Class_rate*Sum; (III) For the t classes found, calculate the approximate lane area Rect1, Rect2, ..., Rect composed of the elements contained in each class t ; Each Rect i Rect is a polygonal area composed of several vertices. i The elements are two-dimensional vectors (x, y), where x is the horizontal coordinate of the vertex and y is the vertical coordinate of the vertex. The details are as follows: (i) Find a class C i The element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate, and the largest vertical coordinate are respectively denoted as (x left ,y left )、(x right ,y right )、(x up ,y up )、(x down ,y down ) and added to the approximate lane area Rect i ; (ii) Select C i The vertical coordinate is between y up and right Between and the horizontal axis is between x up and x right The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ; (ⅲ) Select C i The vertical coordinate is between y right and down Between and the horizontal axis is between x right and x down The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with the non-largest abscissa among them and add the remaining elements to the approximate lane area Rect i ; (iv) Select C i The vertical coordinate is between y down and left Between and the horizontal axis is between x down and x left The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ; (v) Select C i The vertical coordinate is between y left and up Between and the horizontal axis is between x left and x up The selected elements have the following conditions: ① If the ordinates of each element are different, all selected elements are added to the approximate lane area Rect i ; ② If there are multiple elements with the same ordinate, remove the element with a non-smallest abscissa among the multiple elements and add the remaining elements to the approximate lane area Rect i ; (5) Analyze the vehicle motion trajectory within the frame within the cycle and calculate the lane area Rect i Lane direction vector Direct i (x1,y1,x2,y2); (6) Based on the dynamic generation of approximate lane area Rect i Traffic flow statistics line L i , set status to 2 and enter traffic event determination mode; the details are as follows: For each approximate lane area Rect i , find the element with the smallest horizontal coordinate, the largest horizontal coordinate, the smallest vertical coordinate and the largest vertical coordinate in the region and record them as (x i,left ,y i,left )、(x i,right ,y i,right )、(x i,up ,y i,up )、(x i,down ,y i,down ); Calculate the lane direction vector Direct i and vector ((x i,left ,y i,left ),(x i,right ,y i,right ))The included angle θ1 between them; Calculate the lane direction vector Direct i and vector ((x i,up ,y i,up ),(x i,down ,y i,down )) has an angle θ2 between them; the situation is as follows: ①, when θ1 ≥ θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,left ,y i,left ),(x i,right ,y i,right )); ② When θ1<θ2, the approximate lane area Rect i Traffic flow statistics line L i is ((x i,up ,y i,up ),(x i,down ,y i,down )); (7) Based on the approximate lane area obtained in step (4), the lane direction vector obtained in step (5), and the traffic flow statistics line of the approximate lane area obtained in step (6), the traffic flow passing through the monitoring area is counted, and traffic events such as wrong-way driving, illegal parking, and accidents are analyzed and judged; the situation is as follows: ① If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists (x c,k ,y c,k ) and (x c,k+1 ,y c,k+1 ) are located in L i On both sides, the traffic flow statistics of the approximate lane area increase by 1; ② If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and there exists a vector ((x c,0 ,y c,0 ),(x c,Frame-1 ,y c,Frame-1 )) and the lane direction vector Direct i If the angle between the two vehicles is greater than 90 degrees, it is determined that the vehicle is driving against traffic; ③. If the target queue T of any vehicle c Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the vehicle has illegally parked; Among them, Stop_value represents the effective displacement judgment threshold, k∈[1,Frame-1]; ④ If the target queue T of any two vehicles c and T d Belongs to the approximate lane area Rect i , and the following conditions are met: It is determined that the two vehicles have an accident behavior; Among them, Stop_value represents the effective displacement judgment threshold; Accident_value represents the effective accident judgment threshold, kc∈[1,Frame-1], kd∈[1,Frame-1], k∈[Frame-1-A_n,Frame-1], A_n is the accident judgment confidence threshold; (8) Upload traffic flow statistics and traffic incident warning information to the management module of the traffic video monitoring system.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the highway scene understanding and traffic event determination method as described in claim 1 or 2.