A vehicle collision detection method based on vision, intelligent terminal and storage medium
By detecting and tracking vehicles in traffic surveillance videos, using Mask R-CNN and abnormality index calculation methods, the vehicle collision accidents are detected quickly and accurately, and the problems of untimely and inaccurate detection in the prior art are solved, and efficient accidents are achieved Detection and analysis.
Patent Information
- Application Number
- CN202011169031.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-28
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2040-10-28
AI Technical Summary
The prior art is difficult to detect vehicle collision accidents in scenarios quickly and accurately, especially when processing massive traffic surveillance video data, the manual analysis task is large, and the existing algorithm is complex, which cannot meet the real-time requirements.
By detecting vehicles in traffic surveillance video, the vehicle is detected using Mask R-CNN deep neural network, and the vehicle is framed through a rectangular frame, outputting the vehicle rectangular border and vehicle number. Track the detected vehicles, determine whether the vehicle rectangular borders between vehicles overlap, and extract the vehicle's acceleration, trajectory and direction changes. When the vehicle rectangular borders overlap between vehicles, the abnormality index is calculated based on the extracted vehicle characteristics, and whether it is greater than the preset threshold value to determine whether it is a vehicle collision accident.
It realizes the rapid and accurate detection of vehicle collision accidents in the scene, which can effectively reduce the amount of manual analysis tasks and meet real-time requirements.
Smart Images

Figure CN112200131B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle detection, and in particular to a vision-based vehicle collision detection method, an intelligent terminal and a storage medium. Background Art
[0002] With the increase in the number of vehicles and traffic density in cities, the situation of urban road supervision has become increasingly severe. Traditional non-automatic traffic supervision methods require a lot of manpower and are also limited by the human eye's ability to distinguish and fatigue. The accident investigation effect is not ideal and the supervision efficiency is relatively low.
[0003] In recent years, with the rapid development of computer vision technology, urban intelligent transportation systems based on vision have emerged. By real-time monitoring of traffic flow, speed, and vehicle trajectory on the road, the intelligent transportation system can analyze the traffic conditions in the scene, detect abnormal events on the road, and then take corresponding dispatch and early warning measures. Compared with the traditional manual investigation method, vehicle abnormal behavior detection based on deep learning not only saves manpower and material resources, but also improves the accuracy of accident investigation.
[0004] Among many types of traffic abnormal events, vehicle collisions often represent the occurrence of traffic accidents. Whether timely responses can be made after the accident and corresponding rescue, evacuation and isolation measures can be taken greatly affects the survival rate of accident victims and the traffic conditions at the scene of the accident. Therefore, automatic, fast and accurate detection of collision accidents in traffic surveillance videos is one of the indispensable core capabilities of intelligent transportation systems. In addition, a huge amount of traffic surveillance video data is generated every year, and it is an extremely arduous task to find and analyze accidents in these data. By intelligently retrieving and detecting the parts of the massive videos where accidents occur, the amount of manual video analysis tasks can be greatly reduced.
[0005] In the prior art, a generative adversarial network (GAN) is used to predict the next frame of a video of four consecutive frames. During training, the generator is trained with normal video samples so that it can predict normal videos well. During testing, the error between the predicted frame generated by the generator for normal videos and the original video is small, while the generator cannot predict abnormal videos well, and there is a large error between its predicted frame and the original frame. Therefore, the error between the predicted frame and the original frame is used to detect abnormal behavior. The defect of this method is that the algorithm is designed on the assumption that the generator trained with limited normal samples can predict all normal samples well. However, it is impossible to collect all types of normal behaviors in reality, and the effect is not ideal for atypical normal samples. In addition, this method is an end-to-end abnormal behavior detection method based on deep learning, and the complex deep neural network structure makes the algorithm unable to meet the real-time requirements in practical applications.
[0006] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0007] The main purpose of the present invention is to provide a vision-based vehicle collision detection method, an intelligent terminal and a storage medium, aiming to solve the problem in the prior art that a vehicle collision accident in a scene cannot be detected quickly and accurately.
[0008] To achieve the above object, the present invention provides a vehicle collision detection method based on vision, and the vehicle collision detection method based on vision comprises the following steps:
[0009] Detect vehicles in traffic surveillance videos, frame them with rectangular frames, and output the vehicle rectangular frames and vehicle numbers;
[0010] Track the detected vehicles, determine whether the rectangular frames of the vehicles overlap, and extract the acceleration, trajectory, and direction changes of the vehicles;
[0011] When the rectangular frames of vehicles overlap, an abnormality index is obtained based on the extracted acceleration, trajectory and direction change of the vehicles, and it is determined whether the abnormality index is greater than a preset threshold;
[0012] When the abnormality index is greater than a preset threshold, it is determined to be a vehicle collision accident.
[0013] Optionally, in the vision-based vehicle collision detection method, the step of detecting a vehicle in a traffic monitoring video is as follows:
[0014] Use the Mask R-CNN deep neural network to detect vehicles in traffic surveillance videos.
[0015] Optionally, in the vision-based vehicle collision detection method, the step of tracking the detected vehicle specifically includes:
[0016] Calculating the centroid coordinates of the vehicle rectangular frame according to the width and height of the vehicle rectangular frame;
[0017] Calculate the Euclidean distance between the centroid coordinates of the vehicle rectangular bounding box of the newly detected vehicle and the centroid coordinates of the vehicle rectangular bounding box of the existing vehicle;
[0018] Update the center of mass coordinates of the existing vehicles based on the shortest Euclidean distance between the current set of center of mass and the previously stored center of mass;
[0019] Assign a new vehicle number to the newly detected vehicle and store the centroid coordinates;
[0020] Cancel the vehicle information that has disappeared in the current frame.
[0021] Optionally, in the vision-based vehicle collision detection method, the step of determining whether the rectangular frames of the vehicles overlap each other specifically includes:
[0022] Obtain the vehicle rectangular bounding box a and the vehicle rectangular bounding box b of vehicle A and vehicle B respectively, where x and y represent the centroid coordinates of the vehicle rectangular bounding box, and α and β represent the width and height of the vehicle rectangular bounding box, respectively;
[0023] Determine whether (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), thereby determining whether the vehicle rectangular frames of vehicle A and vehicle B overlap.
[0024] Optionally, in the vision-based vehicle collision detection method, the step of determining whether the vehicle rectangular frames of vehicle A and vehicle B overlap may further include:
[0025] When (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), the vehicle rectangular frames between vehicle A and vehicle B overlap;
[0026] The difference between the centroids of the rectangular frames of the same vehicle separated by a first preset number of frames is extracted as the vehicle's motion direction vector μ, whose modulus is Its normalized motion direction vector is
[0027] When |μ| is greater than the threshold, the normalized direction vector of the vehicle in each frame is stored; otherwise, it is not stored;
[0028] Assuming μ1 and μ2 are the direction vectors of the two vehicles with overlapping vehicle rectangular frames, the angle θ between the trajectories of the two vehicles is
[0029] If the video frame rate is set to FR, the time interval between two video frames is
[0030] Assume that the center of mass positions of the vehicle rectangular frame of the vehicle in the two frames separated by I frames are c1 and c2 respectively, then the speed of the vehicle is
[0031] Assuming the height of the image is H and the height of the vehicle rectangular detection box is h, the normalized speed of the vehicle is
[0032] In the two frames of images that are I frames apart, the speeds of the vehicles are and The vehicle's acceleration is
[0033] Optionally, the vision-based vehicle collision detection method, wherein obtaining an abnormality index based on the extracted acceleration, trajectory and direction change of the vehicle, and determining whether the abnormality index is greater than a preset threshold, specifically includes:
[0034] Calculate the average acceleration A of the second preset number of frames before the vehicle rectangular frame overlaps 前 and the maximum acceleration A of the second preset number of frames after the overlap occurs 后 , then A 后 and A 前 The difference is compared with the preset situation to determine the acceleration abnormality factor α;
[0035] If the vehicle rectangular frame overlaps, determine whether the angle of the vehicle trajectory satisfies θ∈(θ L ,θ H ), when yes, then the trajectory anomaly factor β is determined by the condition predefined by the value of θ;
[0036] calculating the angle (θ) of the vehicle relative to its own trajectory within a first preset number of frame intervals, and determining a change in the angle anomaly γ based on the angle of each vehicle according to a predefined condition;
[0037] The three independently determined abnormal factors are fitted into an abnormal function f(α, β, γ), the abnormal function f(α, β, γ) generates a score between 0 and 1, and it is determined whether the score is greater than a preset threshold.
[0038] Optionally, in the vision-based vehicle collision detection method, when the abnormality index is greater than a preset threshold, it is judged as a vehicle collision accident, specifically:
[0039] If the score is greater than a preset threshold, it is determined to be a vehicle collision accident.
[0040] Optionally, in the vision-based vehicle collision detection method, the step of determining whether the angle of the vehicle trajectory satisfies θ∈(θ L ,θ H ), and later:
[0041] When No, β is determined by the distance of the intersection of θ and the trajectory with a predefined set of conditions.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides an intelligent terminal, wherein the intelligent terminal includes: a memory, a processor, and a vision-based vehicle collision detection program stored in the memory and executable on the processor, wherein the vision-based vehicle collision detection program implements the steps of the vision-based vehicle collision detection method as described above when executed by the processor.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, wherein the storage medium stores a vision-based vehicle collision detection program, and when the vision-based vehicle collision detection program is executed by a processor, the steps of the vision-based vehicle collision detection method as described above are implemented.
[0044] The present invention detects vehicles in traffic monitoring videos, frames the vehicles in the traffic monitoring videos with rectangular frames, and outputs the vehicle rectangular frames and vehicle numbers; tracks the detected vehicles, determines whether the vehicle rectangular frames between the vehicles overlap, and extracts the acceleration, trajectory and direction changes of the vehicles; when the vehicle rectangular frames between the vehicles overlap, an abnormality index is obtained according to the extracted acceleration, trajectory and direction changes of the vehicles, and determines whether the abnormality index is greater than a preset threshold; when the abnormality index is greater than the preset threshold, it is determined to be a vehicle collision accident. The present invention achieves the purpose of vehicle collision accident detection by extracting and analyzing the acceleration, trajectory and direction characteristics of the vehicle, and comprehensively considering the three factors of the vehicle in terms of abnormal acceleration, abnormal trajectory and abnormal direction, and can quickly and accurately detect vehicle collision accidents in the scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of a preferred embodiment of the vehicle collision detection method based on vision of the present invention;
[0046] Figure 2 It is a flow chart of vehicle accident detection in a preferred embodiment of the vision-based vehicle collision detection method of the present invention;
[0047] Figure 3 Schematic diagram of the operating environment of a preferred embodiment of the intelligent terminal of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0049] The vehicle collision detection method based on vision described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the vision-based vehicle collision detection method includes the following steps:
[0050] Step S10: Detect vehicles in the traffic monitoring video, frame the vehicles in the traffic monitoring video with a rectangular frame, and output the vehicle rectangular frame and vehicle number.
[0051] Specifically, the present invention detects vehicles in traffic surveillance videos by using the Mask R-CNN deep neural network, wherein the Mask R-CNN deep neural network is a regional convolutional neural network that applies deep learning to target detection, and R-CNN is based on convolutional neural networks (CNN, Convolutional Neural Networks, is a type of feedforward neural network that includes convolution calculations and has a deep structure. The convolutional neural network has representation learning capabilities and can perform translation-invariant classification of input information according to its hierarchical structure, so it is also called a translation-invariant artificial neural network), linear regression, and support vector machine (SVM) and other algorithms to achieve target detection technology.
[0052] Furthermore, after a vehicle is detected in a traffic surveillance video, the vehicle in the traffic surveillance video is framed by a rectangular frame (i.e., the vehicle in the video image is completely framed by a rectangular frame), and then the vehicle rectangular frame (i.e., the rectangular frame that has framed the vehicle) and the vehicle number are output.
[0053] Step S20: Track the detected vehicles, determine whether the rectangular frames of the vehicles overlap, and extract the acceleration, trajectory and direction change of the vehicles.
[0054] Specifically, Figure 2As shown, when the detected vehicle is tracked, the centroid coordinates of the vehicle rectangular frame are calculated according to the width and height of the vehicle rectangular frame detected in step S10 (referring to the position of the points in the figure relative to the vertices in the geometric structure); the Euclidean distance between the centroid coordinates of the vehicle rectangular frame of the newly detected vehicle and the centroid coordinates of the existing vehicle rectangular frame is calculated (a commonly used distance definition, referring to the real distance between two points in m-dimensional space, or the natural length of a vector (i.e., the distance from the point to the origin), the Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points); the centroid coordinates of the existing vehicle are updated based on the current centroid set and the shortest Euclidean distance of the previously stored centroids; new vehicle numbers are assigned to the newly detected vehicles, and their centroid coordinates are stored; and the vehicle information that has disappeared in the current frame (i.e., vehicle target information) is cancelled.
[0055] Further, assuming that there are vehicles A and B, obtain the vehicle rectangular bounding box a and vehicle rectangular bounding box b of vehicle A and vehicle B respectively, where x and y represent the centroid coordinates of the vehicle rectangular bounding box, and α and β represent the width and height of the vehicle rectangular bounding box respectively; determine whether (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), thereby determining whether the vehicle rectangular frames of vehicle A and vehicle B overlap.
[0056] When (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), the vehicle rectangular frames of vehicle A and vehicle B overlap; otherwise, the vehicle rectangular frames of vehicle A and vehicle B do not overlap.
[0057] If there is overlap between the rectangular frames of the vehicles, the difference between the centroids of the rectangular frames of the same vehicle at every first preset number of frames (for example, the first preset number is 5, i.e. every 5 frames) is extracted as the moving direction vector μ of the vehicle, and its modulus is Its normalized motion direction vector is When |μ| is greater than the threshold, the normalized direction vector of the vehicle in each frame is stored; otherwise, it is not stored; let μ1 and μ2 be the direction vectors of two vehicles with overlapping vehicle rectangular frames, then the angle θ between the trajectories of the two vehicles is If the video frame rate is set to FR, the time interval between two video frames is Assume that the center of mass positions of the vehicle rectangular frame of the vehicle in the two frames separated by I frames are c1 and c2 respectively, then the speed of the vehicle is Assuming the height of the image is H and the height of the vehicle rectangular detection box is h, the normalized speed of the vehicle is In the two frames of images that are I frames apart, the speeds of the vehicles are and The vehicle's acceleration is
[0058] Step S30: When the rectangular frames of the vehicles overlap, an abnormality index is obtained based on the extracted acceleration, trajectory and direction change of the vehicles, and it is determined whether the abnormality index is greater than a preset threshold.
[0059] Specifically, the average acceleration A of a second preset number of frames (for example, the second preset number is 15) before the vehicle rectangular frames overlap is calculated. 前 and the maximum acceleration A of a second preset number of frames (for example, the second preset number is 15) after the overlap occurs 后 (i.e., calculate the average acceleration A of the 15 frames before the vehicle rectangular detection frame overlaps 前 The maximum acceleration A of 15 frames after the overlap occurs 后 ), then A 后 and A 前 The difference between the two values is compared with the preset value to determine the acceleration abnormality factor α; if the vehicle rectangular frame overlaps, determine whether the angle of the vehicle trajectory satisfies θ∈(θ L ,θ H ), when yes, the trajectory anomaly factor β is determined by the condition predefined by the θ value, and when no, β is determined by the distance between θ and the trajectory intersection and the predefined condition set; calculating the angle (θ) of the vehicle relative to its own trajectory within a first preset number of frames (for example, the first preset number is 5), and based on the angle of each vehicle, determining the change of the angle anomaly γ according to the predefined conditions; fitting the three separately determined anomaly factors into an anomaly function f(α, β, γ), the anomaly function f(α, β, γ) generates a score between 0 and 1, and judging whether the score is greater than a preset threshold (such as Figure 2 in T).
[0060] Step S40: When the abnormality index is greater than a preset threshold, it is determined to be a vehicle collision accident.
[0061] Specifically, the abnormal function f(α, β, γ) generates a score between 0 and 1. If the score is greater than a preset threshold (T), it is determined to be a vehicle collision accident, otherwise it is normal.
[0062] The present invention uses Mask R-CNN to detect vehicle targets in complex traffic scenes, providing a basis for subsequent vehicle motion feature extraction and collision accident detection. It extracts and analyzes the acceleration, trajectory and direction features of the vehicle respectively, and comprehensively considers the three factors of abnormal acceleration, abnormal trajectory and abnormal direction of the vehicle to achieve the purpose of vehicle collision accident detection. It can quickly and accurately detect vehicle collision accidents in the scene.
[0063] Furthermore, if Figure 3 As shown, based on the above-mentioned vision-based vehicle collision detection method, the present invention also provides a smart terminal accordingly, and the smart terminal includes a processor 10, a memory 20 and a display 30. Figure 3 Only some components of the smart terminal are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0064] In some embodiments, the memory 20 may be an internal storage unit of the smart terminal, such as a hard disk or memory of the smart terminal. In other embodiments, the memory 20 may also be an external storage device of the smart terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the smart terminal. Further, the memory 20 may also include both an internal storage unit of the smart terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the smart terminal, such as the program code of the smart terminal installed. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a vision-based vehicle collision detection program 40 is stored on the memory 20, and the vision-based vehicle collision detection program 40 can be executed by the processor 10, thereby realizing the vision-based vehicle collision detection method in the present application.
[0065] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the vision-based vehicle collision detection method.
[0066] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the smart terminal and to display a visual user interface. The components 10-30 of the smart terminal communicate with each other via a system bus.
[0067] In one embodiment, when the processor 10 executes the vision-based vehicle collision detection program 40 in the memory 20, the following steps are implemented:
[0068] Detect vehicles in traffic surveillance videos, frame them with rectangular frames, and output the vehicle rectangular frames and vehicle numbers;
[0069] Track the detected vehicles, determine whether the rectangular frames of the vehicles overlap, and extract the acceleration, trajectory, and direction changes of the vehicles;
[0070] When the rectangular frames of vehicles overlap, an abnormality index is obtained based on the extracted acceleration, trajectory and direction change of the vehicles, and it is determined whether the abnormality index is greater than a preset threshold;
[0071] When the abnormality index is greater than a preset threshold, it is determined to be a vehicle collision accident.
[0072] The detecting of vehicles in the traffic monitoring video is specifically:
[0073] Use the Mask R-CNN deep neural network to detect vehicles in traffic surveillance videos.
[0074] The step of tracking the detected vehicle specifically includes:
[0075] Calculating the centroid coordinates of the vehicle rectangular frame according to the width and height of the vehicle rectangular frame;
[0076] Calculate the Euclidean distance between the centroid coordinates of the vehicle rectangular bounding box of the newly detected vehicle and the centroid coordinates of the vehicle rectangular bounding box of the existing vehicle;
[0077] Update the center of mass coordinates of the existing vehicles based on the shortest Euclidean distance between the current set of center of mass and the previously stored center of mass;
[0078] Assign a new vehicle number to the newly detected vehicle and store the centroid coordinates;
[0079] Cancel the vehicle information that has disappeared in the current frame.
[0080] The step of determining whether the rectangular frames of the vehicles overlap each other specifically includes:
[0081] Obtain the vehicle rectangular bounding box a and the vehicle rectangular bounding box b of vehicle A and vehicle B respectively, where x and y represent the centroid coordinates of the vehicle rectangular bounding box, and α and β represent the width and height of the vehicle rectangular bounding box, respectively;
[0082] Determine whether (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), thereby determining whether the vehicle rectangular frames of vehicle A and vehicle B overlap.
[0083] The step of determining whether the rectangular borders of vehicles A and B overlap each other may include:
[0084] When (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), the vehicle rectangular frames between vehicle A and vehicle B overlap;
[0085] The difference between the centroids of the rectangular frames of the same vehicle separated by a first preset number of frames is extracted as the vehicle's motion direction vector μ, whose modulus is Its normalized motion direction vector is
[0086] When |μ| is greater than the threshold, the normalized direction vector of the vehicle in each frame is stored; otherwise, it is not stored;
[0087] Assuming μ1 and μ2 are the direction vectors of the two vehicles with overlapping vehicle rectangular frames, the angle θ between the trajectories of the two vehicles is
[0088] If the video frame rate is set to FR, the time interval between two video frames is
[0089] Assume that the center of mass positions of the vehicle rectangular frame of the vehicle in the two frames separated by I frames are c1 and c2 respectively, then the speed of the vehicle is
[0090] Assuming the height of the image is H and the height of the vehicle rectangular detection box is h, the normalized speed of the vehicle is
[0091] In the two frames of images that are I frames apart, the speeds of the vehicles are and The vehicle's acceleration is
[0092] The abnormality index is obtained according to the extracted acceleration, trajectory and direction change of the vehicle, and it is determined whether the abnormality index is greater than a preset threshold, specifically including:
[0093] Calculate the average acceleration A of the second preset number of frames before the vehicle rectangular frame overlaps 前 and the maximum acceleration A of the second preset number of frames after the overlap occurs 后 , then A 后 and A 前 The difference is compared with the preset situation to determine the acceleration abnormality factor α;
[0094] If the vehicle rectangular frame overlaps, determine whether the angle of the vehicle trajectory satisfies θ∈(θ L ,θ H ), when yes, then the trajectory anomaly factor β is determined by the condition predefined by the value of θ;
[0095] calculating the angle (θ) of the vehicle relative to its own trajectory within a first preset number of frame intervals, and determining a change in the angle anomaly γ based on the angle of each vehicle according to a predefined condition;
[0096] The three independently determined abnormal factors are fitted into an abnormal function f(α, β, γ), the abnormal function f(α, β, γ) generates a score between 0 and 1, and it is determined whether the score is greater than a preset threshold.
[0097] Wherein, when the abnormality index is greater than a preset threshold, it is judged as a vehicle collision accident, specifically:
[0098] If the score is greater than a preset threshold, it is determined to be a vehicle collision accident.
[0099] Wherein, the angle of the vehicle trajectory is determined to satisfy θ∈(θ L ,θ H ), and later:
[0100] When No, β is determined by the distance of the intersection of θ and the trajectory with a predefined set of conditions.
[0101] The present invention also provides a storage medium, wherein the storage medium stores a vision-based vehicle collision detection program, and when the vision-based vehicle collision detection program is executed by a processor, the steps of the vision-based vehicle collision detection method as described above are implemented.
[0102] In summary, the present invention provides a vehicle collision detection method based on vision, an intelligent terminal and a storage medium, the method comprising: detecting vehicles in a traffic monitoring video, framing the vehicles in the traffic monitoring video by a rectangular frame, and outputting the vehicle rectangular frame and the vehicle number; tracking the detected vehicles, judging whether the vehicle rectangular frames between the vehicles overlap, and extracting the acceleration, trajectory and direction change of the vehicles; when the vehicle rectangular frames between the vehicles overlap, obtaining an abnormality index according to the extracted acceleration, trajectory and direction change of the vehicles, judging whether the abnormality index is greater than a preset threshold; when the abnormality index is greater than the preset threshold, it is judged as a vehicle collision accident. The present invention achieves the purpose of vehicle collision accident detection by extracting and analyzing the acceleration, trajectory and direction characteristics of the vehicle, and comprehensively considering the three factors of the vehicle in terms of abnormal acceleration, abnormal trajectory and abnormal direction, and can quickly and accurately detect vehicle collision accidents in the scene.
[0103] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, an optical disk, etc.
[0104] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A vehicle collision detection method based on vision, characterized in that: The vision-based vehicle collision detection method comprises: Detect vehicles in traffic surveillance videos, frame them with rectangular frames, and output the vehicle rectangular frames and vehicle numbers; The detecting of vehicles in the traffic monitoring video is specifically: Use the Mask R-CNN deep neural network to detect vehicles in traffic surveillance videos; Track the detected vehicles, determine whether the rectangular frames of the vehicles overlap, and extract the acceleration, trajectory, and direction changes of the vehicles; The tracking of the detected vehicle specifically includes: Calculating the centroid coordinates of the vehicle rectangular frame according to the width and height of the vehicle rectangular frame; Calculate the Euclidean distance between the centroid coordinates of the vehicle rectangular bounding box of the newly detected vehicle and the centroid coordinates of the vehicle rectangular bounding box of the existing vehicle; Update the center of mass coordinates of the existing vehicles based on the shortest Euclidean distance between the current set of center of mass and the previously stored center of mass; Assign a new vehicle number to the newly detected vehicle and store the centroid coordinates; Cancel the vehicle information that has disappeared in the current frame; When the rectangular frames of vehicles overlap, an abnormality index is obtained based on the extracted acceleration, trajectory and direction change of the vehicles, and it is determined whether the abnormality index is greater than a preset threshold; The abnormality index is obtained according to the extracted acceleration, trajectory and direction change of the vehicle, and judging whether the abnormality index is greater than a preset threshold value specifically includes: Calculate the average acceleration Abefore of the second preset number of frames before the vehicle rectangular frames overlap and the maximum acceleration Abefore of the second preset number of frames after the overlap, and compare the difference between Abefore and Abefore with a preset situation to determine the acceleration abnormality factor α; If the vehicle rectangular frame overlaps, determine whether the angle of the vehicle trajectory satisfies θ∈(θ L ,θ H ); When no, the trajectory anomaly factor β is determined by the distance between θ and the predefined condition set and the distance between the trajectory intersection and the predefined condition set, and when yes, the trajectory anomaly factor β is determined by the condition predefined by the value of θ; calculating the angle of the vehicle relative to its own trajectory within a first preset number of frame intervals, and determining a change in the angle anomaly γ based on the angle of each vehicle according to a predefined condition; The three separately determined abnormal factors are fitted into an abnormal function f(α, β, γ), and the abnormal function f(α, β, γ) generates a score between 0 and 1, and determines whether the score is greater than a preset threshold, and comprehensively considers the three factors of acceleration abnormality, trajectory abnormality and direction abnormality of the vehicle to achieve the purpose of vehicle collision accident detection; When the abnormality index is greater than a preset threshold, it is determined to be a vehicle collision accident.
2. The vision-based vehicle collision detection method according to claim 1, characterized in that: The determining whether the rectangular frames of the vehicles overlap each other specifically includes: Obtain the vehicle rectangular bounding box a and the vehicle rectangular bounding box b of vehicle A and vehicle B respectively, where x and y represent the centroid coordinates of the vehicle rectangular bounding box, and α and β represent the width and height of the vehicle rectangular bounding box, respectively; Determine whether (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), thereby determining whether the vehicle rectangular frames of vehicle A and vehicle B overlap.
3. The vision-based vehicle collision detection method according to claim 2, characterized in that: The step of determining whether the rectangular frames of vehicles A and B overlap each other comprises: When (2×|x a -x b |<α a +α b )∧(2×|y a -y b |<β a +β b ), the vehicle rectangular frames between vehicle A and vehicle B overlap; The difference between the centroids of the rectangular frames of the same vehicle separated by a first preset number of frames is extracted as the vehicle's motion direction vector μ, whose modulus is Its normalized motion direction vector is When |μ| is greater than the threshold, the normalized direction vector of the vehicle in each frame is stored; otherwise, it is not stored; Assuming μ1 and μ2 are the direction vectors of the two vehicles with overlapping vehicle rectangular frames, the angle θ between the trajectories of the two vehicles is If the video frame rate is set to FR, the time interval between two video frames is Assume that the center of mass positions of the vehicle rectangular frame of the vehicle in the two frames separated by I frames are c1 and c2 respectively, then the speed of the vehicle is Assuming the height of the image is H and the height of the vehicle rectangular detection box is h, the normalized speed of the vehicle is In the two frames of images that are I frames apart, the speeds of the vehicles are and The vehicle's acceleration is 4. An intelligent terminal, characterized in that: The intelligent terminal includes: a memory, a processor, and a vision-based vehicle collision detection program stored in the memory and executable on the processor. When the vision-based vehicle collision detection program is executed by the processor, the steps of the vision-based vehicle collision detection method as described in any one of claims 1 to 3 are implemented.
5. A storage medium, characterized in that: The storage medium stores a vision-based vehicle collision detection program, and when the vision-based vehicle collision detection program is executed by the processor, the steps of the vision-based vehicle collision detection method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Video-based vehicle collision accident detection method and system
CN103226891A
Intersection traffic conflict discrimination method based on real-time vehicle track
CN111445699A
Cited By
Apparatus and method for processing vehicle accident video
KR102969745B1