A vehicle interweaving and congestion key vehicle identification method based on visual identification
By performing vehicle detection and multi-target tracking in intersection surveillance videos, and utilizing homography matrix mapping and comprehensive congestion index calculation, the contribution of key vehicles can be identified. This solves the problem of difficulty in locating key vehicles in congestion in existing technologies, and enables interpretability and real-time risk analysis of traffic congestion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JILIN UNIVERSITY
- Filing Date
- 2026-04-29
- Publication Date
- 2026-06-05
AI Technical Summary
Existing traffic congestion assessment methods struggle to reliably extract interwoven evidence from intersection surveillance videos, fail to accurately reflect the congestion formation mechanism, struggle to locate key vehicles, and are difficult to achieve real-time risk analysis, interpretable display, and event tracing in intersection scenarios.
By collecting traffic surveillance video at intersections, vehicle detection and multi-target tracking are performed. Based on homography matrix mapping, vehicle coordinates are mapped to bird's-eye view coordinates. A comprehensive congestion index is calculated and events are triggered in a graded manner. Vehicle weaving relationships are identified, the congestion contribution of key vehicles is calculated, and a visualization layer and event file are generated.
It enables the interpretable quantification of congestion causes, adapts to different traffic scenarios, reduces system deployment costs, provides interpretable and traceable diagnostic evidence, is suitable for batch deployment at multiple intersections, and supports real-time traffic monitoring and early warning.
Smart Images

Figure CN122157500A_ABST
Abstract
Description
Technical Field
[0001] With the continuous growth of urban motor vehicle ownership, traffic congestion at intersections, ramps, and bottleneck sections is characterized by high frequency, rapid spread, and wide impact. Existing traffic operation monitoring and congestion assessment methods mainly include geomagnetic coils, radar, floating cars, and fixed surveillance videos, among which video surveillance is widely used due to its relatively low deployment cost and rich information content. Background Technology
[0002] Existing video-based traffic congestion assessment methods typically focus on statistical macro-indicators of traffic flow, such as vehicle quantity and density, average vehicle speed, queue length, and occupancy rate. Yanli Ma proposed a real-time risk assessment method for multi-vehicle interaction in weaving areas based on a risk potential field. This method quantifies the risk of multi-vehicle interaction by constructing risk potential energy between vehicles and combining it with vehicle motion states. Parameter calibration is then used to match the model output with typical conflict indicators, thereby enabling the assessment and comparative analysis of risk intensity in weaving areas (Yanli Ma, Fangqi Dong, Biqing Yin, Yining Lou, Real-time risk assessment model for multi-vehicle interaction of connected and autonomous vehicles in weaving area based on risk potential field (Physica A, 2023)). However, it has the following defects: (1) This method is geared towards “risk assessment” of the vehicle-to-everything (V2X) / autonomous driving weaving zone. It usually relies on relatively complete kinematic data and parameter calibration, and outputs risk field / risk value. It is difficult to stably extract weaving evidence from intersection monitoring videos and give vehicle-level congestion contribution ranking; (2) It does not couple the results with congestion mechanisms such as signal cycle queuing and backlog clearing, so it is difficult to meet the requirements of “real-time interpretable display + event tracing + key congested vehicle location” in intersection scenarios. Zheng Lai used roadside lidar point clouds to extract the trajectories of motor vehicles, non-motor vehicles, and pedestrians, and based on alternative safety indicators such as TTC and PET, he achieved automatic identification of multiple types of traffic conflicts (conflict points / encroachment events) at signalized intersections. At the same time, he proposed correction strategies for problems such as trajectory breakage, type misidentification, and the same target being split into multiple trajectories, and compared and verified them with the results of manual identification (Zheng, L., Fan, S., Ma, S., & Jiao, H. (2024). Multi-Type Traffic Conflict Identification at Signalized Intersections Based on LiDAR Point Cloud. Transportation Research Record, 2678(10), 916–925.).However, it has the following shortcomings: (1) The study uses LiDAR point cloud as the main data source, which is not suitable for low-cost batch deployment of monitoring video terminals; (2) Its output focuses on conflict events and indicator thresholds, which makes it difficult to further form a closed loop of "vehicle-level congestion contribution ranking + interpretable visualization + event traceability file" oriented towards congestion mechanism; In addition, when relying solely on video detection and tracking, it may still face the problem of interlacing point extraction being sensitive to trajectory continuity and measurement noise, and lacking stability.
[0003] Therefore, existing congestion assessment methods are based on relatively macroscopic parameter model estimations, mostly relying on macroscopic indicators, which makes it difficult to accurately reflect the formation mechanism of congestion. Although they have application value in specific scenarios, they lack spatial representation and readability when facing integrated applications of "real-time risk analysis + interpretable display + event tracing," and they are also difficult to locate key vehicles that cause or exacerbate congestion. Therefore, there is an urgent need for a traffic congestion key vehicle identification method for real-time risk analysis in intersection traffic scenarios. Summary of the Invention
[0004] In view of the shortcomings and deficiencies of existing technologies, the purpose of this invention is to provide a vision-based method for identifying key vehicles in traffic weaving and congestion. This method acquires intersection surveillance video and performs vehicle detection and multi-target tracking; solves the homography matrix based on calibration points to map vehicle coordinates to bird's-eye view coordinates; calculates the direction and speed for each vehicle; constructs a comprehensive congestion index and triggers events according to threshold levels; identifies vehicle weaving relationships, calculates the congestion contribution of key vehicles based on these relationships, and outputs a ranking of key congestion vehicles; finally, it combines the comprehensive congestion index, risk level, and key vehicle congestion contribution value (key congestion vehicles) to generate a visualization layer and event file. This method does not require high-precision maps or additional hardware, balances macro-level congestion assessment with micro-level vehicle-level diagnosis, is adaptable to batch deployment at multiple intersections, and effectively solves the technical problems of unstable extraction of weaving points, difficulty in identifying key congested vehicles, and insufficient explanation of congestion mechanisms in existing technologies.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A vision-based method for identifying key vehicles in vehicle weaving and congestion, comprising the following steps: Step S1: Collect intersection surveillance video, perform vehicle target detection and multi-target tracking on the video frames to obtain the detection box and unique tracking identifier of each vehicle; Step S2: Solve the homography matrix based on the four non-collinear calibration points on the ground plane of the intersection, and map the pixel coordinates of the vehicles in the video frame to the bird's-eye view coordinate system; Step S3: Calculate the vehicle's motion state parameters based on the position coordinates of the same tracking identifier in the bird's-eye view coordinate system in consecutive frames; Step S4: Calculate the comprehensive congestion index, which characterizes the degree of congestion at the intersection, based on the vehicle motion state parameters. Congestion risk is classified according to preset thresholds and included in the comprehensive congestion index. When the event triggering conditions are met, execute step S5; Step S5: Identify the weaving relationships between vehicles and calculate the congestion contribution of each vehicle based on these relationships. The system outputs a set of key vehicles and / or a ranking of key vehicles based on their congestion contribution. The weaving relationship between vehicles is determined by the geometric intersection of the vehicle driving direction indicator line segments, which determines the conflict relationship of vehicle driving trajectories. The congestion contribution is calculated based on the number of weaving points of vehicles, combined with multi-dimensional factor weighting and vehicle type differentiation weighting for intersection scenarios. The multi-dimensional factor weighting includes at least a distance urgency factor, a dynamic weight of the comprehensive congestion index, and a weaving time correction factor. Step S6: Spatiotemporally align the comprehensive congestion index, congestion risk level, and congestion contribution at the same time to generate a visual overlay result.
[0006] As a preferred embodiment of the present invention, step S1 specifically involves: firstly, decoding the collected fixed-point monitoring video of the intersection frame by frame according to a set frame rate to obtain the... Time frame image The image frames are then input into the target detection model to obtain the detection set. Next, class-based adaptive confidence gating and GPU-based tensor masking are applied to the detection set to block irrelevant category detection boxes that do not meet the conditions, resulting in a vehicle detection set. Then, non-maximum suppression is applied to the vehicle detection set to remove overlapping detection boxes. Finally, the processed vehicle detection results are input into the multi-target tracking module, which outputs the matching relationship and trajectory status.
[0007] As a preferred embodiment of the present invention, the vehicle motion state parameters in step S3 include at least the driving direction and driving speed; wherein, the vehicle driving direction is obtained by first combining the real-world physical coordinate sequence of the same trajectory within a historical time window, and then using the least squares method to fit and generate a time-series motion trajectory angle based on the world coordinate system. When the target detection uses the OBB rotated bounding box parameter model, the spatial heading reference angle is calculated based on the image heading angle output by the model. Then, a speed-adaptive weighting function is used to dynamically adjust the confidence levels of both parameters, and a nonlinear vector field synthesis formula is introduced to construct the vehicle's final unit direction vector. The expression is: ; in, The dynamic confidence weights for the trajectory direction. , To smooth the attenuation coefficient, The vehicle speed.
[0008] In a preferred embodiment of the present invention, step S4 processes the vehicle motion state parameters obtained in step S3, removes abnormal samples, constructs a valid vehicle set, and calculates the comprehensive congestion index based on the valid vehicle set. The expression is: ; in, All of these are weighting coefficients. The vehicle quantity factor is determined based on the effective vehicles after removal and the intersection saturation capacity threshold. The velocity decay factor is determined based on the average velocity and the phase transition threshold velocity. The percentage of static areas; The edge percentage is determined based on the number of valid vehicles within the edge zone and the total number of valid vehicles currently in use. After obtaining the comprehensive congestion index, a length of [length missing] is used. The congestion risk is then graded based on a preset threshold after smoothing the time window.
[0009] As a preferred embodiment of the present invention, step S5 first divides the congested road segment into an intersection road segment or a long straight road segment. If the current congested road segment is an intersection road segment, then the vehicles are divided into weaving road segment group and non-weaving road segment group according to the location of the vehicles. For vehicles in the non-weaving road segment group, they are further divided into two subgroups: entrance lane and exit lane. Different congestion contribution assessment methods are used for different groups. When identifying the weaving relationships between vehicles in congested road sections, directional indicator line segments are constructed based on the vehicle's position, unit direction vector, and speed; subsequently, for any vehicle pair... Determine the direction indicator line segment and The geometric intersection relationship yields pairwise interlacing indicators. When the interleaving condition is met, take Otherwise take The number of vehicle weaving points is counted based on pairwise weaving relationships. It is used for assessing the contribution of congestion.
[0010] As a further preferred embodiment of the present invention, the direction indicator line segment in step S5 The starting point is the end point of the vehicle. ,end for: ; in, Based on the extended length, For speed proportionality coefficient, the first The car at any time The position is The unit direction vector is The vehicle speed is The length of the direction indicator line segment is .
[0011] As a further preferred embodiment of the present invention, the first step after grouping in step S5 Group congestion contribution If the intersection is a weaving section, the comprehensive congestion index is calculated using an adaptive dynamic weighting method. Total number of vehicles in a group When ≤1, , When there are no valid interleaved events , When the first Total number of vehicles in a group At that time, the first Group Congestion Contribution The expression is: ; ; In the formula, ; This is the overall congestion index of the current road segment after smoothing. ; Vehicle interaction situation factors, Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; Interleaving time correction factor; No. The contribution of the i-th vehicle to congestion in the intersecting road sections within the group ,in The corresponding vehicle model differentiation weight.
[0012] As a further preferred embodiment of the present invention, in step S5, if the intersection is a non-weaving section, then different comprehensive congestion indices are used to adaptively and dynamically weight the calculation of the first congestion index. Group Congestion Contribution When the first Total number of vehicles in a group hour, , When the first Total number of vehicles in a group At that time, for the import road Group vehicle congestion contribution The expression is: ; ; For the exit road Group vehicle congestion contribution The expression is: ; ; ; in, ; This is the overall congestion index of the current road segment after smoothing. ; For vehicle interaction situation factors; The clearing weighting coefficient; This is the low-speed attenuation term at the exit point; For the export road The average speed of the group of vehicles; Reference speed for free flow at the exit lane of an urban intersection; Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; The complete signal cycle duration of the traffic lights at the target intersection; The duration of continuous stationary movement of vehicles at the entrance and exit lanes of non-interlacing areas; when , ; No. The congestion contribution of the i-th vehicle on the non-weaving road segment within the group ,in The corresponding vehicle model differentiation weight.
[0013] As a further preferred embodiment of the present invention, if step S5 is performed on a long straight road section, then the... Group vehicle congestion contribution The expression is: ; ; ; in, ; For the first The total number of vehicles in the group This is the overall congestion index of the current road segment after smoothing. ; Vehicle interaction situation factors, Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; As the interleaving time correction factor, As the static bottleneck resistance factor, The duration of time the vehicle remains stationary; No. The contribution of the i-th vehicle to congestion on a long straight road segment within the group ;in, To assign different weights to the corresponding vehicle models, To correspond to the driving speed of TrackID vehicles, For free-flowing traffic speeds in the city.
[0014] As a further preferred embodiment of the present invention, the distance urgency factor and interleaving time correction factor They are respectively: = ; ; in, The average distance from the two vehicles to the weaving point. For timestamp The critical safety distance in the following scenarios The duration of continuous weaving between the two vehicles.
[0015] Advantages and beneficial effects of the present invention: (1) This invention enables the quantification of the "interpretability" of congestion causes. Traditional traffic congestion assessment methods mostly remain at the level of macro indicators (such as average vehicle speed, queue length, and congestion index), which can only answer the question of "whether there is congestion" but cannot answer "why there is congestion" and "who caused the congestion". This invention, by constructing a quantitative mapping of "vehicle weaving relationship - congestion contribution", for the first time sinks the causes of congestion from "statistical phenomena" to structured data of "traceable individual behavior". The contribution value of each identified key vehicle directly reflects the "responsibility weight" of the vehicle in the formation of congestion, providing traffic managers with interpretable, traceable, and accountable diagnostic basis.
[0016] (2) This invention achieves scenario-adaptive and refined modeling, covering the complexity of real traffic. The mechanism of traffic congestion varies depending on the scenario: at intersections, vehicle weaving is the main problem; on long straight sections, queue overflow is the core issue; and on non-weaving sections, stationary vehicles also contribute significantly to congestion. This invention designs differentiated contribution calculation models for the above three typical scenarios, and solves the long-standing modeling problem of "the continuous impact of stationary vehicles on long straight sections" through specialized parameters such as static bottleneck resistance factors and speed attenuation factors. This scenario-adaptive design makes this method applicable to more than 90% of congestion scenarios in urban roads, far exceeding the applicability of traditional "one-size-fits-all" assessment methods.
[0017] (3) This invention achieves a unified spatial approach that combines low cost and high precision in monography bird's-eye view mapping. By using monography bird's-eye view mapping, a unified conversion between image pixel coordinates and real-world coordinates is achieved. This eliminates the need for additional sensing hardware such as high-precision maps or radar; the entire evaluation process can be completed using only standard intersection surveillance video, significantly reducing system deployment costs. Furthermore, this invention enables rapid monography conversion, adapting to existing urban traffic monitoring systems and facilitating batch deployment across multiple intersections. Since the monography conversion for vehicle recognition does not convert the entire vehicle but rather the coordinates of the vehicle's center point, it maintains stable accuracy in vehicle recognition and tracking. This technical approach significantly reduces system deployment costs while ensuring vehicle recognition and tracking accuracy, enabling the method to be deployed quickly and conveniently, covering existing urban traffic monitoring networks in batches.
[0018] (4) This invention establishes a unified analytical framework for macro-level situation and micro-level diagnosis, embedding the comprehensive congestion index as a dynamic weight into the analysis of vehicle-level contribution, thereby achieving non-linear coupling between "macro-level congestion status" and "micro-level vehicle behavior." When the congestion level is low, the contribution is mainly determined by the complexity of vehicle driving behavior (number of intersection points); when congestion worsens, the contribution reflects the intensity of interaction between vehicles more. This adaptive mechanism ensures that the evaluation results conform to macro-level traffic patterns and accurately pinpoint the micro-level responsible parties.
[0019] (5) This invention can decouple vehicle detection and tracking, coordinate mapping, state calculation, congestion index assessment, contribution quantification, and visualization output into independent modules. Users can flexibly adjust these modules according to actual intersection geometry (number of lanes, lane width, signal cycle), vehicle type classification standards, and congestion level thresholds without modifying the core content. This design allows the method to operate as an independent system or be embedded as a module into existing traffic management platforms, making it highly adaptable to various engineering scenarios.
[0020] (6) This invention fully considers real-time requirements: vehicle detection and tracking adopt a lightweight deep learning model (such as YOLO11); homography is a matrix multiplication operation with extremely low computational cost; the comprehensive congestion index and contribution calculation are both analytical formulas, requiring no iterative optimization. On mainstream edge computing devices (such as NVIDIA Jetson series) or cloud servers, the single-intersection processing frame rate can reach 25-30 FPS, meeting the timeliness requirements of real-time traffic monitoring and early warning.
[0021] (7) This invention not only outputs evaluation results, but also constructs a closed-loop process of "event identification - contribution measurement - visualization presentation - result archiving". The system can automatically record the start and end times, peak times, and risk level evolution curves of congestion events, and output visualized results including key vehicle labels, contribution values, and risk level indicators in a layered manner. These output results can be directly used for downstream applications such as traffic management review, traffic accident tracing, and driver behavior analysis, significantly reducing the time cost from "data" to "decision".
[0022] (8) This invention can accurately locate key vehicles in congestion, enabling managers to “follow the map”: to focus on, trace and analyze, and even enforce accountability for vehicles that rank first in terms of contribution.
[0023] (9) This invention is the first to introduce traffic flow conservation and the queuing dissipation mechanism at signalized intersections into vehicle interaction modeling. During the event triggering phase, the nearest... The peak time of the comprehensive congestion index is selected using seconds as the time window. Directional indicator segments are constructed using the vehicle tail endpoints and headings. Vehicle weaving events are defined by geometric intersection and temporal proximity constraints, resulting in pairwise weaving indicators and weaving point groupings. A multi-dimensional weighted weaving intensity is further constructed, incorporating distance urgency factors and weaving duration correction factors. Adaptive gating based on the comprehensive congestion index is used to achieve dynamic weighting of low congestion emphasizing structural levels and high congestion emphasizing interaction. For non-weaving zone entrances and exits, a signal cycle is introduced... The normalized static duration saturation term and the exit channel low-speed decay term characterize the insufficient queuing and backlog clearing across cycles.
[0024] (10) This invention can provide a decision-making basis for vehicle-to-everything (V2X) and autonomous driving scenarios. In V2X and autonomous driving scenarios, vehicles need to perceive the surrounding traffic situation and predict risks in real time. The vehicle-level congestion contribution output by this method can be used as a "dynamic risk warning" information pushed to vehicles by the roadside unit (RSU): when the contribution of a vehicle exceeds the threshold, the system can broadcast warnings such as "abnormal behavior of the vehicle ahead, it is recommended to keep a safe distance" to surrounding vehicles, thereby improving the safety and efficiency of the overall traffic flow.
[0025] (11) This invention can provide data support for traffic insurance and driving behavior scoring. Based on the vehicle contribution data obtained by this invention, a "driving behavior scoring model" can be derived: vehicles with high contribution in congestion events are identified as having "high risk" or "poor driving" behavior, which can be used as a reference for UBI (Usage-Based Insurance) car insurance pricing or for behavior correction in driver training. This application direction expands the commercial value boundary of this method.
[0026] (12) During continuous operation, this method will continuously accumulate structured data such as key vehicle identification records, congestion event trajectories, and vehicle contribution distribution. As this data accumulates over time, it can form a "traffic behavior dataset" covering different time periods, weather conditions, and traffic states, which can be used for subsequent data-driven applications such as traffic planning optimization, signal timing learning, and congestion prediction model training. This "assessment as data" characteristic makes this method not only a technical solution but also a tool for building sustainable and value-added data assets.
[0027] (13) This method enables contribution-driven counterfactual evaluation and parameter self-calibration mechanisms. This invention can, during event triggering or review phases, rank vehicles by their contribution. The candidate critical vehicles undergo "counterfactual ablation" calculation: without altering the trajectories of other vehicles, the candidate vehicles are virtually removed or their trajectories are perturbed (e.g., their speed is increased to the free-flow reference, their stationary state is replaced with a low-speed uniform state, or the length of their weaving segments is proportionally shortened), and the overall congestion index is recalculated. and contribution within the group The system corrects the screening results of key vehicles based on the changes in the index before and after ablation, and adaptively calibrates the clearing weight, time scale parameters, and vehicle type weight, thereby improving the accuracy and interpretability of key vehicle identification and enhancing the generalization ability across intersections and time periods. Attached Figure Description
[0028] Other objects and results of the invention will become more apparent and readily understood with reference to the following description taken in conjunction with the accompanying drawings. In the drawings: Figure 1 A flowchart of a vision-based method for identifying key vehicles in vehicle weaving and congestion, provided by the present invention; Figure 2 A flowchart for congestion assessment and critical vehicle identification based on motion state parameters; Figure 3 A bird's-eye view illustration of vehicle target tracking and motion vector; Figure 4 This is a schematic diagram illustrating the trend of the comprehensive congestion index over time. Figure 5 A visual illustration of the key congested vehicle identification results in a complex and intertwined scenario; Figure 6 A comparative curve of the comprehensive congestion index after key vehicle location and identification. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solutions and advantages of the present invention, the present application will be described in detail below with reference to the accompanying drawings, but this is not intended to limit the scope of protection of the present invention.
[0030] All symbols and parameter definitions involved in this embodiment are consistent with those in the claims and specification of this invention, including: image frames. Target set Homography matrix Image pixels World plane mapping point World plane coordinates Vehicle coordinates at different times , , , Vehicle speed Comprehensive congestion index Number of vehicle weaving points Intertwined indicator quantities Congestion contribution within the group Vehicle-level congestion contribution wait.
[0031] like Figure 1 As shown, this embodiment provides a vision-based method for identifying key vehicles in vehicle weaving and congestion, which includes the following steps: Step S1: Collect intersection surveillance video, perform vehicle target detection and multi-target tracking on the video frames, and obtain the detection box and its unique tracking identifier (TrackID) for each vehicle. Step S2: Solve the homography matrix based on the four non-collinear calibration points on the ground plane of the intersection, and map the pixel coordinates of the vehicle in the video frame to the bird's-eye view coordinate system to obtain the position coordinates of the vehicle in the bird's-eye view coordinate system. Step S3: Based on the position coordinates of the same TrackID in the bird's-eye view coordinate system in consecutive frames, calculate the motion state parameters of the vehicle, which include at least the driving direction and driving speed; Step S4: Calculate the comprehensive congestion index, which characterizes the degree of congestion at the intersection, based on the vehicle motion state parameters. Congestion risk is classified according to preset thresholds and included in the comprehensive congestion index. When the event triggering conditions are met, step S5 is executed, which is to enter the congestion contribution calculation stage; Step S5: In the congestion contribution calculation stage, identify the weaving relationship between vehicles and calculate the congestion contribution of each vehicle based on the weaving relationship. The system outputs a set of key vehicles and / or a ranking of key vehicles based on their congestion contribution; the inter-vehicle weaving relationship is determined by the geometric intersection of vehicle direction indicator line segments to identify vehicle trajectory conflict relationships; the congestion contribution... To quantify the impact of vehicles on intersection congestion, a quantitative indicator is calculated based on the number of vehicle weaving points, combined with multi-dimensional factor weighting for intersection scenarios and vehicle type differentiation weighting. A static bottleneck resistance factor is introduced to address the queuing overflow congestion problem on long straight road sections. The multi-dimensional factor weighting includes at least a distance urgency factor, a dynamic weight of the comprehensive congestion index, and a weaving time correction factor. Step S6: Combine the overall congestion index at the same time. Congestion risk level and congestion contribution Spatiotemporal alignment is performed to generate a visual overlay result, and the overlay image frame or independent visual layer is output. The congestion analysis results can be subjected to hierarchical ablation experiments to verify the sensitivity of the impact of the key vehicle identification results on the comprehensive congestion index.
[0032] Furthermore, this invention can send the identification results and their corresponding congestion contribution to vehicles through roadside units (RSUs), thereby pushing "dynamic risk warning" information to vehicles: when a vehicle's contribution exceeds a threshold, it can broadcast warnings such as "abnormal behavior of the vehicle ahead, it is recommended to keep a safe distance" to surrounding vehicles, thereby improving the safety and efficiency of the overall traffic flow and alleviating traffic congestion.
[0033] Furthermore, such as Figure 2 As shown in this embodiment, step S1 is the video acquisition, vehicle target detection, and multi-target tracking step, and the specific implementation process is as follows: Step S1.1: Set the frame rate The collected video footage from fixed intersection locations is decoded frame by frame to obtain the first... Time frame image And record the timestamp corresponding to the frame. ; Step S1.2: Set the image frame Input the object detection model, preferably the YOLO11 (You Only Look Once v11) object detection model, to obtain the detection set. ;in , For the target bounding box parameters, For the target category, Target confidence level; Step S1.3: For the detection set The process involves blocking detection boxes of irrelevant categories that do not meet the conditions, resulting in a vehicle detection set.
[0034] Traditional methods employ a globally uniform high confidence level (e.g., 0.75), which can easily lead to missed detections of partially obscured cars at congested intersections. Lowering the global threshold, on the other hand, increases false positives. To address this issue, this invention optimizes the detection set... By implementing category-based adaptive confidence gating and GPU-side tensor mask early filtering, the recall and accuracy of different vehicle models in congested scenarios are balanced. This also effectively avoids bandwidth congestion and tracker latency spikes caused by transferring massive amounts of low-confidence redundant bounding boxes from GPU memory to CPU main memory, ensuring the real-time performance of the system under high-density traffic flow.
[0035] Specifically, this embodiment addresses different vehicle categories. Set independent confidence thresholds (For example, a lower threshold is set for easily occluded cars, and a higher threshold is set for large passenger and freight vehicles with obvious features). The above analogy pairing and filtering operations are performed directly at the tensor level of the GPU device, directly blocking detection boxes that do not meet the conditions or belong to irrelevant categories such as non-motorized vehicles / pedestrians, thus obtaining the vehicle detection set. Its mathematical expression is:
[0036] in, This embodiment includes a preset set of vehicle categories, specifically cars, buses, and trucks. In this embodiment, the confidence thresholds for class-adaptive confidence are set to 0.20, 0.28, and 0.28 for small cars, large buses, and trucks, respectively.
[0037] Step S1.4: For the vehicle detection set Perform non-maximum suppression (NMS) to remove overlapping bounding boxes of duplicate detections and prevent the same vehicle from being detected repeatedly; Step S1.5: Input the processed vehicle detection results into the multi-target tracking module, preferably using the ByteTrack tracker. The tracker combines the target detection overlap relationship with motion information to complete cross-frame association and output the matching relationship and trajectory status.
[0038] Step S1.6: Based on the internal association results of the tracker, inherit the original TrackID for successfully matched targets, assign a new TrackID to unmatched detection boxes, perform deactivation processing on continuous unmatched trajectories, and generate the current time-based trajectory set. .
[0039] Step S1.7: Maintain a temporal state vector for each TrackID and output a structured result that includes at least the detection box, center point, category, confidence score, and TrackID.
[0040] It should be noted that in this embodiment, target detection can use either the HBB axis-aligned bounding box parameter model or the OBB rotated bounding box parameter model. The HBB axis-aligned bounding box parameter model outputs... HBB axis alignment detection box The target center point is calculated as follows: ;in, and These represent the pixel coordinates of the top-left and bottom-right corners of the detection box in the image coordinate system. OBB Rotated Bounding Box Parametric Model Output Rotating detection frame OBB is preferred. In this case, directly use... As the target center point, and using As the initial heading angle. In the above formula, The width of the rotating frame (in pixels); The height of the rotating frame (in pixels). This represents the category index in the output tensor of the deep learning object detection model, storing the category to which the identified object belongs; This represents the confidence score in the output tensor of a deep learning object detection model, indicating whether the model is certain that the bounding box belongs to the specified category. The probability value of the target is usually between 0 and 1.
[0041] Furthermore, in this embodiment, the specific steps of step S2 are as follows: Step S2.1: Select four feature points corresponding to the ground plane of the intersection in the calibration image, and form an image plane point set in the order of upper left, upper right, lower right, and lower left. ,in ; Step S2.2: Construct a world plane point set based on the actual scale parameters of the intersection. ,in The unit is meters; Step S2.3: Based on point pairs Solve for the homography matrix from the image plane to the world plane. (Used to implement coordinate mapping from the intersection image plane to the bird's-eye view world plane), satisfying homogeneous relations: ;in, This is the homogeneous scaling factor. Since homography is performed in projective geometric space, the projection results will lose absolute depth / scaling information. These are non-zero coefficients used to maintain the linear proportion on both sides of the homogeneous equation.
[0042] Step S2.4: For any vehicle pixel in the video frame To perform the mapping, first calculate: ; Then perform homogeneous normalization to obtain world coordinates: ; in, This is the homogeneous world coordinate vector to be normalized after projection transformation; This is the middle horizontal component. The middle vertical component, This refers to the homogeneous depth (scale) component. Ultimately, the true physical world coordinates must be homogeneously normalized (i.e.,...). Only then can it be obtained.
[0043] Step S2.5: Set world coordinates Mapped to bird's-eye view canvas coordinates The expression is: , , in, This is the offset parameter of the world coordinate origin. The pixel ratio is meters. The pixel height of the canvas when viewed from above; Step S2.6: Bind the obtained bird's-eye view position coordinates to the TrackID generated in step S1 to form a temporal position sequence of the vehicle in the bird's-eye view coordinate system, which will be used for the state calculation and contribution evaluation in subsequent steps S3 to S5.
[0044] Furthermore, in this embodiment, step S2 can be completed by a rapid calibration tool to quickly configure the homography transformation of the intersection, specifically including the following steps: a) In the intersection index configuration file, pre-register the calibration image path for each intersection. Path to the homography matrix configuration file and the actual physical length parameters of the four sides of the intersection. ; b) After starting the fast calibration program, interactively read the measured lengths of the four sides: top, right, bottom, and left, and click the corresponding four corner points on the calibration image; c) Standardize the order of manually clicked corner points, unifying it to the order of top left, top right, bottom right, bottom left, reducing calibration deviation caused by errors in the order of manual clicks; d) Construct a world-planar quadrilateral based on the side length constraints, where: make , , ; and through constraints Solve This automatically generates a world point set; e) Set the image plane points World Plane Point Set Intersection side length parameters The calibrated image path is written to the homography transformation quick configuration file; this configuration is read again and calculated when the main process runs. It is used for real-time mapping of vehicle pixel coordinates to world coordinates / bird's-eye view coordinates.
[0045] In this embodiment, after the bird's-eye view mapping step is completed, the intersection road segment is divided into weaving and non-weaving segments, as well as intersection road segments and long straight one-way / two-way road segments. Weaving and non-weaving segments refer to road segments within an intersection where vehicle trajectories theoretically intersect and those where vehicle trajectories theoretically should not intersect. Specifically, if the current road segment is an intersection, it is divided into weaving and non-weaving segments based on the intersection position from the bird's-eye view after coordinate transformation. The intersection points where each road intersects are classified as weaving segments, and the remaining road segments are classified as non-weaving segments. On the boundary line between the non-weaving and weaving segments, each line segment has an entrance / exit lane separation point. The left side of the separation point relative to the center of the weaving segment is the entrance lane, and the right side is the exit lane. If the current road segment is a long straight road segment that is not an intersection, all road segments are classified as non-weaving segments. To facilitate quick identification of the road segment where the vehicle is located, for intersection segments, a bounding box can be set within the system during the bird's-eye view conversion process to distinguish between weaving and non-weaving road segments. Segments within the bounding box are defined as weaving intersection segments, while those outside the bounding box are defined as non-weaving segments.
[0046] Furthermore, in this embodiment, step S3 is the vehicle motion state parameter calculation step, and the specific steps are as follows: Let the same TrackID be the timestamp of the video reference. and ( The coordinates of point ) mapped to the real physical world from a bird's-eye view are respectively and First, calculate the vehicle's physical linear displacement within that time interval. :
[0047] Then, calculate the vehicle's speed based on the displacement and time difference: .
[0048] In this embodiment, a sliding time window of 5 frames is used to smooth the vehicle speed, suppressing the speed calculation error caused by inter-frame jitter.
[0049] To obtain the vehicle's true physical direction of travel, the center point of the extracted image pixels is used as the reference. Based on this, the homography matrix calculated in step S2 is called. Perform perspective transformation and homogeneous normalization to obtain the vehicle's real-world physical coordinates in the current frame. Furthermore, by combining the physical coordinate sequence of the same trajectory (TrackID) within a historical time window, a time-series motion vector based on the world coordinate system is generated using the least squares method. If the model is in OBB mode, the apparent rotation angle of the pixel viewpoint is additionally calculated. via matrix The projection is mapped to the physical heading angle (spatial heading reference angle). The parameters are then fused with the aforementioned temporal motion vector using a weighted Kalman filter to ultimately output high-precision vehicle driving direction parameters after eliminating perspective distortion.
[0050] Specifically, physical heading angle The mapping and vehicle driving direction parameters are calculated as follows: a) Physical heading angle Mapping: Due to perspective distortion, the heading angle of the image output by OBB is... It cannot be directly mixed with the physical trajectory direction. The system is positioned on the image plane with the target center point... Based on, along The direction is cut off to create a virtual endpoint representing the direction the car is pointing. :
[0051]
[0052] in, The set pixel reference step size.
[0053] Then, the homography matrix from step S2 is used. center point With front end point Projecting them onto the physical world coordinate system respectively, we get and Based on this, the spatial heading reference angle of the vehicle, derived from the OBB frame, in the real-world physical coordinate system was calculated. : ; b) Calculation of the motion heading angle of the temporal trajectory: Combining step S1 and the aforementioned physical world coordinate temporal sequence, take the current frame With historical reference frames The difference in physical coordinates is used to calculate the temporal motion trajectory angle. : ; c) Velocity-adaptive unit vector fusion: To avoid the problems that occur when directly weighting and averaging angle values. and For boundary abrupt changes (i.e., the angle-around problem), this embodiment uses the unit eigenvector synthesis method to calculate the final driving direction. This is combined with the instantaneous vehicle speed calculated in the current step. The confidence levels of both are dynamically adjusted using a speed-adaptive weighting function. Define dynamic confidence weights for trajectory direction for:
[0054] in, This is the smoothing attenuation coefficient. That is, when the vehicle speed... hour, The system highly trusts OBB static angle. When the vehicle speed is relatively high, The system has a high degree of trust in the trajectory direction. .
[0055] Therefore, a nonlinear vector field synthesis formula is introduced to construct the vehicle's final unit direction vector. :
[0056] Final vehicle travel direction parameters (absolute heading angle) The solution formula is:
[0057] in, and Unit direction vectors The vertical and horizontal components in the physical world coordinate system.
[0058] Furthermore, in this embodiment, step S4 is the comprehensive congestion index calculation and congestion risk classification step, and the specific implementation method is as follows: At any moment First, based on the vehicle time-series state parameters obtained in step S3, construct a valid vehicle set. After the outlier removal is completed, the basic statistics used for congestion assessment are calculated. The outlier removal includes two types of constraints: rule constraints and physical feasibility constraints. Rule constraints are used to remove targets with low confidence, targets with insufficient trajectory duration, and targets with interrupted trajectories. Physical feasibility constraints are used to remove outliers with excessive speed, acceleration, or direction changes.
[0059] Let the number of valid vehicles after removal be . The robust average speed is Then the vehicle quantity factor and velocity decay factor They are defined as follows:
[0060] in, In this embodiment, the intersection saturation capacity threshold is set to 35 vehicles based on the number of lanes at the intersection. The phase transition threshold speed is set in this embodiment to the traffic flow speed at 36% of the urban free-flow speed, i.e., 5.0 m / s.
[0061] In addition, the proportion of static areas should also be considered. With edge proportion The overall congestion index is... Defined as:
[0062] in, These are all weighting coefficients, usually .
[0063] The static proportion The method used to characterize the degree of vehicle stillness at an intersection at a given time is as follows: Under a unified bird's-eye view physical coordinate system, the speed of the current valid vehicle set is determined, and vehicles with speeds not exceeding a preset stillness threshold are identified. And this condition must be met continuously for at least the minimum duration. Vehicles that are stationary are recorded as stationary vehicles, and their number is recorded as . And its relationship with the current total number of valid vehicles. The ratio of to is taken as the static proportion, that is:
[0064] The total number of valid vehicles is used to eliminate the abnormal situation where the denominator is zero in the empty scenario, thereby ensuring that the indicator is calculable, comparable and physically consistent throughout the entire time period.
[0065] The edge proportion This is used to characterize the risk of vehicle aggregation and spillover near the boundary of the monitoring area. The method for determining this is as follows: a predefined edge zone area is defined within a bird's-eye view canvas or the corresponding world coordinate region. The number of valid vehicles located in this area is recorded as And its relationship with the current total number of valid vehicles. The ratio of these values is used as the edge proportion, i.e.:
[0066] The width of the edge band can be preset according to the geometric scale of the intersection or the canvas ratio to reflect the spatial characteristics of the outward expansion of the queue at the intersection entrance, so that the comprehensive congestion index has a stable perception capability for the "boundary backlog" condition.
[0067] Furthermore, to suppress exponential fluctuations caused by frame-level jitter, a length of [length missing] is used. Time window After smoothing, we get:
[0068] Subsequently, congestion risk is classified according to preset thresholds: when Determined as low risk; when Classified as medium risk; when Deemed high-risk; when It was deemed a serious risk, among which In this embodiment , , This threshold setting can be adjusted according to the actual situation.
[0069] In the event trigger determination, a mechanism of "triggered by upward movement, deactivated by downward movement" is adopted: when First time exceeding the event threshold from bottom to top The time is recorded as the starting point of the congestion event; when Falling back to The following and continuously maintain a duration of not less than the threshold. The time is recorded as the endpoint of the congestion event, in this embodiment. Similarly, different thresholds can be set for different road segments. During the active period of an event, the system enters the congestion contribution calculation stage in step S5 to output the key vehicle set and ranking results.
[0070] Furthermore, such as Figure 2 As shown, Figure 2 The flowchart shows the logical relationship between steps S3 to S5: Step S3 is used to calculate vehicle motion state parameters and perform validity screening; when the state parameters are valid, the process proceeds to step S4 to calculate the comprehensive congestion index. Risk classification is performed; when the event triggering conditions are met, step S5 is entered to calculate the vehicle congestion contribution. It outputs the key vehicles; if no event is triggered, it continues monitoring; if the event ends, it archives the data and returns to the monitoring process.
[0071] Furthermore, in this embodiment, step S5 is a congestion contribution quantification step based on interleaving relationships, and the specific implementation method is as follows: After determining in step S4 that the event calculation phase has begun, the event calculation phase is initiated based on the event closest to the trigger time. The analysis interval is defined as a time window of seconds, selecting the moment when the comprehensive congestion index reaches its peak. As a key calculation moment, the trajectory status of each TrackID in the bird's-eye view coordinate system is extracted at that moment and in its neighborhood. If it is an intersection segment, the TrackIDs of vehicles located on weaving and non-weaving segments are counted into different groups. Non-weaving segments are divided into two subgroups: entrance lanes and exit lanes, which facilitates differentiated calculation of vehicles on different segments later. If it is a long straight one-way or two-way segment, all segments are considered non-weaving segments and enter different calculation branches.
[0072] For the first The vehicle, assuming it is at time The position is The unit direction vector is The vehicle speed is Construct directional indicator line segments The length of the corresponding directional indicator line segment is Its starting point is the rear end of the vehicle. The endpoint is defined as:
[0073] in, The base extension length is usually twice the vehicle length; This is the speed proportionality coefficient, typically taken as 0.5. Then, for any vehicle... Determine the direction indicator line segment and The geometric intersection relationship is determined, and the pairwise interleaving indicators are obtained by combining the temporal proximity constraint. When the interleaving condition is met, take Otherwise take The number of vehicle weaving points is counted based on pairwise weaving relationships:
[0074] and according to Vehicles are classified into the first Group, let the number of vehicles in this group be... .
[0075] The aforementioned directional indicator lines can be viewed as an expression of the short-term motion trend of vehicles in a bird's-eye view coordinate system. In the geometric sense of the lines, the intersection of lines is equivalent to "the two vehicles' motion directions having a potential conflict point in space," which is consistent with the concept of conflict points in traffic engineering. In weaving areas, such potential conflicts usually lead to yielding, deceleration, or stopping, thereby reducing effective traffic capacity and triggering the propagation of speed disturbances.
[0076] Furthermore, step S5 completes the grouping process. Group congestion contribution If the intersection is a weaving section, the comprehensive congestion index is calculated using an adaptive dynamic weighting method, as follows: a) Grouping boundary condition calculation: When the first... Total number of vehicles in a group When ≤1, let ,in Numerically equal to the number of weaving points of vehicles within that group. When there are no valid interleaved events , ; b) Calculation of core formula for multi-car train sets: When the first... Total number of vehicles in a group At that time, the congestion contribution within the group is calculated using the following formula:
[0077]
[0078] In the formula, ; For the first The group's contribution to congestion; This is the overall congestion index of the current road segment after smoothing. For the first The total number of vehicles in the group; Numerically equal to the number of weaving points of vehicles within that group. ; Vehicle interaction situation factors, composed of weaving point conditions and distance urgency factors, describe... Car and The spatial interaction between vehicles; Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; This is the interleaving time correction factor; after calculation, the first... The first in the group Vehicle's contribution to congestion Assigned value ,in For the corresponding vehicle model differentiation weights; The above-mentioned grouping of vehicles by the number of weaving points is equivalent to stratifying them by the "structural degree of involvement in the conflict"; while the statistical analysis of pairwise relationships within a group (e.g., for...) Summation and according to Normalization can be interpreted as "the average level of the intensity of interaction within a group," used to characterize the group phenomenon of congestion: congestion is not a single-vehicle attribute, but rather a coupling result caused by mutual constraints between vehicles (yielding / lane changing / following fluctuations).
[0079] Normalizing the summation term can avoid group size This directly amplifies the indicators, thereby enhancing comparability across time periods and intersections. and The weighted intragroup interaction terms reflect the phase transition mechanism: in the low congestion phase ( Smaller congestion levels, with localized interweaving reflecting more potential risks and structural conflict levels; during periods of high congestion ( (For larger systems), as the system approaches or enters the congestion phase transition, local conflicts are more likely to trigger stop-start waves and disturbance propagation. The contribution of intra-group interleaving intensity to congestion is amplified, therefore, a more appropriate approach is adopted. It is reasonable to apply adaptive weighting to the interaction terms.
[0080] c) Vehicle-level contribution assignment: Congestion contribution within the group After the calculation is completed, the first Vehicle-level congestion contribution of all vehicles in the group Assigned value * ,in To correspond with the vehicle type differentiation weighting for TrackID vehicles, the weighting is divided into the following categories: small passenger cars 1.0, medium-sized buses and light trucks 1.6, large buses and heavy trucks 2.2, special-purpose vehicles 2.5, and vehicles with special right-of-way, such as fire trucks and ambulances, 0.7. (Vehicle type differentiation weighting) This can be seen as an engineering expression of the concept of "vehicle equivalent / loaded vehicle equivalent" in traffic engineering. Different vehicle types differ in terms of starting losses, acceleration, expected travel time, and occupied space, which in turn affect the saturation flow rate and queue dissipation velocity. Therefore, the concept of "vehicle equivalent / loaded vehicle equivalent" is introduced. To depict the different contributions of different vehicle types to the formation and spread of congestion, and It can be determined by scene data calibration.
[0081] Furthermore, step S5 completes the grouping process. Group Congestion Contribution In non-weaving sections of an intersection, the congestion mechanism differs from that in weaving sections. Therefore, the formation and spread of traffic congestion are governed by traffic flow conservation and supply-demand constraints. (Based on traffic flow density...) ,speed With flow rate As basic variables, they satisfy the conservation relationship. Furthermore, the evolution of traffic conditions over time and space can be described using conservation principles:
[0082] When demand at the entrance exceeds supply at the exit, queuing and backlog occur, manifested as increased vehicle slow / stationary time and decreased clearance efficiency. At signalized intersections, queue dissipation exhibits a clear signal periodicity; if the duration of stationary or slow speed spans one or more signal cycles, it typically corresponds to overflow backlog or cross-cycle queuing. Therefore, this step is crucial in the overall congestion index. Based on the description of macroscopic congestion, the contribution of local conflicts to the reduction of effective capacity and speed disturbance is characterized by the weaving relationship between vehicles, and a signal cycle is introduced. The normalized static duration saturation term characterizes the cross-cycle congestion intensity; a low-speed attenuation term is further introduced into the exit channel of the non-interlacing zone to reflect the contribution of insufficient clearing capacity to congestion. The above modeling follows the mechanism of "structural factors dominating in the low-congestion stage, and interaction and amplification of congestion effects in the high-congestion stage".
[0083] Therefore, an adaptive dynamic weighting method is used to calculate different comprehensive congestion indices, as detailed below: a) Grouping boundary condition calculation: When the first... Total number of vehicles in a group season ,in Numerically equal to the number of weaving points of vehicles within that group. ; b) Calculation of the core formula for multi-car groups at the entrance lane of the non-weaving zone: When the first Total number of vehicles in a group At that time, the congestion contribution within the group is calculated using the following formula:
[0084]
[0085] c) Calculation of core formula for multi-car group exit lane in non-weaving zone: When the... Total number of vehicles in a group At that time, the congestion contribution within the group is calculated using the following formula:
[0086]
[0087]
[0088] In the formula, ; For the first The group's contribution to congestion; The overall congestion index for the current road section; For the first The total number of vehicles in the group; Numerically equal to the number of weaving points of vehicles within that group. ; The vehicle interaction situation factor consists of the weaving point situation and the distance urgency factor, describing... Car and The spatial interaction between vehicles; The clearing weighting coefficient; This is the low-speed attenuation term at the exit point; For the export road The average speed of the group of vehicles; Reference speed for free flow at the exit lane of an urban intersection; Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; The complete signal cycle duration of the traffic lights at the target intersection; The duration of continuous stationary movement of vehicles at the entrance and exit lanes of non-interlacing areas; d) When there are no valid weaving events in the non-weaving section area However, this does not mean that it contributes nothing to congestion. In this case, it is calculated as follows:
[0089] After the calculation is completed, the first Congestion contribution of all non-weaving road sections within the group Assigned value ,in For the corresponding vehicle model differentiation weights; e) Vehicle-level contribution assignment: Congestion contribution within the group After the calculation is completed, the first Vehicle-level congestion contribution of vehicle i within the group Assigned value * ,in To correspond to the vehicle type differentiation weights of TrackID vehicles, the values can be different from those for weaving road sections. In this embodiment, the values are as follows, divided by vehicle type: 1.0 for small passenger cars, 1.6 for medium-sized buses and light trucks, 2.2 for large buses and heavy trucks, 2.5 for special operation vehicles, and 0.7 for vehicles with special right-of-way, such as fire trucks and ambulances.
[0090] Furthermore, regarding queue overflow congestion on long, straight road sections, theoretically, the directional lines of vehicles on such sections should be parallel. However, in reality, it's unavoidable that some vehicles will slightly weave with other vehicles. It's also necessary to consider whether vehicles tend to occupy or change lanes, and to quantify the impact of this behavior on congestion. Therefore, different methods are used to calculate the congestion contribution of key vehicles:
[0091]
[0092]
[0093] in, This is a static bottleneck congestion factor used to quantify the continuous congestion effect of stationary vehicles on traffic flow, and can solve the problem of identifying key vehicles during queuing. The duration of the vehicle remaining stationary, in seconds.
[0094] Since the impact of vehicle speed on congestion is not negligible on long, straight, one-way and two-way road sections, the congestion contribution within the group is... After the calculation is completed, the first Vehicle-level congestion contribution of all vehicles in the group Assigned value ,in To correspond to the vehicle model differentiation weights for TrackID vehicles, To correspond to the driving speed of TrackID vehicles, The free-flow speed in the city is taken as 14 m / s in this embodiment; where, the vehicle type differentiation weight corresponds to the TrackID vehicle. The values may differ from those for weaving road sections. In this embodiment, the values are as follows, categorized by vehicle type: 1.0 for small passenger cars, 1.6 for medium-sized buses and light trucks, 2.2 for large buses and heavy trucks, 2.5 for special operation vehicles, and 0.7 for vehicles with special right-of-way, such as fire trucks and ambulances.
[0095] Furthermore, the weighting factor in step S5 is specifically calculated as follows: distance urgency factor and interleaving time correction factor They are respectively: =
[0096]
[0097] in, The average distance from the two vehicles to the weaving point. For timestamp The critical safety distance in the following scenarios This refers to the duration of continuous weaving between the two vehicles. In this embodiment, the critical safety distance is assigned the length of the vehicle direction indicator segment. .
[0098] Furthermore, in this embodiment, step S6 is the result visualization and output step, specifically implemented as follows: at each time step... The comprehensive congestion index obtained in step S4 Along with risk level labels, and the vehicle-level congestion contribution obtained in step S5. Spatiotemporal alignment is performed, and graphic overlay is executed on the original video frames, bird's-eye view transformed frames, or independent risk layers to form a visual output result. The overlaid content includes at least risk level indicators, index values, event status, and vehicle contribution or key congestion vehicle annotations. Specifically, a highlighting strategy is used for key congestion vehicles, prioritizing their display. Top The goal or satisfaction The target is color-enhanced and its border is thickened, and the TrackID and contribution value are displayed near the target.
[0099] To maintain display stability, contribution can be mapped to visualization intensity. :
[0100] Highlight overlay is achieved using a transparency blending method:
[0101] in, For background frames, For highlighting layers, Based on transparency, This is the contribution enhancement coefficient.
[0102] The final output can be a sequence of overlaid continuous image frames, or a visual layer and event snapshot separated by layer, for real-time display and post-event review.
[0103] Furthermore, the graded ablation assessment method in step S6 is as follows: a) Within the event window, sort the vehicles in descending order according to their congestion contribution, and construct a hierarchical ablation sequence based on their contribution groups; b) Define the first Level cumulative ablation collection ,in: ,
[0104] in, Indicates the first A group of vehicles with high contribution rates. Indicates the maximum ablation level; c) For each ablation level Remove collection After reconstructing the effective vehicle set, the number of weaving points, group congestion contribution, and overall congestion index are recalculated to obtain the following results. ; d) Record the original result as grade 0, i.e. The total number of interlacing points is denoted as ; to classify The total number of interlacing points is denoted as ; e) Calculate the exponential decline and the intersection point decline for each level: , ; f) Based on the above graded ablation results, generate a comparison data table and comparison chart to output the quantitative changes "before / after ablation". Figure 6 middle Shaft fixed as The ablation levels are represented by multiple broken lines; each broken line is labeled with the corresponding level label. ).
[0105] Furthermore, in a feasible engineering embodiment, the graded ablation output includes at least: 1) Event-level graded ablation comparison table, recording the events at each level. , , and ; 2) Event-level hierarchical ablation comparison chart, with a summary of the changes in the total number of interleaving points at each level output at the top; 3) A detailed table of interweaving points, a table of group contributions, and a visual fill chart corresponding to each level.
[0106] Furthermore, the hierarchical ablation assessment does not change the original detection and tracking process. It only performs conditional elimination and repeated calculation on the vehicle set in the post-event assessment branch. Therefore, it does not change the main process function definition and can be used as an additional verification step for interpreting key congested vehicles.
[0107] The method provided by this invention can automatically identify, number, and estimate the direction of vehicle targets within an intersection. Figure 3 This is a bird's-eye view diagram of vehicle target tracking and motion vector. As can be seen from the diagram, the present invention can accurately locate the position, orientation, and relative motion of vehicles in complex unsignalized intersections. It makes congestion not an "abstract statistic" but is implemented on specific individual vehicles, which makes it easier to identify key congestion-causing objects and enhances the interpretability and traceability of the system results.
[0108] The method provided by this invention can calculate a comprehensive congestion index that characterizes the degree of congestion at intersections, by constructing a time-series curve of the comprehensive congestion index (see...). Figure 4 This technology can quantitatively express the evolution trend of traffic risks at intersections and can be used to identify risk peaks and congestion duration intervals, thereby improving the effectiveness of traffic condition assessment and early warning, and providing quantitative basis for signal control, intervention timing selection, and key vehicle management.
[0109] The method provided by this invention can automatically identify and prominently mark key congested vehicles in complex unsignalized intersection scenarios. A visualization of the key congested vehicle identification results in complex intersecting scenarios is shown below. Figure 5 As shown in the figure, the highlighted targets represent the sets of vehicles that have a dominant influence on intertwined conflicts, traffic obstruction, and local queuing. This result proves that the present invention achieves traceable localization from macroscopic congestion phenomena to microscopic congestion-causing individuals. Compared with existing solutions that only output the global congestion level, the present invention can identify the key vehicle objects causing congestion, improving the executability of the governance targets.
[0110] This embodiment demonstrates the change curve of the comprehensive risk index after removing the aforementioned key vehicles according to their contribution levels within the same time period, which is used to verify the effectiveness, interpretability, and engineering usability of the key target identification and risk assessment model. Figure 6 The study demonstrates a significant change in the comprehensive risk index before and after ablation, indicating that the identified key vehicles are not ordinary background targets, but rather dominant factors that significantly contribute to system risk. Simultaneously, the occurrence of short-term non-monotonic changes in certain stages also indirectly proves the realistic characterization of traffic coupling relationships in this embodiment; that is, the system can reflect actual traffic mechanisms such as traffic flow redistribution and local speed structure changes, rather than simple linear scoring. Combining the highlighting of key vehicles with the hierarchical ablation-linked output forms a visual and quantifiable dual evidence chain, facilitating scheme demonstration and strategy optimization.
[0111] The present invention also provides an electronic device, comprising: one or more processors and a memory; wherein the memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method for identifying key vehicles in vehicle weaving and congestion based on visual recognition.
[0112] The present invention also provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described method for identifying key vehicles in vehicle weaving and congestion based on visual recognition.
[0113] Those skilled in the art will understand that all or part of the functions of the various methods / modules in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved.
[0114] In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the programs can also be stored in storage media such as servers, other computers, disks, optical discs, flash drives, or portable hard drives. They can be downloaded or copied to the memory of the local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be implemented.
[0115] The above-described specific examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for identifying key vehicles in vehicle weaving and congestion based on visual recognition, characterized in that, The method includes the following steps: Step S1: Collect intersection surveillance video, perform vehicle target detection and multi-target tracking on the video frames to obtain the detection box and unique tracking identifier of each vehicle; Step S2: Solve the homography matrix based on the four non-collinear calibration points on the ground plane of the intersection, and map the pixel coordinates of the vehicles in the video frame to the bird's-eye view coordinate system; Step S3: Calculate the vehicle's motion state parameters based on the position coordinates of the same tracking identifier in the bird's-eye view coordinate system in consecutive frames; Step S4: Calculate the comprehensive congestion index, which characterizes the degree of congestion at the intersection, based on the vehicle motion state parameters. Congestion risk is classified according to preset thresholds and included in the comprehensive congestion index. When the event triggering conditions are met, step S5 is executed; Step S5: Identify the weaving relationships between vehicles and calculate the congestion contribution of each vehicle based on these relationships. The system outputs a set of key vehicles and / or a ranking of key vehicles based on their congestion contribution. The weaving relationship between vehicles is determined by the geometric intersection of the vehicle driving direction indicator line segments, which determines the conflict relationship of vehicle driving trajectories. The congestion contribution is calculated based on the number of weaving points of vehicles, combined with multi-dimensional factor weighting and vehicle type differentiation weighting for intersection scenarios. The multi-dimensional factor weighting includes at least a distance urgency factor, a dynamic weight of the comprehensive congestion index, and a weaving time correction factor. Step S6: Spatiotemporally align the comprehensive congestion index, congestion risk level, and congestion contribution at the same time to generate a visual overlay result.
2. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 1, characterized in that, The specific steps of step S1 are as follows: First, decode the collected fixed-point monitoring video of the intersection frame by frame according to the set frame rate to obtain the first frame. Time frame image The image frames are then input into the target detection model to obtain the detection set. Next, class-based adaptive confidence gating and GPU-based tensor masking are applied to the detection set to block irrelevant category detection boxes that do not meet the conditions, resulting in a vehicle detection set. Then, non-maximum suppression is applied to the vehicle detection set to remove overlapping detection boxes. Finally, the processed vehicle detection results are input into the multi-target tracking module, which outputs the matching relationship and trajectory status.
3. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 1, characterized in that, In step S3, the vehicle's motion state parameters include at least the driving direction and speed; wherein, the vehicle's driving direction is obtained by first combining the real-world physical coordinate sequence of the same trajectory within a historical time window, and then using the least squares method to fit and generate a time-series motion trajectory angle based on the world coordinate system. When the target detection uses the OBB rotated bounding box parameter model, the spatial heading reference angle is calculated based on the image heading angle output by the model. Then, a speed-adaptive weighting function is used to dynamically adjust the confidence levels of both parameters, and a nonlinear vector field synthesis formula is introduced to construct the vehicle's final unit direction vector. The expression is: ; in, The dynamic confidence weights for the trajectory direction. , To smooth the attenuation coefficient, The speed is the vehicle speed.
4. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 1, characterized in that, Step S4 processes the vehicle motion state parameters obtained in step S3, removes abnormal samples, constructs a valid vehicle set, and calculates the comprehensive congestion index based on the valid vehicle set. The expression is: ; in, All of these are weighting coefficients. The vehicle quantity factor is determined based on the effective vehicles after removal and the intersection saturation capacity threshold. The velocity decay factor is determined based on the average velocity and the phase transition threshold velocity. The percentage of static areas; The edge percentage is determined based on the number of valid vehicles within the edge zone and the total number of valid vehicles currently in use. After obtaining the comprehensive congestion index, a length of [length missing] is used. The congestion risk is then graded based on a preset threshold after smoothing the time window.
5. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 1, characterized in that, In step S5, the congested road segment is first divided into intersection road segment or long straight road segment. If the current congested road segment is an intersection road segment, the vehicles are divided into weaving road segment group and non-weaving road segment group according to the location of the vehicles. For vehicles in the non-weaving road segment group, they are further divided into two subgroups: entrance lane and exit lane. Different congestion contribution assessment methods are used for different groups. When identifying the weaving relationships between vehicles in congested road sections, directional indicator line segments are constructed based on the vehicle's position, unit direction vector, and speed; subsequently, for any vehicle pair... Determine the direction indicator line segment and The geometric intersection relationship yields pairwise interlacing indicators. When the interleaving condition is met, take Otherwise take ; The number of vehicle weaving points is counted based on pairwise weaving relationships. It is used for assessing the contribution of congestion.
6. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 5, characterized in that, The direction indicator line segment in step S5 The starting point is the end point of the vehicle. ,end for: ; in, Based on the extended length, For speed proportionality coefficient, the first The car at any time The position is The unit direction vector is The vehicle speed is The length of the direction indicator line segment is .
7. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 5, characterized in that, The first step after grouping in step S5 Group congestion contribution If the intersection is a weaving section, the comprehensive congestion index is calculated using an adaptive dynamic weighting method. Total number of vehicles in a group When ≤1, , When there are no valid interleaved events , When the first Total number of vehicles in a group At that time, the first Group Congestion Contribution The expression is: ; ; In the formula, ; This is the overall congestion index of the current road segment after smoothing. ; Vehicle interaction situation factors, Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; Interleaving time correction factor; No. The contribution of the i-th vehicle to congestion in the intersecting road sections within the group ,in The corresponding vehicle model differentiation weight.
8. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 5, characterized in that, In step S5, if the intersection is a non-weaving section, then different comprehensive congestion indices are used to adaptively and dynamically weight the calculation of the first congestion index. Group Congestion Contribution When the first Total number of vehicles in a group hour, , When the first Total number of vehicles in a group At that time, for the import road Group vehicle congestion contribution The expression is: ; ; For the exit road Group vehicle congestion contribution The expression is: ; ; ; in, ; This is the overall congestion index of the current road segment after smoothing. ; For vehicle interaction situation factors; The clearing weighting coefficient; This is the low-speed attenuation term at the exit point; For the export route The average speed of the group of vehicles; Reference speed for free flow at the exit lane of an urban intersection; Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; The complete signal cycle duration of the traffic lights at the target intersection; The duration of continuous stationary movement of vehicles at the entrance and exit lanes of non-interlacing areas; when , ; No. The congestion contribution of the i-th vehicle on the non-weaving road segment within the group ,in The corresponding vehicle model differentiation weight.
9. The method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 5, characterized in that, If in step S5 the road is a long straight section, then the first... Group vehicle congestion contribution The expression is: ; ; ; in, ; For the first The total number of vehicles in the group This is the overall congestion index of the current road segment after smoothing. ; Vehicle interaction situation factors, Within the same group Vehicle and the The quantity of vehicles intersecting in pairs; The distance urgency factor at the point where the two vehicles intersect; As the interleaving time correction factor, As the static bottleneck resistance factor, The duration of the vehicle remaining stationary; No. The contribution of the i-th vehicle to congestion on a long straight road segment within the group ;in, To assign different weights to the corresponding vehicle models, To correspond to the driving speed of TrackID vehicles, For free-flowing traffic speeds in the city.
10. A method for identifying key vehicles in vehicle weaving and congestion based on visual recognition according to claim 7, 8, or 9, characterized in that, Distance urgency factor and interleaving time correction factor They are respectively: = ; ; in, The average distance from the two vehicles to the weaving point. For timestamp The critical safety distance in the following scenarios The duration of continuous weaving between the two vehicles.