Disclosure of Invention
The invention provides an abnormal driving early warning method based on the reasonable driving range of vehicles at the intersection aiming at the existing technical problems, the method takes the intersection as a research object, realizes extraction and analysis of the vehicle track at the intersection based on historical monitoring video data, effectively judges the abnormal vehicle track to realize extraction and analysis of the normal vehicle track, further determines the reasonable driving range of the vehicles in each flow direction at the intersection aiming at the normal vehicle track, establishes a normal range database, and carries out early warning on illegal vehicles and abnormal behaviors at the intersection, thereby improving the monitoring efficiency of the intersection and providing effective precautionary measures for traffic accidents and congestion at the intersection.
The abnormal driving early warning method based on the reasonable driving range of the vehicles at the intersection comprises the following steps:
step 1, determining each vehicle track of an intersection based on an intersection monitoring historical video, and classifying vehicle track type modes through hierarchical clustering and intersection canalization;
step 2, extracting and analyzing the reasonable range of the vehicle track in each flow direction of the intersection respectively to realize the reasonable range management of the vehicles at the intersection;
and 3, early warning the passing abnormal running vehicles according to the real-time monitoring video information of the intersection, and monitoring and managing the abnormal conditions of the intersection.
Further, in the step 1, the specific steps are as follows:
step 1-1, based on historical videos of intersection monitoring unit time periods, extracting original track points under different vehicle IDs, marking the original track points as P (f, x, y), wherein f represents a frame number, x and y represent coordinate values, further determining a single vehicle track of the different vehicle IDs through initial data cleaning, and marking the single vehicle track as TR (TR) { P | P }iI is more than or equal to 1 and less than or equal to n, and n is the number of track points };
step 1-2, classifying the vehicle track type modes based on a hierarchical clustering algorithm and intersection channelized information. Specifically, the feature point p is performed on a single vehicle trackiAnd extracting, namely performing vehicle track hierarchical clustering through the Euclidean distance or the LCSS distance, eliminating abnormal vehicle tracks, and realizing vehicle track division according to intersection canalization characteristics.
Further, the step 2 specifically includes the following steps:
and 2-1, extracting a single mode type vehicle track TR, and realizing normal vehicle track extraction and analysis under the mode type through hierarchical clustering.
And 2-2, smoothing the track based on the normal vehicle track screened and extracted in the step 2-1, re-extracting the vehicle track characteristic points, and determining the running range of the vehicle in the single direction.
And 2-3, repeating the steps 2-1 and 2-2 to determine the envelope track of each flow direction of the intersection, and integrating to obtain the reasonable driving range of the vehicle track at the intersection.
Further, the step 2-1 specifically comprises the following sub-steps:
step 2-1-1, based on vehicle trajectory TRjCharacteristic point piTrack similarity lambda and variance alpha of single vehicle track2And the arc length ratio sigma is used as a characteristic numerical value to solve. Wherein i is more than or equal to 1 and less than or equal to n, and n is the number of the track characteristic points; j is more than or equal to 1 and less than or equal to N, and N is the number of vehicle tracks; in particular, the vehicle trajectory TR is solved by the LCSS algorithm or DTW algorithm according to the vehicle trajectory typejSimilarity lambda; based on vehicle trajectory TRjCharacteristic point p ofiDetermines the vehicle track TR by the number of frames and the distance between the feature pointsjAcceleration variance α of2(ii) a Based on vehicle trajectory TRjDetermining the vehicle trajectory TR by the distance between the characteristic pointsjArc length ratioσ;
Step 2-1-2, the vehicle track TR
jSimilarity λ, acceleration variance α of
2Arc length ratio sigma
jPerforming hierarchical clustering on vehicle tracks serving as feature data, dividing the vehicle tracks into three types, namely abnormal driving tracks, abnormal behavior tracks and normal vehicle tracks, further rejecting the abnormal driving tracks and the abnormal behavior tracks, and realizing normal vehicle track data extraction; specifically, each vehicle track TR is integrated
jSimilarity of (D) ("lambda")
jVariance of acceleration
Arc length ratio sigma
jAnd dividing the numerical value into three groups of data by using a hierarchical clustering algorithm as a characteristic value, and determining an abnormal driving track, an abnormal behavior track and a normal vehicle track according to the data volume and the dispersion degree epsilon of each group of data. The data with the minimum data volume and the ratio of the number of the groups to the total number of the groups smaller than the abnormal threshold value is defaulted as an abnormal track, and the data with the larger dispersion degree epsilon is defaulted as an abnormal behavior track;
and 2-1-3, performing hierarchical clustering on the normal vehicle tracks in the step 2-1-2 again based on a DTW (delay tolerant shift) algorithm, judging and dividing the normal vehicle tracks and the outlier tracks based on the track number and the dispersion degree epsilon of each cluster after clustering, and extracting the normal vehicle tracks.
Further, the step 2-2 specifically comprises the following sub-steps:
step 2-2-1, normal vehicle track TR extracted by screeningjLower trace point piRealizing the smoothness of the vehicle track, equally selecting and determining new characteristic points p 'of the vehicle track according to the smoothed vehicle track points'i;
Step 2-2-2, based on all vehicle trajectories TRjAnd novel characteristic point p'iDetermining a main curve of vehicle operation; specifically, feature points p 'are selected based on each vehicle track'iCorresponding the main curves one by one, determining the central point of the stage i in the same stage i to obtain the main curve TRmidNamely:
in the formula, TRmidRepresenting a vehicle trajectory master curve; pimidRepresenting the central point of the i-th stage track characteristic point, wherein i is more than or equal to 1 and less than or equal to n, and n represents the number of the selected characteristic points; p'jiRepresenting the new characteristic points of the ith stage track of the jth vehicle track, wherein j is more than or equal to 1 and less than or equal to N, and N represents the total number of the vehicle tracks;
and simultaneously determining outliers of each stage based on the numerical distribution of the distance between each stage and the central point, namely:
of formula (II b), dist (p'ji,Pimid) Representing the distance between the characteristic point of j tracks i and the central point of the stage i;
analyzing the distance values of all track points in the stage i, and defaulting the track stage points corresponding to the values which are greater than normal distribution (mu +2 sigma) to be outliers through normal distribution analysis;
step 2-2-3, according to the main curve TRmidAnd a phase point P on the main curveimidDetermining envelope point Q of each stageiThen, two envelope lines are obtained smoothly, and a reasonable driving range of the vehicle track is determined;
further, the step 2-2-3 specifically comprises the following sub-steps:
step 2-2-3-1, according to stage point P on main curveimidDetermining vehicle track points p 'in the same stage'jiWith main curve TRmidIf the point of the track closest to the main curve is not on the main curve TRmidIf so, indicating that the vehicle track points at the stage deviate, and rejecting the vehicle track points, otherwise, turning to the next step;
step 2-2-3-2, track points p 'on each vehicle track which is not deviated in the same stage'jiWith main curve TRmidDistance dist (p'ji,TRmid) Sorting, selecting 80-90% median value as radius distance of envelope curve corresponding to the main curve at the stage, and recording as ri;
Step 2-2-3-3, based on the stage point P on the main curveimidDetermining envelope point coordinates Q at the same stageiIs recorded as (x'i,y′i) And in particular,
y′i=kix′i+bi
in formula (II), x'
iAnd y'
iPoint coordinates representing the envelope at stage i, denoted as Q
i,
And
denotes the main curve coordinate in phase i, denoted P
imid;k
iRepresents the slope of the envelope in phase i, b
iRepresenting the intercept of the intersection line of the envelope curve and the main curve in the i stage;
step 2-2-3-4, judging the position relation between the envelope coordinate and the main curve according to the envelope coordinate solved in the previous step; in particular, the main curve point P according to this phase
imidAnd the main curve point of the next stage
An envelope threshold ξ is obtained, namely:
in formula (II), x'
iAnd y'
iPoint coordinates representing the envelope at stage i;
and
representing the main curve coordinates on stage i;
x 'if ξ < 0'iAnd y'iThe point of the envelope curve is on the left side of the main curve, and ξ > 0 represents x'iAnd y'iThe envelope curve point is on the right side of the main curve, otherwise, the envelope curve point is on a straight line intersecting the main curve;
step 2-2-3-5, coordinate Q of envelope curve point of all stage pointsiIntegrating, smoothing envelope track to obtain new envelope characteristic point qs(i) To thereby determine the envelope trajectory TRqAnd the range formed by the two lines is the reasonable driving range of the vehicle track in the mode.
Further, thestep 3 includes the following sub-steps:
step 3-1, determining the running direction and track information of the vehicle according to the real-time monitoring video analysis;
step 3-2, comparing the vehicle track path obtained in the step 3-1 with the reasonable driving range of the vehicle track at the intersection obtained in the step 2; if the vehicle exceeds the driving range, early warning is carried out, and vehicle information is issued to an off-site law enforcement system;
and 3-3, if the ratio of the number of early warning vehicles in the running flow direction in unit time to the total number of passing vehicles is greater than the threshold value of the abnormal condition, early warning the flow direction of the intersection, and simultaneously associating the flow direction to a traffic situation monitoring system or a video monitoring system, so that the alarm of the abnormal condition of the intersection is realized, and the abnormal condition of the intersection is monitored.
The invention achieves the following beneficial effects: compared with the traditional GPS vehicle track clustering abnormal analysis mode, the method provided by the invention realizes extraction and analysis of the vehicle track at the intersection by a hierarchical clustering algorithm on the basis of historical video data, effectively identifies vehicle tracks such as abnormal vehicle tracks, abnormal behavior tracks and outlier tracks, and extracts correct vehicle tracks. Compared with the traditional crossing illegal abnormal early warning mode, the invention extracts and analyzes the correct vehicle track, determines the reasonable driving range of each flow direction vehicle of the crossing, has smaller and more reasonable track interval than the original crossing, effectively warns the abnormal illegal driving vehicle, improves the non-field law enforcement efficiency, reduces the workload of manual examination and verification, and provides a reference index for intelligent identification; meanwhile, the abnormal conditions of the intersection are judged based on the abnormality of a plurality of vehicles, so that remote linkage monitoring is realized, and the supervision efficiency of intersection traffic is improved.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the drawings in the specification.
The abnormal driving early warning method based on the reasonable driving range of the vehicles at the intersection comprises the following steps:
step 1, determining each vehicle track of the intersection based on the intersection monitoring historical video, and classifying the vehicle track type modes through hierarchical clustering and intersection canalization.
Step 1-1, based on historical videos of intersection monitoring unit time periods, extracting original track points under different vehicle IDs, marking the original track points as P (f, x, y), wherein f represents a frame number, x and y represent coordinate values, further determining a single vehicle track of the different vehicle IDs through initial data cleaning, and marking the single vehicle track as TR (TR) { P | P }iI is more than or equal to 1 and less than or equal to n, and n is the number of track points }; in general, the unit time period is 5 min.
Step 1-2, classifying the vehicle track type modes based on a hierarchical clustering algorithm and intersection channelized information. Specifically, the feature point p is performed on a single vehicle trackiAnd extracting, namely performing vehicle track hierarchical clustering through the Euclidean distance or the LCSS distance, eliminating abnormal vehicle tracks (such as vehicle running tracks of stopping at the intersection, reverse running and the like), and realizing vehicle track division according to intersection canalization characteristics. Generally, taking an intersection as an example, the vehicle trajectory types include 12 types of left turn, straight turn and right turn in the east, south, west and north directions.
And 2, extracting and analyzing the reasonable range of the vehicle track in each flow direction of the intersection respectively, and realizing the reasonable range management of the vehicles at the intersection.
And 2-1, extracting the single-mode type vehicle track TR, and analyzing all tracks under the type through a hierarchical clustering algorithm to realize normal vehicle track extraction.
Step 2-1-1, based on vehicle trajectory TRjCharacteristic point piTrack similarity lambda and variance alpha of single vehicle track2And the arc length ratio sigma is used as a characteristic numerical value to solve. Wherein i is more than or equal to 1 and less than or equal to n, and n is the number of the track characteristic points; j is more than or equal to 1 and less than or equal to N, and N is the number of the vehicle tracks.
In particular, the vehicle trajectory TR is solved by the LCSS algorithm or DTW algorithm according to the vehicle trajectory typejSimilarity lambda; based on vehicle trajectory TRjCharacteristic point p ofiDetermines the vehicle track TR by the number of frames and the distance between the feature pointsjAcceleration variance α of2(ii) a Based on vehicle trajectory TRjDetermining the vehicle trajectory TR by the distance between the characteristic pointsjThe arc length ratio σ.
Wherein, taking LCSS algorithm as an example, the vehicle track TRjThe similarity λ formula is:
wherein TR is
1And TR
2Two tracks with the length of m and n are respectively arranged;
wherein p is
iAnd q is
jRespectively represent the coordinates of the characteristic points of the track,
in the same way
Wherein i is more than or equal to 1 and less than or equal to m, j is more than or equal to 1 and less than or equal to n,
indicating that the track is empty; dist (p)
i,q
j) Representing Euclidean distance of two coordinate points, wherein gamma is a similarity threshold value; LCSS (TR)
1,TR
2) Represents TR
1And TR
2The longest common subsequence length of the two tracks; d
LCSS(TR
1,TR
2) Is a track TR
1And TR
2The similarity distance of (2); min (len)
TR1,len
TR2) Representing the track TR
1Length and TR
2The smaller value of the length; d
LCSS(TR
1,TR
l) Represents TR
1And TR
lThe longest common subsequence similarity distance between, N represents the number of vehicle tracks; lambda [ alpha ]
1Represents TR
1Phase of vehicle trajectoryA similarity value.
Vehicle track TRjAcceleration variance α of2Comprises the following steps:
in the formula, alpha
i+1Represents the acceleration of the characteristic point i +1, where f
iAnd f
i+1Which represents the number of frames,
denotes the Euclidean distance, p, between the feature point i and the feature point i +1
iAnd p
i+1The feature points are represented.
Vehicle track TRjThe arc length ratio σ of the trajectory of (a) is:
in the formula, p
1、p
i、p
i+1、p
nAll represent vehicle trajectory TR
jAn inner feature point;
representing the Euclidean distance between the vehicle track characteristic point i and the characteristic point i + 1;
representing the Euclidean distance between the characteristic point n of the vehicle root track and the characteristic point 1; n represents the number of characteristic points in the vehicle track, and i is more than or equal to 1 and less than or equal to n.
Step 2-1-2, the vehicle track TRjThe similarity of the two components is lambda,Acceleration variance α2Arc length ratio sigmajAnd performing hierarchical clustering on the vehicle track as characteristic data, dividing the characteristic data into three types, namely abnormal driving track, abnormal behavior track and normal vehicle track, and further removing the abnormal driving track and the abnormal behavior track to realize normal vehicle track data extraction.
Specifically, each vehicle track TR is integrated
jSimilarity of (D) ("lambda")
jVariance of acceleration
Arc length ratio sigma
jAnd dividing the numerical value into three groups of data by using a hierarchical clustering algorithm as a characteristic value, and determining an abnormal driving track, an abnormal behavior track and a normal vehicle track according to the data volume and the dispersion degree epsilon of each group of data. The data set with the minimum data volume and the ratio of the data volume to the total number smaller than the abnormal threshold (generally 30%) is defaulted as an abnormal track, and the data set with the greater dispersion degree epsilon is defaulted as an abnormal behavior, wherein the dispersion degree epsilon is as follows:
in the formula, n' is the total number of all vehicle track characteristic points in the divided group; p is a radical of
iIn order to be a characteristic point, the method comprises the following steps of,
the cluster center point is the group center of the divided group data;
represents p
iPoint to cluster center point distance.
And 2-1-3, performing hierarchical clustering on the normal vehicle track in the previous step again under the DTW algorithm, and dividing and judging the normal vehicle track and the outlier track.
Specifically, the normal vehicle track in the previous step is extracted, the similarity between every two tracks is determined based on a DTW algorithm, a similarity matrix S [ a ] [ b ] is listed, the vehicle tracks are divided into two types including normal tracks and outlier tracks through hierarchical clustering, the outlier tracks are determined based on the track number or the dispersion degree epsilon, and therefore the normal vehicle track is extracted.
In general, if the number of the two vehicle trajectories a and B is smaller than that of the other vehicle trajectory, and the ratio of the number to the total number is smaller than an abnormal threshold (generally 30%), the one vehicle trajectory is defaulted as an abnormal outlier trajectory, and the other vehicle trajectory is a normal trajectory; otherwise, the discrete degrees epsilon of the two groups of data are respectively solved, and the group of data with large values is defaulted as the abnormal outlier track.
And 2-2, performing track smoothing on the vehicle track screened and extracted in the step 2-1, re-extracting vehicle track characteristic points, and determining the running range of the vehicle in the single direction.
Step 2-2-1, screening and extracting the normal vehicle track TR in the previous stepjLower trace point piRealizing vehicle track smoothing, analyzing and determining new feature point p 'after vehicle track smoothing'i。
Specifically, a method such as a moving average, a weighted moving average, and an exponential moving average may be used. The invention selects a sliding average smoothing method, which comprises the following steps:
in the formula ps(i) Representing the smoothed vehicle track points: omega is a smoothing index and is determined according to the number of track points of the shortest track in all tracks and the number of feature points needing to be selected, and the omega takes the value of 5 because 10 feature points are selected again.
Further vehicle trajectory bisectionAnd re-selecting a new characteristic point, and recording the new characteristic point as a vehicle track TR ═ P '| P'iI is more than or equal to 1 and less than or equal to n, n is the number of the track feature points }, and generally, ten feature points are selected again.
Step 2-2-2, based on all vehicle trajectories TRjAnd characteristic point p'iA master curve of vehicle operation is determined. Specifically, feature points p 'are selected based on each vehicle track'iCorresponding the main curves one by one, determining the central point of the stage i in the same stage i to obtain the main curve TRmidNamely:
in the formula, TRmidRepresenting a vehicle trajectory master curve; pimidRepresenting the central point of the i-th stage track feature point, wherein i is more than or equal to 1 and less than or equal to n, and n represents the number of the selected feature points (generally, the value of n is 10); p'jiAnd representing the new characteristic points of the ith stage track of the jth vehicle track, wherein j is more than or equal to 1 and less than or equal to N, and N represents the total number of the vehicle tracks.
And simultaneously determining outliers of each stage based on the numerical distribution of the distance between each stage and the central point, namely:
of formula (II b), dist (p'ji,Pimid) And representing the distance between the characteristic point of j tracks i and the central point of the i stage.
And further analyzing the distance numerical values of all track points in the i stage, and defaulting the numerical values which are larger than the normal distribution (mu +2 sigma) to the track stage points as outliers through normal distribution analysis.
Step 2-2-3, according to the main curve TR of the previous stepmidAnd on the main curvePhase point PimidDetermining envelope point Q of each stageiAnd then the envelope curve is obtained smoothly.
Step 2-2-3-1, according to stage point P on main curveimidDetermining vehicle track points p 'in the same stage'jiWith main curve TRmidIf the point of the track closest to the main curve is not on the main curve TRmidAnd if so, indicating that the vehicle track points at the stage deviate, and rejecting the vehicle track points, otherwise, turning to the next step.
Step 2-2-3-2, track points p 'on each vehicle track which is not deviated in the same stage'jiWith main curve TRmidDistance dist (p'ji,TRmid) Sorting, selecting 80-90% median value as radius distance of envelope curve corresponding to the main curve at the stage, and recording as ri。
Step 2-2-3-3, based on the stage point P on the main curveimidDetermining envelope point coordinates Q at the same stageiIs recorded as (x'i,y′i). Specifically, the method comprises the following steps:
y′i=kix′i+bi
in formula (II), x'
iAnd y'
iPoint coordinates representing the envelope at stage i, denoted as Q
i,
And
denotes the main curve coordinate in phase i, denoted P
imid;k
iRepresents the slope of the envelope in phase i, b
iRepresenting the intercept of the intersection of the envelope with the main curve at stage i.
And 2-2-3-4, judging the position relation between the envelope coordinate and the main curve according to the envelope coordinate solved in the previous step. In particular, the main curve point P according to this phase
imidAnd the main curve point of the next stage
An envelope threshold ξ is obtained, namely:
in formula (II), x'
iAnd y'
iPoint coordinates representing the envelope at stage i;
and
representing the main curve coordinates on stage i.
X 'if ξ < 0'iAnd y'iThe envelope point shown is to the left of the main curve, and ξ > 0 represents xiAnd yiThe envelope point is to the right of the main curve, and vice versa on the line where the envelope intersects the main curve.
Step 2-2-3-5, coordinate Q of envelope curve point of all stage pointsiIntegrating, smoothing envelope track to obtain new envelope characteristic point qs(i) To thereby determine the envelope trajectory TRqNamely, the reasonable driving range of the vehicle track in the mode (direction) is obtained.
And 2-3, repeating the steps 2-1 and 2-2 to determine the track (the reasonable driving range of the vehicle) of each flow direction envelope line of the intersection, and integrating to obtain the reasonable driving range of the vehicle track of the intersection.
Specifically, taking a conventional intersection as an example, the vehicle reasonable driving ranges of the vehicle trajectories of the vehicle turning left, going straight and turning right in four directions are respectively determined.
And 3, early warning the passing abnormal running vehicles according to the real-time monitoring video information of the intersection, and monitoring and managing the abnormal conditions of the intersection.
And 3-1, analyzing and determining the running direction and track information of the vehicle according to the real-time monitoring video.
Step 3-2, comparing the vehicle track path obtained in the step 3-1 with the reasonable driving range of the vehicle track at the intersection obtained in the step 2; and if the vehicle exceeds the driving range, early warning is carried out, and vehicle information is issued to an off-site law enforcement system.
And 3-2, if the ratio of the number of early warning vehicles and the total number of passing vehicles in the running flow direction in unit time is greater than an abnormal condition threshold value (generally about 50%, the value can be selected according to the actual condition of the intersection), early warning is carried out on the flow direction of the intersection, and meanwhile the flow direction of the intersection can be related to a traffic situation monitoring system or a video monitoring system, so that the alarm of the abnormal condition of the intersection is realized, and the abnormal condition of the intersection is monitored.
The following is illustrated by specific examples:
selecting a certain intersection for research, extracting a monitoring video of the intersection within 5min, determining a vehicle track according to track points, and dividing a vehicle track mode by hierarchical clustering, which is specifically shown in fig. 2.
Further extracting and analyzing the vehicle track at the single intersection, taking the left turn of the south entrance as an example, extracting the abnormal track of the vehicle, and determining a main curve and an envelope curve according to the normal vehicle track and the characteristic points thereof, as shown in fig. 3. Namely, the section between the envelope line 1 and the envelope line 2 in the figure is a reasonable driving range of the south-entry left-turn.
When the left-turn vehicle at the south entrance exceeds the reasonable driving range in the process of driving, early warning is carried out, if the early warning frequency in unit time period (1 hour) exceeds 50% of the vehicle-passing record, association is automatically prompted, and the intersection remote monitoring is realized.
The above description is only a preferred embodiment of the present invention, and the scope of the present invention is not limited to the above embodiment, but equivalent modifications or changes made by those skilled in the art according to the present disclosure should be included in the scope of the present invention as set forth in the appended claims.