An intersection trajectory completion and statistics method based on aerial trajectory structure inference

CN122888458APending Publication Date: 2026-10-09GUANGDONG COMM POLYTECHNIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611012561.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

传统方法在面对航拍场景下轨迹不完整、噪声干扰大等技术难题时,缺乏一套将轨迹结构推断、轨迹补全与流量统计有机整合的一体化解决方案

Benefits of technology

1、通过直行轨迹筛选、K-means方向聚类与区域生成、结构划分的三级流程,能够从航拍轨迹数据本身自动推断出交叉口进口道、出口道、中心区域及右转专用区域的几何拓扑结构,无需预先人工标定任何检测区域或虚拟线圈。这一操作不仅大幅提升系统的部署效率和自动化程度,还能够自动适应无人机视角、高度或位置的变化,解决传统静态标定方法在航拍场景下适应性差的问题。同时,从轨迹数据中挖掘的场景结构先验知识,使后续的轨迹补全和流量统计过程具有明确的物理意义和可解释性,克服现有数据驱动方法可解释性不足的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888458A_ABST
    Figure CN122888458A_ABST
Patent Text Reader

Abstract

The application discloses an intersection trajectory completion and statistics method based on aerial trajectory structure inference, and relates to the technical field of intelligent transportation. The method comprises the following steps: extracting original trajectory data in aerial video by using a target detection and multi-target tracking algorithm; smoothing the original trajectory data by using a Savitzky-Golay filter to generate a vehicle trajectory point set; inferring a lane guide area topology structure of an intersection based on the vehicle trajectory point set, and dividing the lane guide area topology structure into four functional areas; designing a four-stage progressive trajectory completion algorithm based on the four functional areas, searching and connecting broken trajectory segments in the corresponding area according to the rules of spatiotemporal proximity, lane consistency and motion rationality, and generating a completed vehicle trajectory. The application automatically infers the topology structure of the intersection, adopts the four-stage progressive trajectory completion algorithm, realizes high-precision full-flow automatic flow statistics, gets rid of the dependence on manual calibration, and significantly improves the precision, robustness and practicability of aerial traffic flow analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method for intersection trajectory completion and statistics based on aerial photography trajectory structure inference. Background Technology

[0002] With the continuous advancement of urbanization, urban road traffic congestion has become an increasingly prominent problem. Accurately and efficiently acquiring traffic flow parameters at intersections has become a fundamental issue that urgently needs to be addressed in the field of traffic management and control. In recent years, the rapid development of drone technology has provided a new technical means for road traffic data collection. Compared with traditional fixed camera shooting methods, drones equipped with high-definition cameras can acquire large-scale, global traffic operation information from a vertical, top-down perspective. Their excellent mobility, low deployment cost, and non-intrusive monitoring characteristics make them show broad application prospects in areas such as traffic operation efficiency assessment, conflict risk identification, and traffic organization optimization.

[0003] However, urban intersections exhibit extremely complex technical characteristics from a vertical aerial perspective, posing a significant challenge to existing technological solutions. Unlike highways or ordinary road sections, vehicles at intersections are small in scale and densely distributed, with diverse directions of entry and exit, and complex and variable driving behaviors such as turning and lane changing. Furthermore, factors such as changing lighting conditions and obstruction from high-altitude obstacles further complicate high-precision and robust target detection and tracking. Against this backdrop, accurately extracting vehicle trajectories from aerial video and conducting effective analysis has become a core research focus in this field.

[0004] In multi-object tracking technology, current mainstream tracking algorithms generally adopt a two-stage framework of "detection-after-tracking." First, a target detection algorithm identifies vehicle targets in each frame of the image, and then data association methods are used to match the target identities of detection boxes between adjacent frames. With the rapid development of deep learning technology, significant breakthroughs have been achieved in the field of visual target detection. From the early application of convolutional neural networks in target detection tasks to the proposal and evolution of the R-CNN series of algorithms, target detection accuracy has been continuously improved. Based on the above research, for multi-object tracking tasks, A. Bewley et al. proposed the SORT algorithm, which uses Kalman filtering to predict the target's motion state and combines it with the Hungarian matching algorithm to achieve data association between detection boxes. The DeepSORT algorithm further introduces a cascaded matching mechanism and an appearance feature extraction network, fusing the target's depth visual features with motion information, effectively improving the robustness of tracking. Subsequent researchers have proposed improved algorithms such as OCSORT and ByteTrack, which optimize the performance of multi-object tracking from different perspectives. To address the challenge of detecting small vehicle targets in aerial photography scenarios, researchers have widely adopted multi-scale feature fusion techniques and attention mechanisms to improve the detection capability for small targets.

[0005] In the field of vehicle trajectory completion, existing methods can be mainly divided into two technical routes: mechanistic modeling and data-driven approaches. Mechanistic modeling methods are based on traffic flow theory or vehicle kinematics models. They estimate the evolution of traffic flow from limited observations using traffic wave models, and then infer the missing vehicle trajectories. For example, some scholars have proposed a continuous frame vehicle tracking algorithm based on maximum a posteriori probability, which is highly sensitive to the accuracy of the vehicle's initial position. Other studies have attempted to construct vehicle trajectories through target association, but the trajectory construction effect significantly decreases when insufficient detection accuracy leads to a high frame drop rate. Mechanistic modeling methods have good interpretability, but are sensitive to model parameter calibration and have limited adaptability. Data-driven methods, on the other hand, can mine deep feature relationships from large amounts of training data. Some studies abstract trajectory completion into a time-series prediction problem, using models such as graph recursive attention neural networks to predict missing trajectories; others use generative adversarial networks to generate the missing trajectories end-to-end. However, such data-driven methods usually require a large amount of labeled data, resulting in high training costs, and the interpretability of the models is relatively insufficient.

[0006] In terms of traffic flow parameter acquisition, traditional methods often rely on video vehicle detection combined with virtual loop methods to quickly obtain parameters such as flow rate and speed. Classic algorithms such as optical flow estimation are also widely used in fixed camera scenarios. Some scholars have conducted in-depth research on traffic flow statistics methods for various video detection scenarios, but most work focuses on improving the deep learning framework itself. Regarding traffic flow statistics in aerial photography scenarios, some studies have improved the object detection framework and used the virtual parking line method for traffic flow statistics. By judging the angle of the trajectory line vector, the direction of vehicle flow is determined, achieving a statistical accuracy of approximately 93.6% under specific test conditions.

[0007] Although existing research has proposed various solutions for multi-target tracking, trajectory completion, and traffic flow statistics, current aerial traffic flow analysis technology still faces deep-seated inherent contradictions in its practical application. In-depth analysis reveals a fundamental limitation at the principle level: both kinematic model-based trajectory prediction methods and data-driven trajectory repair methods treat trajectory completion as a purely sequential processing problem independent of the geometry and semantics of the traffic scene. This approach ignores the topological information inherent in intersections—the spatial distribution and interrelationships of functional areas such as approach lanes, exit lanes, and turning lanes—which can actually be automatically inferred from the vehicle trajectory data itself through cluster analysis. In other words, existing methods fail to fully utilize the prior knowledge of the scene structure contained in the trajectory data, resulting in a lack of interpretability in the completion process, and the completion accuracy is insufficient to meet practical application requirements when faced with long-term trajectory loss or complex turning behaviors.

[0008] Meanwhile, existing intersection traffic flow statistics studies typically rely on pre-defined static detection areas or virtual loops. These areas require manual labeling based on video footage or prior maps, resulting in low automation and an inability to effectively address challenges posed by changes in drone perspective, altitude, or position. When the trajectory is broken, virtual loop-based statistical methods struggle to accurately determine vehicle flow direction, particularly noticeable in right-turn traffic statistics where obstructions are significant. Traditional methods lack an integrated solution that organically combines trajectory structure inference, trajectory completion, and traffic flow statistics when facing technical challenges such as incomplete trajectories and high noise interference in aerial photography scenarios.

[0009] In summary, how to automatically infer the geometric topology of intersections from aerial trajectory data itself, and apply this structural information as a strong constraint to trajectory completion and traffic flow statistics tasks, so as to achieve automated, rapid and accurate traffic flow analysis of aerial intersections, has become a key technical challenge and an urgent technical problem to be solved by those skilled in the art. Summary of the Invention

[0010] To address the aforementioned shortcomings, this invention provides a method for intersection trajectory completion and statistics based on aerial photography trajectory structure inference. By automatically inferring the intersection topology, a four-stage progressive trajectory completion algorithm is adopted to achieve high-precision automated traffic flow statistics across all directions, eliminating reliance on manual calibration and significantly improving the accuracy, robustness, and practicality of aerial traffic flow analysis.

[0011] This invention provides a method for intersection trajectory completion and statistics based on aerial photography trajectory structure inference, including: S1. Obtain aerial video of the intersection area, and use target detection and multi-target tracking algorithms to extract the original trajectory data from the aerial video; use Savitzky-Golay filter to smooth the original trajectory data and generate a set of vehicle trajectory points; S2. Based on the set of vehicle trajectory points, infer the topology of the lane guidance area of ​​the intersection and divide it into four functional areas; S3. Based on the four functional areas, design a four-stage progressive trajectory completion algorithm. According to the rules of spatiotemporal proximity, lane consistency and motion rationality, search and connect broken trajectory segments in the corresponding areas to generate a completed vehicle trajectory. S4. Based on the completed vehicle trajectory, the driving direction of the vehicle is automatically determined according to the entrance lane area where the starting point of each trajectory falls and the exit lane area where the ending point falls; the number of trajectories in the clearly defined starting and ending areas is counted to realize the automatic counting of different turning flows in each entrance lane.

[0012] Preferably, S1 includes: In the target detection stage, a deep learning target detection network is used to identify the vehicle target bounding box in each frame of the image. The deep learning target detection network adopts a convolutional neural network architecture, extracts multi-scale feature maps from aerial videos, generates candidate detection boxes through a preset anchor box mechanism, and outputs the vehicle target bounding box after non-maximum suppression processing. In the target tracking stage, a data association algorithm is used to match the target identity of vehicle target bounding boxes between adjacent frames. The data association algorithm fuses the target's motion prediction information and appearance feature descriptor. The motion prediction information includes the target's position and velocity components in the image coordinate system. The appearance feature descriptor is composed of high-dimensional vectors extracted from the detection box region by a deep convolutional network. The motion similarity and appearance similarity are weighted and fused to form a data association cost matrix. The optimal matching result is then solved using the Hungarian matching algorithm to obtain the original trajectory data. The original trajectory data is smoothed using a Savitzky-Golay filter to generate a set of vehicle trajectory points. The Savitzky-Golay filter uses the linear least squares method to fit a low-order polynomial to adjacent data points within a sliding window, in order to preserve the peak, valley and curvature variations of the signal.

[0013] Preferably, S2 includes: Extract the x-coordinate and y-coordinate sequences of vehicle trajectories and construct a linear regression equation; the linear regression equation is used to calculate the regression coefficient and goodness of fit; wherein, the goodness of fit is measured by the coefficient of determination, and the square root of the coefficient of determination is the Pearson correlation coefficient, which is used to reflect the degree of concentration of the trajectory point distribution. Construct straight-line trajectory determination criteria: If the determination coefficient of the vehicle trajectory is not less than the preset determination coefficient threshold and the average deviation does not exceed the preset maximum allowable average deviation threshold, then it is included in the straight-line trajectory dataset. The K-means clustering algorithm is used to perform directional clustering on all the selected straight trajectories. First, the straight trajectory dataset is aggregated into two-dimensional data points. Then, the sum of squared Euclidean distances from the two-dimensional data points to the centroid of their respective clusters is calculated. The objective function is minimized by alternately performing cluster assignment and centroid update until the convergence condition is met or the preset maximum number of iterations is reached. After clustering, the straight trajectory dataset is assigned to four different clusters: east, west, south, and north. For each straight trajectory cluster, the minimum adjacent rectangle algorithm is used to generate a rectangular region covering the entrance and exit lanes. Based on the rectangular areas of the approach and exit lanes in all directions, the intersection space is further divided into four functional areas: the rectangular area of ​​the approach lanes is defined as the approach lane area; the rectangular area of ​​the exit lanes is defined as the exit lane area; the central area inside the intersection enclosed by the four approach lane areas and the four exit lane areas is defined as the central area of ​​the intersection; for intersections with dedicated right-turn lanes, an independent rectangular area extends from the rightmost side of the approach lane area as the dedicated right-turn area.

[0014] Preferably, the four-stage progressive trajectory completion algorithm includes: For trajectory completion in the approach lane area, first identify whether the trajectory endpoint is located within the approach lane area and the starting area is clear but the endpoint area is not clear; if the above conditions are met, the endpoint of the trajectory to be completed is used as the search starting point, and candidate trajectory segments are searched in the trajectory set of subsequent time periods. The selection criteria for candidate trajectories include three aspects: the first aspect is the time difference constraint, where the absolute value of the difference between the start time of the candidate trajectory and the end time of the trajectory to be completed must be less than the preset maximum allowable time difference threshold; the second aspect is the basic geometric rationality constraint, which uses a preset geometric discriminant function to judge the geometric connection relationship between the candidate trajectory and the trajectory to be completed; and the third aspect is the orientation consistency constraint, where the orientation of the start of the candidate trajectory must be the same as the orientation of the end of the trajectory to be completed. After the candidate trajectories are selected, lane matching score, time difference score, and start-end distance reasonableness score are applied to them. The three scores are then weighted and summed to generate a comprehensive matching score. The candidate trajectory with the best score is then selected for connection. For center area trajectory completion, the starting point of the trajectory to be completed must have clear directional information, and the starting point of the candidate trajectory must be located within the center area. When the ending point of the trajectory to be completed is located within the left-turn lane, if the starting point of the candidate trajectory is located at a reasonable position to the left of the left-turn lane, the lane matching score is full. In addition, center area completion is also subject to an upper limit constraint on the time difference, that is, the time difference between the starting point of the candidate trajectory and the ending point of the trajectory to be completed cannot exceed ±3s of the green light time range of its respective signal phase. For exit lane area trajectory completion, only trajectories that are broken within the exit lane area can be considered as trajectories to be completed. The candidate source for completion is another trajectory that is broken within the exit lane area. The search details are the same as for entrance lane area trajectory completion. For right-turn area trajectory completion, the starting point of the candidate trajectory must be located within the dedicated right-turn area, the starting point of the trajectory to be completed must be greater than or equal to the number of the rightmost lane in the approach lane area, and the endpoint of the trajectory to be completed must be undefined. When the right-turn lanes at some intersections do not have independent safety islands, the right-turn area completion processing logic is incorporated into the approach lane area completion process.

[0015] Preferably, S3 further includes: The candidate trajectory segment with the best matching score is selected and connected to the trajectory to be completed. For the missing trajectory area between the connection points, a simple completion strategy of linear interpolation and time equalization is adopted. Specifically, linear interpolation generates a sequence of intermediate trajectory points in a straight line between the endpoint coordinates of the trajectory to be completed and the starting coordinates of the candidate trajectory. Time equalization distributes the timestamps of the intermediate trajectory points evenly within the total time based on the difference between the timestamp of the endpoint of the trajectory to be completed and the timestamp of the starting coordinate of the candidate trajectory. The four-stage completion algorithm is executed in a loop-iterative manner. The outer loop traverses the four functional area stages, while the inner loop continuously performs completion search until there are no valid candidate trajectories in the current area. Each iteration processes the entrance area, center area, exit area, and right turn area in a fixed order.

[0016] Preferably, the direction of travel of the vehicles includes: Based on the horizontal and vertical coordinates of the starting point of the completed trajectory, determine the specific location of the starting point coordinates within the four entrance lane areas, and mark it as the direction of the starting area of ​​the trajectory. Based on the coordinates of the trajectory's endpoint, determine the specific location where the endpoint falls within one of the four exit lane areas, and mark it as the direction of the trajectory's endpoint area. The turning type of the trajectory is determined based on the combination relationship between the directions of the starting area and the ending area; When the starting area direction and the ending area direction are directly opposite each other, the trajectory is determined to be straight-through traffic; when the starting area direction and the ending area direction are adjacent counterclockwise, it is determined to be left-turn traffic; when the starting area direction and the ending area direction are adjacent clockwise, it is determined to be right-turn traffic; when the starting area direction and the ending area direction are the same, it is determined to be U-turn traffic.

[0017] This invention addresses the core problems of existing aerial traffic flow analysis technologies for intersections, such as low trajectory completion accuracy, reliance on manual calibration for traffic flow statistics, and lack of integrated solutions. It proposes a method for intersection trajectory completion and statistics based on aerial trajectory structure inference, achieving the following significant technical effects: 1. Through a three-level process of straight-line trajectory filtering, K-means directional clustering and region generation, and structure partitioning, the geometric topology of intersection entrance lanes, exit lanes, central areas, and dedicated right-turn areas can be automatically inferred from the aerial trajectory data itself, without the need for pre-calibration of any detection areas or virtual coils. This operation not only significantly improves the system's deployment efficiency and automation level but also automatically adapts to changes in the drone's perspective, altitude, or position, solving the problem of poor adaptability of traditional static calibration methods in aerial photography scenarios. Simultaneously, the prior knowledge of scene structure mined from the trajectory data gives the subsequent trajectory completion and traffic statistics processes clear physical meaning and interpretability, overcoming the problem of insufficient interpretability in existing data-driven methods.

[0018] 2. The complex global trajectory matching problem is decomposed into four sub-problems with strict spatial constraints: the entrance lane, the central area, the exit lane, and the right-turn area. Candidate searches and matches for broken trajectories are performed sequentially in a fixed order. This algorithm comprehensively considers spatiotemporal proximity, lane consistency, and motion rationality rules, constructing a multi-dimensional matching score mechanism that includes lane matching degree, time difference, and the rationality of the start-end distance. Differentiated completion logic is designed for the traffic flow characteristics of different functional areas. Experimental results show that the trajectory completion matching accuracy of this invention reaches 89.93%, which is nearly 20 percentage points higher than the direct global completion method without a zoning strategy (70.31%). This effectively solves the problems of long-term trajectory loss due to changes in lighting and occlusion by high-altitude obstacles, as well as the difficulty in completing trajectories for complex turning behaviors.

[0019] 3. Based on the completed trajectory, the system automatically determines the vehicle flow direction by combining the functional areas of the starting and ending points, avoiding the shortcomings of traditional virtual loop methods that cannot accurately determine the vehicle direction when the trajectory is broken. Simultaneously, the use of an extended area boundary design effectively solves the problem of missed detection caused by vehicles leaving the standard lane area or being obstructed by vegetation when entering. Experimental data shows that during the 820-second observation period, the total flow statistics error for each inlet direction was controlled within 2%, and the short-term flow statistics error based on the green light cycle did not exceed one vehicle, significantly improving the statistical effect of right-turn traffic flow, which is severely affected by obstruction.

[0020] 4. For the first time, this technology organically integrates three key aspects—intersection topology inference, trajectory completion, and traffic flow statistics—into a complete technical system, overcoming the limitations of existing technologies that process each aspect independently. A Savitzky-Golay filter is used for trajectory preprocessing, effectively filtering out high-frequency noise caused by drone vibration and detection frame jitter while preserving the curvature characteristics of vehicle trajectories, providing a high-quality data foundation for subsequent processing. By adjusting the number of clusters and the region generation algorithm, it can seamlessly adapt to intersection scenarios with complex geometries such as five-way intersections and irregular intersections. Furthermore, by introducing virtual detection sections for parking lines, it can further expand to achieve refined analysis of multi-dimensional traffic flow parameters such as saturation flow rate and parking delay, providing reliable technical support for urban traffic operation efficiency assessment, conflict risk identification, and traffic organization optimization. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating a method for intersection trajectory completion and statistical analysis based on aerial photography trajectory structure inference.

[0022] Figure 2 This is a schematic diagram of the trajectory completion and traffic statistics logic in this invention.

[0023] Figure 3 This is a schematic diagram of the four-area division of the intersection in this invention.

[0024] Figure 4 This is a schematic diagram of the four-stage completion process in this invention.

[0025] Figure 5 This is a schematic diagram of the traffic operation at a crossroads in a certain city, as described in this invention.

[0026] Figure 6 This is the effect diagram of lane trajectory completion in Scheme A of the present invention in the first minute.

[0027] Figure 7 This is a diagram showing the full-time lane trajectory completion effect of Scheme A in this invention. Detailed Implementation

[0028] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention. It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0029] Example 1 Please see Figures 1-7 This embodiment proposes a method for intersection trajectory completion and statistics based on aerial trajectory structure inference, using a 30-minute aerial video of the intersection with a resolution of 1920×1080 pixels and a frame rate of 25 frames per second as input data. This video was captured by a drone hovering approximately 120 meters directly above the intersection, covering the complete traffic operation of a city's intersection. The intersection is a standard four-entry intersection, with three lanes in each entry lane, the rightmost lane being a dedicated right-turn lane, and a channelization island between the entry and exit lanes. The method includes: S1. Obtain aerial video of the intersection area, and use target detection and multi-target tracking algorithms to extract the original trajectory data from the aerial video; use Savitzky-Golay filter to smooth the original trajectory data and generate a set of vehicle trajectory points; Specifically, S1 includes: The target detection and multi-target tracking algorithm adopts a post-detection tracking framework. In the target detection stage, a deep learning target detection network identifies vehicle target bounding boxes in each frame of the image. The deep learning target detection network uses a convolutional neural network architecture to extract multi-scale feature maps from aerial videos and generate candidate detection boxes through a preset anchor box mechanism. After non-maximum suppression processing, the vehicle target bounding boxes are output. In the target tracking stage, a data association algorithm is used to match the target identity of vehicle target bounding boxes between adjacent frames. The data association algorithm fuses the target's motion prediction information and appearance feature descriptors. The motion prediction information includes the target's position and velocity components in the image coordinate system. The appearance feature descriptors are composed of high-dimensional vectors extracted from the detection box regions by the deep convolutional network, and the cosine similarity is used to measure the appearance similarity between different detection boxes. The motion similarity and appearance similarity are weighted and fused to form a data association cost matrix. The optimal matching result is then solved using the Hungarian matching algorithm, thereby achieving target identity matching of vehicle target bounding boxes between adjacent frames. The bounding box sequences belonging to the same vehicle target are concatenated into a complete vehicle trajectory, thus obtaining the original trajectory data.

[0030] The original trajectory data contains a continuous frame coordinate sequence for each trajectory, a corresponding timestamp sequence, and a target identification identifier. However, due to factors such as drone vibration during flight, target detection box boundary jitter, and micro-driving behavior of the vehicle, the original trajectory coordinate sequence contains a large amount of high-frequency jitter noise, causing the trajectory lines to exhibit jagged fluctuations. For high frame rate aerial video, overly dense trajectory sampling points can actually increase the computational burden of subsequent processing. Therefore, a Savitzky-Golay filter is used to smooth the original trajectory data to remove high-frequency jitter noise, resulting in a smoothed vehicle trajectory point set.

[0031] The Savitzky-Golay filter is a digital filter based on local polynomial regression. Its core principle is to fit a low-order polynomial to adjacent data points within a sliding window using linear least squares. This filter can reduce noise while preserving the high-order moment characteristics of the signal, effectively retaining important features such as peaks, valleys, and curvature variations. For example, suppose a given one-dimensional coordinate sequence of a trajectory is... ,in The processing flow of the SG filter is as follows: For a length of... A sliding window, the center point of which is denoted as . The index of the data points within the window is taken The corresponding observations are as follows: The algorithm uses a A polynomial of order X is used to fit the data within the window; its expression is: ; The polynomial coefficient vector is obtained by solving the least squares problem. The key to the filter output lies in extracting the fitted polynomial at the center point of the window. The value at that point is used as the smoothed coordinate value, i.e. The calculated value is mathematically equivalent to a linear weighted sum of the observations within the original window: ; Among them, the weighting coefficient The convolution kernel that constitutes the SG filter; this convolution kernel is determined solely by the window length. and polynomial order Since the two parameters are uniquely determined, they can be pre-calculated and stored using standard algorithms. Therefore, the SG smoothing process is computationally equivalent to performing a convolution operation on the sequence using a pre-calculated fixed convolution kernel, resulting in extremely high computational efficiency.

[0032] Regarding parameter settings, window length The smoothing scale needs to be controlled, and its value must be determined by a comprehensive trade-off between the trajectory sampling frequency and the noise frequency band to be filtered out; for aerial video with a frame rate of 60fps, the window length... The polynomial order is typically set to an odd value between 11 and 15 to cover a sufficient time window for local fitting. The flexibility of the fitted curve is determined when... When the moving average is linear, the smoothing effect is strongest, but it may overly smooth out the curvature of the trajectory; when... or At the same time, it can effectively suppress high-frequency noise while maintaining the trajectory curvature characteristics. The present invention preferably... To better preserve the vehicle's steering motion patterns within the intersection.

[0033] In a specific implementation of this invention, for each vehicle trajectory coordinate sequence and The coordinate sequences were processed independently using the SG filtering method described above, with both sequences using the same window length. and polynomial order Parameter pairing. This process can effectively filter out coordinate fluctuations caused by high-frequency jitter, generate vehicle trajectories that maintain the original macroscopic direction, and provide data support for subsequent intersection structure inference and traffic flow statistics.

[0034] S2. Based on the smoothed vehicle trajectory point set, automatically infer the topology of the lane guidance area of ​​the intersection; including straight-ahead trajectory filtering, direction clustering and region generation, and structure division; Based on the foregoing, the straight-line trajectory filtering is used to perform univariate linear regression analysis on each vehicle trajectory to determine whether the shape of the vehicle trajectory is close to a straight line; including: For including Vehicle trajectories at each trajectory point are analyzed, and their x and y coordinate sequences are extracted to construct a linear regression equation. This linear regression equation is used to calculate regression coefficients, determine the slope and intercept of the fitted line, and further calculate the goodness of fit of the linear model. The goodness of fit is determined by the coefficient of determination. measure, square root The Pearson correlation coefficient reflects the concentration of trajectory points around the fitted line; the average deviation of the vertical distance from each trajectory point to the fitted line is also calculated. Based on the above analysis results, the following conditions are designed for determining the straight-ahead trajectory: if the determination coefficient of the vehicle trajectory is... Not less than the preset determination coefficient threshold and average deviation Not exceeding the preset maximum allowable average deviation threshold If the trajectory approximates a straight line, it is determined to be included in the straight trajectory dataset. In a typical intersection scenario, the determination coefficient threshold... The typical value is 0.9, which is the average deviation threshold. The value is 20 pixels, which corresponds to approximately 2 meters of actual distance when measured in a ground coordinate system; the above two sets of parameters can be adjusted according to the geometric characteristics of the actual intersection.

[0035] Based on the foregoing, the directional clustering and region generation are used to perform directional clustering on all selected straight trajectories; including: The directional clustering adopts the K-means clustering algorithm. The K-means clustering algorithm is a classic unsupervised machine learning method based on partitioning. Its core idea is to allocate data points to a preset number of mutually exclusive clusters through iterative optimization, so that data points within the same cluster have high similarity, while data points between different clusters have significant differences.

[0036] In the specific implementation, the coordinates of all trajectory points for each straight trajectory are aggregated into a two-dimensional data point, which represents the directional characteristics of that trajectory; the data points corresponding to all straight trajectories constitute the input dataset for the clustering algorithm. The number of clusters is set. This equals the number of approach lanes at the intersection. For a typical cross intersection, The value is set to 4. The objective function of the K-means algorithm measures the sum of the squared Euclidean distances from each two-dimensional data point to the centroid of its cluster. The algorithm iteratively minimizes this objective function by alternating between two steps: cluster assignment and centroid update, until the convergence condition is met or the preset maximum number of iterations is reached. The cluster assignment step assigns each data point to the cluster represented by the nearest cluster centroid; the centroid update step recalculates the mean vector of all data points within each cluster and uses it as the new centroid of that cluster. After clustering, the straight trajectories in the four cardinal directions (north, south, east, and west) are assigned to four different clusters.

[0037] For each straight-ahead trajectory cluster in each direction, a minimum adjacency rectangle algorithm is used to generate a rectangular region covering both the approach and exit lanes in that direction, taking into account the actual number of lanes in that direction. The minimum adjacency rectangle algorithm takes as input the set of coordinates of all trajectory points within the cluster in that direction and outputs the smallest area axis-aligned rectangle enclosing that coordinate set. This rectangle extends along the vehicle's direction of travel, covering the entire area from upstream of the approach lane to downstream of the exit lane. The width of the rectangular region perpendicular to the direction of travel is determined based on the number of lanes in that direction, ensuring sufficient space for all straight-ahead vehicles.

[0038] Based on the foregoing, the structural division includes: Based on the rectangular areas of the approach and exit lanes in all directions, the intersection space is further divided into four functional zones. The specific division method is as follows: The rectangular areas of the approach lanes in each direction are defined as the approach lane zone, which covers the lane range from the upstream starting point of each approach lane to the stop line position of the intersection; the rectangular areas of the exit lanes in each direction are defined as the exit lane zone, which covers the lane range from the exit position of the intersection to the downstream end of the road segment; the central area inside the intersection enclosed by the four approach lane zones and the four exit lane zones is defined as the central area of ​​the intersection, which is the main activity space for vehicles turning and driving inside the intersection; for intersections with dedicated right-turn lanes, an independent rectangular area extends from the rightmost side of the approach lane zone as the dedicated right-turn zone.

[0039] The division of the above four functional areas is achieved automatically based on the clustering results of straight-line trajectories, without the need for manual pre-labeling of any detection areas. The boundaries of the divided areas closely match the geometric shape of the actual intersections, providing a structured spatial constraint basis for subsequent sub-regional trajectory matching and traffic statistics.

[0040] S3. Based on the four functional regions, a four-stage progressive trajectory completion algorithm is designed. According to the rules of spatiotemporal proximity, lane consistency, and motion rationality, broken trajectory segments are searched and connected within the corresponding regions to generate a completed vehicle trajectory; including: S31. Define the trajectory point data structure; each trajectory point data is a structured record, including the following fields: starting point x-coordinate, starting point y-coordinate, ending point x-coordinate, ending point y-coordinate, starting point timestamp, ending point timestamp, direction of the area where the starting point is located, direction of the area where the ending point is located, lane number of the entrance lane where the starting point is located, and lane number of the exit lane where the ending point is located. The directions of the starting point and ending point are optional, with options being East, South, West, and North. If the landing point is not within any of the defined functional areas, it is recorded as 0. The lane number information is used for lane consistency evaluation in the subsequent matching process.

[0041] S32. Following a fixed order of the entrance lane area, center area, exit lane area, and right turn area, candidate segments of the broken trajectory are searched and matched sequentially within each area. The loop execution logic of the four-stage completion algorithm is described as follows: For trajectory completion in the approach lane area, the first step is to identify whether the endpoint of the trajectory is located within the approach lane area and whether the starting area is clear but the endpoint area is not. If the above conditions are met, the endpoint of the trajectory to be completed is used as the search starting point, and candidate trajectory segments are searched in the trajectory set of subsequent time periods. The selection criteria for candidate trajectories include three aspects. The first aspect is the time difference constraint: the absolute value of the difference between the starting time of the candidate trajectory and the ending time of the trajectory to be completed must be less than the preset maximum allowable time difference threshold. The second aspect is the basic geometric rationality constraint: the geometric connection relationship between the candidate trajectory and the trajectory to be completed is judged by a preset geometric discriminant function. For example, for the trajectory to be completed in the east approach direction, the x-coordinate of its endpoint should not be greater than the x-coordinate of the starting point of the candidate trajectory to ensure the reasonable connection of the vehicle's driving direction. The third aspect is the orientation consistency constraint: for approach lane area completion, the orientation of the starting point of the candidate trajectory must be the same as the orientation of the endpoint of the trajectory to be completed, that is, both belong to the same approach direction.

[0042] Candidate trajectories that pass the above three screening criteria enter the scoring stage. The scoring mechanism comprehensively and quantitatively evaluates the matching degree of candidate trajectories from three aspects: The first aspect is the lane matching score. When the absolute value of the difference between the lane number of the candidate trajectory's starting point and the lane number of the trajectory to be completed is 0, that is, the lane numbers are completely consistent, and full marks are awarded; when the absolute value of the difference is 1, that is, it crosses one lane, and half full marks are awarded; when the difference is greater than 1, the candidate trajectory does not participate in the subsequent scoring; The second aspect is the time difference score. The score is calculated based on the ratio of the difference between the time of the candidate trajectory's starting point and the time of the trajectory to be completed to the maximum allowable time difference. The smaller the time difference, the higher the score; The third aspect is the reasonableness score of the distance between the starting point and the endpoint. This score is calculated based on the deviation between the estimated speed at the endpoint of the trajectory to be completed and the actual spatial distance connecting the starting point and the endpoint. The smaller the deviation, the higher the score.

[0043] The scores from the three aspects mentioned above are weighted and summed to obtain the comprehensive matching score of the candidate trajectories. The candidate trajectory with the highest comprehensive score is selected as the optimal matching segment and proceeds to the trajectory connection stage. After completing one completion operation, the parameter information of the corresponding trajectory in the trajectory database is updated, including the recalculated origin and destination coordinates, origin and destination times, area direction, and lane number. The above search and scoring process is repeated until no candidate trajectory that meets the filtering criteria can be found in the current area, and then the process moves to the next stage of completion processing.

[0044] The core constraint for lane-entry area completion is that the starting point of the candidate trajectory must be located within the same lane-entry area as the ending point of the trajectory to be completed. In special cases, if the ending point of the trajectory to be completed is located within the left-turn lane, and the starting point of the candidate trajectory is extremely close to the ending point in terms of time and space and meets the geometric constraints of U-turn motion, then the candidate trajectory can also be evaluated according to the U-turn direction.

[0045] For trajectory completion in the central area The processing logic for center zone completion differs from that for the approach lane area. Within the center zone, the starting point of the trajectory to be completed must have clear directional information, and the starting point of the candidate trajectory must be located within the center zone. When the ending point of the trajectory to be completed is within the left-turn lane, if the starting point of the candidate trajectory is located at a reasonable position to the left of the left-turn lane, the lane matching score is directly assigned full marks. Furthermore, center zone completion also imposes an upper limit constraint on the time difference; that is, the time difference between the starting point of the candidate trajectory and the ending point of the trajectory to be completed cannot exceed ±3 seconds of the green light time range of their respective signal phases.

[0046] During the exit lane area completion phase, the starting point orientation of the candidate trajectory is not defined. That is, only trajectories that break within the exit lane area can be used as trajectories to be completed. The source of the completion candidates is another trajectory that breaks within the exit lane area. The search details are similar to the logic of the entrance lane area completion phase.

[0047] Right-turn area trajectory completion requires that the starting point of the candidate trajectory must be located within the dedicated right-turn area, the starting point of the trajectory to be completed must be greater than or equal to the number of the rightmost lane in the approach lane area, and the endpoint of the trajectory to be completed must not be specified. It should be noted that at some intersections, the right-turn lane does not have a separate safety island; in this case, the right-turn area completion logic is integrated into the approach lane area completion process.

[0048] S33. Select the candidate trajectory segment with the highest matching score and connect it to the trajectory to be completed. For missing trajectory areas between connection points, a simplified completion strategy using linear interpolation and time equalization is adopted. Specifically, linear interpolation generates a sequence of intermediate trajectory points in a straight line between the endpoint coordinates of the trajectory to be completed and the starting coordinates of the candidate trajectory; time equalization distributes the timestamps of the intermediate trajectory points evenly over the total time based on the difference between the timestamps of the endpoint of the trajectory to be completed and the starting timestamps of the candidate trajectory, thereby forming a continuous completed vehicle trajectory.

[0049] The four-stage completion algorithm executes in an iterative manner. The outer loop traverses the four functional regions, while the inner loop continuously searches for completion until no valid candidate trajectories remain in the current region. Each iteration processes the entrance region, center region, exit region, and right-turn region in a fixed order. This region-based progressive completion strategy decomposes the complex global trajectory matching problem into multiple sub-problems constrained by region boundaries, thereby effectively narrowing the search range of candidate trajectories and reducing the probability of mismatches.

[0050] S4. Based on the completed vehicle trajectory, automatically determine the vehicle's travel direction according to the entrance lane area where the starting point of each trajectory falls and the exit lane area where the ending point falls; count the number of trajectories in the clearly defined starting and ending areas to achieve automated counting of different turning flows at each entrance lane; including: The specific implementation of the flow direction determination logic is as follows: First, based on the horizontal and vertical coordinates of the starting point of the completed trajectory, determine which specific direction among the four entrance lane areas the starting point coordinates fall into, and record this direction as the starting area direction of the trajectory; then, based on the coordinates of the ending point of the trajectory, determine which specific direction among the four exit lane areas the ending point falls into, and record this direction as the ending area direction of the trajectory; finally, determine the turning type of the trajectory based on the combination relationship between the starting area direction and the ending area direction. When the starting area direction and the ending area direction are directly opposite each other, for example, the starting point of the north entrance corresponds to the ending point of the south exit, the trajectory is determined to be straight-through flow; when the starting area direction and the ending area direction are adjacent counterclockwise, for example, the starting point of the north entrance corresponds to the ending point of the west exit, the trajectory is determined to be left-turn flow; when the starting area direction and the ending area direction are adjacent clockwise, for example, the starting point of the north entrance corresponds to the ending point of the east exit, the trajectory is determined to be right-turn flow; when the starting area direction and the ending area direction are the same, that is, vehicles enter from the same entrance direction and exit from the same entrance direction, the trajectory is determined to be U-turn flow.

[0051] Regarding the strategy for defining the entrance and exit lane areas, this invention sets the area boundaries to cover and extend beyond the surrounding adjacent areas, rather than strictly limiting them to within the lane edge lines. This extended design has the following technical effects: For exiting vehicles, even if a vehicle enters a non-standard lane area such as a roadside commercial area, parking lot, or alley after leaving the intersection, its endpoint coordinates still fall within the extended exit lane area, thus avoiding missed detections caused by exiting vehicles leaving the standard lane area; for entering vehicles, even if a vehicle is vertically obstructed by vegetation canopy when entering the entrance lane, its starting coordinates still fall within the extended entrance lane area, thus avoiding missed detections caused by the vehicle being obstructed. This design strategy ensures that as long as a vehicle completes the full trajectory detection from start to finish within the intersection area, it can be accurately included in the traffic flow statistics counting range.

[0052] The specific counting method for traffic flow statistics is as follows: Traverse and complete the starting and ending area direction information of all trajectories. For each trajectory with clearly identified starting and ending areas, count it into the corresponding statistical category according to its turning type. The statistical categories are organized according to two dimensions: entrance direction and turning type. For each entrance direction, straight, left turn, right turn, and U-turn correspond to an independent counting variable. By accumulating the data from all trajectories, the statistical results of different turning flows at each entrance are finally output.

[0053] The following section provides a detailed explanation of the complete processing flow of the method of the present invention in a real intersection scenario, using a specific application example.

[0054] A typical intersection on a main road in a city was selected as the research object. A DJI Mavic Pro 3 drone was used to record the intersection from a vertical angle. The frame rate of the aerial video was set to 60fps, the resolution to 1920×1080 pixels, and the total recording time was 820 seconds. The intersection is obstructed by green vegetation on both sides of the main road and at the safety island. There are parking lots around the intersection, making it a representative example of a complex urban intersection scenario.

[0055] In the raw trajectory acquisition stage, a YOLOv5 object detection network trained on the UAVDT dataset is used in conjunction with the DeepSort multi-object tracking framework to process the aerial video. The YOLOv5 network is responsible for outputting the bounding boxes of all detected vehicle targets and their confidence scores in each frame, while the DeepSort framework is responsible for associating the vehicle detection boxes between adjacent frames to form continuous tracking trajectories. The UAVDT dataset is a large-scale benchmark dataset specifically built for UAV-view target detection and tracking tasks. This dataset extracts approximately 80,000 valid images from about 10 hours of raw aerial video and provides detailed manual annotations, covering various vehicle types such as cars, trucks, and buses. The DeepSort algorithm predicts the position of each tracked target in the current frame using a Kalman filter, and simultaneously uses a deep convolutional network to extract the appearance feature vector of each detection box region. The motion prediction information and appearance feature information are weighted and fused, and then cross-frame data association is achieved through the Hungarian matching algorithm. This processing flow extracts the raw trajectory data of all vehicles from 820 seconds of aerial video.

[0056] During the trajectory smoothing stage, a Savitzky-Golay filter is applied to each extracted original trajectory for smoothing. The sliding window length is set. For 11 sampling points, the polynomial order is... The filter has three orders. It performs independent convolution operations on the coordinate sequences and coordinate arrays of each trajectory to generate a smoothed sequence of trajectory points. The smoothed trajectory effectively eliminates high-frequency coordinate noise caused by UAV flight vibration and detection box jitter, while preserving the curvature characteristics at points where the vehicle's direction of travel changes. The overall shape of the trajectory is smooth and conforms to the actual driving path of the vehicle.

[0057] In the intersection structure inference stage, all smoothed trajectories are first screened for straight-line paths. A univariate linear regression analysis is then used to calculate the coefficient of determination for each trajectory. and average deviation Set the threshold for the coefficient of determination. The average deviation threshold is 0.9. The resolution is 20 pixels. After dual-condition filtering, a large number of near-straight lines were identified as straight-ahead trajectories, while non-linear trajectories such as turning trajectories, parking lot interior driving trajectories, and U-turn trajectories were excluded. The resulting set of straight-ahead trajectories accurately covers the spatial distribution range of the four approach lanes and four exit lanes of the intersection.

[0058] Subsequently, K-means clustering was performed on all straight-ahead trajectories, with the number of clusters set to 4. After iterative calculation, the centroids of the four clusters represent straight-ahead trajectory clusters in the four directions of east, west, north, and south. For each direction cluster, the coordinate distribution range of all trajectory points within the cluster perpendicular to the direction of travel was calculated. Combined with the actual number of lanes in that direction (usually 2 to 3 lanes), an axis-aligned rectangular area covering the approach and exit lanes in that direction was generated using the minimum adjacency rectangle algorithm. Based on the approach and exit lane rectangles in the four directions, the intersection space was divided into four functional areas: the approach lane area covers the upstream sections of the approach lanes in all four directions, the central area covers the core area inside the intersection, the exit lane area covers the downstream sections of the exit lanes in all four directions, and the dedicated right-turn area is independent of the rightmost side of the four approach lanes.

[0059] In the trajectory completion stage, a four-stage progressive completion algorithm is used to process all broken trajectories. Taking the completion of the approach lane area as an example, the trajectory to be completed is one with a clear starting direction but an unclear ending direction. The algorithm searches for candidate trajectories in the subsequent trajectory set whose starting and ending areas are the same, and performs a comprehensive score based on time difference threshold, geometric rationality constraints, and lane matching. The candidate trajectory with the highest score is selected and connected to the trajectory to be completed. The missing segments between the connection points are completed using linear interpolation and time equalization strategies. The completion search is performed iteratively until there are no candidate trajectories to be completed in the approach lane area, and then the completion process for the center area, exit lane area, and right turn area is entered sequentially.

[0060] In this example, the four-stage completion algorithm completed a total of 167 trajectory lines. The completed trajectory effectively compensated for the gaps caused by tree occlusion, significantly improving the overall integrity of the trajectory. Regarding matching accuracy, the regional completion strategy (Solution A) of this invention achieved a matching accuracy of 89.93%, compared to only 70.31% for the direct global completion method (Solution B) without a regional strategy. The regional strategy, by introducing intersection structure constraints, limits the matching search space to a reasonable area, significantly reducing the probability of mismatches.

[0061] During the traffic flow statistics phase, based on the completed trajectory, each trajectory is classified and counted according to the flow direction determination logic. Taking the northbound direction as an example, a trajectory whose starting point falls in the northbound entrance area and whose ending point falls in the southbound exit area is determined as northbound straight-through traffic; a trajectory whose starting point falls in the northbound entrance area and whose ending point falls in the westbound exit area is determined as northbound left-turn traffic; a trajectory whose starting point falls in the northbound entrance area and whose ending point falls in the eastbound exit area is determined as northbound right-turn traffic; and a trajectory whose starting point and ending point both fall in the northbound entrance area is determined as northbound U-turn traffic.

[0062] Statistical results show that during the 820s observation period, the actual total flow at the north inlet was 238 vehicles, while the result for Scheme A was 236 vehicles, with an error of 0.84%; the actual total flow at the south inlet was 166 vehicles, while the result for Scheme A was 166 vehicles, with an error of 0.00%; the actual total flow at the east inlet was 161 vehicles, while the result for Scheme A was 160 vehicles, with an error of 0.62%; and the actual total flow at the west inlet was 118 vehicles, while the result for Scheme A was 116 vehicles, with an error of 1.69%. The statistical error of the total flow in each inlet direction was controlled within 2%.

[0063] Furthermore, when conducting short-term traffic flow statistics using the green light cycle as the statistical unit, the statistical error within each cycle does not exceed one vehicle. In the short-term statistics of right-turn traffic flow, using a 2-minute statistical unit, the south entrance has an unobstructed view, and the right-turn traffic flow statistics for 7 statistical units are completely consistent with the actual values; other entrances are affected by vegetation obstruction, resulting in errors of 0 to 2 vehicles in some statistical intervals, but the error has been significantly reduced compared to the virtual loop method in the comparative scheme.

[0064] Example 2 Based on Embodiment 1, this embodiment provides an alternative technical implementation for handling more complex intersection scenarios or intersections with irregular geometric shapes.

[0065] For the directional clustering step in step S2, when the intersection geometry is irregular or the number of approach lanes is not 4 (e.g., a five-way intersection or an irregular intersection), the cluster size should be adjusted according to the actual number of approach lanes. Furthermore, for irregularly shaped intersections, the minimum adjacent rectangle algorithm can be replaced by a convex hull algorithm or a custom polygon fitting algorithm. The convex hull algorithm calculates the two-dimensional convex hull boundary of the trajectory point set within each directional cluster, generating a minimum convex polygon region covering the lanes in that direction. The custom polygon fitting algorithm, based on the actual distribution of trajectory points, generates an irregular polygon region that fits the distribution characteristics of the trajectory points through a boundary tracking algorithm. These alternative solutions, while maintaining the integrity of region coverage, can better adapt to the geometry of irregular intersections.

[0066] For the matching score mechanism in step S3, the weight combination of the scoring rules can be adjusted according to the actual data characteristics. Specifically, the weight of the time difference score can be increased to adapt to scenarios with high temporal accuracy requirements in high frame rate videos; the weight of the lane matching score can be increased to adapt to scenarios with clear lane divisions and few lane-changing behaviors; and the weight of the start-end distance reasonableness score can be increased to adapt to scenarios with relatively stable vehicle speeds. The weight adjustment of each scoring item is achieved through a preset weight coefficient vector, and the sum of the weight coefficients is set as a normalization constant to ensure the comparability of the scores.

[0067] For the traffic flow statistics step S4, in addition to determining the flow direction based on the location of the trajectory's start and end points, automated traffic flow statistics can also combine the timestamp information and average vehicle speed information of the trajectory at key locations for more refined statistical analysis. Specifically, a virtual detection section is set at the automatically defined stop line location of the entrance lane. When the completed trajectory passes through this section, its passing timestamp is recorded. The instantaneous vehicle speed at the stop line location is calculated by combining the displacement difference between preceding and following frames. Based on the timestamp and speed information of the stop line location, refined traffic parameters such as the saturation flow rate and parking delay of each entrance lane can be further calculated, thus expanding traffic flow statistics into multi-dimensional traffic flow parameter analysis.

[0068] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for intersection trajectory completion and statistics based on aerial photography trajectory structure inference, characterized in that, include: S1. Obtain aerial video of the intersection area and use target detection and multi-target tracking algorithms to extract the original trajectory data from the aerial video; The original trajectory data was smoothed using a Savitzky-Golay filter to generate a set of vehicle trajectory points; S2. Based on the set of vehicle trajectory points, infer the topology of the lane guidance area of ​​the intersection and divide it into four functional areas; S3. Based on the four functional areas, design a four-stage progressive trajectory completion algorithm. According to the rules of spatiotemporal proximity, lane consistency and motion rationality, search and connect broken trajectory segments in the corresponding areas to generate a completed vehicle trajectory. S4. Based on the completed vehicle trajectory, the driving direction of the vehicle is automatically determined according to the entrance lane area where the starting point of each trajectory falls and the exit lane area where the ending point falls; the number of trajectories in the clearly defined starting and ending areas is counted to realize the automatic counting of different turning flows in each entrance lane.

2. The intersection trajectory completion and statistics method based on aerial trajectory structure inference according to claim 1, characterized in that, S1 includes: In the target detection stage, a deep learning target detection network is used to identify the vehicle target bounding box in each frame of the image. The deep learning target detection network adopts a convolutional neural network architecture, extracts multi-scale feature maps from aerial videos, generates candidate detection boxes through a preset anchor box mechanism, and outputs the vehicle target bounding box after non-maximum suppression processing. In the target tracking stage, a data association algorithm is used to match the target identity of vehicle target bounding boxes between adjacent frames. The data association algorithm fuses the target's motion prediction information and appearance feature descriptor. The motion prediction information includes the target's position and velocity components in the image coordinate system. The appearance feature descriptor is composed of high-dimensional vectors extracted from the detection box region by a deep convolutional network. The motion similarity and appearance similarity are weighted and fused to form a data association cost matrix. The optimal matching result is then solved using the Hungarian matching algorithm to obtain the original trajectory data. The original trajectory data is smoothed using a Savitzky-Golay filter to generate a set of vehicle trajectory points. The Savitzky-Golay filter uses the linear least squares method to fit a low-order polynomial to adjacent data points within a sliding window, in order to preserve the peak, valley and curvature variations of the signal.

3. The intersection trajectory completion and statistical method based on aerial trajectory structure inference according to claim 2, characterized in that, S2 includes: Extract the x-coordinate and y-coordinate sequences of vehicle trajectories and construct a linear regression equation; the linear regression equation is used to calculate the regression coefficient and goodness of fit; wherein, the goodness of fit is measured by the coefficient of determination, and the square root of the coefficient of determination is the Pearson correlation coefficient, which is used to reflect the degree of concentration of the trajectory point distribution. Construct straight-line trajectory determination criteria: If the determination coefficient of the vehicle trajectory is not less than the preset determination coefficient threshold and the average deviation does not exceed the preset maximum allowable average deviation threshold, then it is included in the straight-line trajectory dataset. The K-means clustering algorithm is used to perform directional clustering on all the selected straight trajectories. First, the straight trajectory dataset is aggregated into two-dimensional data points. Then, the sum of squared Euclidean distances from the two-dimensional data points to the centroid of their respective clusters is calculated. The objective function is minimized by alternately performing cluster assignment and centroid update until the convergence condition is met or the preset maximum number of iterations is reached. After clustering, the straight trajectory dataset is assigned to four different clusters: east, west, south, and north. For each straight trajectory cluster, the minimum adjacent rectangle algorithm is used to generate a rectangular region covering the entrance and exit lanes. Based on the rectangular areas of the approach and exit lanes in all directions, the intersection space is further divided into four functional areas: the rectangular area of ​​the approach lanes is defined as the approach lane area; the rectangular area of ​​the exit lanes is defined as the exit lane area; the central area inside the intersection enclosed by the four approach lane areas and the four exit lane areas is defined as the central area of ​​the intersection; for intersections with dedicated right-turn lanes, an independent rectangular area extends from the rightmost side of the approach lane area as the dedicated right-turn area.

4. The intersection trajectory completion and statistics method based on aerial trajectory structure inference according to claim 3, characterized in that, The four-stage progressive trajectory completion algorithm includes: For trajectory completion in the approach lane area, first identify whether the trajectory endpoint is located within the approach lane area and the starting area is clear but the endpoint area is not clear; if the above conditions are met, the endpoint of the trajectory to be completed is used as the search starting point, and candidate trajectory segments are searched in the trajectory set of subsequent time periods. The selection criteria for candidate trajectories include three aspects: the first aspect is the time difference constraint, where the absolute value of the difference between the start time of the candidate trajectory and the end time of the trajectory to be completed must be less than the preset maximum allowable time difference threshold; the second aspect is the basic geometric rationality constraint, which uses a preset geometric discriminant function to judge the geometric connection relationship between the candidate trajectory and the trajectory to be completed; and the third aspect is the orientation consistency constraint, where the orientation of the start of the candidate trajectory must be the same as the orientation of the end of the trajectory to be completed. After the candidate trajectories are selected, lane matching score, time difference score, and start-end distance reasonableness score are applied to them. The three scores are then weighted and summed to generate a comprehensive matching score. The candidate trajectory with the best score is then selected for connection. For center area trajectory completion, the starting point of the trajectory to be completed must have clear directional information, and the starting point of the candidate trajectory must be located within the center area. When the ending point of the trajectory to be completed is located within the left-turn lane, if the starting point of the candidate trajectory is located at a reasonable position to the left of the left-turn lane, the lane matching score is full. In addition, center area completion is also subject to an upper limit constraint on the time difference, that is, the time difference between the starting point of the candidate trajectory and the ending point of the trajectory to be completed cannot exceed ±3s of the green light time range of its respective signal phase. For exit lane area trajectory completion, only trajectories that are broken within the exit lane area can be considered as trajectories to be completed. The candidate source for completion is another trajectory that is broken within the exit lane area. The search details are the same as for entrance lane area trajectory completion. For right-turn area trajectory completion, the starting point of the candidate trajectory must be located within the dedicated right-turn area, the starting point of the trajectory to be completed must be greater than or equal to the number of the rightmost lane in the approach lane area, and the endpoint of the trajectory to be completed must be undefined. When the right-turn lanes at some intersections do not have independent safety islands, the right-turn area completion processing logic is incorporated into the approach lane area completion process.

5. The intersection trajectory completion and statistics method based on aerial trajectory structure inference according to claim 4, characterized in that, The S3 further includes: The candidate trajectory segment with the best matching score is selected and connected to the trajectory to be completed. For the missing trajectory area between the connection points, a simple completion strategy of linear interpolation and time equalization is adopted. Among them, linear interpolation generates a sequence of intermediate trajectory points in a straight line between the endpoint coordinates of the trajectory to be completed and the starting coordinates of the candidate trajectory. Time equalization distributes the timestamps of the intermediate trajectory points evenly within the total time based on the difference between the timestamp of the endpoint of the trajectory to be completed and the timestamp of the starting coordinate of the candidate trajectory. The four-stage completion algorithm is executed in a loop-iterative manner. The outer loop traverses the four functional area stages, while the inner loop continuously performs completion search until there are no valid candidate trajectories in the current area. Each iteration processes the entrance area, center area, exit area, and right turn area in a fixed order.

6. The intersection trajectory completion and statistical method based on aerial trajectory structure inference according to claim 5, characterized in that, The direction of travel of the vehicles includes: Based on the horizontal and vertical coordinates of the starting point of the completed trajectory, determine the specific location of the starting point coordinates within the four entrance lane areas, and mark it as the direction of the starting area of ​​the trajectory. Based on the coordinates of the trajectory's endpoint, determine the specific location where the endpoint falls within one of the four exit lane areas, and mark it as the direction of the trajectory's endpoint area. The turning type of the trajectory is determined based on the combination relationship between the directions of the starting area and the ending area; When the starting area direction and the ending area direction are directly opposite each other, the trajectory is determined to be straight-through traffic; when the starting area direction and the ending area direction are adjacent counterclockwise, it is determined to be left-turn traffic; when the starting area direction and the ending area direction are adjacent clockwise, it is determined to be right-turn traffic; when the starting area direction and the ending area direction are the same, it is determined to be U-turn traffic.