CN113469075A - Method, device and equipment for determining traffic flow index and storage medium - Google Patents

Method, device and equipment for determining traffic flow index and storage medium Download PDF

Info

Publication number
CN113469075A
CN113469075A CN202110767463.0A CN202110767463A CN113469075A CN 113469075 A CN113469075 A CN 113469075A CN 202110767463 A CN202110767463 A CN 202110767463A CN 113469075 A CN113469075 A CN 113469075A
Authority
CN
China
Prior art keywords
vehicles
passing
line
vehicle
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110767463.0A
Other languages
Chinese (zh)
Inventor
任金松
阚宇衡
马子安
龚越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN202110767463.0A priority Critical patent/CN113469075A/en
Publication of CN113469075A publication Critical patent/CN113469075A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count

Abstract

The embodiment of the specification provides a method, a device, equipment and a storage medium for determining a traffic flow index. The method comprises the steps that detection results of tracking detection of a plurality of vehicles in a traffic video can be obtained, wherein the traffic video is a collected video of a target intersection, and the detection results comprise running track information of the plurality of vehicles; determining a passing vehicle from the plurality of vehicles based on the travel track information, the travel track of the passing vehicle intersecting a detection line, the detection line being located in the target intersection area and covering one or more lanes of the target intersection; and clustering the passing vehicles, and determining the traffic flow index of the target intersection based on the clustering result. By the method, the traffic flow index of the road intersection can be determined more accurately.

Description

Method, device and equipment for determining traffic flow index and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a storage medium for determining a traffic flow indicator.
Background
With the popularization of automobiles, the number of automobiles on roads is increasing, and a series of traffic problems such as traffic congestion, traffic jam, frequent traffic accidents and the like are caused. In order to alleviate the problems of traffic jam, traffic congestion and the like, the traffic flow on the road can be detected, and scientific and reasonable management and control can be performed on the traffic flow based on the detection result so as to improve the traffic environment. The current traffic flow detection technology mainly detects the traffic flow of each lane, the detection mode is complicated, and the detection precision is still to be improved.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, and storage medium for determining a traffic flow indicator.
According to a first aspect of embodiments of the present disclosure, there is provided a method of determining a traffic flow indicator, the method comprising:
acquiring a detection result of tracking and detecting a plurality of vehicles in a traffic video, wherein the traffic video is a collected video of a target intersection, and the detection result comprises the running track information of the plurality of vehicles;
determining a passing vehicle from the plurality of vehicles based on the travel track information, wherein the travel track of the passing vehicle intersects detection lines covering one or more lanes of the target intersection;
and clustering the passing vehicles, and determining the traffic flow index of the target intersection based on the clustering result.
In some embodiments, the detection line coincides with the target intersection stop line or zebra crossing.
In some embodiments, determining a passing vehicle from the plurality of vehicles based on the travel track information includes:
determining a passing vehicle from vehicles of each frame of video frame of the traffic video based on the driving track information;
and accumulating the passing vehicles in each frame of video frame to obtain the passing vehicles in the plurality of vehicles.
In some embodiments, the driving trajectory information includes coordinates of trajectory points of the plurality of vehicles in different video frames of the traffic video, and determining a passing vehicle from vehicles of each frame video frame of the traffic video based on the driving trajectory information includes:
respectively executing the following operations for each frame of the current video frame:
determining the coordinates of a first track point of each vehicle in a current video frame and the coordinates of a second track point of each vehicle in a previous frame of the current video frame based on the running track information of each vehicle in the current video frame;
and under the condition that the connection line of the first track point and the second track point is intersected with the detection line according to the coordinates of the first track point, the coordinates of the second track point and the coordinates of the two end points of the detection line, determining the vehicle as a passing vehicle.
In some embodiments, the traffic flow indicator includes traffic flow of one or more lanes of the target intersection, the passing vehicles are clustered, and the traffic flow indicator of the target intersection is determined based on the clustering result, including:
clustering the intersection points of the running tracks of the over-line vehicles and the detection lines to obtain one or more intersection point clustering centers, wherein each intersection point clustering center represents a first group;
dividing the passing vehicles into the first group based on distances of the intersections of the passing vehicles from the one or more intersection cluster centers;
determining the traffic flow of one or more lanes of the target intersection based on the lane represented by each first group and the number of passing vehicles in each first group.
In some embodiments, the clustering operation of the intersection points of the driving tracks of the passing vehicles and the detection lines is performed after triggering of preset conditions, where the preset conditions include:
the number of the passing vehicles reaches a preset number threshold; and/or
And the time length of the traffic video reaches a preset time length threshold value.
In some embodiments, the determining the traffic flow indicator includes determining a traffic flow indicator of the target intersection based on a result of the clustering, wherein the determining the traffic flow indicator includes:
clustering the exit track points to obtain one or more exit track point clustering centers, wherein the exit track points are track points of the cross-line vehicle detected in the video frame of the cross-line vehicle for the last time, and each exit track point clustering center represents a second sub-group;
partitioning the passing vehicle into the second group based on distances of exit trajectory points of the passing vehicle from the one or more exit trajectory point cluster centers;
and determining the traffic flow driving to different driving directions from the target intersection based on the driving direction category represented by each second group and the number of the passing vehicles in each second group.
In some embodiments, before performing clustering processing on the exit track points, the method further includes:
and filtering the line passing vehicles with abnormal running tracks based on the running track information of the line passing vehicles, wherein the line passing vehicles with abnormal running tracks comprise vehicles with an interruption phenomenon on the running tracks.
In some embodiments, the travel direction category represented by each second grouping is determined based on:
under the condition that the number of the one or more exit track point clustering centers is consistent with the number of the driving direction categories included by the target intersection, respectively determining an included angle between a connecting line representing each second group of exit track point clustering centers and the center of the detection line and the detection line;
and determining the driving direction category represented by each second sub-group based on the sorting result of the included angles.
In some embodiments, the travel direction category represented by each second group is determined based on:
determining a driving direction category to which each passing vehicle in each second grouping belongs based on the driving track of each passing vehicle in each second grouping under the condition that the number of the one or more exit point cluster centers is less than the number of the driving direction categories included by the target intersection;
determining a target driving direction category from the driving direction categories to which the over-line vehicles belong in the second sub-group, wherein the number of the over-line vehicles in the target driving direction category is greater than that of the over-line vehicles in other driving direction categories;
and taking the target driving direction category as the driving direction category represented by the second group.
In some embodiments, the method further comprises:
determining an included angle between a running track of the line passing vehicle and the detection line;
and determining the running direction of the wire passing vehicle with the included angle less than or equal to 0 as the turning direction.
In some embodiments, determining the driving direction category to which the over-line vehicles in each second sub-group belong based on the driving tracks of the over-line vehicles in each second sub-group comprises:
performing linear fitting on the driving track of the passing vehicle in each second sub-group;
and determining the over-line vehicles with the straight driving direction from the over-line vehicles in each second sub-group based on the linear fitting result.
In some embodiments, determining the driving direction category to which the over-line vehicles in each second sub-group belong based on the driving tracks of the over-line vehicles in each second sub-group comprises:
performing linear fitting on the running track of the over-line vehicle in each second sub-group, and determining the over-line vehicle with the running direction being a non-straight running direction based on the result of the linear fitting;
and determining the wire passing vehicles with the left turn driving direction and the wire passing vehicles with the right turn driving direction from the wire passing vehicles in the non-straight driving direction based on the cosine similarity between the driving tracks of the wire passing vehicles in the non-straight driving direction and the detection line.
In some embodiments, after determining the traffic flow at the target intersection, the method further comprises:
and controlling traffic signal lamps of the target intersection based on the traffic flow. According to a second aspect of embodiments of the present disclosure, there is provided an apparatus for determining a traffic flow indicator, the apparatus comprising:
the system comprises an acquisition module, a tracking module and a tracking module, wherein the acquisition module is used for acquiring a detection result of tracking and detecting a plurality of vehicles in a traffic video, the traffic video is a collected video of a target intersection, and the detection result comprises the running track information of the plurality of vehicles;
a processing module to determine a passing vehicle from the plurality of vehicles based on the travel track information, wherein the travel track of the passing vehicle intersects detection lines covering one or more lanes of the target intersection;
and the clustering module is used for clustering the passing vehicles and determining the traffic flow index of the target intersection based on the clustering result.
According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, where the electronic device includes a processor, a memory, and computer instructions stored in the memory and executable by the processor, and when the processor executes the computer instructions, the method of the first aspect may be implemented.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed, implement the method mentioned in the first aspect above.
In the embodiment of the disclosure, a video of a target intersection can be collected, vehicles in the video can be tracked and detected to obtain a driving track of the vehicles in the video, a detection line can be preset at the position of the target intersection in a video frame, the detection line can cover one or more lanes of the target intersection, a passing vehicle with the driving track intersecting with the detection line can be screened out from the vehicles in the video, and various traffic flow indexes of the target intersection, such as the traffic flow of each lane or the traffic flow of each direction, can be obtained by clustering the passing vehicles. Because this embodiment of this disclosure is whether crossing through the driving track of vehicle and detection line and judges whether the vehicle passes through a certain lane or a certain crossing, compare the mode that carries out vehicle flow through virtual coil, its detection precision can improve greatly, even if under the very saturated condition of vehicle on the road, its detection precision still can not receive the influence. In addition, because each lane is not required to be marked with a virtual coil, the detection method is convenient to operate and is more convenient and quicker.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1(a) and 1(b) are schematic diagrams illustrating a method for detecting a traffic flow by using a virtual coil according to an embodiment of the present disclosure.
Fig. 2 is a flowchart of a method of determining a traffic flow indicator according to an embodiment of the disclosure.
Fig. 3 is a schematic diagram of labeling detection lines at a target intersection according to an embodiment of the present disclosure.
Fig. 4 is a schematic diagram of a traffic flow driving direction at a target intersection according to an embodiment of the disclosure.
Fig. 5 is a schematic diagram of an included angle between a connecting line of exit track points and centers of detection lines and the detection lines of the passing vehicles in different driving directions at the target intersection according to the embodiment of the disclosure.
Fig. 6 is a schematic diagram of a logic structure of an apparatus for determining a traffic flow indicator according to an embodiment of the disclosure.
Fig. 7 is a schematic diagram of a logical structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to make the technical solutions in the embodiments of the present disclosure better understood and make the above objects, features and advantages of the embodiments of the present disclosure more comprehensible, the technical solutions in the embodiments of the present disclosure are described in further detail below with reference to the accompanying drawings.
In order to alleviate a series of traffic problems such as traffic congestion and congestion, the traffic flow on a road may be detected, and then the traffic flow is controlled based on the detection result, for example, the traffic flow may be guided to be shunted to avoid congestion, or the traffic flow condition of each road section of the user may be reminded in real time so that the user avoids the congested road section. The accurate detection of the traffic flow is the premise of realizing scientific and reasonable traffic control.
The current traffic flow detection technology generally acquires a video of a road through a camera mounted on the road, and analyzes and processes the video to determine the traffic flow. At present, when detecting traffic flow, as shown in fig. 1(a), a user is generally required to calibrate a virtual coil on each lane in advance, and then whether a vehicle passes through the virtual coil can be determined according to the pixel change situation of the position of the virtual coil in two adjacent video frames. For example, as shown in fig. 1(b), it is assumed that there are three video frames acquired at time T1, time T2, and time T3, a vehicle has not yet entered into the virtual coil in the video frame at time T1, the vehicle is located right at the virtual coil in the video frame at time T2, and the vehicle has moved away from the virtual coil in the video frame at time T3, pixels at the position of the virtual coil in the three video frames may have a large change, and each time a pixel in the virtual coil has a large change, it is described that there is a vehicle passing through the virtual coil, so that the traffic flow situation of each lane can be counted. The traffic flow detection mode can only detect the traffic flow index of each lane generally, and because a virtual coil needs to be marked on each lane in advance in a manual marking mode, the workload is large and the traffic flow detection mode is complicated. In addition, in the way of detecting the vehicle flow rate through the pixel change in the virtual coil, when vehicles on a road are relatively saturated, that is, when the average headway (the time difference between two adjacent vehicles passing through the virtual coil) is small, the virtual coil is always occupied by the vehicles, the pixel does not change greatly, and the detection precision is rapidly reduced.
Based on this, the embodiments of the present disclosure provide a method for determining a traffic flow index, which may collect a video of a target intersection, perform tracking detection on vehicles in the video to obtain a driving track of the vehicles in the video, then screen a passing vehicle from the vehicles in the video, where the driving track intersects with a detection line, where the detection line covers one or more lanes of the target intersection, and may obtain various traffic flow indexes of the target intersection by performing clustering processing on the passing vehicles, such as a traffic flow of each lane at the target intersection, or a traffic flow of each direction driven by the target intersection. Because this embodiment of this disclosure is whether crossing through the driving track of vehicle and detection line and judges whether the vehicle passes through a certain lane or a certain crossing, compare the mode that carries out vehicle flow through virtual coil, its detection precision can improve greatly, even if under the very saturated condition of vehicle on the road, its detection precision still can not receive the influence. In addition, because each lane is not required to be marked with a virtual coil, the detection method is convenient to operate and is more convenient and quicker.
The method for determining the traffic flow index in the embodiment of the present disclosure may be executed by various road traffic information collecting devices, in some scenarios, the road traffic information collecting device may be an image collecting device installed at a road intersection position, and in some scenarios, the road traffic information collecting device may also be a device in communication connection with the image collecting device installed at the road intersection position, for example, a cloud server, a server cluster, and the like.
The target intersection in the embodiment of the present disclosure may be various intersections whose traffic flow needs to be detected, and the target intersection may be various intersections, such as a cross intersection, a t-shaped intersection, or an intersection with other shapes. And aiming at each target intersection, special image acquisition equipment can be arranged for acquiring traffic videos indicating the traffic conditions of the intersection.
The traffic flow indicator in the embodiments of the present disclosure refers to various indicator parameters for indicating the traffic flow condition of the target intersection, for example, the traffic flow of a certain lane or each lane in the target intersection, or the overall traffic flow passing through the target intersection, or the traffic flow going to different directions after passing through the target intersection, such as the straight traffic flow, the left-turn traffic flow, the turning around traffic flow, and so on.
Specifically, as shown in fig. 2, the method may include the following steps:
step S202, obtaining a detection result of tracking detection of a plurality of vehicles in a traffic video, wherein the traffic video is a collected video of a target intersection, and the detection result comprises the running track information of the plurality of vehicles;
the detection result of tracking detection of a plurality of vehicles in the traffic video of the target intersection can be obtained, wherein the detection result can include the running track information of the plurality of vehicles in the traffic video. The tracking detection of the vehicles in the video can be realized by adopting a target tracking algorithm, for example, the vehicles in each frame of video frame can be detected based on the target detection algorithm, and the vehicles in different video frames are matched, so that the positions of the same vehicle in different video frames can be known, and the tracking of the vehicles can be realized. When the target tracking is performed, an identifier may be set for each vehicle in the traffic video, for example, each vehicle may correspond to a number to identify the vehicle. After the passing vehicle is determined, the corresponding identifier of the passing vehicle can be stored.
The driving track information may be various information representing a driving track of the vehicle, for example, the driving track information may be position information of the vehicle at different times, or position information of the vehicle in different video frames, and the position information may be pixel coordinates in the video frames, or may be pixel coordinates converted into three-dimensional coordinates in a three-dimensional space based on internal and external parameters of the image capturing device, and may be specifically set according to actual requirements, which is not limited in this embodiment.
In some embodiments, the travel track information may be coordinates of track points of vehicles in the traffic video in different video frames of the traffic video. For example, for each vehicle in the video frame, a pixel point capable of representing the position of the vehicle in the video frame may be determined, and the pixel point is used as a driving track point of the vehicle in the current video frame or at the current moment, for example, the center of the vehicle may be used as the driving track point, or the center of an area surrounded by contact points of four tires of the vehicle and the ground may be used as the driving track point, which may be specifically set according to actual requirements. And determining the driving track points of the vehicle aiming at each frame of the video, so that the driving track information of the vehicle in the traffic video can be obtained. For example, in some scenarios, the driving track information may include an identifier of the vehicle and coordinates of driving track points of the vehicle in different video frames (the different video frames may be identified by the capture time of the video frame, and may also be identified by the video frame number).
In addition, the plurality of vehicles may be all vehicles detected in the traffic video, or may be some vehicles detected in the traffic video, and the embodiments of the present disclosure are not limited.
In some embodiments, the tracking detection of the vehicles in the traffic video and the determination of the traffic flow index based on the detection result may be performed by the same device, for example, the tracking detection of the vehicles in the traffic video and the determination of the traffic flow index based on the detection result may be performed by different modules or components on the same device, or performed by the same module or component on the same device. In some embodiments, tracking detection of vehicles in traffic video and determining a traffic flow indicator based on the detection may also be performed by two different devices.
Step S204, determining a passing vehicle from the plurality of vehicles based on the running track information, wherein the running track of the passing vehicle is intersected with the detection line covering one or more lanes of the target intersection.
After obtaining the travel track information of the vehicles in the traffic video, the passing vehicles whose travel tracks intersect the detection lines may be determined from the plurality of vehicles based on the vehicle travel track information. The detection line is used for detecting whether vehicles converge into the intersection from the target intersection, so that the detection line can cover one or more lanes of the target intersection, and vehicles passing through the target intersection and flowing into other intersections can pass through the detection line.
In some embodiments, the detection line may be obtained by a user by calibrating in advance in a video frame of the traffic video, for example, two pixel points may be selected as two end points of the detection line at a target intersection in the video frame, and position coordinates of the two end points are recorded. Of course, in order to detect all vehicles flowing out of the target intersection, when calibrating the detection line, two end points of the detection line may be located at two sides of the target intersection entrance lane, i.e. the detection line may cover one or more lanes of the target intersection entrance lane.
Since vehicles driving from the target entrance to other directions all pass through the stop line or the zebra crossing of the target intersection, in some embodiments, in order to facilitate calibration, the detection line may be calibrated according to the stop line or the zebra crossing of the target intersection, that is, the detection line may coincide with the stop line or the zebra crossing of the target intersection. Of course, when the detection line is actually calibrated, the detection line does not necessarily coincide with the stop line, and only one or more lanes to be detected in the target intersection can be covered, so that the running track of the vehicle passing through the lanes to be detected can be intersected with the detection line.
Because the visual angle of the image acquisition equipment for acquiring the video of the target intersection is generally fixed, the positions of the detection lines in each video frame of the traffic video are fixed, and therefore, when the detection lines are calibrated, the positions of two end points of the detection lines are only required to be calibrated in one video frame, and the position coordinates of the two end points are determined.
In an embodiment, the detection line may also be automatically identified from a video frame of the traffic video, for example, the detection line may be a zebra crossing or a stop line of a target crossing, and the pixel coordinates of two end points of the zebra crossing and the stop line may be determined as the coordinates of the two end points of the detection line by automatically identifying the zebra crossing or the stop line in the video frame. The zebra stripes or the stop lines are automatically identified from the video frames to serve as detection lines, so that the step of marking the detection lines by users can be omitted, and the detection method is more convenient and faster.
As shown in fig. 3, the schematic diagram of an intersection is shown, the intersection includes four intersections (a), (b), (c), and (d), an image capture device may be set for each intersection to capture the intersection traffic video, and the traffic flow index corresponding to the intersection will be determined based on the traffic video. Taking intersection (a) as an example, there is an entrance lane in intersection (a), and vehicles are converged into the intersection from the entrance lane and drive into other intersections. Therefore, a detection line can be calibrated at the position of the entrance lane of the target intersection, and the detection line can cover the lane 1, the lane 2 and the lane 3 in the target intersection, so that vehicles entering the intersection from the lane 1, the lane 2 and the lane 3 can pass through the detection line, namely, the driving tracks of the vehicles can intersect with the detection line, and the vehicles can be detected.
In some embodiments, when a passing vehicle is determined from a plurality of vehicles in the traffic video based on the driving track information, the passing vehicle may be determined from each vehicle in each frame of the video frame according to the driving track information of the vehicle for each frame of the video frame in the traffic video, and then the passing vehicles in each frame of the video frame may be accumulated to obtain the passing vehicle in a section of the traffic video. Because some vehicles may be determined as passing vehicles in multiple video frames, when passing vehicles in different video frames are accumulated, the passing vehicles repeatedly counted in different video frames can be combined, so that repeated counting is avoided.
In some embodiments, the driving track information may be coordinates of track points of vehicles of the traffic video in different video frames of the traffic video, and when determining a passing vehicle from vehicles of each frame of the video frames of the traffic video based on the driving track information, the following method may be adopted: for each vehicle in the current video frame, the coordinates of a first track point of the vehicle in the current video frame and the coordinates of a second track point of the vehicle in a previous frame of the current video frame can be determined based on the driving track information of the vehicle, then whether a connecting line of the first track point and the second track point intersects with the detection line or not is determined according to the coordinates of the first track point, the coordinates of the second track point and the coordinates of two end points of the detection line, and if the connecting line intersects with the detection line, the vehicle is determined to be a passing vehicle. The above steps may be repeated for each vehicle in the current video frame, vehicle by vehicle, to determine whether each vehicle in each current video frame is a passing vehicle. The above steps can also be repeated frame by frame for each frame of video frame in the traffic video, so as to obtain the passing-line vehicles in each frame of video frame. The vehicles passing the line in each frame of video are judged frame by frame, and the vehicles passing the line in each frame of video are accumulated, so that the vehicles passing the line in a section of traffic video can be obtained.
And judging whether the connecting line of the first track point and the second track point intersects with the detection line, namely judging whether the two line segments intersect. In some embodiments, a fast repulsion experiment and a straddle experiment may be employed to determine whether two line segments intersect. For example, assume that the coordinates of the second track point of the vehicle in the frame preceding the current video frame are: p is a radical ofpre=(xpre,ypre) And the coordinates of the first track point in the current video frame are as follows: p is a radical ofcur=(xcur,ycur) And the coordinates of two end points of the detection line are respectively as follows: p is a radical of1=(x1,y1),p2=(x2,y2)。
In order to improve the detection speed of the line passing vehicle, firstly, a vehicle with a driving track and a non-intersecting detection line can be quickly filtered through a quick rejection experiment, for example, when the coordinates of the first track point, the coordinates of the second track point and the coordinates of two end points of the detection line meet any one of the following conditions, the non-intersecting connection line of the first track point and the second track point and the detection line can be judged:
min(xpre,xcur)≤max(x1,x2);
min(x1,x2)≤max(xpre,xcur);
min(ypre,ycur)≤max(y1,y2);
min(y1,y2)≤max(ypre,ycur);
if the coordinates of the first track point, the coordinates of the second track point and the coordinates of the two end points of the detection line are not accordant with the conditions, a straddle experiment can be further carried out to judge whether the connecting line of the first track point and the second track point is intersected with the detection line. When the coordinates of the first track point, the coordinates of the second track point and the coordinates of the two end points of the detection line meet any one of the following conditions, the first track point and the second track point can be judged to be intersected, otherwise, the first track point and the second track point are judged to be not intersected;
((x1-xpre)(y1-ycur)-(x1-xcur)(y1-ypre))×
((x2-xpre)(y2-ycur)-(x2-xcur)(y2-ypre))≤0;
((xpre-x1)(ypre-y2)-(xpre-x2)(ypre-y1))×
((xcur-x1)(ycur-y2)-(xcur-x2)(ycur-y1))≤0;
based on the above determination conditions, the passing vehicle in each video frame can be determined.
Of course, when it is determined whether the driving track intersects with the detection, the driving track may be determined by using the track points of two adjacent frames, or the driving track may be determined by selecting the track points of two video frames with a certain frame number.
After the passing vehicle in each frame of video frame is determined, the coordinates of the intersection point of the running track of the passing vehicle and the detection line, the identification of the video frame at the intersection moment of the running track of the passing vehicle and the detection line, the passing time and other parameters can be recorded for subsequent use by a user.
And S206, clustering the passing vehicles, and determining the traffic flow index of the target intersection based on the clustering result.
After the passing vehicles passing through the detection line of the target intersection are determined, the determined passing vehicles can be clustered, and then the traffic flow index of the target intersection is determined based on the clustering result. Since the vehicles whose travel tracks intersect with the detection lines all pass through the target intersection and flow to the vehicles in all directions, the vehicles passing through the target intersection can be accurately detected, and then the vehicles can be further clustered to determine the number of the vehicles meeting various detection requirements. The detection requirement can be to detect the traffic flow of one or more lanes or to detect the traffic flow of one or more directions, so that the traffic flow of one or more lanes can be determined through clustering processing, or the traffic flow from the target intersection to one direction can be determined through clustering processing, so as to obtain various traffic flow indexes of the target intersection.
In some embodiments, the traffic flow indicator may be a traffic flow of one or more lanes of the target intersection, and when the passing vehicles are subjected to clustering processing and the traffic flow of the one or more lanes of the target intersection is determined based on a result of the clustering processing, the intersection points of the driving tracks of the passing vehicles and the detection lines may be subjected to clustering processing, and the traffic flow of each lane is determined based on a result of the clustering processing of the intersection points. The clustering processing on the intersection points may adopt a DBSCAN clustering algorithm, a K-means clustering algorithm, and the like, and the embodiment of the present disclosure is not limited.
For example, in some scenarios, the vehicles corresponding to the intersection points in each of the clustered categories may be directly used as vehicles in the same lane. Of course, directly employing the clustering result of the intersection as a result of lane partitioning the passing vehicles may be less accurate. In some embodiments, when determining the traffic flow of each lane, the intersection points of the driving tracks of the passing vehicles and the detection lines may also be clustered, so as to obtain one or more clusters, where each cluster corresponds to one or more cluster centers, which are hereinafter referred to as intersection cluster centers, and each intersection cluster center may represent a group, which is hereinafter referred to as a first group. After the intersection point cluster centers are determined, the distance between the intersection point of each passing vehicle and each intersection point cluster center can be respectively determined, and then the passing vehicles are divided into the first groups represented by the intersection point cluster centers closest to the intersection points. The distance between the intersection point and the intersection point clustering center can be a euclidean distance or other types of distances, and can be set according to actual requirements.
For example, assume that the intersection point of the vehicle track and the detection line is pvTwo cluster centers are each p ═ x, yc1=(x1,y1),pc2=(x2,y2) The first group to which the passing vehicle belongs may be determined according to equation (1):
max((x1-x)2+(y1-y)2,(x2-x)2+(y2-y)2) Formula (1)
I.e., the intersection is closest in distance to which intersection cluster center, the vehicle is classified into the first group represented by that intersection cluster center. After dividing each passing vehicle into the first groups represented by each intersection clustering center, the traffic flow of one or more lanes to be detected in the target intersection can be determined according to the lanes represented by each first group and the number of the passing vehicles in the first groups.
In some embodiments, the clustering operation on the intersection points of the driving tracks of the passing vehicles and the detection lines may be performed after a preset condition is triggered, where the preset condition may be that the number of the passing vehicles reaches a preset number threshold, or that the duration of the traffic video reaches a preset duration threshold. For example, in some embodiments, the passing vehicles in each frame of the video frame may be determined one by one, and the passing vehicles in each video frame may be accumulated, and when the accumulated passing vehicles reach a preset number threshold, the intersection points of the passing vehicles may be clustered, so as to obtain the traffic flow of each lane in a period of time. Of course, in some embodiments, the time length of the traffic video of the detected passing vehicle may also be counted, and when the time length reaches a preset time length threshold, the intersection points of the passing vehicles in the period of time are clustered to obtain the traffic flow of each lane in the period of time.
In some embodiments, as shown in fig. 4, the traffic flow indicator may be the traffic flow from the target intersection to different driving directions, for example, it is assumed that the vehicles joining the intersection via the target intersection may go straight, turn left, turn right, and turn around, so that the traffic flow to different directions needs to be counted to regulate and control the traffic flow based on the indicator. When the cross-line vehicles are clustered and the traffic flow from the target intersection to different directions is determined based on the clustering result, the coordinates of exit track points of each cross-line vehicle can be determined firstly, wherein the exit track points are the track points of the cross-line vehicles in the video frames of the cross-line vehicles detected last time in the traffic video, namely the track points of the cross-line vehicles at the moment when the cross-line vehicles exit the visual angle range of the image acquisition equipment. After the coordinates of the exit track points of each passing vehicle are determined, the exit track points of all the passing vehicles can be clustered based on the coordinates of the exit track points, and the traffic flow from the target intersection to each driving direction is determined based on the clustering result of the exit track points.
For example, in some embodiments, the clustering result of the exit track points may be directly used as the result of the driving direction division of the passing vehicle, for example, the vehicle corresponding to the exit track point in each category obtained by clustering is used as a vehicle in one driving direction, but the division result determined in this way is not very accurate.
In some embodiments, the exit trajectory points of the passing vehicle may be clustered to obtain one or more clusters, and a cluster center corresponding to each cluster, hereinafter referred to as an exit trajectory point cluster center, where each exit trajectory point cluster center represents a group, hereinafter referred to as a second group. Each second group may represent a driving direction category, for example, assuming that there are three driving directions of vehicles flowing out from the target intersection, such as straight driving, left turning, and right turning, three exit track point clustering centers and three second groups may be obtained, and the driving directions of the passing vehicles divided into each second group are straight driving, left turning, and right turning, respectively. After the exit track point clustering centers are obtained, the distances between the exit track points of the vehicles and the exit track point clustering centers can be respectively determined, and the vehicles are divided into a second group based on the distances, for example, the vehicles are divided into a second group represented by the exit track point clustering center closest to the exit track point. The amount of traffic traveling from the target intersection to a different direction of travel may then be determined based on the category of direction of travel represented by each second grouping and the number of passing vehicles in each second grouping.
In the related art, when a traffic flow is determined, generally, only a traffic flow of a certain lane can be determined, and the traffic flow in each driving direction from an intersection cannot be detected, that is, the traffic flow in the directions of turning around, and the like on a multifunctional lane cannot be detected. The method provided by the embodiment of the disclosure can determine the traffic flow from the target intersection to different directions, so as to better manage and control the traffic flow based on the traffic flow indexes.
In some embodiments, the direction of travel may include one or more of straight, left turn, right turn, or u-turn. Of course, the types of the driving directions can be set according to the specific conditions of the intersections, for example, the types of the driving directions are different for the intersections such as the crossroads, the T-shaped intersections, the intersections which can turn around and can not turn around. For intersections with more complicated road conditions, there may be more types of driving directions.
Since there may be an identification error when tracking and detecting the vehicle, which may cause an error in the tracking result, the determined vehicle driving track may also have an error. Since the exit track point clustering center is a reference for grouping the passing vehicles, and accurately determining the exit track point clustering center is a key for accurately grouping the passing vehicles, in some embodiments, before clustering the exit track points based on coordinates of the exit track points of the passing vehicles, the passing vehicles with abnormal traveling tracks can be filtered according to traveling track information of the passing vehicles, for example, the vehicles with abnormal traveling tracks can be vehicles with interruption of the traveling tracks. By removing the line passing vehicles with abnormal running tracks and clustering exit track points of the selected line passing vehicles with normal running tracks, exit point clustering centers are obtained and the line passing vehicles are grouped based on the exit track point clustering centers, so that the line passing vehicles can be grouped more accurately.
After dividing the passing vehicles into one or more second groups based on the distance between the passing vehicles and the exit track point clustering center, the driving direction category represented by each second group can be determined, for example, whether the second group represents a straight driving direction, a left turning direction or a right turning direction, so that the driving directions of the passing vehicles divided into the second groups can be determined. In some embodiments, the direction of travel represented by each second grouping may be determined based on the number of clustered exit track point cluster centers. For example, in some embodiments, if the number of the exit track point cluster centers is consistent with the number of the driving direction categories included in the target intersection, an included angle between a connecting line between the exit track point cluster center representing each second group and the center of the detection line and the detection line may be respectively determined, and then the driving direction represented by each second group may be determined based on the magnitude sorting result of the included angle. Generally, the relationship of the included angles between the connecting lines of the centers of the exit track points of the vehicles driving from the target intersection to the centers of the detection lines in all driving directions and the detection lines is constant, so that when the number of the exit track point clustering centers is consistent with that of the driving directions, it is indicated that all driving directions have line-passing vehicles, and therefore the driving directions represented by all second groups can be directly determined according to the sequencing result of the included angles between the connecting lines of the exit track point clustering centers representing the second groups and the centers of the detection lines and the detection lines. Of course, in some embodiments, the included angle may also be an included angle between the cluster center of the exit track point and the stop line of the target intersection, or the center of the zebra crossing, and may be specifically set according to an actual situation.
For example, in some embodiments, the direction of travel of a vehicle exiting a target intersection includes: the number of determined exit track point cluster centers is exactly 4, namely 4 second groups, when the driving direction represented by each second group is determined based on the size sorting result of the included angle between the exit point cluster center representing each second group and the detection line, the second groups can be sorted according to the sequence from small to large of the included angle, and the driving directions corresponding to the sorted second groups are sequentially as follows: turning around, turning right, going straight, turning left. For example, as shown in fig. 4, the traveling direction of a vehicle flowing out of a target intersection includes: the four directions of straight movement, left turning, right turning and turning around are shown in fig. 5, points in the graph represent exit track points of the passing vehicle, wherein the cluster center of the exit track points in the turning around direction is P1 (black points in the graph), the cluster center of the exit track points in the right turning direction is P2 (black points in the graph), the cluster center of the exit track points in the straight moving direction is P3 (black points in the graph), the cluster center of the exit track points in the left turning direction is P4 (black points in the graph), the center point of the detection line is P0, wherein the included angle between P1P0 and the detection line is θ 1, the included angle between P2P0 and the detection line is θ 2, the included angle between P3P0 and the detection line is θ 3, and the included angle between P4P0 and the detection line is θ 4, and it can be known from the graph that the sizes of the four included angles can follow the following rules: theta 1< theta 2< theta 3< theta 4, therefore, if the number of the exiting track point clustering centers is exactly four, namely, the passing vehicles can be divided into 4 second groups, namely, the traveling direction categories represented by the 4 second groups can be determined based on the sorting result of the included angles.
In some implementations, if the number of the exit point cluster centers is less than the number of the driving direction categories included in the target intersection, the driving direction categories represented by the second groups cannot be accurately determined only according to the size relationship between the connecting lines of the exit track point cluster centers representing the second groups and the center of the detection line and the included angle of the detection line. For example, assuming that the driving direction categories include four directions of turning around, turning right, going straight and turning left, and the number of the determined exit track point clustering centers is 2, that is, there are only 2 second groups, the driving direction categories represented by the two second groups cannot be accurately determined only according to the magnitude relation of the included angles between the connecting lines of the exit track point clustering centers representing the two second groups and the detection line centers representing the two second groups. For example, assuming that the included angles between the cluster centers of the exit track points representing the two second groups and the center of the detection line and the detection line are θ 1 and θ 2, respectively, and θ 1> θ 2, the driving direction categories represented by the two groups may be right turn and straight, or straight and left turn, and so on.
In this case, the traveling direction of the passing vehicle may be pre-determined based on the traveling locus of the passing vehicle to obtain a pre-determination result of the traveling direction of each passing vehicle, and then the traveling direction category represented by each second group may be determined with assistance based on the pre-determination result. For example, in some embodiments, for the passing vehicles in each of the second sub-groups after the division, the traveling direction category to which the passing vehicles in each of the second sub-groups belong may be determined based on the traveling track of the passing vehicles, and then a target traveling direction category may be determined from the traveling direction categories to which the passing vehicles in the second sub-groups belong, wherein the number of the passing vehicles in the target traveling direction category is greater than the number of the passing vehicles in the other traveling direction categories, and then the target traveling direction category is taken as the traveling direction category represented by the second sub-group.
For example, assume that exit trajectory points of passing vehicles are clustered to obtain four exit trajectory point clustering centers a, B, C, and D, and then the passing vehicles are classified into groups represented by the four clustering centers based on the distances between the passing vehicles and the clustering centers, and assume a group a, a group B, a group C, and a group D in this order, where IDs of the passing vehicles in the group a are {1, 2, 3, 4, and 5}, IDs of the passing vehicles in the group B are {6, 7, 8, and 9}, IDs of the passing vehicles in the group B are {10, 11, 12, 13, 14, and 15}, and IDs of the passing vehicles in the group D are {16, 17, 18, 19, and 20 }. To determine the travel direction category represented by each of group a, group B, group C, and group D (i.e., the travel direction of the vehicles within the group), the travel direction of the vehicles {1, 2, 3, 4, 5} passing through the group a may be determined based on their travel trajectories, e.g., vehicle 1 is turning left, vehicle 2 is turning left, vehicle 3 is turning left, vehicle 4 is going straight, vehicle 5 is turning right, where the greatest number of vehicles turning left may determine the travel direction represented by group a to be turning left.
In some embodiments, sets of passing vehicles of different driving direction categories may also be obtained based on the driving tracks of the passing vehicles, and then the driving direction category represented by the second grouping is determined based on the comparison result of the identifiers of the passing vehicles in each set and the identifiers of the passing vehicles in the second grouping. For example, assume that the traveling direction represented by the second group a is executed because the ID of the passing vehicle in the straight traveling direction based on the passing vehicle traveling locus information is {1, 2, 3, 4, 5}, the ID of the passing vehicle in the left turn direction is {6, 7, 8, 9}, and the vehicle ID of the second group a is {1, 2, 3, 4}, and the difference from the ID of the passing vehicle in the straight traveling direction is minimal.
In some embodiments, when the traveling direction of the passing vehicle is pre-determined based on the traveling tracks of the passing vehicles in each second sub-group to obtain the traveling direction category to which each passing vehicle in the second sub-group belongs, the traveling tracks of the passing vehicles may be linearly fitted, and the vehicle whose traveling direction is the straight traveling direction may be determined from the passing vehicles according to the linear fitting result. Since the running track of the vehicle in the straight running direction tends to be a straight line as a whole, the running direction of the passing vehicle in which the running track linear fitting result tends to be a straight line can be determined as the straight running direction.
In some embodiments, the running tracks of the passing vehicles may be linearly fitted, cosine similarity between the running tracks of the passing vehicles in the non-straight direction and the detection lines may be determined for the passing vehicles in the non-straight direction determined according to the results of the linear fitting, and then the passing vehicles in the left-turn direction and the passing vehicles in the right-turn direction may be determined from the non-straight vehicles according to the cosine similarity. For example, suppose the coordinates of the vehicle track point in the previous video frame of the current video frame are: p is a radical ofpre=(xpre,ypre) And the coordinates of the vehicle track points in the current video frame are as follows: p is a radical ofaf=(xaf,yaf) (ii) a The coordinates of two end points of the detection line are as follows: p is a radical of1=(x1,y1),p2=(x2,y2) Then, a vector characterizing the travel trajectory can be obtained:
Figure BDA0003152388700000212
vector characterizing detection line:
Figure BDA0003152388700000213
the cosine similarity between the driving track and the detection line can be calculated by the following formula (2):
Figure BDA0003152388700000211
after the cosine sum of the included angle of each non-straight-driving vehicle is obtained, whether each non-straight-driving vehicle is a left-turning vehicle or a right-turning vehicle can be preliminarily determined according to the cosine similarity. For example, if the cosine similarity is greater than the preset threshold, the turn is right, and if the cosine similarity is less than the preset threshold, the turn is left.
When the running track of the cross-line vehicle is subjected to linear fitting and the included angle between the running track of the vehicle and the detection line is determined, a frame extraction mode can be adopted, multiple frames of video frames are extracted at intervals, and the running track of the cross-line vehicle is determined based on track points of the cross-line vehicle on the extracted video frames.
Because the number of u-turn vehicles in the road is usually small, when clustering exit track points of the passing vehicles, the exit track points of the vehicles in the u-turn direction are usually used as noise points to be processed, so that the number of actually determined exit track point clustering centers is 1 less than the number of actually running directions. For example, assume that the direction of travel of a passing vehicle through a target intersection includes: the four directions of turning round, turning right, going straight, turning left, but because the vehicle quantity of turning round is few, is far less than the vehicle quantity of other several directions, therefore, when adopting clustering algorithm to withdraw from the track point and gather, can be handled as the noise point with the track point of withdrawing from of the vehicle that turns round usually to the final track point that withdraws from that obtains clustering center only has 3, can lead to missing the detection to the vehicle that turns round like this.
In order to solve such a problem, in some embodiments, if the number of exit trace point clustering centers is smaller than the number of traveling directions, it may be determined whether there is a u-turn vehicle in the cross-over vehicles first, and if not, the traveling direction represented by each exit trace point clustering center is determined based on a result of the pre-determination of the traveling direction of each cross-over vehicle. If so, all u-turn vehicles may be screened from the over-the-wire vehicles. Because the included angle between the driving track of the u-turn vehicle and the detection line tends to be 0 or less than 0, the included angle between the driving track of the passing vehicle and the detection line can be determined, the vehicles with the included angle less than or equal to 0 are screened out from the passing vehicles, and the driving direction of the vehicles with the included angle less than or equal to 0 is determined as the u-turn direction.
Then, for other non-u-turn vehicles, the driving direction of the vehicles can be further determined according to the driving direction category represented by the second group in which the other non-u-turn vehicles are located. The driving direction category represented by the second group may be determined based on the result of the ranking of the included angles in the above embodiment, or may be determined by combining the driving direction categories predicted by the driving trajectories of the vehicles in each group. For example, when the number of the driving directions included in the target intersection is 4, and the number of the exit track point clustering centers is 3, after the vehicles in the turning direction are screened out, for the remaining 3 second groups of passing vehicles, the sorting result of each second group can be determined based on the sorting result representing the included angle between the connection between the exit track point clustering centers of the 3 second groups and the detection line center. Of course, the traveling direction category of the passing vehicle in each second group may be predicted in conjunction with the traveling locus of the passing vehicle, and the traveling direction category represented by the second group may be determined based on the prediction result. Of course, when the number category of the traveling directions included in the target intersection is 4 and the number of the track point clustering centers is 2, after the vehicles with the turning directions are screened out, for the remaining 2 passing vehicles in the second group, the traveling direction category of the passing vehicles in each second group can be pre-judged according to the traveling tracks of the passing vehicles in each second group, and the traveling direction category represented by the second group is determined based on the pre-judged result.
After the traffic flow index of the target intersection is determined, the traffic flow can be further controlled based on the traffic flow index, for example, a traffic signal lamp can be controlled based on the traffic flow index, or the condition of road traffic can be analyzed based on the traffic flow index, for a road section with a large traffic flow, a measure for closing the road section can be taken, or the traffic flow condition of each lane can be updated to the user in real time, so that the user can avoid the congested road section according to the traffic flow condition. In some embodiments, traffic lights at the target intersection may be controlled based on the determined traffic flow indicator. For example, the time length of the traffic light at the target intersection can be regulated and controlled in real time according to the traffic flow in each driving direction, and if the traffic flow to a certain direction is large, the time length of the green light in the direction can be properly prolonged, and traffic problems such as traffic jam at the target intersection and the like can be avoided in time.
Corresponding to the above method, an embodiment of the present disclosure further provides an apparatus for determining a traffic flow indicator, as shown in fig. 6, the apparatus includes:
the acquiring module 61 is configured to acquire a detection result of tracking and detecting a plurality of vehicles in a traffic video, where the traffic video is a collected video of a target intersection, and the detection result includes information of driving tracks of the plurality of vehicles;
a processing module 62 for determining a passing vehicle from the plurality of vehicles based on the travel track information, the travel track of the passing vehicle intersecting detection lines covering one or more lanes of the target intersection;
and the clustering module 63 is used for clustering the passing vehicles and determining the traffic flow index of the target intersection based on the clustering result.
In some embodiments, the detection line coincides with the target intersection stop line or zebra crossing.
In some embodiments, the processing module, when determining a passing vehicle from the plurality of vehicles based on the travel track information, is specifically configured to:
determining a passing vehicle from vehicles of each frame of video frame of the traffic video based on the driving track information;
and accumulating the passing vehicles in each frame of video frame to obtain the passing vehicles in the plurality of vehicles.
In some embodiments, the driving trace information includes coordinates of trace points of the plurality of vehicles in different video frames of the traffic video, and the processing module is configured to, when determining a passing vehicle from vehicles in each frame of the video frame of the traffic video based on the driving trace information, specifically:
respectively executing the following operations for each frame of the current video frame:
determining the coordinates of a first track point of each vehicle in a current video frame and the coordinates of a second track point of each vehicle in a previous frame of the current video frame based on the running track information of each vehicle in the current video frame;
and under the condition that the connection line of the first track point and the second track point is intersected with the detection line according to the coordinates of the first track point, the coordinates of the second track point and the coordinates of the two end points of the detection line, determining the vehicle as a passing vehicle.
In some embodiments, the traffic flow indicator includes a vehicle flow of one or more lanes of the target intersection, the clustering module is configured to perform clustering processing on the passing vehicles, and when determining the traffic flow indicator of the target intersection based on a result of the clustering processing, the clustering module is specifically configured to:
clustering the intersection points of the running tracks of the over-line vehicles and the detection lines to obtain one or more intersection point clustering centers, wherein each intersection point clustering center represents a first group;
dividing the passing vehicles into the first group based on distances of the intersections of the passing vehicles from the one or more intersection cluster centers;
determining the traffic flow of one or more lanes of the target intersection based on the lane represented by each first group and the number of passing vehicles in each first group.
In some embodiments, the clustering operation of the intersection points of the driving tracks of the passing vehicles and the detection lines is performed after triggering of preset conditions, where the preset conditions include:
the number of the passing vehicles reaches a preset number threshold; and/or
And the time length of the traffic video reaches a preset time length threshold value.
In some embodiments, the traffic flow indicator includes vehicle flows driving from the target intersection to different driving directions, and the clustering module is configured to perform clustering processing on the passing vehicles, and when determining the traffic flow indicator of the target intersection based on a clustering result, the clustering module is specifically configured to:
clustering the exit track points to obtain one or more exit track point clustering centers, wherein the exit track points are track points of the cross-line vehicle detected in the video frame of the cross-line vehicle for the last time, and each exit track point clustering center represents a second sub-group;
partitioning the passing vehicle into the second group based on distances of exit trajectory points of the passing vehicle from the one or more exit trajectory point cluster centers;
and determining the traffic flow driving to different driving directions from the target intersection based on the driving direction category represented by each second group and the number of the passing vehicles in each second group.
In some embodiments, before the clustering process is performed on the exit track points, the apparatus is further configured to:
and filtering the line passing vehicles with abnormal running tracks based on the running track information of the line passing vehicles, wherein the line passing vehicles with abnormal running tracks comprise vehicles with an interruption phenomenon on the running tracks.
In some embodiments, the travel direction category represented by each second grouping is determined based on:
under the condition that the number of the one or more exit track point clustering centers is consistent with the number of the driving direction categories included by the target intersection, respectively determining an included angle between a connecting line representing each second group of exit track point clustering centers and the center of the detection line and the detection line;
and determining the driving direction category represented by each second sub-group based on the sorting result of the included angles.
In some embodiments, the travel direction category represented by each second group is determined based on:
determining a driving direction category to which each passing vehicle in each second grouping belongs based on the driving track of each passing vehicle in each second grouping under the condition that the number of the one or more exit point cluster centers is less than the number of the driving direction categories included by the target intersection;
determining a target driving direction category from the driving direction categories to which the over-line vehicles belong in the second sub-group, wherein the number of the over-line vehicles in the target driving direction category is greater than that of the over-line vehicles in other driving direction categories;
and taking the target driving direction category as the driving direction category represented by the second group.
In some embodiments, the method further comprises:
determining an included angle between a running track of the line passing vehicle and the detection line;
and determining the running direction of the wire passing vehicle with the included angle less than or equal to 0 as the turning direction.
In some embodiments, determining the driving direction category to which the over-line vehicles in each second sub-group belong based on the driving tracks of the over-line vehicles in each second sub-group comprises:
performing linear fitting on the driving track of the passing vehicle in each second sub-group;
and determining the over-line vehicles with the straight driving direction from the over-line vehicles in each second sub-group based on the linear fitting result.
In some embodiments, determining the driving direction category to which the over-line vehicles in each second sub-group belong based on the driving tracks of the over-line vehicles in each second sub-group comprises:
performing linear fitting on the running track of the over-line vehicle in each second sub-group, and determining the over-line vehicle with the running direction being a non-straight running direction based on the result of the linear fitting;
and determining the wire passing vehicles with the left turn driving direction and the wire passing vehicles with the right turn driving direction from the wire passing vehicles in the non-straight driving direction based on the cosine similarity between the driving tracks of the wire passing vehicles in the non-straight driving direction and the detection line.
In some embodiments, after determining the traffic flow at the target intersection, the apparatus is further configured to:
and controlling traffic signal lamps of the target intersection based on the traffic flow.
In addition, as shown in fig. 7, the electronic device includes a processor 71, a memory 72, and computer instructions stored in the memory 72 and executable by the processor 71, where the processor executes the computer instructions to implement the method according to any of the foregoing embodiments.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method of any of the foregoing embodiments.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
From the above description of the embodiments, it is clear to those skilled in the art that the embodiments of the present disclosure can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the embodiments of the present disclosure. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is only a specific embodiment of the embodiments of the present disclosure, and it should be noted that, for those skilled in the art, a plurality of modifications and decorations can be made without departing from the principle of the embodiments of the present disclosure, and these modifications and decorations should also be regarded as the protection scope of the embodiments of the present disclosure.

Claims (17)

1. A method of determining a traffic flow indicator, the method comprising:
acquiring detection results of tracking detection of a plurality of vehicles in a traffic video, wherein the traffic video is a collected video of a target intersection, and the detection results comprise running track information of the plurality of vehicles;
determining a passing vehicle from the plurality of vehicles based on the travel track information, wherein the travel track of the passing vehicle intersects detection lines covering one or more lanes of the target intersection;
and clustering the passing vehicles, and determining the traffic flow index of the target intersection based on the clustering result.
2. The method of claim 1, wherein the detection line coincides with the target intersection stop line or zebra crossing.
3. The method of claim 1 or 2, wherein determining a line-passing vehicle from the plurality of vehicles based on the travel track information comprises:
determining a passing vehicle from vehicles of each frame of video frame of the traffic video based on the driving track information;
and accumulating the passing vehicles in each frame of video frame to obtain the passing vehicles in the plurality of vehicles.
4. The method of any of claims 1-3, wherein the travel track information includes coordinates of track points of the plurality of vehicles in different video frames of the traffic video, and wherein determining a line-passing vehicle from the vehicles of each video frame of the traffic video based on the travel track information comprises:
respectively executing the following operations for each frame of the current video frame:
determining the coordinates of a first track point of each vehicle in a current video frame and the coordinates of a second track point of each vehicle in a previous frame of the current video frame based on the running track information of each vehicle in the current video frame;
and under the condition that the connection line of the first track point and the second track point is intersected with the detection line according to the coordinates of the first track point, the coordinates of the second track point and the coordinates of the two end points of the detection line, determining the vehicle as a passing vehicle.
5. The method according to any one of claims 1-4, wherein the traffic flow indicator comprises traffic flow of one or more lanes of the target intersection, clustering the passing vehicles, and determining the traffic flow indicator of the target intersection based on the clustering result comprises:
clustering the intersection points of the running tracks of the over-line vehicles and the detection lines to obtain one or more intersection point clustering centers, wherein each intersection point clustering center represents a first group;
dividing the passing vehicles into the first group based on distances of the intersections of the passing vehicles from the one or more intersection cluster centers;
determining the traffic flow of one or more lanes of the target intersection based on the lane represented by each first group and the number of passing vehicles in each first group.
6. The method of claim 5, wherein the clustering of the intersection points of the travel tracks of the passing vehicles and the detection lines is performed after triggering of preset conditions, wherein the preset conditions comprise:
the number of the passing vehicles reaches a preset number threshold; and/or
And the time length of the traffic video reaches a preset time length threshold value.
7. The method according to any one of claims 1-6, wherein the traffic flow indicator comprises traffic flow from the target intersection to different driving directions, the clustering the passing vehicles, and determining the traffic flow indicator of the target intersection based on the clustering result comprises:
clustering the exit track points to obtain one or more exit track point clustering centers, wherein the exit track points are track points of the cross-line vehicle detected in the video frame of the cross-line vehicle for the last time, and each exit track point clustering center represents a second sub-group;
partitioning the passing vehicle into the second group based on distances of exit trajectory points of the passing vehicle from the one or more exit trajectory point cluster centers;
and determining the traffic flow driving to different driving directions from the target intersection based on the driving direction category represented by each second group and the number of the passing vehicles in each second group.
8. The method of claim 7, wherein before clustering the exit track points, further comprising:
and filtering the line passing vehicles with abnormal running tracks based on the running track information of the line passing vehicles, wherein the line passing vehicles with abnormal running tracks comprise vehicles with an interruption phenomenon on the running tracks.
9. Method according to claim 7 or 8, characterized in that the travel direction category represented by each second sub-group is determined on the basis of:
under the condition that the number of the one or more exit track point clustering centers is consistent with the number of the driving direction categories included by the target intersection, respectively determining an included angle between a connecting line representing each second group of exit track point clustering centers and the center of the detection line and the detection line;
and determining the driving direction category represented by each second sub-group based on the sorting result of the included angles.
10. A method according to any of claims 7-9, characterized in that the travel direction category represented by each second sub-group is determined on the basis of:
determining a driving direction category to which each passing vehicle in each second grouping belongs based on the driving track of each passing vehicle in each second grouping under the condition that the number of the one or more exit point cluster centers is less than the number of the driving direction categories included by the target intersection;
determining a target driving direction category from the driving direction categories to which the over-line vehicles belong in the second sub-group, wherein the number of the over-line vehicles in the target driving direction category is greater than that of the over-line vehicles in other driving direction categories;
and taking the target driving direction category as the driving direction category represented by the second group.
11. The method of claim 10, further comprising:
determining an included angle between a running track of the line passing vehicle and the detection line;
and determining the running direction of the wire passing vehicle with the included angle less than or equal to 0 as the turning direction.
12. The method of claim 10, wherein determining the travel direction category to which the over-line vehicles in each second grouping belong based on the travel track of the over-line vehicles in each second grouping comprises:
performing linear fitting on the driving track of the passing vehicle in each second sub-group;
and determining the over-line vehicles with the straight driving direction from the over-line vehicles in each second sub-group based on the linear fitting result.
13. The method of any of claims 10-12, wherein determining the travel direction category to which the over-line vehicles in each second grouping belong based on the travel tracks of the over-line vehicles in each second grouping comprises:
performing linear fitting on the running track of the over-line vehicle in each second sub-group, and determining the over-line vehicle with the running direction being a non-straight running direction based on the result of the linear fitting;
and determining the wire passing vehicles with the left turn driving direction and the wire passing vehicles with the right turn driving direction from the wire passing vehicles in the non-straight driving direction based on the cosine similarity between the driving tracks of the wire passing vehicles in the non-straight driving direction and the detection line.
14. The method according to any one of claims 1-13, further comprising, after determining the traffic flow at the target intersection:
and controlling traffic signal lamps of the target intersection based on the traffic flow.
15. An apparatus for determining a traffic flow indicator, the apparatus comprising:
the system comprises an acquisition module, a tracking module and a tracking module, wherein the acquisition module is used for acquiring a detection result of tracking and detecting a plurality of vehicles in a traffic video, the traffic video is a collected video of a target intersection, and the detection result comprises the running track information of the plurality of vehicles;
a processing module to determine a passing vehicle from the plurality of vehicles based on the travel track information, wherein the travel track of the passing vehicle intersects detection lines covering one or more lanes of the target intersection;
and the clustering module is used for clustering the passing vehicles and determining the traffic flow index of the target intersection based on the clustering result.
16. An electronic device comprising a processor, a memory, and computer instructions stored in the memory for execution by the processor, wherein the processor, when executing the computer instructions, implements the method of any of claims 1-14.
17. A computer-readable storage medium having stored thereon computer instructions which, when executed, implement the method of any one of claims 1-14.
CN202110767463.0A 2021-07-07 2021-07-07 Method, device and equipment for determining traffic flow index and storage medium Pending CN113469075A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110767463.0A CN113469075A (en) 2021-07-07 2021-07-07 Method, device and equipment for determining traffic flow index and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110767463.0A CN113469075A (en) 2021-07-07 2021-07-07 Method, device and equipment for determining traffic flow index and storage medium

Publications (1)

Publication Number Publication Date
CN113469075A true CN113469075A (en) 2021-10-01

Family

ID=77879107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110767463.0A Pending CN113469075A (en) 2021-07-07 2021-07-07 Method, device and equipment for determining traffic flow index and storage medium

Country Status (1)

Country Link
CN (1) CN113469075A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114092915A (en) * 2021-11-26 2022-02-25 阿波罗智联(北京)科技有限公司 Intersection traffic flow verification method, device, equipment and storage medium
CN114485698A (en) * 2021-12-28 2022-05-13 武汉中海庭数据技术有限公司 Intersection guide line generating method and system
CN114998857A (en) * 2022-08-04 2022-09-02 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Lane traffic classification method and system based on machine vision
CN116884250A (en) * 2023-07-12 2023-10-13 凉山州交通运输应急指挥中心 Early warning method based on laser radar and expressway early warning system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114092915A (en) * 2021-11-26 2022-02-25 阿波罗智联(北京)科技有限公司 Intersection traffic flow verification method, device, equipment and storage medium
CN114485698A (en) * 2021-12-28 2022-05-13 武汉中海庭数据技术有限公司 Intersection guide line generating method and system
CN114485698B (en) * 2021-12-28 2023-11-28 武汉中海庭数据技术有限公司 Intersection guide line generation method and system
CN114998857A (en) * 2022-08-04 2022-09-02 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Lane traffic classification method and system based on machine vision
CN114998857B (en) * 2022-08-04 2022-10-25 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Lane traffic classification method and system based on machine vision
CN116884250A (en) * 2023-07-12 2023-10-13 凉山州交通运输应急指挥中心 Early warning method based on laser radar and expressway early warning system
CN116884250B (en) * 2023-07-12 2024-01-26 凉山州交通运输应急指挥中心 Early warning method based on laser radar and expressway early warning system

Similar Documents

Publication Publication Date Title
CN113469075A (en) Method, device and equipment for determining traffic flow index and storage medium
CN112069643B (en) Automatic driving simulation scene generation method and device
CN110717433A (en) Deep learning-based traffic violation analysis method and device
CN104537841A (en) Unlicensed vehicle violation detection method and detection system thereof
CN109101939B (en) Method, system, terminal and readable storage medium for determining vehicle motion state
CN110188482B (en) Test scene creating method and device based on intelligent driving
CN107886055A (en) A kind of retrograde detection method judged for direction of vehicle movement
Poddar et al. Automated traffic monitoring system using computer vision
CN109427191A (en) A kind of traveling detection method and device
CN106092123A (en) A kind of video navigation method and device
CN114333344A (en) Motor vehicle violation snapshot method and device and electronic equipment
CN111524350B (en) Method, system, terminal device and medium for detecting abnormal driving condition of vehicle and road cooperation
US20220237919A1 (en) Method, Apparatus, and Computing Device for Lane Recognition
Xiong et al. Vehicle re-identification with image processing and car-following model using multiple surveillance cameras from urban arterials
CN112447060A (en) Method and device for recognizing lane and computing equipment
CN114202936B (en) Traffic guidance robot and control method thereof
Azimjonov et al. Vision-based vehicle tracking on highway traffic using bounding-box features to extract statistical information
CN110610118A (en) Traffic parameter acquisition method and device
Ha et al. IMPROVED VEHICLES DETECTION & CLASSIFICATION ALGORITHM FOR TRAFFIC SURVEILLANCE SYSTEM.
CN114694370A (en) Method, device, computing equipment and storage medium for displaying intersection traffic flow
CN111931650A (en) Target detection model construction and red light running responsibility tracing method, system, terminal and medium
CN113095345A (en) Data matching method and device and data processing equipment
CN111832352A (en) Non-motor vehicle monitoring method, device and equipment and storage medium
CN115762126A (en) Scene screening method, device and equipment based on lane matching and storage medium
Namazi et al. Identifying and counting vehicles in multiple lanes by using a low-cost vehicle-mounted sensor for intelligent traffic management systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination