Data processing method, trajectory visualization method and analysis method for traffic video stream
Through multi-target tracking algorithms and trajectory visualization methods, traffic dynamic information in intersection surveillance videos is extracted and optimized, solving the problems of difficult analysis and low efficiency in the existing technology, and achieving fast and accurate traffic video stream data processing and visual analysis. .
Patent Information
- Application Number
- CN202210539892.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-05-17
AI Technical Summary
Existing technology is difficult to quickly and effectively analyze the traffic dynamic information in intersection surveillance videos. The manual browsing process is laborious and time-consuming. Existing video summary technology cannot be directly applied to summarize the content of intersection surveillance videos.
A multi-target tracking algorithm is used to extract motion trajectories, trained through the Fairmot model and visdrone data set, combined with the UPNP algorithm, z-score algorithm and dynamic programming method to calculate continuous traffic flow data information, and use trajectory visualization methods such as FDEB and information entropy algorithms Optimize and display intersection traffic flow dynamic information.
It achieves fast processing, reliable and accurate traffic video stream data processing, can quickly obtain the continuous traffic information flow in the intersection trajectory, assists users to quickly understand and analyze video content, and reduces the difficulty of analysis.
Smart Images

Figure CN114926495B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of digital image processing, and in particular relates to a data processing method, a trajectory visualization method and an analysis method of a traffic video stream. Background Art
[0002] Intersection surveillance cameras are widely distributed in the road network systems of various cities, thus generating a massive amount of video data resources. Intersections are the places with the lowest traffic capacity, the greatest traffic congestion, the greatest reduction in driving speed, and the highest probability of traffic accidents in the road system; therefore, understanding and analyzing traffic dynamic information in surveillance videos can help transportation departments fully understand the microscopic behavior of objects in traffic scenes, thereby assisting in discovering actual traffic problems.
[0003] However, as more and more data becomes available, a major challenge facing researchers is how to quickly analyze the collected intersection surveillance videos to obtain more effective data. Currently, the most direct way to analyze video data is to browse manually; however, since intersections are the throats of road traffic, various vehicles and pedestrians on intersecting roads must converge, turn, and pass through intersections, resulting in many junctions, intersections, and intersections, and serious mutual interference. This makes the process of manually browsing video content a laborious and time-consuming task for users. In addition, although video summarization technology has been widely used in the analysis of surveillance videos, existing technologies cannot be directly applied to the summary of intersection surveillance video content, because existing video summarization technologies usually extract key frames from surveillance videos according to different standards, so they cannot better explore traffic dynamic information in surveillance videos. Summary of the invention
[0004] One of the purposes of the present invention is to provide a data processing method for a traffic video stream which can quickly process and obtain a continuous traffic information stream in a road intersection trajectory and has high reliability and good accuracy.
[0005] A second object of the present invention is to provide a trajectory visualization method including the data processing method of the traffic video stream.
[0006] A third object of the present invention is to provide an analysis method including the data processing method and trajectory visualization method of the traffic video stream.
[0007] The data processing method of the traffic video stream provided by the present invention comprises the following steps:
[0008] S1. Obtain the intersection traffic video stream data to be processed;
[0009] S2. Using a multi-target tracking algorithm, the motion trajectory of the video stream data obtained in step S1 is extracted;
[0010] S3. Restoring, cleaning and calculating the properties of the motion trajectory extracted in step S2;
[0011] S4. Calculate and obtain the final continuous traffic flow data information based on the processed data obtained in step S3.
[0012] The multi-target tracking algorithm described in step S2 is used to extract the motion trajectory of the video stream data obtained in step S1, which specifically includes the following steps:
[0013] S2-1. Select the single-step model Fairmot as the multi-target extraction model;
[0014] S2-2. Select the drone dataset visdrone as the pre-training dataset for the multi-target extraction model;
[0015] S2-3. Select a set amount of local surveillance video data in proportion, and manually annotate the selected local surveillance video data, and use the annotated video data as pre-training data;
[0016] S2-4. Use the obtained pre-training data set to train the selected multi-target extraction model Fairmot to obtain the final motion trajectory extraction model;
[0017] S2.5 uses the motion trajectory extraction model obtained in step S2-4 to extract the motion trajectory of the video stream data obtained in step S1.
[0018] The annotation described in step S2-3 specifically includes annotation of object type, annotation of moving direction and annotation of meteorological conditions; at the same time, before annotation, the area behind the stop line of the lane at the intersection in the local monitoring video is blocked to improve the subsequent model accuracy.
[0019] The restoration described in step S3 is specifically performed by using the following steps to restore the trajectory:
[0020] The UPNP algorithm is used to convert the pixel coordinates in the trajectory into world coordinates, thereby completing the restoration of the motion trajectory.
[0021] The cleaning described in step S3 is specifically performed by the following steps to clean the track:
[0022] The same turning trajectory data is assumed to conform to normal distribution;
[0023] Use the z-score algorithm to clean the trajectory: For the same turning trajectory data, first calculate the average value of the trajectory length The variance of trajectory length σ l , the average value of the trajectory existence time and the variance σ of the trajectory existence time t , thus obtaining the i-th trajectory T i The z-score value is l i is the trajectory T i The length, t i is the trajectory T i duration of existence;
[0024] When the trajectory T i When the z-score value of is greater than the set threshold, the trajectory T i Clean and filter;
[0025] After all trajectories are cleaned, the final trajectory cleaning result is obtained.
[0026] The attribute calculation described in step S3 is specifically performed by using the following steps:
[0027] Speed calculation:
[0028] The i-th trajectory T i A set of world coordinate points p i,j and the timestamp t of each coordinate point i,j Composition, where j = 1, 2, ..., N, N is the i-th trajectory T i The total number of world coordinate points included; the speed v is calculated using the following formula i,j :
[0029]
[0030] Where || || is the distance between two points; w is the time window size; median() is the median value;
[0031] Turning to computing:
[0032] Calculate reference trajectory: For each turn, select the best trajectories; then use the k-means clustering algorithm to cluster the trajectories, where k is the number of turns at the intersection; after clustering, use the best centroid of each category as the reference trajectory of the corresponding turn;
[0033] Calculate similarity:
[0034] For the target trajectory, the target trajectory and all the obtained reference trajectories are converted into string vector form, and then the dynamic programming method is used to calculate the edit distance between the string vector of the target trajectory and the string vector of each reference trajectory, and the turn corresponding to the reference trajectory with the smallest edit distance is taken as the turn of the target trajectory.
[0035] Step S4, according to the processed data obtained in step S3, calculates and obtains the final continuous traffic flow data information, which specifically includes the following steps:
[0036] Based on the average distance, determine whether any two trajectories of the same type belong to the same continuous traffic flow:
[0037] For any two trajectories T of the same type A and T B , the trajectory T A and T B Considered as consisting of one-dimensional point coordinates; the trajectory T A The start time of the movement is The end time of the exercise is Track T B The start time of the movement is The end time of the exercise is
[0038] Calculate two trajectories T A and T B The average distance D between the coordinates of each point when moving simultaneously is Where t start is the trajectory T A and T B At the same time, the start time of the movement, and t end is the trajectory T A and T B At the same time, the end time of the movement, and T A (t) is the trajectory T at time t A The value of T B (t) is the trajectory T at time t B The value of
[0039] If t start >t end , then the trajectory T A and T B do not belong to the same continuous traffic flow; if the value of the average distance D is less than the set threshold, then the trajectory T A and T B Belong to the same continuous traffic flow;
[0040] The concept of connected blocks of graphs is used to identify complete continuous traffic flows:
[0041] Construct graph G: The nodes in G represent trajectories, and the edges between nodes indicate that the corresponding two trajectories belong to the same continuous traffic flow;
[0042] For graph G, a depth-first traversal algorithm is used to search for all connected blocks in graph G; when the number of elements in a connected block is greater than 1, P is considered to be a continuous traffic flow; when the number of elements in a connected block P is 1, P is considered to be a discrete trajectory.
[0043] The present invention also provides a trajectory visualization method including the data processing method of the traffic video stream, comprising the following steps:
[0044] A. Obtain the intersection traffic video stream data to be processed;
[0045] B. Using the above-mentioned traffic video stream data processing method to process the intersection traffic video stream data obtained in step A to obtain continuous traffic flow data information;
[0046] C. Visualize the continuous traffic flow data information obtained in step B;
[0047] D. Using the FDEB-based trajectory bundling algorithm to optimize the continuous traffic flow data information in the visualization data obtained in step C;
[0048] E. Using the trajectory reduction algorithm based on information entropy to optimize the discrete trajectories in the visualization data obtained in step C;
[0049] F. Visualize the optimized data information.
[0050] The FDEB-based trajectory bundling algorithm described in step D is used to optimize the continuous traffic flow data information in the visualization data obtained in step C, which specifically includes the following steps:
[0051] D1. For each trajectory, k coordinate points are uniformly sampled and used as control points;
[0052] D2. For each trajectory, set the subdivisions between consecutive control points as springs; then the linear spring force F between consecutive control points s F s =k p (||p i-1 -p i ||+||p i -p i+1 ||), where k p is the local elastic coefficient of the pth segment, and k p =K / |p|, K is the global elastic coefficient, |p| is the length of the pth segment; ||p i-1 -p i || is p i-1 、p i The distance between two points, ||p i-p i+1 || is p i 、p i+1 The distance between two points;
[0053] D3. Assume that all control points on the trajectory have charges. Then, for each pair of trajectories that interact with each other, there is an electrostatic force F between the corresponding control points with the same subscript. e,i for where ||p i -q i || is p i ,q i The distance between two points; at the same time, if the difference between the angle between the two trajectories and 90 degrees is less than the set value, or the difference between the lengths of the two trajectories is greater than the set value, or the distance between the midpoints of the two trajectories is greater than the set value, or the two trajectories cannot be projected onto each other, then it is determined that there is no electrostatic force between the two trajectories;
[0054] D4. Apply a force F to the control point pointing to the original position of the control point d F d =||p i -p i,ori || 2 , used to reduce the change of trajectory position; where ||p i -p i,ori || is p i and the corresponding original position p i,ori The distance between
[0055] D5. Apply a force F to correct the direction of each segment of the trajectory. r F r =FF c , used to maintain the shape of the original trajectory; where F is the resultant force, and F = p i,ori -p i-1,ori ; F c is the first force component, and F c =p i -p i-1 ;p i and p i,ori are the coordinates of the control points.
[0056] D6. Use the following formula to calculate the resultant force F on each control point during trajectory binding: pi :
[0057]
[0058] Where n and m are the set parameters, P is the edge where the control point is located, Q is the edge that interacts with P, E is the set of all edges that interact with P, and C e(P,Q) is the angle compatibility value of P and Q;
[0059] D7. In each iteration, the resultant force applied to each subdivision point on the trajectory is calculated, and the position of the subdivision point is updated by the distance moved in the direction of the resultant force until the resultant force on the trajectory is 0. The iteration ends, thus completing the bundling of the trajectory.
[0060] The step E uses the trajectory reduction algorithm based on information entropy to optimize the discrete trajectories in the visualization data obtained in the step C, which specifically includes the following steps:
[0061] E1. The occlusion information amount V(O) is used to measure the visual confusion attenuation gain caused by trajectory reduction; the set of screen blocks containing trajectory sub-segments is X, c(x) is the pixel occlusion statistics caused by the trajectory sub-segments in the screen blocks, and C is the sum of c(x). The occlusion information amount V(O) brought by a certain trajectory under a certain viewpoint is calculated as
[0062] E2. The similarity information V(H) represents the similarity between the trajectory T and the reference trajectory T'; the similarity information V(H) is calculated as V(H) = EditDistace(T,T') + EuclideanDistace(T,T'), where EditDistace(T,T') is the edit distance between the calculated trajectories T and T', and EuclideanDistace(T,T') is the Euclidean distance between the calculated trajectories T and T';
[0063] E3. Data distribution density V(G) is used to measure the data distribution density of the neighborhood of trajectory T; the start time of trajectory T is t, G(t1,t2) represents the number of trajectories started from t1 to t2, then the data distribution density V(G) in the neighborhood of Δt is calculated as
[0064] E4. The calculated reduction gain index V(T) is The larger the reduction gain index V(T), the more the corresponding trajectory T should be reduced;
[0065] E5. According to the reduction gain index V(T) of each trajectory obtained in step E4, the trajectory whose reduction gain index V(T) is greater than the set value is reduced to complete the optimization processing of the discrete trajectory in the final visualization data.
[0066] The step F of visually displaying the optimized data information specifically includes the following steps:
[0067] The continuous traffic flow is visualized by using a pipe that can surround the continuous traffic flow; the attributes of the continuous traffic flow are encoded by the attributes of the pipe;
[0068] Assume that the continuous traffic flow S consists of a set of trajectories {T1,T2,...,T n}, each trajectory includes o coordinate points, trajectory T i By trajectory coordinate point The minimum external pipeline of continuous traffic flow is determined by the cross-sectional circle set C, C = {c1, c2, ..., c m}, c m is the size of the mth cross-sectional circle of the minimum external pipe of the continuous traffic flow; the cross-sectional circle set C is calculated using the following steps:
[0069] F1. Take a trajectory T from the continuous traffic flow S k As the reference trajectory for calculating the cross-sectional circle; then from the trajectory T k Evenly extract m trajectory coordinate points from As the reference coordinate point, construct T according to the adjacent reference coordinate points k A collection of path vectors The path vector set of all trajectories in the continuous traffic flow S is calculated respectively; T i The reference coordinate point is The jth reference coordinate point The calculation formula is Among them, argmin|||| is the parameter that makes the formula take the minimum value, T i The trajectory coordinate points in T k The j-th reference coordinate point, j = 1, 2, ..., m;
[0070] F2. For trajectory T i Each path vector Calculate the path vector at point Normal plane P j ; Then calculate the continuous traffic flow S except for the trajectory T i The remaining trajectory outside and the normal plane P j The intersection of i=1,2,...,n, n is the number of trajectories contained in the continuous traffic flow S; after the calculation is completed, the normal plane P is obtained. j The point set Q j for
[0071] F3. Set the normal plane P j Project the point set on the xy plane; set the normal plane P j The expression is ax+by+cz+d=0, and the normal plane P j Projection onto a plane The projection transformation formula is qR=p, where q is the normal plane P j point on the plane, p is a point on the plane Z, and R is the rotation matrix; since the normal plane P j and plane Z are known, we get the normal plane P j The normal vector is Here a, b, c are the normal plane P j The coefficient of , the normal vector of plane Z is Then the angle-axis expression of the rotation matrix R is calculated as where θ is and The angle between the rotation axis and Orthogonal; the parameters of the rotation matrix R are calculated as: and
[0072] F4. After projecting to the xy plane, the Welzl algorithm is used to calculate the radius and center coordinates of the minimum circumscribed circle; then the inverse transformation is mapped to the normal plane P j , thus obtaining the cross-section circle set C;
[0073] F5. The calculated pipe radius is used to reflect the size of the continuous traffic flow; the color and texture of the pipe are used to encode the attributes of the continuous traffic flow; the color of the pipe is used to encode the object type of the trajectory in the continuous traffic, and the basic color of the pipe is determined by the object type that accounts for the largest proportion in the continuous traffic. For the remaining object types, a texture spline of the corresponding color is surrounded on the surface of the pipe; the average speed of the continuous traffic flow in different sections is calculated, and then the speed is encoded using a dark gradient. The darker the color of the pipe, the faster the speed;
[0074] F6. Complete the final visualization.
[0075] The present invention also provides an analysis method including the data processing method of the traffic video stream and the trajectory visualization method, comprising the following steps:
[0076] a. Obtain the intersection traffic video stream data to be processed;
[0077] b. Using the above-mentioned traffic video stream data processing method to process the intersection traffic video stream data obtained in step a to obtain continuous traffic flow data information;
[0078] c. Use the intersection traffic overview diagram to display the statistical information of continuous traffic flow; the intersection traffic overview diagram includes traffic flow diagram, traffic heat map and intersection static trajectory diagram;
[0079] d. Using the trajectory visualization method to visualize the continuous traffic flow data information;
[0080] e. Set up the video panel and use it to understand the original video stream data.
[0081] Step c) uses the intersection traffic overview diagram to display the statistical information of the continuous traffic flow, which specifically includes the following steps:
[0082] The flow chart shows the macro overview of the traffic information at the intersection in time series; the horizontal axis of the flow chart encodes the flow value information, and the vertical axis encodes the time information; the rivers in the flow chart encode the flow time series changes of the objects, and the colors encode the types of objects. The wider the river, the greater the flow;
[0083] The traffic heat map is used to display the overview of traffic information in time series at multiple levels. The traffic heat map is associated with the traffic flow map. After the user selects the time period of interest in the traffic flow map, the traffic heat map displays a more detailed overview of traffic flow information in the time period. The vertical axis of the traffic heat map encodes time information, and the horizontal axis encodes different movement directions at the intersection. The arrow diagrams are used to represent different trajectory movement directions, and the movement directions are grouped according to the exits. The trajectory movement directions in each group are arranged in the order of straight, right turn, and left turn. The cells in the traffic heat map are used to encode the traffic information of a specific movement direction in the corresponding time period. Each rectangular cell is divided into more small rectangles. The number of blocks is determined by the number of object types. The width of the small rectangle encodes the proportion of the number of different object types, and the absolute value of the trajectory of different object types is encoded by transparency. The time axis selection interactive operation is provided for the traffic heat map. After the user selects the time period of interest, the video information of the time period is analyzed in the dynamic evolution view of the intersection trajectory. When the mouse hovers over the cell of the traffic heat map, the object type, the proportion of different types of objects, and the numerical information are displayed next to the cell.
[0084] The static trajectory map of the intersection is used to analyze the spatial overview of traffic information; the static trajectory map of the intersection shows the road network structure and trajectory information of the intersection. The curves represent the trajectories in the intersection. The color of the curves encodes the type of object, and the transparency of the curves encodes the speed of the trajectory. A statistical information table is provided to display the statistical information of the data in the static trajectory map of the intersection; the statistical information table contains statistical values of the number, proportion, and average speed of different types of objects.
[0085] The step d of using the trajectory visualization method to visualize the continuous traffic flow data information specifically includes the following steps:
[0086] The trajectory visualization method is used to visualize the continuous traffic flow data information;
[0087] After visualization, users can understand the traffic dynamic information in the video through visualization of intersection trajectories, and assist users to quickly analyze the video content. The intersection road network displays the geometric design and channelization facilities of the intersection, assists users to understand the static environment information of the intersection, and assists users to understand the location of the trajectory on the map, so as to observe the surrounding situation; the continuous traffic flow in the intersection trajectory is visualized; for discontinuous trajectories, smooth curves are used to encode, and the visual encoding of the discontinuous trajectory attributes is kept consistent with the visual encoding of the continuous traffic flow attributes; a compass is added to the view to identify the user's current field of view direction, and the compass is consistent with the direction of the local coordinate system in the view; when the user rotates the view, the compass will change accordingly to help the user perceive the direction;
[0088] Provide interactive functions for the dynamic evolution view of intersection trajectories to assist users in analysis: provide interactive methods of space-time cube technology, including interaction, translation and rotation, to help users complete search, tracking and navigation tasks; add a viewpoint reset key to help users quickly return to the starting viewpoint; provide indexing operations for quickly associating video frames and video segments to help users quickly view the original context: users right-click on the trajectory or continuous traffic flow of interest, and then the video frames associated with this trajectory are displayed on the side, and the video interface will also index to the corresponding time point.
[0089] Setting the video panel in step e to understand the original video stream data through the video panel specifically includes the following steps:
[0090] The original video is provided to help users understand the original scene: two types of videos are provided for users to browse and analyze, the first is the original video, and the second is the video with multi-target tracking output result information added, so as to help users search for analysis targets;
[0091] Provides interactive video operations: including slow, normal or fast video playback, and enabling video picture-in-picture mode;
[0092] The video interface is associated with other views: after selecting a time range in any visualization box, the interface automatically jumps to the corresponding time point; the user right-clicks the track to index the starting frame of the track in the video.
[0093] The data processing method, trajectory visualization method and analysis method of the traffic video stream provided by the present invention are applicable to various traffic intersection scenes and can be quickly promoted. The trajectory information and its dynamic evolution in the intersection monitoring video are visualized to allow users to quickly understand the video content and assist users in real-time analysis. Therefore, the method of the present invention can process, present and visualize complex traffic dynamic information in the monitoring video, can quickly process and obtain a continuous traffic information flow in the intersection trajectory, and has high reliability and good accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 The figure is a flowchart of the data processing method of the present invention.
[0095] Figure 2 It is a schematic diagram of the effect of extracting motion trajectory information of the data processing method of the present invention.
[0096] Figure 3 It is a schematic diagram of the effect of the camera calibration process of the data processing method of the present invention.
[0097] Figure 4 It is a schematic diagram of the effect of trajectory restoration of the data processing method of the present invention.
[0098] Figure 5 It is a time-position schematic diagram of the trajectory of the data processing method of the present invention.
[0099] Figure 6 A schematic diagram of continuous traffic flow of the data processing method of the present invention.
[0100] Figure 7 Schematic diagram of the method flow of the trajectory visualization method of the present invention.
[0101] Figure 8 Schematic diagram of the visualized trajectory data effect of the trajectory visualization method of the present invention.
[0102] Fig. 9 Schematic diagram of spring force and electrostatic force in the trajectory visualization method of the present invention.
[0103] Fig.10 It is a schematic diagram of the force pointing to the original position of the trajectory visualization method of the present invention.
[0104] Fig.11 A schematic diagram of the force for correcting the direction of the trajectory visualization method of the present invention.
[0105] Fig.12 It is a schematic diagram of the effect of trajectory bundling of the trajectory visualization method of the present invention.
[0106] Fig.13 It is a schematic diagram of the effect of trajectory reduction of the trajectory visualization method of the present invention.
[0107] Fig.14 It is a schematic diagram of the effect of blocking information amount of the trajectory visualization method of the present invention.
[0108] Fig.15 A schematic diagram of a path vector set of the trajectory visualization method of the present invention.
[0109] Fig.16 A schematic diagram of a pipeline cross section of the trajectory visualization method of the present invention.
[0110] Fig.17 It is a schematic diagram of the projection effect of the trajectory visualization method of the present invention.
[0111] Fig.18 It is a schematic diagram of the pipeline effect of the trajectory visualization method of the present invention.
[0112] Fig.19 It is a schematic diagram of the final effect of the trajectory visualization method of the present invention.
[0113] Fig. 20 The figure is a schematic diagram of the process flow of the analytical method of the present invention.
[0114] Fig.21 It is a schematic diagram of the effect of the flow chart of the analysis method of the present invention.
[0115] Fig. 22 The schematic diagram is a schematic diagram of the effect of the static trajectory diagram of the intersection of the analysis method of the present invention.
[0116] Fig.23 It is a schematic diagram of the visualization effect of the analysis method of the present invention.
[0117] Fig.24 It is a schematic diagram of the analysis effect of the analysis method of the present invention.
[0118] Fig.25 This is a schematic diagram of traffic conflict observed at a circle in a dynamic evolution view of intersection trajectories according to the first embodiment of the present invention.
[0119] Fig.26 This is a schematic diagram of a traffic conflict observed in an original image in the first embodiment of the present invention.
[0120] Fig. 27 This is a schematic diagram of a large number of traffic conflicts in the south-straight and north-left directions during the evening rush hour in Example 1 of the present invention.
[0121] Fig.28 This is an actual schematic diagram of traffic conflicts between the late south straight and north left directions during the evening rush hour in the first embodiment of the present invention. DETAILED DESCRIPTION
[0122] like Figure 1 The data processing method of the present invention is shown as a flow chart of the method. The data processing method of the traffic video stream provided by the present invention comprises the following steps:
[0123] S1. Obtain the intersection traffic video stream data to be processed;
[0124] S2. Using a multi-target tracking algorithm, extract the motion trajectory of the video stream data obtained in step S1; specifically comprising the following steps:
[0125] S2-1. Select the single-step model Fairmot as the multi-target extraction model;
[0126] S2-2. Select the drone dataset visdrone as the pre-training dataset for the multi-target extraction model;
[0127] In order to ensure the accuracy and generalization ability of the model, the drone dataset Visdrone, which is similar to the surveillance videos of high-point intersections in terms of camera field of view and video content, was selected as the pre-training dataset of the model; the Visdrone dataset contains 400 video clips shot by cameras carried by various drones, and 40 video clips that are highly similar to traffic intersection scenes were selected as training data; in order to ensure the diversity of video content, the training data covers different urban and rural environments, multiple target object types, different traffic density scenes and different meteorological conditions;
[0128] S2-3. Select a set amount of local surveillance video data in proportion, and annotate the selected local surveillance video data manually, and use the annotated video data as pre-training data; specifically, the object type, moving direction, and meteorological conditions are annotated; at the same time, before annotating, the area behind the stop line of the lane at the intersection in the local surveillance video is occluded to improve the subsequent model accuracy; the occlusion processing mainly considers the following two factors: Factor 1: small distant targets will cause more ID switching, affecting the trajectory extraction accuracy; Factor 2: the traffic information of the intersection is mainly concentrated in the traffic area of the intersection, so this article mainly focuses on the analysis of the traffic area of the intersection;
[0129] S2-4. Use the obtained pre-training data set to train the selected multi-target extraction model Fairmot to obtain the final motion trajectory extraction model; the specific effect is as follows Figure 2 As shown, Figure 2 (a) is target detection, Figure 2 (b) is target association, and the lines in the figure are the trajectories formed after associating the detection results;
[0130] S2.5 uses the motion trajectory extraction model obtained in step S2-4 to extract the motion trajectory of the video stream data obtained in step S1;
[0131] S3. Restoring, cleaning and calculating the properties of the motion trajectory extracted in step S2;
[0132] In specific implementation, the restoration is to restore the trajectory using the following steps:
[0133] Select a camera calibration method that can estimate both the camera intrinsic and extrinsic parameters. The UPNP algorithm converts the pixel coordinates in the trajectory into world coordinates, thereby completing the restoration of the motion trajectory. The camera calibration process and trajectory restoration are as follows: Figure 3 and Figure 4 As shown, Figure 4 (a) is the trajectory point in the pixel coordinate system, Figure 4 (b) is the trajectory point from a bird’s-eye view in the world coordinate system after trajectory restoration;
[0134] Cleaning is to use the following steps to clean the track:
[0135] The same turning trajectory data is assumed to conform to normal distribution;
[0136] Use the z-score algorithm to clean the trajectory: For the same turning trajectory data, first calculate the average value of the trajectory length The variance of trajectory length σ l , the average value of the trajectory existence time and the variance σ of the trajectory existence time t , thus obtaining the i-th trajectory T i The z-score value is l i is the trajectory T i The length, t i is the trajectory T i duration of existence;
[0137] When the trajectory T i When the z-score value of is greater than the set threshold (preferably 2), the trajectory T i Clean and filter;
[0138] After all trajectories are cleaned, the final trajectory cleaning result is obtained;
[0139] The attribute calculation is performed using the following steps:
[0140] Speed calculation:
[0141] The i-th trajectory T i A set of world coordinate points p i,j and the timestamp t of each coordinate point i,j Composition, where j = 1, 2, ..., N, N is the i-th trajectory T i The total number of world coordinate points included; the speed v is calculated using the following formula i,j :
[0142]
[0143] Where |||| is the distance between two points; w is the time window size; median() is the median value;
[0144] Turning to computing:
[0145] Calculate reference trajectories: For each turn, select the best trajectories (select trajectories with high integrity, continuity and confidence); then use the k-means clustering algorithm to cluster the trajectories, where k is the number of turns at the intersection; after clustering, use the best centroid of each category as the reference trajectory for the corresponding turn;
[0146] Calculate similarity:
[0147] For the target trajectory, the target trajectory and all the reference trajectories are converted into string vectors. Then, the edit distance between the string vector of the target trajectory and the string vectors of each reference trajectory is calculated using the dynamic programming method. The turn corresponding to the reference trajectory with the smallest edit distance is taken as the turn of the target trajectory.
[0148] S4. Calculate the final continuous traffic flow data information based on the processed data obtained in step S3. In real life, a group of trajectories that are very close to each other at the same time is regarded as a continuous traffic flow. Therefore, the proposed method first determines whether any two trajectories of the same type belong to the same continuous traffic flow based on the average spacing, and then uses the concept of connected blocks in the graph to identify the complete continuous traffic flow. Specifically, it includes the following steps:
[0149] Based on the average distance, determine whether any two trajectories of the same type belong to the same continuous traffic flow:
[0150] For any two trajectories T of the same type A and T B , the trajectory T A and T B Considered as consisting of one-dimensional point coordinates (such as Figure 5 As shown); trajectory T A The start time of the movement is The end time of the exercise is Track T B The start time of the movement is The end time of the exercise is
[0151] Calculate two trajectories T A and T B The average distance D between the coordinates of each point when moving simultaneously is Where t start is the trajectory T A and T B At the same time, the start time of the movement, and tend is the trajectory T A and T B At the same time, the end time of the movement, and T A (t) is the trajectory T at time t A The value of T B (t) is the trajectory T at time t B The value of
[0152] If t start >t end , then the trajectory T A and T B do not belong to the same continuous traffic flow; if the value of the average distance D is less than the set threshold, then the trajectory T A and T B Belong to the same continuous traffic flow;
[0153] The concept of connected blocks of graphs is used to identify complete continuous traffic flows:
[0154] Construct graph G: The nodes in G represent trajectories, and the edges between nodes indicate that the corresponding two trajectories belong to the same continuous traffic flow;
[0155] For graph G, a depth-first traversal algorithm is used to search for all connected blocks in graph G; when the number of elements in a connected block is greater than 1, P is considered a continuous traffic flow; when the number of elements in a connected block P is 1, P is considered a discrete trajectory; the specific effects are as follows Figure 6 As shown, the three upper areas are continuous traffic flows, and the bottom trajectory 13 is a discrete trajectory.
[0156] like Figure 7 The present invention also provides a trajectory visualization method including the data processing method of the traffic video stream, comprising the following steps:
[0157] A. Obtain the intersection traffic video stream data to be processed;
[0158] B. Using the above-mentioned traffic video stream data processing method to process the intersection traffic video stream data obtained in step A, to obtain continuous traffic flow data information; specifically, Figure 8 As shown;
[0159] C. Visualize the continuous traffic flow data information obtained in step B;
[0160] D. Using the FDEB-based trajectory bundling algorithm, the continuous traffic flow data information in the visualization data obtained in step C is optimized; specifically, the following steps are included:
[0161] D1. For each trajectory, k coordinate points are uniformly sampled and used as control points;
[0162] D2. For each trajectory, set the subdivisions between consecutive control points as springs; then the linear spring force F between consecutive control points s F s =k p (||p i-1 -p i ||+||p i -p i+1 ||), where k p is the local elastic coefficient of the pth segment, and k p =K / |p|, K is the global elastic coefficient, |p| is the length of the pth segment; ||p i-1 -p i || is p i-1 、p i The distance between two points, ||p i -p i+1 || is p i 、p i+1 The distance between two points;
[0163] D3. Assume that all control points on the trajectory have charges. Then, for each pair of trajectories that interact with each other, there is an electrostatic force F between the corresponding control points with the same subscript. e,i for where ||p i -q i || is p i ,q i The distance between two points; at the same time, if the difference between the angle between the two trajectories and 90 degrees is less than the set value, or the difference between the lengths of the two trajectories is greater than the set value, or the distance between the midpoints of the two trajectories is greater than the set value, or the two trajectories cannot be projected onto each other, then it is determined that there is no electrostatic force between the two trajectories;
[0164] D4. Apply a force F to the control point pointing to the original position of the control point d F d =||p i -p i,ori || 2 , used to reduce the change of trajectory position; where ||p i -p i,ori || is p i and the corresponding original position p i,ori The distance between
[0165] D5. Apply a force F to correct the direction of each segment of the trajectory. r F r=FF c , used to maintain the shape of the original trajectory; where F is the resultant force, and F = p i,ori -p i-1,ori ; F c is the first force component, and F c =p i -p i-1 ;p i and p i,ori are the coordinates of the control points.
[0166] D6. Use the following formula to calculate the resultant force F on each control point during trajectory binding: pi :
[0167]
[0168] Where n and m are the set parameters, P is the edge where the control point is located, Q is the edge that interacts with P, E is the set of all edges that interact with P, and C e (P,Q) is the angle compatibility value of P and Q;
[0169] D7. In each iteration, the resultant force applied to each subdivision point on the trajectory is calculated, and the position of the subdivision point is updated by the distance moved in the direction of the resultant force until the resultant force on the trajectory is 0, the iteration ends, and the trajectory is bundled; specifically, Fig.12 As shown, Fig.12 (a) is the original image, Fig.12 (b) is the optimization effect after 15 iterations of trajectory bundling. Fig.12 (c) is the optimization effect after 30 iterations of trajectory bundling;
[0170] E. Use trajectory reduction algorithm based on information entropy (reduction effect is as follows Fig.13 As shown, Fig.13 (a) is the initial trajectory, Fig.13 (b) is the trajectory after reducing the first 10%. Fig.13 (c) is the trajectory of the first 15% reduction), the discrete trajectory in the visualization data obtained in step C is optimized; specifically, the following steps are included:
[0171] E1. Assuming that the smaller the occlusion, the clearer the trajectory dynamics can be highlighted, the numerical value can be equivalent to the occlusion information brought by the trajectory. When the occlusion information brought by the trajectory is larger, the trajectory should be reduced. The occlusion information V(O) is used to measure the visual confusion attenuation gain brought by the trajectory reduction. The set of screen blocks containing the trajectory sub-segment is X, c(x) is the pixel occlusion statistics caused by the trajectory sub-segment in the screen block, and C is the sum of c(x). Then the occlusion information V(O) brought by a certain trajectory under a certain viewpoint is calculated as Specific as Fig.14 As shown;
[0172] E2. The more similar the trajectory is to the reference trajectory, the more the trajectory should be reduced; the similarity information V(H) represents the similarity between the trajectory T and the reference trajectory T'; the similarity information V(H) is calculated as V(H) = EditDistace(T,T') + EuclideanDistace(T,T'), where EditDistace(T,T') is the edit distance between the calculated trajectory T and T', and EuclideanDistace(T,T') is the Euclidean distance between the calculated trajectory T and T';
[0173] E3. The higher the data distribution density, the more the trajectory should be reduced; the data distribution density V(G) is used to measure the data distribution density of the neighborhood of trajectory T; the start time of trajectory T is t, G(t1,t2) represents the number of trajectories started from t1 to t2, then the data distribution density V(G) in the neighborhood of Δt is calculated as
[0174] E4. The calculated reduction gain index V(T) is The larger the reduction gain index V(T), the more the corresponding trajectory T should be reduced;
[0175] E5. According to the reduction gain index V(T) of each trajectory obtained in step E4, the trajectory whose reduction gain index V(T) is greater than the set value is reduced to complete the optimization processing of the discrete trajectory in the final visualization data;
[0176] F. Visualize the optimized data information; specifically include the following steps:
[0177] The continuous traffic flow is visualized by using a pipe that can surround the continuous traffic flow; the attributes of the continuous traffic flow are encoded by the attributes of the pipe;
[0178] Assume that the continuous traffic flow S consists of a set of trajectories {T1,T2,...,T n}, each trajectory includes o coordinate points, trajectory T i By trajectory coordinate point The minimum external pipeline of continuous traffic flow is determined by the cross-sectional circle set C, C = {c1, c2, ..., c m}, c m is the size of the mth cross-sectional circle of the minimum external pipe of the continuous traffic flow; the cross-sectional circle set C is calculated using the following steps:
[0179] F1. Take a trajectory T from the continuous traffic flow S k As the reference trajectory for calculating the cross-sectional circle; then from the trajectory Tk Evenly extract m trajectory coordinate points from As the reference coordinate point, construct T according to the adjacent reference coordinate points k A collection of path vectors The path vector set of all trajectories in the continuous traffic flow S is calculated respectively; T i The reference coordinate point is The jth reference coordinate point The calculation formula is Among them, argmin|| || is the parameter that makes the formula take the minimum value, T i The trajectory coordinate points in T k The j-th reference coordinate point, j = 1, 2, ..., m;
[0180] F2. For trajectory T i Each path vector Calculate the path vector at point Normal plane P j ; Then calculate the continuous traffic flow S except for the trajectory T i The remaining trajectory outside and the normal plane P j The intersection of i=1,2,...,n, n is the number of trajectories contained in the continuous traffic flow S; after the calculation is completed, the normal plane P is obtained. j The point set Q j for
[0181] F3. Set the normal plane P j Project the point set on the xy plane; set the normal plane P j The expression is ax+by+cz+d=0, and the normal plane P j Projection onto a plane The projection transformation formula is qR=p, where q is the normal plane P j point on the plane, p is a point on the plane Z, and R is the rotation matrix; since the normal plane P j and plane Z are known, we get the normal plane P j The normal vector is Here a, b, c are the normal plane P j The coefficient of , the normal vector of plane Z is Then the angle-axis expression of the rotation matrix R is calculated as where θ is and The angle between the rotation axis and Orthogonal; the parameters of the rotation matrix R are calculated as: and
[0182] F4. After projecting to the xy plane, the Welzl algorithm is used to calculate the radius and center coordinates of the minimum circumscribed circle; then the inverse transformation is mapped to the normal plane P j , thus obtaining the cross-section circle set C; specifically, Fig.18 As shown;
[0183] F5. The calculated pipe radius is used to reflect the size of the continuous traffic flow; the color and texture of the pipe are used to encode the attributes of the continuous traffic flow; the color of the pipe is used to encode the object type of the trajectory in the continuous traffic, and the basic color of the pipe is determined by the object type that accounts for the largest proportion in the continuous traffic. For the remaining object types, texture splines of corresponding colors are surrounded on the surface of the pipe; the average speed of the continuous traffic flow in different sections is calculated, and then the speed is encoded using a dark gradient. The darker the color of the pipe, the faster the speed; as shown in the following example: Fig.19 As shown;
[0184] F6. Complete the final visualization.
[0185] like Fig. 20 The method flow diagram of the analysis method of the present invention is shown as follows: the analysis method provided by the present invention, which includes the data processing method of the traffic video stream and the trajectory visualization method, comprises the following steps:
[0186] a. Obtain the intersection traffic video stream data to be processed;
[0187] b. Using the above-mentioned traffic video stream data processing method to process the intersection traffic video stream data obtained in step a to obtain continuous traffic flow data information;
[0188] c. Use the intersection traffic overview map to display the statistical information of continuous traffic flow; the intersection traffic overview map includes traffic flow map, traffic heat map and intersection static trajectory map; specifically includes the following steps:
[0189] The flow chart shows the macro overview of the intersection flow information in time series; the horizontal axis of the flow chart encodes the flow value information, and the vertical axis encodes the time information; the rivers in the flow chart encode the flow time series changes of the objects, and the colors encode the types of objects. The wider the river, the greater the flow; Fig.21 As shown;
[0190] The traffic heat map is used to display the overview of traffic information in time series at multiple levels. The traffic heat map is associated with the traffic flow map. After the user selects the time period of interest in the traffic flow map, the traffic heat map displays a more detailed overview of traffic flow information in the time period. The vertical axis of the traffic heat map encodes time information, and the horizontal axis encodes different movement directions at the intersection. The arrow diagrams are used to represent different trajectory movement directions, and the movement directions are grouped according to the exits. The trajectory movement directions in each group are arranged in the order of straight, right turn, and left turn. The cells in the traffic heat map are used to encode the traffic information of a specific movement direction in the corresponding time period. Each rectangular cell is divided into more small rectangles. The number of blocks is determined by the number of object types. The width of the small rectangle encodes the proportion of the number of different object types, and the absolute value of the trajectory of different object types is encoded by transparency. The time axis selection interactive operation is provided for the traffic heat map. After the user selects the time period of interest, the video information of the time period is analyzed in the dynamic evolution view of the intersection trajectory. When the mouse hovers over the cell of the traffic heat map, the object type, the proportion of different types of objects, and the numerical information are displayed next to the cell.
[0191] In specific implementation, the traffic heat map is used to display a multi-level overview of traffic information in time series; there is a strong correlation between the traffic heat map and the traffic flow map. After the user selects the time period of interest in the traffic flow map, the intersection traffic heat map will show a more detailed overview of the traffic flow information in this time period; the view is drawn based on the heat map, with the vertical axis encoding time information and the horizontal axis encoding different movement directions at the intersection; a classic intersection has four main entrances and exits, each of which can lead to the other three, so there are at least 12 different movement directions. Since the entrances and exits of the intersection may allow U-turns, the actual movement directions may be greater than 12; due to the large number of trajectory movement directions, it is easy to bring a memory burden to users during analysis, so two methods are used to alleviate this problem; first, different trajectory movement directions are represented by concise and vivid arrow diagrams; secondly, these movement directions are grouped according to the exits. Since there are generally four exits at an intersection, the trajectory movement directions are divided into four groups, and the trajectory movement directions in each group are arranged in the order of straight, right turn, and left turn. The cells in the heat map are used to encode the traffic information of a specific moving direction in the corresponding time period. In order to display the types of objects in the traffic information and the proportion and numerical information of different types of objects, each rectangular cell is divided into more small rectangles. The number of blocks is determined by the number of object types. The width of the small rectangle encodes the proportion of the number of different object types, and the absolute value of the trajectories of different object types is encoded by transparency. In addition, some interactive functions are added to this view to assist users in analysis; because the time range in the intersection traffic heat map may still be too large for users to analyze video content, a timeline selection interactive operation is still provided for the intersection traffic heat map. After the user selects the time period of interest, the video information of this time period can be comprehensively analyzed in the intersection trajectory dynamic evolution view. In addition, when the mouse hovers over a cell in the heat map, the object type, the proportion of different types of objects, and the numerical information will be displayed next to the cell;
[0192] The static trajectory map of the intersection is used to analyze the spatial overview of traffic information; the static trajectory map of the intersection shows the road network structure and trajectory information of the intersection. The curves represent the trajectories in the intersection. The color of the curves encodes the type of object, and the transparency of the curves encodes the speed of the trajectory. A statistical information table is provided to display the statistical information of the data in the static trajectory map of the intersection; the statistical information table contains statistical values of the number, proportion, and average speed of different types of objects; specifically, Fig. 22 As shown;
[0193] d. Use the trajectory visualization method to visualize the continuous traffic flow data information (specifically, Fig.23 Specifically, the following steps are included:
[0194] The trajectory visualization method is used to visualize the continuous traffic flow data information;
[0195] After visualization, users can understand the traffic dynamic information in the video through visualization of intersection trajectories, and assist users to quickly analyze the video content. The intersection road network displays the geometric design and channelization facilities of the intersection, assists users to understand the static environment information of the intersection, and assists users to understand the location of the trajectory on the map, so as to observe the surrounding situation; the continuous traffic flow in the intersection trajectory is visualized; for discontinuous trajectories, smooth curves are used to encode, and the visual encoding of the discontinuous trajectory attributes is kept consistent with the visual encoding of the continuous traffic flow attributes; a compass is added to the view to identify the user's current field of view direction, and the compass is consistent with the direction of the local coordinate system in the view; when the user rotates the view, the compass will change accordingly to help the user perceive the direction;
[0196] Provide interactive functions for the dynamic evolution view of intersection trajectories to assist users in analysis: provide interactive methods of space-time cube technology, including interaction, translation and rotation, to help users complete search, tracking and navigation tasks; add a viewpoint reset key to help users quickly return to the starting viewpoint; provide indexing operations for quickly associating video frames and video segments to help users quickly view the original context: users can right-click on the trajectory or continuous traffic flow of interest, and then display the video frame associated with this trajectory on the side, and the video interface will also index to the corresponding time point;
[0197] e. Set up the video panel and use it to understand the original video stream data (for example Fig.24 As shown, Fig.24 (a) is the original video, Fig.24 (b) is a video with target detection information); specifically includes the following steps:
[0198] The original video is provided to help users understand the original scene: two types of videos are provided for users to browse and analyze, the first is the original video, and the second is the video with multi-target tracking output result information added, so as to help users search for analysis targets;
[0199] Provides interactive video operations: including slow, normal or fast video playback, and enabling video picture-in-picture mode;
[0200] The video interface is associated with other views: after selecting a time range in any visualization box, the interface automatically jumps to the corresponding time point; the user right-clicks the track to index the starting frame of the track in the video.
[0201] The present invention will be further described below in conjunction with embodiments:
[0202] Research question: Traffic conflict analysis at intersections
[0203] When observing the traffic at a noon intersection through the dynamic evolution view of the intersection trajectory, we first quickly discovered two east-west continuous vehicle traffic flows with significant gaps. We can judge that this time period roughly includes two red light cycles. Then we quickly discovered that in the second red light cycle, a continuous vehicle traffic flow in the north left and south straight directions intersected, and the speed at the intersection was significantly lower, such as Fig.25 , so it is speculated that a traffic conflict occurred here, and the conjecture is confirmed by right-clicking the corresponding continuous traffic flow to view the image frame corresponding to this moment, such as Fig.26 .
[0204] Next, we further investigated the traffic conflicts at South Straight and North Left to analyze their causes and the extent of their impact on intersection safety. First, we rotated the view to view the time information of the trajectory, and found that the start and end times of the trajectories in the South Straight and North Left directions were consistent. Therefore, we determined that the South Straight and North Left directions belonged to the same phase in the signal control scheme, and thus we knew that the traffic conflict here was mainly caused by the unreasonable setting of the signal control scheme at the intersection.
[0205] Then, in the traffic heat map, the time frame selection range is expanded, and the evening peak period of 5:30-6:00 is selected for analysis. The analysis focuses on the trajectories in the south-straight and north-left directions. Therefore, the trajectories in other moving directions are filtered out in the parameter panel, such as Fig. 27 shown.
[0206] It is found that there are a lot of traffic conflicts between the south straight and north left traffic flows during this time period. Through observation, it is known that there are 8 traffic light cycles during this period. In each traffic light cycle, there are traffic conflicts between the south straight and north left directions. And by viewing the original image frames corresponding to the traffic conflicts, such as Fig.28 As shown ( Fig.28 (a) is the traffic conflict in the southbound direction during the evening peak period. Fig.28 (b) is the traffic conflict in the north-left direction during the evening peak period). It is found that the scale of traffic conflicts in the south-straight and north-left directions is large, and by observing the original video, it is found that it has caused great hidden dangers to traffic order and safety. Therefore, it is recommended that the traffic department should stagger the phases of the south-straight and north-left directions during peak hours when setting up the intersection signal control plan to avoid serious traffic conflicts caused by the two directions being in the same phase.
Claims
1. A data processing method for a traffic video stream comprises the following steps: S1. Obtain the intersection traffic video stream data to be processed; S2. Using a multi-target tracking algorithm, the motion trajectory of the video stream data obtained in step S1 is extracted; S3. Restoring, cleaning and calculating the properties of the motion trajectory extracted in step S2; S4. According to the processed data obtained in step S3, the final continuous traffic flow data information is calculated; specifically comprising the following steps: Based on the average distance, determine whether any two trajectories of the same type belong to the same continuous traffic flow: For any two trajectories T of the same type A and T B , the trajectory T A and T B Considered as consisting of one-dimensional point coordinates; the trajectory T A The start time of the movement is The end time of the exercise is Track T B The start time of the movement is The end time of the exercise is Calculate two trajectories T A and T B The average distance D between the coordinates of each point when moving simultaneously is Where t start is the trajectory T A and T B At the same time, the start time of the movement, and t end is the trajectory T A and T B At the same time, the end time of the movement, and T A (t) is the trajectory T at time t A The value of T B (t) is the trajectory T at time t B The value of If start >t end , then the trajectory T A and T B do not belong to the same continuous traffic flow; if the value of the average distance D is less than the set threshold, then the trajectory T A and T B Belong to the same continuous traffic flow; The concept of connected blocks of graphs is used to identify complete continuous traffic flows: Construct graph G: The nodes in G represent trajectories, and the edges between nodes indicate that the corresponding two trajectories belong to the same continuous traffic flow; For graph G, a depth-first traversal algorithm is used to search for all connected blocks in graph G; when the number of elements in a connected block is greater than 1, P is considered to be a continuous traffic flow; when the number of elements in a connected block P is 1, P is considered to be a discrete trajectory.
2. The data processing method of traffic video stream according to claim 1 is characterized in that The multi-target tracking algorithm described in step S2 is used to extract the motion trajectory of the video stream data obtained in step S1, which specifically includes the following steps: S2-1. Select the single-step model Fairmot as the multi-target extraction model; S2-2. Select the drone dataset visdrone as the pre-training dataset for the multi-target extraction model; S2-3. Select a set amount of local surveillance video data in proportion, and manually annotate the selected local surveillance video data, and use the annotated video data as pre-training data; S2-4. Use the obtained pre-training data set to train the selected multi-target extraction model Fairmot to obtain the final motion trajectory extraction model; S2.5 uses the motion trajectory extraction model obtained in step S2-4 to extract the motion trajectory of the video stream data obtained in step S1; The annotation described in step S2-3 specifically includes annotation of object type, annotation of moving direction and annotation of meteorological conditions; at the same time, before annotation, the area behind the stop line of the lane at the intersection in the local monitoring video is blocked to improve the subsequent model accuracy.
3. The data processing method of traffic video stream according to claim 2 is characterized in that The restoration described in step S3 is specifically performed by using the following steps to restore the trajectory: The UPNP algorithm is used to convert the pixel coordinates in the trajectory into world coordinates, thereby completing the restoration of the motion trajectory; The cleaning described in step S3 is specifically performed by the following steps to clean the track: The same turning trajectory data is assumed to conform to normal distribution; Use the z-score algorithm to clean the trajectory: For the same turning trajectory data, first calculate the average value of the trajectory length The variance of trajectory length σ l , the average value of the trajectory existence time and the variance of the trajectory existence time σ t , thus obtaining the i-th trajectory T i The z-score value is l i is the trajectory T i The length, t i is the trajectory T i duration of existence; When the trajectory T i When the z-score value of is greater than the set threshold, the trajectory T i Clean and filter; After all trajectories are cleaned, the final trajectory cleaning result is obtained; The attribute calculation described in step S3 is specifically performed by using the following steps: Speed calculation: The i-th trajectory T i A set of world coordinate points p i,j and the timestamp t of each coordinate point i,j Composition, where j = 1, 2, ..., N, N is the i-th trajectory T i The total number of world coordinate points included; the speed v is calculated using the following formula i,j : Where || || is the distance between two points; w is the time window size; median() is the median value; Turning to computing: Calculate reference trajectory: For each turn, select the best trajectories; then use the k-means clustering algorithm to cluster the trajectories, where k is the number of turns at the intersection; after clustering, use the best centroid of each category as the reference trajectory of the corresponding turn; Calculate similarity: For the target trajectory, the target trajectory and all the obtained reference trajectories are converted into string vector form, and then the dynamic programming method is used to calculate the edit distance between the string vector of the target trajectory and the string vector of each reference trajectory, and the turn corresponding to the reference trajectory with the smallest edit distance is taken as the turn of the target trajectory.
4. A trajectory visualization method comprising the data processing method of traffic video stream according to any one of claims 1 to 3, characterized in that The steps include: A. Obtain the intersection traffic video stream data to be processed; B. using the traffic video stream data processing method according to any one of claims 1 to 3 to process the intersection traffic video stream data obtained in step A to obtain continuous traffic flow data information; C. Visualize the continuous traffic flow data information obtained in step B; D. Using the FDEB-based trajectory bundling algorithm, the continuous traffic flow data information in the visualization data obtained in step C is optimized; specifically, the following steps are included: D1. For each trajectory, k coordinate points are uniformly sampled and used as control points; D2. For each trajectory, set the subdivisions between consecutive control points as springs; then the linear spring force F between consecutive control points s F s =k p (||p i-1 -p i ||+||p i -p i+1 ||), where k p is the local elastic coefficient of the pth segment, and k p =K / |p|, K is the global elastic coefficient, |p| is the length of the pth segment; ||p i-1 -p i || is p i-1 、p i The distance between two points, ||p i -p i+1 || is p i 、p i+1 The distance between two points; D3. Assume that all control points on the trajectory have charges. Then, for each pair of trajectories that interact with each other, there is an electrostatic force F between the corresponding control points with the same subscript. e,i for where ||p i -q i || is p i ,q i The distance between two points; at the same time, if the difference between the angle between the two trajectories and 90 degrees is less than the set value, or the difference between the lengths of the two trajectories is greater than the set value, or the distance between the midpoints of the two trajectories is greater than the set value, or the two trajectories cannot be projected onto each other, then it is determined that there is no electrostatic force between the two trajectories; D4. Apply a force F to the control point pointing to the original position of the control point d F d =||p i -p i,ori || 2 , used to reduce the change of trajectory position; where ||p i -p i,ori || is p i and the corresponding original position p i,ori The distance between D5. Apply a force F to correct the direction of each segment of the trajectory. r F r =FF c , used to maintain the shape of the original trajectory; where F is the resultant force, and F = p i,ori -p i-1,ori ; F c is the first force component, and F c =p i -p i-1 ;p i and p i,ori are the coordinates of the control points; D6. Use the following formula to calculate the resultant force F on each control point during trajectory binding: pi : Where n and m are the set parameters, P is the edge where the control point is located, Q is the edge that interacts with P, E is the set of all edges that interact with P, and C e (P,Q) is the angle compatibility value of P and Q; D7. In each iteration, the resultant force applied to each subdivision point on the trajectory is calculated, and the position of the subdivision point is updated by the distance moved in the direction of the resultant force until the resultant force on the trajectory is 0. The iteration ends, thus completing the bundling of the trajectory; E. Using the trajectory reduction algorithm based on information entropy to optimize the discrete trajectories in the visualization data obtained in step C; F. Visualize the optimized data information.
5. The trajectory visualization method according to claim 4, characterized in that The step E uses the trajectory reduction algorithm based on information entropy to optimize the discrete trajectories in the visualization data obtained in the step C, which specifically includes the following steps: E1. The occlusion information amount V(O) is used to measure the visual confusion attenuation gain caused by trajectory reduction; the screen block set containing the trajectory sub-segment is X, c(x) is the pixel occlusion statistics caused by the trajectory sub-segment in the screen block, C is the sum of c(x), then the occlusion information amount V(O) brought by a certain trajectory under a certain viewpoint is calculated as E2. The similarity information V(H) represents the similarity between the trajectory T and the reference trajectory T'; the similarity information V(H) is calculated as V(H) = EditDistace(T,T') + EuclideanDistace(T,T'), where EditDistace(T,T') is the edit distance between the calculated trajectories T and T', and EuclideanDistace(T,T') is the Euclidean distance between the calculated trajectories T and T'; E3. Data distribution density V(G) is used to measure the data distribution density of the neighborhood of trajectory T; the start time of trajectory T is t, G(t1,t2) represents the number of trajectories started from t1 to t2, then the data distribution density V(G) in the neighborhood of Δt is calculated as E4. The calculated reduction gain index V(T) is The larger the reduction gain index V(T), the more the corresponding trajectory T should be reduced; E5. According to the reduction gain index V(T) of each trajectory obtained in step E4, the trajectory whose reduction gain index V(T) is greater than the set value is reduced to complete the optimization processing of the discrete trajectory in the final visualization data.
6. The trajectory visualization method according to claim 5, characterized in that The step F of visually displaying the optimized data information specifically includes the following steps: The continuous traffic flow is visualized by using a pipe that can surround the continuous traffic flow; the attributes of the continuous traffic flow are encoded by the attributes of the pipe; Assume that the continuous traffic flow S consists of a set of trajectories {T1,T2,...,T n }, each trajectory includes o coordinate points, trajectory T i By trajectory coordinate point The minimum external pipeline of continuous traffic flow is determined by the cross-sectional circle set C, C = {c1, c2, ..., c m },c m is the size of the mth cross-sectional circle of the minimum circumscribed pipe of the continuous traffic flow; the cross-sectional circle set C is calculated using the following steps: F1. Take a trajectory T from the continuous traffic flow S k As the reference trajectory for calculating the cross-sectional circle; then from the trajectory T k Evenly extract m trajectory coordinate points from As the reference coordinate point, construct T according to the adjacent reference coordinate points k A collection of path vectors The path vector set of all trajectories in the continuous traffic flow S is calculated respectively; T i The reference coordinate point is The jth reference coordinate point The calculation formula is Among them, argmin|| || is the parameter that makes the formula take the minimum value, T i The trajectory coordinate points in T k The j-th reference coordinate point, j = 1, 2, ..., m; F2. For trajectory T i Each path vector Calculate the path vector at point Normal plane P j ; Then calculate the continuous traffic flow S except for the trajectory T i The remaining trajectory outside and the normal plane P j The intersection of n is the number of trajectories contained in the continuous traffic flow S. After the calculation is completed, the normal plane P is obtained. j The point set Q j for F3. Set the normal plane P j Project the point set on the xy plane; set the normal plane P j The expression is ax+by+cz+d=0, and the normal plane P j Projection onto a plane The projection transformation formula is qR=p, where q is the normal plane P j point on the plane, p is a point on the plane Z, and R is the rotation matrix; since the normal plane P j and plane Z are known, we get the normal plane P j The normal vector is Here a, b, c are the normal plane P j The coefficient of , the normal vector of plane Z is Then the angle-axis expression of the rotation matrix R is calculated as where θ is and The angle between the rotation axis and Orthogonal; the parameters of the rotation matrix R are calculated as: and F4. After projecting to the xy plane, the Welzl algorithm is used to calculate the radius and center coordinates of the minimum circumscribed circle; then the inverse transformation is mapped to the normal plane P j , thus obtaining the cross-section circle set C; F5. The calculated pipe radius is used to reflect the size of the continuous traffic flow; the color and texture of the pipe are used to encode the attributes of the continuous traffic flow; the color of the pipe is used to encode the object type of the trajectory in the continuous traffic, and the basic color of the pipe is determined by the object type that accounts for the largest proportion in the continuous traffic. For the remaining object types, a texture spline of the corresponding color is surrounded on the surface of the pipe; the average speed of the continuous traffic flow in different sections is calculated, and then the speed is encoded using a dark gradient. The darker the color of the pipe, the faster the speed; F6. Complete the final visualization.
7. An analysis method comprising the traffic video stream data processing method according to any one of claims 1 to 3 and the trajectory visualization method according to any one of claims 4 to 6, characterized in that The steps include: a. Obtain the intersection traffic video stream data to be processed; b. Processing the intersection traffic video stream data obtained in step a by using the traffic video stream data processing method according to one of claims 1 to 3 to obtain continuous traffic flow data information; c. Use the intersection traffic overview diagram to display the statistical information of continuous traffic flow; the intersection traffic overview diagram includes traffic flow diagram, traffic heat map and intersection static trajectory diagram; d. Using the trajectory visualization method according to any one of claims 4 to 6 to visualize the continuous traffic flow data information; e. Set up the video panel and use it to understand the original video stream data.
8. The analysis method according to claim 7, characterized in that Step c) uses the intersection traffic overview diagram to display the statistical information of the continuous traffic flow, which specifically includes the following steps: The flow chart shows the macro overview of the traffic information at the intersection in time series; the horizontal axis of the flow chart encodes the flow value information, and the vertical axis encodes the time information; the rivers in the flow chart encode the flow time series changes of the objects, and the colors encode the types of objects. The wider the river, the greater the flow; The traffic heat map is used to display a multi-level overview of traffic information in time series. The traffic heat map is associated with the traffic flow map. After the user selects the time period of interest in the traffic flow map, the traffic heat map displays a more detailed overview of traffic flow information in that time period. The vertical axis of the traffic heat map encodes time information, and the horizontal axis encodes different movement directions at the intersection. Different trajectory movement directions are represented by arrow diagrams, and the movement directions are grouped according to the exits. The trajectory movement directions in each group are arranged in the order of straight ahead, right turn, and left turn. The cells in the traffic heat map are used to encode the traffic information of a specific moving direction in the corresponding time period. Each rectangular cell is divided into more small rectangles. The number of blocks is determined by the number of object types. The width of the small rectangle encodes the proportion of the number of different object types. The absolute value of the trajectory of different object types is encoded by transparency. Provides a timeline selection interactive operation for the traffic heat map. After the user selects the time period of interest, the video information of the time period is analyzed in the intersection trajectory dynamic evolution view; When the mouse hovers over a cell in the traffic heat map, the object type, the proportion of different types of objects, and the numerical information are displayed next to the cell; The static track map of the intersection is used to analyze the spatial overview of traffic information; the static track map of the intersection shows the road network structure and track information of the intersection. The curves represent the tracks in the intersection. The color of the curves encodes the type of object, and the transparency of the curves encodes the speed of the track. A statistical information table is provided to display the statistical information of the data in the static track map of the intersection; the statistical information table contains the statistical values of the number, proportion, and average speed of different types of objects; The step d of using the trajectory visualization method to visualize the continuous traffic flow data information specifically includes the following steps: The trajectory visualization method is used to visualize the continuous traffic flow data information; After visualization, users can understand the traffic dynamic information in the video through visualization of intersection trajectories, and assist users to quickly analyze the video content. The intersection road network displays the geometric design and channelization facilities of the intersection, assists users to understand the static environment information of the intersection, and assists users to understand the location of the trajectory on the map, so as to observe the surrounding situation; the continuous traffic flow in the intersection trajectory is visualized; for discontinuous trajectories, smooth curves are used to encode, and the visual encoding of the discontinuous trajectory attributes is kept consistent with the visual encoding of the continuous traffic flow attributes; a compass is added to the view to identify the user's current field of view direction, and the compass is consistent with the direction of the local coordinate system in the view; when the user rotates the view, the compass will change accordingly to help the user perceive the direction; Provide interactive functions for the dynamic evolution view of intersection trajectories to assist users in analysis: Provide interactive methods of space-time cube technology, including interaction, translation and rotation, to help users complete search, tracking and navigation tasks; Add a viewpoint reset button to help users quickly return to the starting viewpoint; Provides indexing operations for quickly associating video frames and video segments, helping users quickly view the original context: users can right-click on the trajectory or continuous traffic flow of interest, and then display the video frames associated with this trajectory on the side, and the video interface will also index to the corresponding time point; Setting the video panel in step e to understand the original video stream data through the video panel specifically includes the following steps: The original video is provided to help users understand the original scene: two types of videos are provided for users to browse and analyze, the first is the original video, and the second is the video with multi-target tracking output result information added, so as to help users search for analysis targets; Provides interactive video operations: including slow, normal or fast video playback, and enabling video picture-in-picture mode; The video interface is associated with other views: after selecting a time range in any visualization box, the interface automatically jumps to the corresponding time point; the user right-clicks the track to index the starting frame of the track in the video.
Citation Information
Patent Citations
Microscopic visual analysis method for high-density group trajectory data
CN112463901A
Road running state detection method and system based on radar and video fusion
CN112946628A
Computer system and method for state prediction of a traffic system
EP3413284A1
Method for calculating length of time taken for train to pass through tunnel, system, and storage medium
WO2021013192A1
