Vehicle counting method, device, electronic equipment and storage medium
Through the classification and target detection and clustering of traffic characteristics, combined with time sliding window accumulation and vehicle tracking, the problems of low vehicle counting accuracy and weather impact in complex traffic scenarios are solved, and a vehicle counting method with high accuracy and real-time processing is achieved.
Patent Information
- Application Number
- CN202210836713.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-07-15
AI Technical Summary
The existing traffic monitoring technology has low accuracy in complex traffic scenarios and is susceptible to weather environment.
By obtaining the traffic characteristics of the road to be tested, classification, target detection and clustering are performed, combining time sliding window accumulation and vehicle tracking of different models, and integrating target similarity rules to deal with intermittent trajectory problems, realizing vehicle counting.
It realizes high-accurate vehicle counting in complex traffic scenarios, the detection performance is not affected by light and weather, the algorithm is low in complexity, and real-time processing can be completed on embedded devices.
Smart Images

Figure CN115147783B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of intelligent transportation technology, and in particular to a vehicle counting method, device, electronic device and storage medium. Background Art
[0002] With the rapid growth of the number of private cars in my country, the huge number of private vehicles has brought a series of problems to the construction and management of cities. The effective way to solve this problem is to build smart transportation, and smart transportation is a very critical part of building smart cities. The number of vehicles on the road, the speed of vehicles and other basic traffic information are the basic guarantee for building smart transportation. Therefore, how to monitor traffic conditions all day and all weather and obtain these basic traffic information is of great research significance.
[0003] The existing traffic monitoring technologies mainly include: (1) geomagnetic detection technology. This detection technology requires the sensor to be buried under the road surface. When a vehicle passes through the detection area, the sensor signal will change. The peripheral circuit and algorithm can be used to complete the traffic flow statistics. Its detection accuracy is relatively high; however, installation and maintenance require the destruction of the road surface, which is very inconvenient and costly, and also affects the normal operation of traffic. (2) video detection technology. The research on traffic monitoring technology based on video sensors is very extensive and the algorithm is mature. Due to the intuitiveness of video information, it is currently widely used in the field of transportation, mainly to measure the average speed of vehicles in a section of road, and to record vehicle violations at specific intersections or specific areas. In terms of vehicle detection and number statistics, its detection effect has a high accuracy rate under good conditions; however, in bad weather environments such as darkness, strong light and fog, its performance drops significantly. (3) Frequency detection technology mainly includes three detection methods: ultrasonic, infrared and microwave. Ultrasonic wave can realize all-weather detection based on the propagation and reflection principle of sound waves, and its detection accuracy is high. However, since the sensor must be installed on the ceiling, its application range is limited, so it can only detect one lane at a time. Infrared detection calculates the speed of the vehicle based on the time difference between the transmitting and receiving devices. It has high sensitivity, fast response speed and is insensitive to light. However, it is greatly affected by atmospheric temperature and humidity. Frequency detection is mainly the detection of radar sensors. The speed and distance of the target are calculated based on the time difference between the electromagnetic wave emitted by the radar antenna and the echo. If the multi-transmitter and multi-receiver radar also contains phase information, the angle information of the target can be calculated. It is sensitive to moving targets and can detect at a high frame rate. It can realize real-time speed measurement and is not affected by weather conditions such as strong light, fog and night. It is a true all-day and all-weather monitoring sensor. Summary of the invention
[0004] The present application provides a vehicle counting method, device, electronic device and storage medium, which can adapt to complex traffic scenarios and have high statistical accuracy; and the detection performance is not affected by light and weather, the algorithm complexity is low, and real-time processing can be completed on embedded devices.
[0005] In a first aspect, an embodiment of the present application provides a vehicle counting method, the method comprising:
[0006] Obtain the traffic characteristics of the tested road at each time;
[0007] Classifying the traffic characteristics of the tested road at each time to obtain the classification results of the traffic status of the tested road at each time; performing target detection and clustering on each instantaneous traffic status based on the classification results of the traffic status of the tested road at each time; and performing time sliding window accumulation based on the classification results of the traffic status of the tested road at each time to classify the traffic status of the tested road within a predetermined time period to obtain the classification results of the traffic status of the tested road within the predetermined time period;
[0008] Based on the classification results of the traffic state of the tested road within the predetermined time period and the target detection and clustering results, different models of vehicle tracking are performed on the traffic state within each predetermined time period to obtain the tracking results of the vehicles on the tested road;
[0009] According to the tracking results of the vehicles on the tested road, the target similarity rules are integrated and the track discontinuity problem is processed, and the vehicles on the tested road within the predetermined time period are counted.
[0010] In a second aspect, the embodiment of the present application further provides a vehicle counting device, the device comprising: an acquisition module, a classification module, a tracking module and a counting module; wherein:
[0011] The acquisition module is used to acquire the traffic characteristics of the tested road at various times;
[0012] The classification module is used to classify the traffic characteristics of the tested road at each time to obtain the classification results of the traffic status of the tested road at each time; based on the classification results of the traffic status of the tested road at each time, perform target detection and clustering on each instantaneous traffic status; and perform time sliding window accumulation based on the classification results of the traffic status of the tested road at each time, classify the traffic status of the tested road within a predetermined time period, and obtain the classification results of the traffic status of the tested road within the predetermined time period;
[0013] The tracking module is used to perform vehicle tracking of different models on the traffic state in each predetermined time period based on the classification result of the traffic state of the tested road in the predetermined time period and the target detection and clustering result, so as to obtain the tracking result of the vehicle on the tested road;
[0014] The counting module is used to count the vehicles on the tested road within the predetermined time period according to the tracking results of the vehicles on the tested road, integrating the target similarity rules and processing the trajectory discontinuity problem.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0016] one or more processors;
[0017] a memory for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle counting method described in any embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the vehicle counting method described in any embodiment of the present application is implemented.
[0020] The embodiment of the present application proposes a vehicle counting method, device, electronic device and storage medium, firstly obtains the traffic characteristics of the tested road at each moment; then classifies the traffic characteristics of the tested road at each moment, and obtains the classification results of the traffic status of the tested road at each moment; then based on the classification results of the traffic status of the tested road at each moment, performs target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment, performs time sliding window accumulation, classifies the traffic status of the tested road within a predetermined time period, and obtains the classification results of the traffic status of the tested road within the predetermined time period; then based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, performs vehicle tracking of different models on the traffic status within each predetermined time period, and obtains the tracking results of the vehicles on the tested road; finally, according to the tracking results of the vehicles on the tested road, integrates the target similarity rules and handles the trajectory discontinuity problem, and counts the vehicles on the tested road within the predetermined time period. That is to say, in the technical solution of the present application, the vehicles of the two-way multi-lane based on the multi-traffic status classification are counted. In the prior art, the detection accuracy is low and is easily affected by the weather environment. Therefore, compared with the prior art, the vehicle counting method, device, electronic device and storage medium proposed in the embodiment of the present application can adapt to complex traffic scenes and have a higher statistical accuracy; the detection performance is not affected by light and weather, the algorithm complexity is low, and real-time processing can be completed on embedded devices; and the technical solution of the embodiment of the present application is simple and convenient to implement, easy to popularize, and has a wider range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of a first process flow of a vehicle counting method provided in an embodiment of the present application;
[0022] Figure 2 A second flow chart of the vehicle counting method provided in an embodiment of the present application;
[0023] Figure 3 A third flow chart of the vehicle counting method provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a vehicle counting device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0027] Embodiment 1
[0028] Figure 1 This is a first flow chart of the vehicle counting method provided in the embodiment of the present application. The method can be executed by a vehicle counting device or electronic device. The device or electronic device can be implemented by software and / or hardware. The device or electronic device can be integrated in any smart device with network communication function. Figure 1 As shown, the vehicle counting method may include the following steps:
[0029] S101. Obtain traffic characteristics of the measured road at each time.
[0030] In this step, the electronic device can obtain the traffic characteristics of the measured road at each time. Specifically, the electronic device can first pre-process the echo signal of the radar at each time to obtain the distance angle spectrum of the measured road at each time; then calculate the traffic characteristics of the measured road at each time according to the distance angle spectrum of the measured road at each time.
[0031] S102, classifying the traffic characteristics of the tested road at each time to obtain the classification results of the traffic status of the tested road at each time; based on the classification results of the traffic status of the tested road at each time, performing target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each time, performing time sliding window accumulation, classifying the traffic status of the tested road within a predetermined time period, and obtaining the classification results of the traffic status of the tested road within the predetermined time period.
[0032] In this step, the electronic device can classify the traffic characteristics of the tested road at each moment, and obtain the classification results of the traffic status of the tested road at each moment; based on the classification results of the traffic status of the tested road at each moment, target detection and clustering are performed on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment, time sliding window accumulation is performed to classify the traffic status of the tested road within a predetermined time period, and the classification results of the traffic status of the tested road within the predetermined time period are obtained. That is, the embodiment of the present application can obtain the classification results of the traffic status within the predetermined time period after time sliding window and accumulation according to the classification results of the traffic status at the current moment. Specifically, when the electronic device classifies the traffic characteristics of the tested road at each moment, it can first count the number of effective peaks of the tested road within the predetermined time period according to the distance angle spectrum of the tested road at each moment; then calculate the minimum vehicle spacing and the second smallest vehicle spacing of the tested road within the predetermined time period; and then classify the traffic status of the tested road within the predetermined time period according to the number of effective peaks and the minimum vehicle spacing and the second smallest vehicle spacing.
[0033] S103, based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, the traffic status within each predetermined time period is tracked using different models to obtain the tracking results of the vehicles on the tested road.
[0034] In this step, the electronic device can track the traffic status of the road under test in each predetermined time period using different models based on the classification results of the traffic status of the road under test in the predetermined time period and the target detection and clustering results, and obtain the tracking results of the vehicle on the road under test. There are many methods for trajectory smoothing, such as the early classic tracking methods Meanshift, Particle Filter and Kalman Filter; taking the Kalman Filter algorithm as an example, based on the traffic status over a period of time, the vehicle motion model is divided into a uniform motion model and a uniform acceleration motion model. When congestion occurs, ST = 0, and the uniform acceleration motion state model is used for tracking. When non-congestion occurs, that is, ST = 1 or 2, the uniform motion state model is used for tracking.
[0035] S104: According to the tracking results of the vehicles on the tested road, the target similarity rules are integrated and the trajectory discontinuity problem is processed, and the vehicles on the tested road within a predetermined time period are counted.
[0036] In this step, the electronic device can count the vehicles on the measured road within a predetermined time period based on the tracking results of the vehicles on the measured road, integrating the target similarity rules and processing the trajectory discontinuity problem. Specifically, the electronic device can first perform target detection on the vehicles on the measured road within the predetermined time period based on the traffic state classification results to obtain the target detection results of the measured road within the predetermined time period; then perform point cloud clustering on the vehicles on the measured road within the predetermined time period based on the target detection results to obtain the point cloud clustering results of the measured road within the predetermined time period; and then count the vehicles on the measured road within the predetermined time period based on the point cloud clustering results of the measured road within the predetermined time period.
[0037] In complex traffic scenarios, the following situations may occur on the same road section: 1) Vehicles are slow and congested, with frequent acceleration and forced parking; 2) There are many vehicles, but there is no congestion, that is, heavy traffic; 3) Vehicles are too fast and the traffic volume is sparse; In the face of these traffic conditions, it is difficult to adapt to simply using a perception method. Starting from the complex traffic scene types, this application extracts corresponding features based on the acquired perception signals and classifies the traffic types; further, considering that under different traffic types, vehicles undergo multiple state changes within a period of time (1 second or several seconds); therefore, based on different traffic types, corresponding target detection, clustering, trajectory association, tracking and other algorithms are designed respectively, and finally the number of vehicles in two-way multi-lane traffic is counted under complex traffic.
[0038] The vehicle counting method proposed in the embodiment of the present application first obtains the traffic characteristics of the tested road at each moment; then classifies the traffic characteristics of the tested road at each moment to obtain the classification results of the traffic status of the tested road at each moment; then based on the classification results of the traffic status of the tested road at each moment, performs target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment, performs time sliding window accumulation, classifies the traffic status of the tested road within a predetermined time period, and obtains the classification results of the traffic status of the tested road within the predetermined time period; then based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, performs vehicle tracking of different models on the traffic status within each predetermined time period to obtain the tracking results of the vehicles on the tested road; finally, according to the tracking results of the vehicles on the tested road, integrates the target similarity rules and handles the trajectory discontinuity problem, and counts the vehicles on the tested road within the predetermined time period. That is to say, in the technical solution of the present application, the vehicles of the two-way multi-lane based on the multi-traffic status classification are counted. In the prior art, the detection accuracy is low and is easily affected by the weather environment. Therefore, compared with the prior art, the vehicle counting method proposed in the embodiment of the present application can adapt to complex traffic scenes and has a higher statistical accuracy; the detection performance is not affected by light and weather, the algorithm complexity is low, and real-time processing can be completed on embedded devices; and the technical solution of the embodiment of the present application is simple and convenient to implement, easy to popularize, and has a wider range of applications.
[0039] Embodiment 2
[0040] Figure 2 The second flow chart of the vehicle counting method provided in the embodiment of the present application is further optimized and expanded based on the above technical solution, and can be combined with the above optional implementation methods. Figure 2 As shown, the vehicle counting method may include the following steps:
[0041] S201 , pre-processing the radar echo signal at each time to obtain the distance angle spectrum of the measured road at each time.
[0042] In a specific embodiment of the present application, in order to obtain information of more dimensions, a multi-channel radar module can be selected, using a mode of 2 transmitting antennas and 4 receiving antennas, but not limited to the radar RF module. In this step, the radar echo data can be pre-processed first, including distance dimension FFT and DoA estimation, to obtain a distance angle spectrum. Since the traffic conditions of lanes in different directions may be different, the data in two directions (close to the radar direction and away from the radar direction) can be marked separately, and then the first area and the second area with high signal-to-noise ratio are selected for the two directions (for example, the radius R1 of the first area is 15m, and the radius R2 of the second area is 35m) for effective peak target detection, and then the number of effective peaks and the distance between the targets are counted respectively, and the number, the minimum spacing between targets and the second small spacing are used as features to judge whether the current traffic condition is congested and mark it. The second small spacing is added as a feature to avoid the small minimum spacing caused by vehicles driving side by side, thereby misjudging it as congestion, and improving the reliability of traffic type judgment. Based on the above traffic characteristics, the traffic type of the current frame is classified into instantaneous traffic status, traffic congestion is marked as ST=0, heavy traffic flow and sparse traffic flow are marked as ST=1 and ST=2 respectively; and they are classified into non-congested types in the types of instantaneous traffic status.
[0043] In a specific embodiment of the present application, based on the judgment of instantaneous traffic type, a period of accumulation is first performed, and then a period of traffic state judgment is performed for setting trajectory association and vehicle motion state model. The specific classification method and implementation are as follows: a) The number of effective peaks within the statistical range z k , calculate the distance z between every two vehicles dt (i); b) Find z dt (i) The minimum value z min1 and the next smallest value z min2 According to the traffic characteristics, the number of vehicles is 4 or more, the minimum distance between vehicles is 1 meter, and the second smallest distance is 1.5 meters, which is the characteristic of traffic congestion. Therefore, the target number threshold Th is set. peaks =4. Since the point with the largest amplitude among the scattered points of the vehicle target is extracted in the actual detection, the distance between the centers of the vehicles can be used as the reference minimum distance and the second smallest distance threshold Thd when setting the vehicle distance threshold. m1 =3.5 and Thd m2 =4. c) Use the following formula to determine whether the current instantaneous traffic state is congested: k Greater than or equal to Th peaks And z min1 Less than Thd m1 , ST=0; z k Greater than or equal to Th peaks And z min2Less than Thd m2 , ST=0. For the instantaneous traffic type, multiple frames are accumulated. This application adopts the frame number threshold frameThre=20, and the number of ST=0 is recorded as z w , set a threshold frameThre0, if z w If the traffic state is greater than this threshold, it is considered that the traffic state during this period is congested, that is, ST = 0; otherwise, the non-congested state is further classified and the number of non-congested occurrences is recorded as z t , set a threshold frameThre1, if z t If it is greater than this threshold, it is considered that the vehicles are sparse during this period, and it is judged as sparse vehicles, that is, ST = 2. Otherwise, z t If it is less than this threshold, it is determined that the traffic type during this period is heavy, but the vehicle is still in a normal driving state, that is, ST=1.
[0044] S202: Calculate the traffic characteristics of the measured road at each time according to the distance angle spectrum of the measured road at each time.
[0045] S203, classify the traffic characteristics of the tested road at each moment to obtain the classification results of the traffic status of the tested road at each moment; based on the classification results of the traffic status of the tested road at each moment, perform target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment and the target detection results and clustering results, classify the traffic status of the tested road within a predetermined time period to obtain the classification results of the traffic status of the tested road within the predetermined time period.
[0046] S204: Based on the classification result of the traffic state of the tested road within the predetermined time period, different models of vehicle tracking are performed on the traffic state within each predetermined time period to obtain the tracking result of the vehicle on the tested road.
[0047] S205 , according to the tracking results of the vehicles on the tested road, the target similarity rules are integrated and the trajectory discontinuity problem is processed, and the vehicles on the tested road within a predetermined time period are counted.
[0048] In this step, the electronic device can integrate the target similarity rules and process the trajectory discontinuity problem according to the tracking results of the vehicles on the measured road, and count the vehicles on the measured road within a predetermined time period. Specifically, the electronic device can first extract the centroid from the point cloud clustering results; then, according to the classification results of the traffic status of the measured road within the predetermined time period, set different trajectory association parameters and different vehicle tracking state models, and associate and track the extracted centroids; then, according to the trajectory association results and vehicle tracking results and the classification results of the traffic status of the measured road within the predetermined time period, integrate the target similarity rules and process the trajectory association trajectory discontinuity problem, and count the vehicles on the measured road within the predetermined time period; wherein, the processing of the trajectory association trajectory discontinuity problem includes trajectory similarity processing and the best trajectory segment selection method.
[0049] The vehicle counting method proposed in the embodiment of the present application first obtains the traffic characteristics of the tested road at each moment; then classifies the traffic characteristics of the tested road at each moment to obtain the classification results of the traffic status of the tested road at each moment; then based on the classification results of the traffic status of the tested road at each moment, performs target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment, performs time sliding window accumulation, classifies the traffic status of the tested road within a predetermined time period, and obtains the classification results of the traffic status of the tested road within the predetermined time period; then based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, performs vehicle tracking of different models on the traffic status within each predetermined time period to obtain the tracking results of the vehicles on the tested road; finally, according to the tracking results of the vehicles on the tested road, integrates the target similarity rules and handles the trajectory discontinuity problem, and counts the vehicles on the tested road within the predetermined time period. That is to say, in the technical solution of the present application, the vehicles of the two-way multi-lane based on the multi-traffic status classification are counted. In the prior art, the detection accuracy is low and is easily affected by the weather environment. Therefore, compared with the prior art, the vehicle counting method proposed in the embodiment of the present application can adapt to complex traffic scenes and has a higher statistical accuracy; the detection performance is not affected by light and weather, the algorithm complexity is low, and real-time processing can be completed on embedded devices; and the technical solution of the embodiment of the present application is simple and convenient to implement, easy to popularize, and has a wider range of applications.
[0050] Embodiment 3
[0051] Figure 3 The third flow chart of the vehicle counting method provided in the embodiment of the present application is further optimized and expanded based on the above technical solution, and can be combined with the above optional implementation methods. Figure 3As shown, the vehicle counting method may include the following steps:
[0052] S301 , pre-processing the radar echo signal at each time to obtain the distance angle spectrum of the measured road at each time.
[0053] S302: Calculate the traffic characteristics of the measured road at each time according to the distance angle spectrum of the measured road at each time.
[0054] S303: Count the number of effective peaks of the measured road within a predetermined time period according to the distance angle spectrum of the measured road at each time.
[0055] S304: Calculate the minimum vehicle spacing and the second minimum vehicle spacing on the tested road at each time.
[0056] S305: Classify the traffic status of the tested road at each time according to the number of effective peaks, the minimum vehicle distance and the second minimum vehicle distance.
[0057] S306: Based on the classification results of the traffic status of the tested road at each moment, target detection and clustering are performed on each instantaneous traffic status.
[0058] In a specific embodiment of the present application, since the present application is aimed at applications in two-way multi-lane complex traffic scenarios, target detection in a multi-target situation adopts an Order Statistics Constant False Alarm Rate (OS-CFAR) algorithm, the detector performs target detection and sets different detection reference units for traffic congestion and non-congestion based on the classification of instantaneous traffic status.
[0059] The embodiment of the present application is aimed at the situation that vehicles in congested state may be forced to stop, and the safe distance between vehicles is very short. According to observation, the limit of this empirical value is close to 1 meter, and in the experimental test radar parameters of the present application, the distance resolution dres of the ranging is 0.42 meters, and the angle resolution of the measurement is 1°. Therefore, the distance dimension reference unit is set to 2×dres, and the angle dimension reference unit is set to 2; for non-congested traffic conditions, the safe distance for normal driving of vehicles must be greater than 2 meters, so the distance dimension reference unit is set to 5×dres, and the angle dimension reference unit is set to 5.
[0060] S307: Perform time sliding window accumulation based on the classification results of the traffic status of the tested road at each time, classify the traffic status of the tested road within a predetermined time period, and obtain the classification results of the traffic status of the tested road within the predetermined time period.
[0061] In the embodiment of the present application, the clustering parameters are set as follows: ① For congested traffic conditions, the distance dimension eps r Set to dres, angle dimension cluster radius eps a Set to 2, Doppler clustering radius eps v Set to 2×vres; ② For non-congested traffic conditions, the distance dimension eps r Set to 4×dres, angle dimension cluster radius eps a Set to 2, Doppler clustering radius eps v Set to 5×vres; the minimum point number parameter MinPts of both classes is set to 3.
[0062] S308. Based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, different models of vehicle tracking are performed on the traffic status within each predetermined time period to obtain tracking results of the vehicles on the tested road.
[0063] S309: According to the tracking results of the vehicles on the tested road, the target similarity rules are integrated and the trajectory discontinuity problem is processed, and the vehicles on the tested road within a predetermined time period are counted.
[0064] The present application utilizes traffic status characteristics to classify instantaneous traffic status into three categories: congestion, heavy traffic, and light traffic; adopts the OS-CFAR algorithm and sets different reference units according to the instantaneous traffic status, thereby improving the accuracy of target detection and adaptability to traffic conditions; utilizes the distance, angle, and speed information of vehicle point clouds to perform a density clustering algorithm, and sets different clustering radii according to the instantaneous traffic status, thereby improving the accuracy of clustering; utilizes the traffic status characteristics of multiple frames to determine the traffic status within a period of time, and uses the traffic status within a period of time to set different trajectory association thresholds, thereby improving the accuracy of trajectory association; and utilizes the temporary start and end times of vehicles in congestion conditions to determine the traffic status within a period of time. Based on the characteristics of slow and fast lane changes, a variable speed motion state model is adopted for the vehicle. Under normal circumstances, the speed of the vehicle will not change in a very short time, so a uniform speed motion state model is adopted for the vehicle. The trajectory is smoothly tracked using Kalman filtering, and different motion state models are selected according to the traffic status over a period of time. According to the phenomenon that the trajectory of the same vehicle is cut into two or more segments in the detection area due to the forced parking of the vehicle, the trajectory is re-associated using the similarity of the trajectory. According to the problem of echo amplitude fluctuation caused by the rapid driving of the vehicle, the trajectory of a vehicle may form multiple trajectory segments, and the strategy of selecting the best trajectory segment is adopted to improve the accuracy of vehicle trajectory statistics.
[0065] In a specific embodiment of the present application, the method of trajectory association and trajectory establishment is described in detail as follows: a) First, the centroid of each cluster after clustering is calculated, and then each centroid point is used as the vehicle target; the centroid of the first entry into the detection area is used as the starting point of the trajectory; b) The centroid of subsequent entry into the detection area is associated with the known trajectory according to the continuity of the distance, angle and speed changes, and the association matrix A is established x ; c) Traverse all the current centroids, in the association matrix A x Find the minimum value of each column, denoted as X min d) The threshold value of the above trajectory association will be set based on the traffic status over a period of time; e) After traversing all the current centroids, all trajectories that do not have new points added are marked as C zero (i).
[0066] In the specific embodiment of the present application, similar trajectory discrimination, optimal trajectory segment extraction and pseudo trajectory discrimination: ① In view of the low signal-to-noise ratio that may cause missed detection when a vehicle is forced to stop in congestion, resulting in a vehicle being cut into multiple trajectory segments in the detection area, the traditional method directly counts the trajectory according to the length of the trajectory segment, which can effectively avoid the pseudo trajectory problem caused by noise. However, in this case, if the lengths of multiple trajectory segments meet the set trajectory length threshold, it is possible that the same vehicle will be counted multiple times, and if the lengths of multiple trajectory segments just meet the set trajectory threshold, the vehicle will not be counted. Therefore, multiple trajectory segments are compared for similarity, and the best trajectory segment is extracted as the trajectory count to improve the accuracy of vehicle counting. Specifically, mark the end points of all trajectories, extract the distance feature of the last point of the end of the trajectory, and if it is within 2 / 3 of the radar detection area, put this trajectory into the to-be-matched trajectory library; then, for the trajectory whose starting point is after 2 / 3 of the detection area, make a similarity judgment with the to-be-matched trajectory library, the distance correlation is within 2 meters, the speed change is within 8m / s, and the time correlation is within 100 frames, that is, 5 seconds; if all are satisfied, it is considered that these two trajectories are two trajectories generated by the same vehicle being forced to stop due to congestion, and extract the longest similar trajectory segment as the optimal trajectory segment. ② In view of the amplitude fluctuation problem that may occur when a vehicle is driving fast, resulting in a vehicle being cut into multiple trajectory segments in the detection area, similarly, multiple trajectory segments are compared for similarity in the case of congestion, and the best trajectory segment is extracted as the trajectory count to improve the accuracy of vehicle counting. Specifically, traffic conditions are different and traffic behaviors vary greatly, so the settings of the association parameters are also different. The distance association is set within 10 meters, the speed change is within 2m / s, and the time association is within 20 frames, that is, 1 second. If all of them are met, the two trajectories are determined to be similar trajectory segments; the longest similar trajectory segment is extracted as the optimal trajectory segment.
[0067] In the specific embodiment of the present application, the number of vehicles in two-way multi-lane is counted: the trajectory of a vehicle is not associated with a new point in the current frame, and it is marked C zero (i) If the trajectory is not associated for ten consecutive frames, it is considered that the trajectory has ended and is added to the trajectory library. Furthermore, the trajectory length is determined and false trajectories are removed (for example, the shortest trajectory length is set to 8 meters). Then, trajectory similarity judgment and optimal trajectory segment extraction are performed. Finally, the number of valid trajectories is counted and the number of vehicles that meet the valid trajectory is increased by one.
[0068] In the complex traffic scenarios of this algorithm, the minimum accuracy of this application can reach 84.5%, the average accuracy of the direction of vehicles approaching the radar can reach 90%, the average accuracy of the direction away from the radar can reach 93.4%, and the overall average accuracy of the two directions can reach 92.4%. In addition, the similar trajectory judgment and optimal trajectory segment extraction strategies adopted increase the overall average accuracy by 4 percentage points; when this method is applied to ordinary traffic scenarios, the overall average accuracy can reach more than 95%; therefore, this application has adaptability and robustness to traffic scenarios.
[0069] Compared with the existing technologies, the advantages of this application are: (1) Compared with the existing geomagnetic detection technology, this method has the advantages of convenient and flexible installation and maintenance, and will not affect roads and traffic; compared with the existing video detection technology, this method has the advantages of not being affected by weather, light and environmental changes, being able to work all day and all weather, and being able to measure the instantaneous speed of vehicles; compared with the existing radar-based traffic monitoring technology, such as the number of vehicles and vehicle speed, the existing technology mainly measures the traffic flow in a single direction or one or two lanes, while this method can realize the traffic flow statistics of multiple lanes in two directions and obtain the speed information of vehicles at the same time. (2) This application counts the traffic flow based on the trajectory characteristics of the vehicle. Under the condition of high accuracy under general traffic conditions, in order to adapt to complex traffic scenes, the traffic state is classified based on traffic characteristics, and different parameters and strategies are designed for subsequent target detection, clustering, tracking and trajectory number statistics based on the type of traffic state. This application is more adaptable to changes in traffic conditions.
[0070] The vehicle counting method proposed in the embodiment of the present application first obtains the traffic characteristics of the tested road at each moment; then classifies the traffic characteristics of the tested road at each moment to obtain the classification results of the traffic status of the tested road at each moment; then based on the classification results of the traffic status of the tested road at each moment, performs target detection and clustering on each instantaneous traffic status; and based on the classification results of the traffic status of the tested road at each moment, performs time sliding window accumulation, classifies the traffic status of the tested road within a predetermined time period, and obtains the classification results of the traffic status of the tested road within the predetermined time period; then based on the classification results of the traffic status of the tested road within the predetermined time period and the target detection and clustering results, performs vehicle tracking of different models on the traffic status within each predetermined time period to obtain the tracking results of the vehicles on the tested road; finally, according to the tracking results of the vehicles on the tested road, integrates the target similarity rules and handles the trajectory discontinuity problem, and counts the vehicles on the tested road within the predetermined time period. That is to say, in the technical solution of the present application, the vehicles of the two-way multi-lane based on the multi-traffic status classification are counted. In the prior art, the detection accuracy is low and is easily affected by the weather environment. Therefore, compared with the prior art, the vehicle counting method proposed in the embodiment of the present application can adapt to complex traffic scenes and has a higher statistical accuracy; the detection performance is not affected by light and weather, the algorithm complexity is low, and real-time processing can be completed on embedded devices; and the technical solution of the embodiment of the present application is simple and convenient to implement, easy to popularize, and has a wider range of applications.
[0071] Embodiment 4
[0072] Figure 4 This is a schematic diagram of the structure of the vehicle counting device provided in the embodiment of the present application. Figure 4 As shown, the vehicle counting device includes: an acquisition module 401, a classification module 402, a tracking module 403 and a counting module 404; wherein,
[0073] The acquisition module 401 is used to acquire the traffic characteristics of the tested road at each time;
[0074] The classification module 402 is used to classify the traffic characteristics of the tested road at each time to obtain the classification results of the traffic status of the tested road at each time; based on the classification results of the traffic status of the tested road at each time, perform target detection and clustering on each instantaneous traffic status; and perform time sliding window accumulation based on the classification results of the traffic status of the tested road at each time, classify the traffic status of the tested road within a predetermined time period, and obtain the classification results of the traffic status of the tested road within the predetermined time period;
[0075] The tracking module 403 is used to perform vehicle tracking of different models on the traffic state in each predetermined time period based on the classification result of the traffic state of the tested road in the predetermined time period and the target detection and clustering result, so as to obtain the tracking result of the vehicle on the tested road;
[0076] The counting module 404 is used to count the vehicles on the measured road within the predetermined time period according to the tracking results of the vehicles on the measured road, integrating the target similarity rule and processing the trajectory discontinuity problem.
[0077] Furthermore, the acquisition module 401 is specifically used to pre-process the echo signal of the radar at each moment to obtain the distance angle spectrum of the measured road at each moment; and calculate the traffic characteristics of the measured road at each moment based on the distance angle spectrum of the measured road at each moment.
[0078] Furthermore, the classification module 402 is specifically used to count the number of effective peaks of the tested road within a predetermined time period according to the distance angle spectrum of the tested road at each time; calculate the minimum vehicle spacing and the second smallest vehicle spacing of the tested road at each time; and classify the traffic status of the tested road at each time according to the number of effective peaks and the minimum vehicle spacing and the second smallest vehicle spacing.
[0079] The above vehicle counting device can execute the method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the vehicle counting method provided by any embodiment of the present application.
[0080] Embodiment 5
[0081] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present application is shown. Figure 5 The electronic device 12 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0082] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0083] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0084] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0085] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0086] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0087] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0088] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the vehicle counting method provided in the embodiment of the present application.
[0089] Embodiment 6
[0090] An embodiment of the present application provides a computer storage medium.
[0091] The computer-readable storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0092] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0093] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0094] Computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0095] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A vehicle counting method, characterized in that: The method comprises: Obtain the traffic characteristics of the tested road at each time; Classifying the traffic characteristics of the tested road at various times to obtain classification results of the traffic status of the tested road at various times; based on the classification results of the traffic status of the tested road at various times, performing target detection on the vehicles of the tested road at various times to obtain target detection results of the tested road at various times; performing point cloud clustering on the vehicles of the tested road at various times based on the target detection results to obtain point cloud clustering results of the tested road at various times; and performing time sliding window accumulation based on the classification results of the traffic status of the tested road at various times to classify the traffic status of the tested road within a predetermined time period to obtain classification results of the traffic status of the tested road within the predetermined time period; Based on the classification results of the traffic state of the tested road within the predetermined time period and the target detection and clustering results, a vehicle motion model is used to track vehicles of different models for the traffic state within each predetermined time period to obtain tracking results of the vehicles on the tested road; wherein the vehicle motion model includes a uniform motion model and a uniform acceleration motion model; The centroid is extracted from the point cloud clustering result; different trajectory association parameters and different vehicle tracking state models are set according to the classification result of the traffic state of the measured road within the predetermined time period, and the vehicle trajectory is associated and tracked for the extracted centroid; according to the trajectory association result and the vehicle tracking result and the classification result of the traffic state of the measured road within the predetermined time period, the target similarity rule is integrated and the trajectory association discontinuity problem is processed, and the vehicles on the measured road within the predetermined time period are counted; wherein the processing of the trajectory association discontinuity problem includes trajectory similarity processing and optimal trajectory segment selection method.
2. The method according to claim 1, characterized in that Obtain the traffic characteristics of the tested road at each time, including: Preprocessing the radar echo signal at each time to obtain the distance angle spectrum of the measured road at each time; The traffic characteristics of the measured road at each moment are calculated according to the distance angle spectrum of the measured road at each moment.
3. The method according to claim 2, characterized in that Classifying the traffic status of the tested road at each time, including: According to the distance angle spectrum of the measured road at each time, counting the number of effective peaks of the measured road within a predetermined time period; Calculating the minimum vehicle spacing and the second minimum vehicle spacing of the measured road at each time; The traffic status of the tested road at each time is classified according to the number of the effective peaks, the minimum vehicle distance and the second minimum vehicle distance.
4. A vehicle counting device, characterized in that: The device comprises: an acquisition module, a classification module, a tracking module and a counting module; wherein, The acquisition module is used to acquire the traffic characteristics of the tested road at various times; The classification module is used to classify the traffic characteristics of the tested road at various times to obtain the classification results of the traffic status of the tested road at various times; based on the classification results of the traffic status of the tested road at various times, perform target detection on the vehicles on the tested road at various times to obtain the target detection results of the tested road at various times; perform point cloud clustering on the vehicles on the tested road at various times based on the target detection results to obtain the point cloud clustering results of the tested road at various times; and perform time sliding window accumulation based on the classification results of the traffic status of the tested road at various times to classify the traffic status of the tested road within a predetermined time period to obtain the classification results of the traffic status of the tested road within the predetermined time period; The tracking module is used to perform vehicle tracking of different models on the traffic state in each predetermined time period using a vehicle motion model based on the classification result of the traffic state of the tested road in a predetermined time period and the target detection and clustering result, so as to obtain the tracking result of the vehicle on the tested road; wherein the vehicle motion model includes a uniform motion model and a uniform acceleration motion model; The counting module is used to extract the centroid from the point cloud clustering result; according to the classification result of the traffic state of the measured road in the predetermined time period, different trajectory association parameters and different vehicle tracking state models are set to associate and track the extracted centroid with the vehicle trajectory; according to the trajectory association result and the vehicle tracking result and the classification result of the traffic state of the measured road in the predetermined time period, the target similarity rule is integrated and the trajectory association trajectory discontinuity problem is processed, and the vehicles on the measured road in the predetermined time period are counted; wherein the processing of the trajectory association trajectory discontinuity problem includes trajectory similarity processing and optimal trajectory segment selection method.
5. The device according to claim 4, characterized in that The acquisition module is specifically used to pre-process the echo signal of the radar at each moment to obtain the distance angle spectrum of the measured road at each moment; and calculate the traffic characteristics of the measured road at each moment according to the distance angle spectrum of the measured road at each moment.
6. The device according to claim 5, characterized in that The classification module is specifically used to count the number of effective peaks of the tested road within a predetermined time period according to the distance angle spectrum of the tested road at each time; calculate the minimum vehicle spacing and the second smallest vehicle spacing of the tested road at each time; and classify the traffic status of the tested road at each time according to the number of effective peaks and the minimum vehicle spacing and the second smallest vehicle spacing.
7. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle counting method according to any one of claims 1 to 3.
8. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the vehicle counting method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Road vehicle tracking method and system based on attention mechanism and multi-target tracking
CN114627447A
Trajectory prediction method and apparatus
WO2022001773A1