Traffic accident detection method and electronic equipment

Through the multi-objective detection and tracking algorithm, combining the vehicle's static duration, driving status and movement trajectory intersection, traffic accidents are judged, which solves the problem of low accuracy in traffic accident detection in the existing technology and improves the accuracy of accident identification.

CN119323746APending Publication Date: 2025-01-17QINGDAO HISENSE TRANS TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310876941.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-17
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

In the scenes of urban traffic intersections, the accuracy of traffic accident detection is low, and it is greatly affected by inconsistent story characteristics and scene interference factors.

Method used

The multi-objective detection and tracking algorithm is used to determine the location information of each vehicle and pedestrian in a continuous video frame. The accident probability is calculated based on the vehicle's rest time, driving state and the state of intersecting with other vehicles, and the presence of surrounding pedestrians. And determine whether a traffic accident occurred.

Benefits of technology

It improves the accuracy of traffic accident detection and can more accurately identify traffic accidents, especially in complex urban traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323746A_ABST
    Figure CN119323746A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic accident detection method and electronic equipment, and the method comprises the steps: determining the position information of vehicles and pedestrians in a plurality of continuous video frames, determining the static duration of the vehicles according to the duration of adjacent frames and the position information of the vehicles in the video frames, screening the vehicles with the static duration greater than a first preset duration, and outputting the screened vehicles. Determining the accident probability according to the driving state of the screened vehicle before the vehicle is static, the intersection state with the motion trails of other vehicles and the existence state of surrounding pedestrians, and if the accident probability is greater than a preset probability, and the target vehicle is in a static state, the initial position of the pedestrian in the video frame is within a preset range with the target vehicle as the center. If so, determining that an accident occurs. Whether an accident occurs or not is judged based on the motion state of the vehicle before the vehicle is static, the intersection state of the vehicle and the motion trails of other vehicles, the surrounding pedestrian existence state and whether the initial position of the pedestrian in the static state is within the preset range with the vehicle as the center or not, and therefore the accuracy of accident detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The rapid reporting and handling of police incidents is the core business of urban traffic management, and traffic accidents are the type of police incidents that traffic police pay the most attention to. How to quickly and accurately identify traffic accidents is of great significance.

[0003] With existing technologies, event detectors can be used to proactively warn about traffic accidents. The event detectors are connected to front-end real-time video surveillance, and target detection and tracking are performed based on deep learning algorithms. Certain intelligent analysis rules are configured in the system to output relevant abnormal event alarm information. This method has become the mainstream technical means in the current industry, but due to the inconsistency of accident event characteristics and interference factors in coverage scenarios, the accident detection effect is poor, especially in the scene of urban traffic intersections, where the accuracy of traffic accident detection is low due to the influence of pedestrians crossing the street, parking in the waiting area, and mixed traffic of vehicles and non-motor vehicles. Summary of the invention

[0004] The present invention provides a traffic accident detection method and electronic equipment, which are used to solve the problem of low traffic accident detection accuracy in the prior art.

[0005] In a first aspect, the present application provides a traffic accident detection method, the method comprising:

[0006] Adopt multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames;

[0007] For each vehicle, determine the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame;

[0008] Vehicles whose stationary time is greater than a first preset time are taken as target vehicles, and for each target vehicle, the accident probability is determined according to the driving state of the target vehicle before it comes to a stop, the intersection state of the target vehicle's motion trajectories with other vehicles, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

[0009] In a possible implementation, determining the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame includes:

[0010] Determining the driving state of the vehicle according to the duration of the adjacent frames and the position information of the vehicle in each video frame;

[0011] The stationary time length of the vehicle is determined according to the adjacent frame time lengths and the number of consecutive frames when the vehicle is in a stationary state.

[0012] In a possible implementation, determining the driving state of the vehicle according to the adjacent frame durations and the position information of the vehicle in each video frame includes:

[0013] For each group of adjacent video frames, determine the adjacent displacement distance according to the position information of the vehicle in the adjacent video frames; and use the ratio of the adjacent displacement distance to the duration of the adjacent frames as the adjacent movement speed of the vehicle;

[0014] If the adjacent moving speeds are within a preset speed range, it is determined that the driving state of the vehicle is a stationary state; otherwise, it is determined that the driving state of the vehicle is a moving state.

[0015] In a possible implementation, determining the accident probability according to the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle includes:

[0016] Normalizing the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle to obtain normalized first, second, and third characteristic parameters;

[0017] The sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

[0018] In a possible implementation, before determining the accident probability, the process further includes:

[0019] If it is determined that the driving state of the target vehicle before it comes to rest is a moving state, it is determined that the moving time length of the target vehicle in the moving state is greater than a second preset time length.

[0020] In a possible implementation, the intersection state of the target vehicle and the motion trajectory of other vehicles is determined by:

[0021] Determine the motion trajectory of the target vehicle before it is stationary based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary;

[0022] After the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames when other vehicles are in motion;

[0023] An intersection algorithm is adopted to determine the intersection state of the target vehicle and the motion trajectories of other vehicles according to the motion trajectory of the target vehicle before being in a stationary state and the motion trajectories of other vehicles.

[0024] In a possible implementation, the presence status of pedestrians around the target vehicle is determined by:

[0025] For each pedestrian in the video frame when the target vehicle is in a stationary state, judging whether there is a pedestrian in a second preset range centered on the position information of the target vehicle according to the position information of the pedestrian;

[0026] The presence status of pedestrians around the target vehicle is determined according to the judgment result.

[0027] In a possible implementation, the multi-target detection and tracking algorithm is used to determine the position information of each vehicle and each pedestrian in a plurality of consecutive video frames, including:

[0028] Using a multi-target detection and tracking algorithm, determine a first target detection frame and a second target detection frame in the plurality of consecutive video frames, wherein the object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian;

[0029] The center point coordinates of the first target detection frame are used as the position information of the vehicle in the first target detection frame, and the center point coordinates of the second target detection frame are used as the position information of the pedestrian in the second target detection frame.

[0030] In a possible implementation, determining that the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle is performed in the following manner:

[0031] Expanding the first target detection frame corresponding to the target vehicle by a preset distance to obtain a third target detection frame;

[0032] It is determined that the initial position information of the pedestrian in the video frame is within the third target detection frame.

[0033] In a second aspect, the present application further provides an electronic device, the electronic device comprising a communication unit and a processor, wherein:

[0034] The communication unit is used to communicate with the camera and obtain a video stream consisting of a plurality of continuous video frames from the camera;

[0035] The processor is used to use a multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames; for each vehicle, determine the stationary time of the vehicle based on the duration of adjacent frames and the position information of the vehicle in each video frame; take a vehicle with a stationary time longer than a first preset time as a target vehicle, and for each target vehicle, determine the accident probability based on the driving state of the target vehicle before it came to a standstill, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

[0036] In a possible implementation manner, the processor is specifically configured to:

[0037] Determining the driving state of the vehicle according to the duration of the adjacent frames and the position information of the vehicle in each video frame;

[0038] The stationary time length of the vehicle is determined according to the adjacent frame time lengths and the number of consecutive frames when the vehicle is in a stationary state.

[0039] In a possible implementation manner, the processor is specifically configured to:

[0040] For each group of adjacent video frames, determine the adjacent displacement distance according to the position information of the vehicle in the adjacent video frames; and use the ratio of the adjacent displacement distance to the duration of the adjacent frames as the adjacent movement speed of the vehicle;

[0041] If the adjacent moving speeds are within a preset speed range, it is determined that the driving state of the vehicle is a stationary state; otherwise, it is determined that the driving state of the vehicle is a moving state.

[0042] In a possible implementation manner, the processor is specifically configured to:

[0043] Normalizing the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle to obtain normalized first, second, and third characteristic parameters;

[0044] The sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

[0045] In a possible implementation manner, before determining the accident probability, the processor is further configured to:

[0046] If it is determined that the driving state of the target vehicle before it comes to rest is a moving state, it is determined that the moving time length of the target vehicle in the moving state is greater than a second preset time length.

[0047] In a possible implementation, the processor determines the intersection state of the target vehicle and the motion trajectory of other vehicles in the following manner:

[0048] Determine the motion trajectory of the target vehicle before it is stationary based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary;

[0049] After the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames when other vehicles are in motion;

[0050] An intersection algorithm is adopted to determine the intersection state of the target vehicle and the motion trajectories of other vehicles according to the motion trajectory of the target vehicle before being in a stationary state and the motion trajectories of other vehicles.

[0051] In a possible implementation, the processor determines the presence status of pedestrians around the target vehicle in the following manner:

[0052] For each pedestrian in the video frame when the target vehicle is in a stationary state, judging whether there is a pedestrian in a second preset range centered on the position information of the target vehicle according to the position information of the pedestrian;

[0053] The presence status of pedestrians around the target vehicle is determined according to the judgment result.

[0054] In a possible implementation manner, the processor is specifically configured to:

[0055] Using a multi-target detection and tracking algorithm, determine a first target detection frame and a second target detection frame in the plurality of consecutive video frames, wherein the object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian;

[0056] The center point coordinates of the first target detection frame are used as the position information of the vehicle in the first target detection frame, and the center point coordinates of the second target detection frame are used as the position information of the pedestrian in the second target detection frame.

[0057] In a possible implementation, the processor determines that the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle in the following manner:

[0058] Expanding the first target detection frame corresponding to the target vehicle by a preset distance to obtain a third target detection frame;

[0059] It is determined that the initial position information of the pedestrian in the video frame is within the third target detection frame.

[0060] The beneficial effects of the present invention are as follows:

[0061] The traffic accident detection method and electronic device provided by the embodiment of the present application include: firstly, using a multi-target tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple continuous video frames, then for each vehicle, according to the duration of adjacent frames and the position information of the vehicle in each video frame, determine the static duration of the vehicle, then take the vehicle with a static duration greater than the first preset duration as the target vehicle, and for each target vehicle, according to the driving state of the target vehicle before it is static, the intersection state of the target vehicle and other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle, determine the accident probability, if it is determined that the accident probability is greater than the preset probability, and when it is determined that the target vehicle is in a static state, the initial position information of the pedestrian in the video frame is within a preset range centered on the position of the target vehicle, then determine that an accident has occurred. Since when detecting an accident, the accident probability is determined based on the motion state of the vehicle before it is static, the intersection state of the motion trajectories of the target vehicle and other vehicles, and the existence state of pedestrians around the target vehicle, and then based on the accident probability and whether the initial position information of the pedestrian in the video frame when the vehicle is in a static state is within the preset range centered on the position of the target vehicle, it is determined whether an accident has occurred, so the accuracy of accident detection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0063] Figure 1 An application scenario of a traffic accident detection method provided in an embodiment of the present application;

[0064] Figure 2 A flow chart of a traffic accident detection method provided in an embodiment of the present application;

[0065] Figure 3 A schematic diagram of a complete method flow for traffic accident detection provided in an embodiment of the present application;

[0066] Figure 4 A schematic diagram of a video frame provided in an embodiment of the present application;

[0067] Figure 5A schematic diagram of another video frame provided in an embodiment of the present application;

[0068] Figure 6 A schematic diagram of another video frame provided in an embodiment of the present application;

[0069] Figure 7 A schematic diagram of another video frame provided in an embodiment of the present application;

[0070] Figure 8 A schematic flow chart of a method for determining the length of time a vehicle is stationary provided in an embodiment of the present application;

[0071] Fig. 9 A schematic diagram of another video frame provided in an embodiment of the present application;

[0072] Fig.10 A schematic diagram of another video frame provided in an embodiment of the present application;

[0073] Fig.11 A schematic diagram of a process for determining the intersection state of vehicle trajectories provided in an embodiment of the present application;

[0074] Fig.12 A schematic diagram of another video frame provided in an embodiment of the present application;

[0075] Fig.13 A schematic diagram of another video frame provided in an embodiment of the present application;

[0076] Fig.14 A schematic diagram of the structure of a traffic accident detection device provided in an embodiment of the present application;

[0077] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0079] In the description of the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0080] The application scenarios described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems. In the description of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more.

[0081] In the prior art, event detectors can be used to proactively warn of traffic accidents. The industry has introduced a variety of methods such as video and radar to detect traffic accidents. However, the accuracy of event detectors is low.

[0082] Based on the above technical problems, the embodiment of the present application provides a traffic accident detection method and electronic device, the method comprising: firstly using a multi-target tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple continuous video frames, and then for each vehicle, according to the duration of adjacent frames and the position information of the vehicle in each video frame, determining the static duration of the vehicle; taking the vehicle with a static duration greater than the first preset duration as the target vehicle, for each target vehicle, determining the accident probability according to the driving state of the target vehicle before it is static, the intersection state of the target vehicle with other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle; if it is determined that the accident probability is greater than the preset probability, and when it is determined that the target vehicle is in a static state, the initial position information of the pedestrian in the video frame is within a preset range centered on the position of the target vehicle, then it is determined that an accident has occurred. Since when detecting an accident, the accident probability is determined based on the motion state of the vehicle before it is static, the intersection state of the target vehicle with other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle, and then based on the accident probability and whether there are pedestrians around the vehicle when the vehicle is in a static state, it is determined whether an accident has occurred, therefore, the accuracy of accident detection can be improved.

[0083] like Figure 1 As shown, an application scenario of a traffic accident detection method provided in an embodiment of the present application, the application scenario includes multiple cameras 110, electronic devices 120 and terminal devices 130 set up at intersections, wherein the electronic device 120 in this embodiment can be a central processing unit CPU or a graphics processing unit GPU. Figure 1 In the figure, one terminal device 130 is taken as an example, and in fact, the number of terminal devices 130 is not limited. The terminal device 130 may be a mobile phone, a tablet computer, a personal computer, etc.

[0084] In a possible application scenario, the electronic device 120 communicates with the camera 110 and obtains a video stream composed of continuous video frames from the camera 110; then a multi-target detection and tracking algorithm is used to determine the position information of each vehicle and each pedestrian in multiple continuous video frames; for each vehicle, the stationary time of the vehicle is determined according to the duration of adjacent frames and the position information of the vehicle in each video frame; a vehicle with a stationary time longer than a first preset time is taken as a target vehicle, and for each target vehicle, the accident probability is determined according to the driving state of the target vehicle before it is stationary, the intersection state of the target vehicle with other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a preset range centered on the position of the target vehicle, then it is determined that an accident has occurred. Finally, the electronic device 120 sends the traffic accident detection results of each intersection to the terminal device 130 for display.

[0085] It should be noted that the method provided in the embodiment of the present application is not limited to Figure 1 The application scenario shown can also be used in other possible application scenarios, which are not limited in the embodiments of the present application.

[0086] like Figure 2 FIG. 1 is a flow chart of a traffic accident detection method provided in an embodiment of the present application, which specifically includes the following steps:

[0087] S201, using a multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames;

[0088] S202, for each vehicle, determining the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame;

[0089] S203, taking vehicles whose stationary time is greater than a first preset time as target vehicles, and for each target vehicle, determining the accident probability according to the driving state of the target vehicle before it came to a stop, the intersection state of the target vehicle's motion trajectories with other vehicles, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrians in the video frame is within a preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

[0090] The traffic accident detection method provided by the embodiment of the present application first adopts a multi-target tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple continuous video frames, and then for each vehicle, according to the duration of adjacent frames and the position information of the vehicle in each video frame, the stationary duration of the vehicle is determined, and then the vehicle with a stationary duration greater than the first preset duration is taken as the target vehicle, and for each target vehicle, according to the driving state of the target vehicle before it is stationary, the intersection state of the target vehicle and other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle, the accident probability is determined, and if it is determined that the accident probability is greater than the preset probability, and when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a preset range centered on the position of the target vehicle, then it is determined that an accident has occurred. Since when detecting an accident, the accident probability is determined based on the motion state of the vehicle before it is stationary, the intersection state of the target vehicle and other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle, and then based on the accident probability and whether the initial position information of the pedestrian in the video frame when the vehicle is in a stationary state is within the preset range centered on the position of the target vehicle, it is determined whether an accident has occurred, therefore, the accuracy of accident detection can be improved.

[0091] like Figure 3 As shown, a complete method flow chart of a traffic accident detection method is provided in an embodiment of the present application, and the method comprises the following steps:

[0092] S301, using a multi-target tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames;

[0093] In one embodiment, the position information of each vehicle and each pedestrian in a plurality of consecutive video frames may be determined by:

[0094] Based on the multi-target detection and tracking algorithm, vehicles and pedestrians in the video frames are detected, and the first target detection frame and the second target detection frame of each video frame are output, and a unique identification ID is assigned to each vehicle and pedestrian, where the object in the first target detection frame is a vehicle and the object in the second target detection frame is a pedestrian.

[0095] After obtaining the first target detection frame and the second target detection frame in each video frame, the center point coordinates of the first target detection frame are used as the vehicle position information, and the center point coordinates of the second target detection frame are used as the pedestrian position information.

[0096] Specifically, before using the multi-target detection and tracking algorithm to obtain the first target detection frame and the second target detection frame in each video frame, firstly, a rectangular coordinate system is established with the lower left corner of the video frame as the coordinate origin (0,0), and then the center point coordinates of the first target detection frame and the second target detection frame in each video frame are determined.

[0097] In a specific implementation, a video stream is first received through a camera, which may be a video stream at an intersection or a video stream obtained by cameras on both sides of the road. Then, a multi-target detection and tracking algorithm is used for multiple consecutive video frames in the video stream to determine a first target detection frame and a second target detection frame in the multiple consecutive video frames. The object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian.

[0098] It should be noted that when a multi-target detection and tracking algorithm is used to determine target detection frames in multiple consecutive video frames, multiple first target detection frames and / or multiple second target detection frames may be determined for each video frame. For example, Figure 4 As shown, there are four target detection frames, namely a second target detection frame 41, a second target detection frame 42 and a first target detection frame 43.

[0099] like Figure 5 FIG. 1 is a schematic diagram of another video frame provided in an embodiment of the present application, from Figure 5 It can be seen that a rectangular coordinate system is established with the lower left corner of the video frame as the origin o.

[0100] like Figure 6 FIG. 1 is a schematic diagram of another video frame provided in an embodiment of the present application, from Figure 6 It can be seen that by using the multi-target detection and tracking algorithm, the center point of the second target detection frame 41 is O1, and the coordinates of the center point O1 are (x1, y1), that is, the position information of the pedestrian ID1 is (x1, y1); the center point of the second target detection frame 42 is O2, and the coordinates of the center point O2 are (x2, y2), that is, the position information of the pedestrian ID2 is (x2, y2); the center point of the first target detection frame 43 is O3, and the coordinates of the center point O3 are (x3, y3), that is, the position information of the vehicle ID3 is (x3, y3).

[0101] S302, for each vehicle, determining the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame;

[0102] In one embodiment, when determining the stationary duration of a vehicle, the driving state of the vehicle is first determined based on the duration of adjacent frames and the position information of the vehicle in each video frame; then the stationary duration of the vehicle is determined based on the duration of adjacent frames and the number of consecutive frames when the vehicle is stationary.

[0103] In an embodiment of the present application, when determining the driving state of the vehicle, it can be determined based on the adjacent movement speed of the vehicle. Specifically, for each group of adjacent video frames, the adjacent displacement distance of the vehicle is determined based on the position information of the vehicle in the adjacent video frames, and the ratio of the adjacent displacement distance to the adjacent frame duration is used as the adjacent speed of the vehicle. If the adjacent speed is within a preset range, the driving state of the vehicle is determined to be a stationary state. Otherwise, the driving state of the vehicle is determined to be a moving state, wherein the preset range can be 0-10m / s.

[0104] For example, Figure 7 As shown, video frame 1 and video frame 2 are adjacent video frames, the position information of vehicle ID3 in video frame 1 is O3(x3, y3), and the position information of vehicle ID3 in video frame 2 is O3'(x3', y3'). The distance between position information O3 and position information O3' is calculated, that is, The distance may be a pixel distance. After obtaining the distance between the vehicle ID3 in the video frame 1 and the video frame 2, the ratio of the distance to the duration of the adjacent frames is used as the adjacent motion speed of the vehicle ID3.

[0105] If the adjacent movement speed is within the range of 0-10m / s, it is determined that vehicle ID3 is stationary between video frame 1 and video frame 2; if the adjacent movement speed is greater than 10m / s, it is determined that vehicle ID3 is in motion between video 1 and video 2.

[0106] After determining the driving state of vehicle ID3 between adjacent frames, the number of consecutive frames when vehicle ID3 is in a stationary state is determined. For example, vehicle ID3 is in a stationary state between video frame 2 and video frame 15, that is, the number of consecutive frames when vehicle ID3 is in a stationary state is 14.

[0107] If the duration of adjacent frames is 0.5 ms, the product of the duration of adjacent frames and (number of consecutive frames - 1) is 0.5 ms*13=6.5 ms, and the static duration of vehicle ID3 is 6.5 ms.

[0108] It should be noted that the above is only an example. In specific implementation, the stationary time of the vehicle can be calculated according to actual conditions, and the embodiments of the present application do not impose any limitation thereto.

[0109] like Figure 8 As shown, a flow chart of determining the stationary time of a vehicle provided in an embodiment of the present application includes the following steps:

[0110] S801. For each group of adjacent video frames, determine an adjacent displacement distance according to position information of the vehicle in the adjacent video frames;

[0111] S802, taking the ratio of the adjacent displacement distance to the adjacent frame duration as the adjacent movement speed of the vehicle;

[0112] S803, determine whether the adjacent motion speed is within a preset speed range, if so, execute S804, otherwise, execute S805;

[0113] S804, determining that the driving state of the vehicle in the adjacent video frame is a stationary state;

[0114] S805, determining that the driving state of the vehicle in the adjacent video frame is a moving state;

[0115] S806, determining the number of consecutive frames when the vehicle is in a stationary state;

[0116] S807: Determine the stationary time length of the vehicle according to the adjacent frame time lengths and the determined number of consecutive frames when the vehicle is in a stationary state.

[0117] The length of time the vehicle is stationary is a prerequisite for determining whether an accident has occurred. If the length of time the vehicle is stationary does not exceed a first preset length of time, it is determined that no accident has occurred; if the length of time the vehicle is stationary exceeds the first preset length of time, subsequent feature extraction and judgment are performed.

[0118] S303, determining whether the vehicle stationary time exceeds a first preset time, if so, executing S304, otherwise executing S308;

[0119] In the embodiment of the present application, the vehicle stationary time is used as a prerequisite. If the vehicle stationary time does not exceed the first preset time, it is determined that no accident has occurred; if the vehicle stationary time exceeds the first preset time, subsequent feature extraction and judgment are performed.

[0120] S304, taking vehicles whose stationary time is longer than the first preset time as target vehicles, and determining, for each target vehicle, the driving state of the target vehicle before it came to a stop, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle;

[0121] In one embodiment, the driving state of the target vehicle before it comes to a stop can be determined in the following manner. Specifically, whether the driving state of the target vehicle before it comes to a stop is a moving state is determined based on the adjacent moving speeds of the target vehicle, that is, whether the adjacent moving speeds of the target vehicle before it comes to a stop are not within a preset speed range. If so, it is determined that the moving time length that the target vehicle is in a moving state is greater than a second preset time length, and then it is determined that the target vehicle is in a moving state before it comes to a stop.

[0122] In a specific implementation, when it is determined that the movement time of the target vehicle in a moving state is greater than a second preset time, the number of continuous video frames in a moving state can be determined by the adjacent movement speed of the target vehicle before the target vehicle stops, and the movement time of the target vehicle in a moving state can be determined based on the adjacent frame time and the determined number of continuous video frames in a moving state.

[0123] For example, the number of continuous video frames in motion is determined to be 21, and the duration of adjacent frames is 0.5 ms. Then, the duration of the target vehicle in motion is 0.5 ms*(21-1), that is, the duration of the motion is 10 ms.

[0124] In one embodiment, the intersection state of the target vehicle and the motion trajectories of other vehicles can be determined in the following manner. Specifically, the motion trajectory of the target vehicle before it is stationary is determined based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary; after the target vehicle is stationary, the motion trajectories of other vehicles are determined based on the video frames when the other vehicles are in motion; and the intersection state of the motion trajectories of the target vehicle and other vehicles is determined based on the motion trajectory of the target vehicle before it is stationary and the motion trajectory of the other vehicles using an intersection algorithm.

[0125] The intersection state of the motion trajectories of the target vehicle and other vehicles may be a state in which the motion trajectories of the target vehicle and other vehicles intersect, or a state in which the motion trajectories of the target vehicle and other vehicles do not intersect.

[0126] It should be noted that, in the embodiment of the present application, the intersection state of the target vehicle and the motion trajectory of other vehicles refers to the motion trajectory of the target vehicle before it stops, and the intersection state of the motion trajectories of other vehicles after the target vehicle stops.

[0127] Since the traffic accident occurs in motion, and at least one of the vehicles involved in the traffic accident changes from motion to stationary state, such as Fig. 9 As shown in Figure 1, the movement trajectories of vehicle ID3 and vehicle ID4 are shown. Fig.10 FIG. 1 is a schematic diagram of another video frame provided in an embodiment of the present application, from Fig.10It can be seen that vehicles ID3 and ID4 collided, where the two dotted lines represent the movement trajectories of vehicles ID3 and ID4 before the collision, that is, before vehicles ID3 and ID4 came to rest, respectively. The solid line represents the movement trajectory of vehicle ID5, which had to take a detour due to a traffic accident. The intersection algorithm is used to calculate whether the movement trajectory of the stationary vehicle ID3 before it came to rest and the movement trajectory of vehicle ID5 intersect, and to calculate whether the movement trajectory of the stationary vehicle ID4 before it came to rest and the movement trajectory of vehicle ID5 intersect. If there is an intersection, the intersection state of the movement trajectory of the target vehicle and the other vehicle is determined to be an intersection state. If there is no intersection, the intersection state of the movement trajectory of the target vehicle and the other vehicle is determined to be a non-intersection state.

[0128] In specific implementation, after a traffic accident occurs, if there are vehicles driving normally behind the vehicle involved in the traffic accident, then such vehicles will pass by the accident vehicle, and the previous movement trajectory of the accident vehicle is very likely to intersect with the trajectory of other moving vehicles. In order to exclude the scenario where the stationary vehicle is just a parking event rather than an accident, the state of the vehicle's movement trajectory intersecting with other vehicles is introduced.

[0129] like Fig.11 The flowchart of determining the intersection state of vehicle trajectories provided in the embodiment of the present application includes the following steps:

[0130] S1101, determining a motion trajectory of the target vehicle before it is stationary based on position information of the target vehicle in a video frame when the target vehicle is in motion before it is stationary;

[0131] S1102, after the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames of other vehicles in motion;

[0132] S1103: Using an intersection algorithm, according to the motion trajectory of the target vehicle before it is stationary and the motion trajectories of other vehicles, determine the intersection state of the motion trajectories of the target vehicle and other vehicles.

[0133] In one embodiment, the presence status of pedestrians around the target vehicle can be determined in the following manner. Specifically, for each pedestrian in the video frame when the target vehicle is stationary, based on the position information of the pedestrian, it is determined whether there is a pedestrian in a second preset range centered on the target vehicle, and the presence status of pedestrians around the target vehicle is determined based on the judgment result.

[0134] In a specific implementation, the pedestrian presence status around the target vehicle is the presence of pedestrians around the target vehicle and the absence of pedestrians around the target vehicle. If it is determined that there are pedestrians within the second preset range centered on the target vehicle, the pedestrian presence status around the target vehicle is the presence of pedestrians around the target vehicle; if it is determined that there are no pedestrians within the second preset range centered on the target vehicle, the pedestrian presence status around the target vehicle is the absence of pedestrians around the target vehicle.

[0135] For example, Fig.12 FIG. 1 is another schematic diagram of a video frame provided in an embodiment of the present application. Fig.12 In the example, after a traffic accident occurs between vehicle ID3 and vehicle ID4, the first target detection frame 121 is the first target detection frame corresponding to vehicle ID3. The edge of the first target detection frame 121 is expanded by a preset distance d to obtain Fig.12 The dotted frame in the figure is used to determine whether there is a pedestrian in the dotted frame. Since the second target detection frame is a pedestrian, it is determined whether there is a second target detection frame in the dotted frame. Fig.12 In the figure, there is no second target detection frame in the dotted frame, that is, the pedestrian presence state around the target vehicle is determined as no pedestrians around the target vehicle.

[0136] like Fig.13 As shown, another video frame schematic diagram provided by an embodiment of the present application is shown. Fig.13 It can be seen that the second target detection frame 122 exists in the dotted frame, that is, the pedestrian presence state around the target vehicle is determined as pedestrians existing around the target vehicle.

[0137] It should be noted that Fig.12 and Fig.13 This is an explanation of the presence status of pedestrians around vehicle ID3. In implementation, in addition to confirming the presence status of pedestrians around vehicle ID3, it is also necessary to confirm the presence status of pedestrians around vehicle ID4. The confirmation method is the same as above and will not be repeated here.

[0138] S305, calculating the accident probability according to the determined driving state of the target vehicle before it came to rest, the intersection state of the target vehicle and other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle;

[0139] In one embodiment, the accident probability can be determined in the following manner: first, the driving state of the target vehicle before it stops, the intersection state of the target vehicle and other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle are normalized to obtain the normalized first characteristic parameter, second characteristic parameter, and third characteristic parameter; then, the sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

[0140] In a specific embodiment, since the three features of the driving state before the target vehicle stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the existence state of pedestrians around the target vehicle have their own measurement units, the three features are normalized to obtain the normalized first feature parameter, the second feature parameter, and the third feature parameter, and obtain the feature vector V=[first feature parameter, second feature parameter, third feature parameter];

[0141] The weight vector W=[first weight, second weight, third weight], and the sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is taken as the accident probability P.

[0142] P=V×Transpose(W)

[0143] In implementation, when normalization is performed, if the driving state of the target vehicle before it stops is a stationary state, the first characteristic parameter is 0; if the driving state of the target vehicle before it stops is a moving state, the first characteristic parameter is 1; if the intersection state of the target vehicle and the motion trajectory of other vehicles is no intersection, the second characteristic parameter is 0; if the intersection state of the target vehicle and the motion trajectory of other vehicles is intersection, the second characteristic parameter is 1; if the presence state of pedestrians around the target vehicle is no pedestrians, the third characteristic parameter is 0; if the presence state of pedestrians around the target vehicle is pedestrians, the third characteristic parameter is 1.

[0144] In a specific implementation, the first weight, the second weight and the third weight can be determined according to the importance of the three features: the driving state of the target vehicle before it stops, the intersection state of the target vehicle's motion trajectory with other vehicles, and the presence state of pedestrians around the target vehicle. For example, if the presence state of pedestrians around the target vehicle is more important, the third weight can be set larger.

[0145] It should be noted that the status of pedestrians around the target vehicle in the embodiment of the present application can also be the number of frames in which pedestrians exist around the target vehicle. For example, when the target vehicle changes from a moving state to a stationary state, in the continuous video frames in which the target vehicle is in a stationary state, the number of frames in which pedestrians are detected around the target vehicle is determined, the number of frames in which pedestrians are detected is multiplied by the third weight, and the product is added to the other two products to obtain the accident probability.

[0146] S306. Determine whether the accident probability is greater than a preset probability, and when the target vehicle is stationary, the initial position information of the pedestrian in the video frame is within a second preset range centered on the position of the target vehicle. If so, execute S307, otherwise execute S308.

[0147] In one embodiment, if the accident probability is greater than a preset probability, it is determined whether the initial position information of the pedestrian in the video frame is within a second preset range centered on the position of the target vehicle when the target vehicle is stationary. If so, it is determined that an accident has occurred.

[0148] If the accident probability is less than the preset probability, or the initial position of the pedestrian in the video frame when the vehicle is stationary is not within the first preset range, it is determined that no accident has occurred.

[0149] Specifically, when judging whether the target vehicle is stationary, whether the initial position information of the pedestrian in the video frame is within the second preset range centered on the position of the target vehicle, first determine the position information of the pedestrian in the video frame where the pedestrian first appears when the target vehicle is stationary, that is, the initial position of the pedestrian, and then in the video frame, expand the first target detection frame corresponding to the target vehicle by a second preset distance to obtain a third target detection frame, and judge whether the initial position information of the pedestrian is within the third target detection frame; if the initial position of the pedestrian is within the third target detection frame, then determine that when the vehicle is stationary, the initial position of the pedestrian in the video frame is within the first preset range; if the initial position of the pedestrian is not within the third target detection frame, then determine that when the vehicle is stationary, the initial position of the pedestrian in the video frame is not within the first preset range.

[0150] In one embodiment, the second target detection frame centered on the target vehicle may be expanded by 1.5 times to obtain a third target detection frame.

[0151] S307, determining that an accident has occurred;

[0152] S308. Determine that no accident has occurred.

[0153] In the embodiment of the present application, through video analysis technology, each vehicle and each pedestrian in the continuous video frame is detected and tracked, and after determining that the stationary time of the vehicle exceeds the first preset time, three features are extracted: the motion state of the vehicle before it is stationary, the intersection state of the vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the vehicle. According to the three extracted features, the accident probability is determined, and the accident probability is compared with the preset probability, as well as the initial position of the pedestrian in the video frame when the vehicle is stationary, to determine whether a traffic accident has occurred. The problem of low accident detection accuracy caused by inconsistent accident event characteristics and interference factors in the coverage scene in the related technology is solved, and the accuracy of traffic accident detection is improved, which can assist in the determination of high-speed vehicle speeding events.

[0154] Based on the same disclosed concept, the traffic accident detection method described above in the present disclosure can also be implemented by a traffic accident detection device. The effect of the traffic accident detection device is similar to that of the aforementioned method, and will not be described in detail here.

[0155] Fig.14 Schematic diagram of the structure of a traffic accident detection device according to an embodiment of the present disclosure.

[0156] like Fig.14 As shown, the traffic accident detection device 1400 of the present disclosure may include a first determination module 1401, a second determination module 1402 and a detection module 1403, wherein:

[0157] The first determination module 1401 is used to determine the position information of each vehicle and each pedestrian in a plurality of consecutive video frames by using a multi-target detection and tracking algorithm;

[0158] A second determination module 1402 is used to determine, for each vehicle, a stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame;

[0159] The detection module 1403 is used to take vehicles whose stationary time is greater than a first preset time as target vehicles, and for each target vehicle, determine the accident probability according to the driving state of the target vehicle before it came to a stop, the intersection state of the target vehicle's motion trajectory with other vehicles, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

[0160] In one embodiment, the second determining module 1402 is specifically configured to:

[0161] Determining the driving state of the vehicle according to the duration of the adjacent frames and the position information of the vehicle in each video frame;

[0162] The stationary time length of the vehicle is determined according to the adjacent frame time lengths and the number of consecutive frames when the vehicle is in a stationary state.

[0163] In one embodiment, the second determining module 1402 is specifically configured to:

[0164] For each group of adjacent video frames, determine the adjacent displacement distance according to the position information of the vehicle in the adjacent video frames; and use the ratio of the adjacent displacement distance to the duration of the adjacent frames as the adjacent movement speed of the vehicle;

[0165] If the adjacent moving speeds are within a preset speed range, it is determined that the driving state of the vehicle is a stationary state; otherwise, it is determined that the driving state of the vehicle is a moving state.

[0166] In one embodiment, the detection module 1403 is specifically used to:

[0167] Normalizing the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle to obtain normalized first, second, and third characteristic parameters;

[0168] The sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

[0169] In one embodiment, the detection module 1403 is further configured to:

[0170] Before determining the accident probability, if it is determined that the driving state of the target vehicle before it comes to a standstill is a moving state, it is determined that the moving time length of the target vehicle in the moving state is greater than a second preset time length.

[0171] In one embodiment, the detection module 1403 is specifically configured to determine the intersection state of the target vehicle and other vehicle motion trajectories in the following manner:

[0172] Determine the motion trajectory of the target vehicle before it is stationary based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary;

[0173] After the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames when other vehicles are in motion;

[0174] An intersection algorithm is adopted to determine the intersection state of the target vehicle and the motion trajectories of other vehicles according to the motion trajectory of the target vehicle before being in a stationary state and the motion trajectories of other vehicles.

[0175] In one embodiment, the detection module 1403 determines the presence status of pedestrians around the target vehicle in the following manner:

[0176] For each pedestrian in the video frame when the target vehicle is in a stationary state, judging whether there is a pedestrian in a second preset range centered on the position information of the target vehicle according to the position information of the pedestrian;

[0177] The presence status of pedestrians around the target vehicle is determined according to the judgment result.

[0178] In one embodiment, the first determining module 1001 is specifically configured to:

[0179] Using a multi-target detection and tracking algorithm, determine a first target detection frame and a second target detection frame in the plurality of consecutive video frames, wherein the object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian;

[0180] The center point coordinates of the first target detection frame are used as the position information of the vehicle in the first target detection frame, and the center point coordinates of the second target detection frame are used as the position information of the pedestrian in the second target detection frame.

[0181] In one embodiment, the detection module 1403 determines that the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle by:

[0182] Expanding the first target detection frame corresponding to the target vehicle by a preset distance to obtain a third target detection frame;

[0183] It is determined that the initial position information of the pedestrian in the video frame is within the third target detection frame.

[0184] After introducing a traffic accident detection method and device according to an exemplary embodiment of the present disclosure, next, an electronic device according to another exemplary embodiment of the present disclosure is introduced.

[0185] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0186] In some possible implementations, the electronic device in the present disclosure may be a central processing unit or a graphics processing unit. The electronic device according to the present disclosure may include at least one processor and at least one computer storage medium. The computer storage medium stores program code, and when the program code is executed by the processor, the processor executes the steps of the traffic accident detection method according to various exemplary embodiments of the present disclosure described above in this specification. For example, the processor may execute the following steps: Figure 2 Steps 201-203 shown in .

[0187] Refer to the following Fig.15 15 to describe the electronic device 1500 according to this embodiment of the present disclosure. Fig.15 The electronic device 1500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0188] like Fig.15 As shown, the electronic device 1500 is in the form of a general electronic device. The components of the electronic device 1500 may include but are not limited to: the at least one processor 1501, the at least one computer storage medium 1502, and a bus 1503 connecting different system components (including the computer storage medium 1502 and the processor 1501).

[0189] Bus 1503 represents one or more of several types of bus structures, including a computer storage media bus or computer storage media controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0190] Computer storage media 1502 may include readable media in the form of volatile computer storage media, such as random access computer storage media (RAM) 1521 and / or cache storage media 1522 , and may further include read-only computer storage media (ROM) 1523 .

[0191] The computer storage medium 1502 may also include a program / utility 1525 having a set (at least one) of program modules 1524, such program modules 1524 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.

[0192] The electronic device 1500 may also communicate with one or more external devices 1504 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1500, and / or communicate with any device that enables the electronic device 1500 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1505. Furthermore, the electronic device 1500 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1506. As shown, the network adapter 1506 communicates with other modules for the electronic device 1500 via a bus 1503. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1500, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0193] In one embodiment, the electronic device disclosed in the present application may further include a communication unit ( Fig.15 The communication unit is used to communicate with the camera and obtain a video stream consisting of the continuous video frames from the camera.

[0194] Processor 1501 is used to use a multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames; for each vehicle, determine the stationary time of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame; take a vehicle with a stationary time longer than a first preset time as a target vehicle, and for each target vehicle, determine the accident probability according to the driving state of the target vehicle before it comes to a standstill, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

[0195] In one embodiment, the processor 1501 is specifically configured to:

[0196] Determining the driving state of the vehicle according to the duration of the adjacent frames and the position information of the vehicle in each video frame;

[0197] The stationary time length of the vehicle is determined according to the adjacent frame time lengths and the number of consecutive frames when the vehicle is in a stationary state.

[0198] In one embodiment, the processor 1501 is specifically configured to:

[0199] For each group of adjacent video frames, determine the adjacent displacement distance according to the position information of the vehicle in the adjacent video frames; and use the ratio of the adjacent displacement distance to the duration of the adjacent frames as the adjacent movement speed of the vehicle;

[0200] If the adjacent moving speeds are within a preset speed range, it is determined that the driving state of the vehicle is a stationary state; otherwise, it is determined that the driving state of the vehicle is a moving state.

[0201] In one embodiment, the processor 1501 is specifically configured to:

[0202] Normalizing the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle to obtain normalized first, second, and third characteristic parameters;

[0203] The sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

[0204] In one embodiment, before determining the accident probability, the processor 1501 is further configured to:

[0205] If it is determined that the driving state of the target vehicle before it comes to rest is a moving state, it is determined that the moving time length of the target vehicle in the moving state is greater than a second preset time length.

[0206] In one embodiment, the processor 1501 determines the intersection state of the target vehicle and other vehicle motion trajectories in the following manner:

[0207] Determine the motion trajectory of the target vehicle before it is stationary based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary;

[0208] After the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames when other vehicles are in motion;

[0209] An intersection algorithm is adopted to determine the intersection state of the target vehicle and the motion trajectories of other vehicles according to the motion trajectory of the target vehicle before being in a stationary state and the motion trajectories of other vehicles.

[0210] In one embodiment, the processor 1501 determines the presence status of pedestrians around the target vehicle in the following manner:

[0211] For each pedestrian in the video frame when the target vehicle is in a stationary state, judging whether there is a pedestrian in a second preset range centered on the position information of the target vehicle according to the position information of the pedestrian;

[0212] The presence status of pedestrians around the target vehicle is determined according to the judgment result.

[0213] In one embodiment, the processor 1501 is specifically configured to:

[0214] Using a multi-target detection and tracking algorithm, determine a first target detection frame and a second target detection frame in the plurality of consecutive video frames, wherein the object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian;

[0215] The center point coordinates of the first target detection frame are used as the position information of the vehicle in the first target detection frame, and the center point coordinates of the second target detection frame are used as the position information of the pedestrian in the second target detection frame.

[0216] In one embodiment, the processor 1501 determines that the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle by:

[0217] Expanding the first target detection frame corresponding to the target vehicle by a preset distance to obtain a third target detection frame;

[0218] It is determined that the initial position information of the pedestrian in the video frame is within the third target detection frame.

[0219] In some possible implementations, various aspects of a traffic accident detection method provided by the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the traffic accident detection method according to various exemplary embodiments of the present disclosure described above in this specification.

[0220] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access computer storage medium (RAM), a read-only computer storage medium (ROM), an erasable programmable read-only computer storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only computer storage medium (CD-ROM), an optical computer storage medium, a magnetic computer storage medium, or any suitable combination of the above.

[0221] The program product of the traffic accident detection of the embodiment of the present disclosure can adopt a portable compact disk read-only computer storage medium (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present disclosure is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.

[0222] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. 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. The readable signal medium may also be any readable medium other than a 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.

[0223] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0224] Program code for performing the disclosed operations may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user electronic device, partially on the user device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on the remote electronic device. In the case of a remote electronic device, the remote electronic device may be connected to the user electronic device via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external electronic device (e.g., via the Internet using an Internet service provider).

[0225] It should be noted that although several modules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be embodied.

[0226] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0227] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk computer storage media, CD-ROM, optical computer storage media, etc.) containing computer-usable program codes.

[0228] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0229] These computer program instructions may also be stored in a computer-readable computer storage medium that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable computer storage medium produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0230] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0231] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. A traffic accident detection method, characterized in that: The method comprises: Adopt multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames; For each vehicle, determine the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame; Vehicles whose stationary time is greater than a first preset time are taken as target vehicles, and for each target vehicle, the accident probability is determined according to the driving state of the target vehicle before it comes to a stop, the intersection state of the target vehicle's motion trajectories with other vehicles, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

2. The method according to claim 1, characterized in that The step of determining the stationary duration of the vehicle according to the duration of adjacent frames and the position information of the vehicle in each video frame includes: Determining the driving state of the vehicle according to the duration of the adjacent frames and the position information of the vehicle in each video frame; The stationary time length of the vehicle is determined according to the adjacent frame time lengths and the number of consecutive frames when the vehicle is in a stationary state.

3. The method according to claim 2, characterized in that The determining the driving state of the vehicle according to the adjacent frame durations and the position information of the vehicle in each video frame includes: For each group of adjacent video frames, determine the adjacent displacement distance according to the position information of the vehicle in the adjacent video frames; and use the ratio of the adjacent displacement distance to the duration of the adjacent frames as the adjacent movement speed of the vehicle; If the adjacent moving speeds are within a preset speed range, it is determined that the driving state of the vehicle is a stationary state; otherwise, it is determined that the driving state of the vehicle is a moving state.

4. The method according to claim 1, characterized in that The determining of the accident probability according to the driving state of the target vehicle before it comes to rest, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle includes: Normalizing the driving state of the target vehicle before it stops, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle to obtain normalized first, second, and third characteristic parameters; The sum of the product of the first characteristic parameter and the first weight, the product of the second characteristic parameter and the second weight, and the product of the third characteristic parameter and the third weight is used as the accident probability.

5. The method according to claim 4, characterized in that Before determining the accident probability, the following steps are also included: If it is determined that the driving state of the target vehicle before it comes to rest is a moving state, it is determined that the moving time length of the target vehicle in the moving state is greater than a second preset time length.

6. The method according to claim 1, characterized in that The intersection state of the target vehicle and other vehicle motion trajectories is determined by: Determine the motion trajectory of the target vehicle before it is stationary based on the position information of the target vehicle in the video frame when the target vehicle is in motion before it is stationary; After the target vehicle is in a stationary state, determining the motion trajectories of other vehicles based on video frames when other vehicles are in motion; An intersection algorithm is adopted to determine the intersection state of the target vehicle and the motion trajectories of other vehicles according to the motion trajectory of the target vehicle before being in a stationary state and the motion trajectories of other vehicles.

7. The method according to claim 1, characterized in that The presence status of pedestrians around the target vehicle is determined by: For each pedestrian in the video frame when the target vehicle is in a stationary state, judging whether there is a pedestrian in a second preset range centered on the position information of the target vehicle according to the position information of the pedestrian; The presence status of pedestrians around the target vehicle is determined according to the judgment result.

8. The method according to claim 7, characterized in that The multi-target detection and tracking algorithm is used to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames, including: Using a multi-target detection and tracking algorithm, determine a first target detection frame and a second target detection frame in the plurality of consecutive video frames, wherein the object in the first target detection frame is a vehicle, and the object in the second target detection frame is a pedestrian; The center point coordinates of the first target detection frame are used as the position information of the vehicle in the first target detection frame, and the center point coordinates of the second target detection frame are used as the position information of the pedestrian in the second target detection frame.

9. The method according to claim 8, characterized in that Determine that the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle by the following method: Expanding the first target detection frame corresponding to the target vehicle by a preset distance to obtain a third target detection frame; It is determined that the initial position information of the pedestrian in the video frame is within the third target detection frame.

10. An electronic device, characterized in that: The electronic device comprises a communication unit and a processor, wherein: The communication unit is used to communicate with the camera and obtain a video stream consisting of a plurality of continuous video frames from the camera; The processor is used to use a multi-target detection and tracking algorithm to determine the position information of each vehicle and each pedestrian in multiple consecutive video frames; for each vehicle, determine the stationary time of the vehicle based on the duration of adjacent frames and the position information of the vehicle in each video frame; take a vehicle with a stationary time longer than a first preset time as a target vehicle, and for each target vehicle, determine the accident probability based on the driving state of the target vehicle before it came to a standstill, the intersection state of the target vehicle with other vehicles' motion trajectories, and the presence state of pedestrians around the target vehicle, wherein the driving state includes a stationary state and a moving state; if it is determined that the accident probability is greater than the preset probability, and, when it is determined that the target vehicle is in a stationary state, the initial position information of the pedestrian in the video frame is within a first preset range centered on the position of the target vehicle, then it is determined that a traffic accident has occurred.

Citation Information

Cited By

  • Method, device and equipment for judging pedestrian-vehicle conflict event at intersection

    CN120431762A