Traffic accident determination method and electronic equipment
By combining vehicle motion and door status through the target detection neural network model, the problem of low accuracy of traffic accident determination methods in the existing technology is solved, and more accurate traffic accident detection is achieved.
Patent Information
- Application Number
- CN202110959516.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-08-20
AI Technical Summary
The traffic accident determination method in the existing technology only uses the current motion state of the vehicle, and the accuracy is low, resulting in frequent misidentifications. For example, a driver who stops by the roadside to rest is mistakenly diagnosed as a traffic accident.
The target detection neural network model is used, combined with the current motion state of the vehicle and the door state, to perform vehicle detection and identification through the CSPdarknet53 network, screen the vehicle location, determine whether the vehicle is in a parking state and the parking duration, and then determine whether a traffic accident has occurred.
It improves the accuracy of traffic accident determination, reduces misidentification phenomena, and enhances the ability to accurately detect traffic accidents, especially in the judgment of parking and parking duration.
Smart Images

Figure CN113657299B_ABST
Abstract
Description
Background Art
[0002] With the development of economy, the number of cars in cities has gradually increased, leading to frequent traffic accidents in cities. In order to reduce and prevent the occurrence of traffic accidents, people pay more and more attention to the real-time detection and real-time monitoring of urban road traffic, so the research of intelligent transportation system has become a hot spot. In the intelligent transportation system, traffic incidents on the road can be detected quickly, reducing the impact of casualties, property losses, etc. caused by traffic incidents, and avoiding the occurrence of secondary incidents.
[0003] The traffic accident determination method in the prior art only determines whether each vehicle has a traffic accident based on the current motion state of each vehicle. The identification result of this method is not very accurate. For example, when the driver only stops to rest on the roadside, this method will identify that a traffic accident has occurred. As a result, the accuracy of traffic accident determination is low. Summary of the invention
[0004] In an exemplary embodiment of the present disclosure, a traffic accident determination method and an electronic device are provided to improve the accuracy of traffic accident determination.
[0005] A first aspect of the present disclosure provides a traffic accident determination method, the method comprising:
[0006] For the video image to be detected in the road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected is obtained;
[0007] Based on the position of each target vehicle in the video image to be detected, obtaining the identification of each target vehicle in the video image to be detected;
[0008] Determine the current motion state and the current door state of each target vehicle in the video image to be detected respectively according to the position and identification of each target vehicle in the video image to be detected;
[0009] According to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected, it is determined whether each target vehicle has a traffic accident.
[0010] In this embodiment, whether each target vehicle has an accident is determined based on the current door status of each target vehicle in the video image to be detected and the current movement status of each target vehicle. Since most drivers involved in traffic accidents will get out of the car to check, the current movement status and door status of the target vehicle are used to judge whether the target vehicle has an accident, thereby improving the accuracy of the traffic accident determination results.
[0011] In one embodiment, the target detection neural network model uses the content security policy dark network CSPdarknet53 as the backbone network, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hollow convolution with a dilation rate of a set value.
[0012] In this embodiment, the backbone network of the target detection neural network is replaced by the content security policy dark network CSPdarknet53, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hole convolution with a dilation rate of a set value. Thus, the hole convolution in the target detection neural network is used to expand the global field of view to obtain more abstract features and spatial information in the video image. In this way, the target vehicle in the video image is detected by the improved target detection neural network in this embodiment, so that the vehicle recognition result is more accurate, and the accuracy of traffic accident determination is further improved.
[0013] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0014] The step of determining whether a traffic accident occurs to each target vehicle according to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected includes:
[0015] For any target vehicle in the video image to be detected, if the current door state of the target vehicle is an open state and the current motion state of the target vehicle is a target state, it is determined that the target vehicle has a traffic accident; wherein the target state is that the target vehicle is in a parking state and the parking time is greater than a specified time;
[0016] Otherwise, it is determined that the target vehicle has not had a traffic accident.
[0017] In this embodiment, for any target vehicle in the video image to be detected, if the current door state of the target vehicle is open, the current motion state of the target vehicle is parked, and the parking time is greater than a specified time, then it is determined that the target vehicle has a traffic accident. Thus, the accuracy of the traffic accident detection result is improved.
[0018] In one embodiment, obtaining the identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected includes:
[0019] For any target vehicle having a plurality of positions in the video image to be detected, screening the plurality of positions of the target vehicle to obtain the screened position of the target vehicle;
[0020] By using a preset target tracking algorithm and the position of each target vehicle, each target vehicle is identified respectively to obtain the identification of each target vehicle in the video image to be detected.
[0021] This embodiment screens multiple positions of any target vehicle with multiple positions in the video image to be detected, and then determines the identity of the target vehicle, so that the identity of the target vehicle can be determined more accurately.
[0022] In one embodiment, after determining the current motion state and the current door state of each target vehicle in the video image to be detected by the position and identification of each target vehicle in the video image to be detected, the method further includes:
[0023] For any two target vehicles in the to-be-detected video image, determining a distance between the two target vehicles based on the positions of the two target vehicles;
[0024] Based on the distance between the two target vehicles, the current motion states of the two target vehicles and the door states of the two target vehicles, it is determined whether a traffic accident occurs between the two target vehicles.
[0025] In this embodiment, for any two target vehicles in the second target image, based on the distance between the two target vehicles, the door status and the current motion status of the two target vehicles, it is determined whether the two target vehicles have a traffic accident, thereby improving the accuracy of traffic accident detection results in the case of a rear-end collision between two vehicles.
[0026] In one embodiment, the current motion state includes whether the target vehicle is currently in a parking state and the parking time of the target vehicle when the target vehicle is in the parking state;
[0027] The determining whether a traffic accident occurs between the two target vehicles based on the distance between the two target vehicles, the current motion states of the two target vehicles, and the door states of the two target vehicles includes:
[0028] If it is determined that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is a target state and the door of at least one target vehicle is in an open state, it is determined that the two target vehicles have a traffic accident; wherein the target state is that both of the two target vehicles are in a parked state, and the duration of being in the parked state is greater than a specified duration;
[0029] Otherwise, it is determined that no traffic accident occurs between the two target vehicles.
[0030] This embodiment determines that a traffic accident occurs between the two target vehicles by determining that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is that the two target vehicles are both in a parked state, and the length of time in the parked state is greater than a specified length of time, and the door of at least one of the target vehicles is open. Therefore, in this embodiment, whether a traffic accident occurs between the two target vehicles is determined by the distance between the target vehicles, whether the target vehicles are in a parked state, and the length of time parked in combination with the open and closed state of the doors, so that the determination result of the traffic accident is more accurate.
[0031] In one embodiment, the current door status of the target vehicle is determined by:
[0032] For any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain an image of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model;
[0033] The image of the target vehicle is input into a pre-trained residual network for recognition to obtain the current door state of the target vehicle.
[0034] In this embodiment, for any target vehicle, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain the image of the target vehicle, and then the image of the target vehicle is input into a pre-trained residual network for recognition to obtain the current door state of the target vehicle, thereby improving the accuracy of the result.
[0035] In one embodiment, whether the target vehicle is in a parked state is determined by:
[0036] For any target vehicle in the video image to be detected, if the position of the target vehicle in the video image to be detected is equal to the position of the target vehicle in the previous frame of the video image, it is determined that the target vehicle is in a parked state;
[0037] Otherwise, it is determined that the target vehicle is not in a parked state.
[0038] In this embodiment, whether the vehicle is in a parked state is determined by the position of the target vehicle in the video image to be detected and the position of the target vehicle in the previous frame of the video image, so that whether the vehicle is in a parked state can be determined through one calculation, reducing the amount of calculation.
[0039] In one embodiment, the parking duration is determined by:
[0040] After determining that the target vehicle is in a parked state, determining the position of the target vehicle in each frame of video image before the video image to be detected based on the identification of the target vehicle; and,
[0041] The parking time of the target vehicle is determined by the position of the target vehicle in each frame of the video image.
[0042] This embodiment determines the position of the target vehicle in each frame of video image before the video image to be detected based on the identification of the target vehicle, and determines the parking time of the target vehicle based on the position of the target vehicle in each frame of video image, thereby making the determined parking time more accurate.
[0043] A second aspect of the present disclosure provides an electronic device, including a storage unit and a processor, wherein:
[0044] The storage unit is configured to store the video of the road section to be identified;
[0045] The processor is configured to:
[0046] For the video image to be detected in the road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected is obtained;
[0047] Based on the position of each target vehicle in the video image to be detected, obtaining the identification of each target vehicle in the video image to be detected;
[0048] Determine the current motion state and the current door state of each target vehicle in the video image to be detected respectively according to the position and identification of each target vehicle in the video image to be detected;
[0049] According to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected, it is determined whether each target vehicle has a traffic accident.
[0050] In one embodiment, the target detection neural network model uses the content security policy dark network CSPdarknet53 as the backbone network, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hollow convolution with a dilation rate of a set value.
[0051] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0052] The processor executes the step of determining whether a traffic accident occurs to each target vehicle according to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected, and is specifically configured as follows:
[0053] For any target vehicle in the video image to be detected, if the current door state of the target vehicle is an open state and the current motion state of the target vehicle is a target state, it is determined that the target vehicle has a traffic accident; wherein the target state is that the target vehicle is in a parking state and the parking time is greater than a specified time;
[0054] Otherwise, it is determined that the target vehicle has not had a traffic accident.
[0055] In one embodiment, the processor performs the step of obtaining the identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected, and is specifically configured as follows:
[0056] For any target vehicle having a plurality of positions in the video image to be detected, screening the plurality of positions of the target vehicle to obtain the screened position of the target vehicle;
[0057] By using a preset target tracking algorithm and the position of each target vehicle, each target vehicle is identified respectively to obtain the identification of each target vehicle in the video image to be detected.
[0058] In one embodiment, the processor is further configured to:
[0059] After respectively determining the current motion state and the current door state of each target vehicle in the video image to be detected by using the position and identification of each target vehicle in the video image to be detected, for any two target vehicles in the video image to be detected, determining the distance between the two target vehicles based on the positions of the two target vehicles;
[0060] Based on the distance between the two target vehicles, the current motion states of the two target vehicles and the door states of the two target vehicles, it is determined whether a traffic accident occurs between the two target vehicles.
[0061] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0062] The processor performs the step of determining whether a traffic accident occurs between the two target vehicles based on the distance between the two target vehicles, the current motion states of the two target vehicles, and the door states of the two target vehicles, and is specifically configured as follows:
[0063] If it is determined that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is a target state and the door of at least one target vehicle is in an open state, it is determined that the two target vehicles have a traffic accident; wherein the target state is that both of the two target vehicles are in a parked state, and the duration of being in the parked state is greater than a specified duration;
[0064] Otherwise, it is determined that no traffic accident occurs between the two target vehicles.
[0065] In one embodiment, the processor is further configured to:
[0066] The current door status of the target vehicle is determined by:
[0067] For any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain an image of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model;
[0068] The image of the target vehicle is input into a pre-trained residual network for recognition to obtain the current door state of the target vehicle.
[0069] In one embodiment, the processor is further configured to:
[0070] Determine whether the target vehicle is in a parked state by:
[0071] For any target vehicle in the video image to be detected, if the position of the target vehicle in the video image to be detected is equal to the position of the target vehicle in the previous frame of the video image, it is determined that the target vehicle is in a parked state;
[0072] Otherwise, it is determined that the target vehicle is not in a parked state.
[0073] In one embodiment, the processor is further configured to:
[0074] The parking duration is determined by:
[0075] After determining that the target vehicle is in a parked state, determining the position of the target vehicle in each frame of video image before the video image to be detected based on the identification of the target vehicle; and,
[0076] The parking time of the target vehicle is determined by the position of the target vehicle in each frame of the video image.
[0077] According to a third aspect provided by an embodiment of the present disclosure, a computer storage medium is provided, wherein the computer storage medium stores a computer program, and the computer program is used to execute the method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, 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 disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0079] Figure 1 A schematic diagram of an applicable scenario in an embodiment of the present disclosure;
[0080] Figure 2 This is one of the flowcharts of a method for determining a traffic accident according to an embodiment of the present disclosure;
[0081] Figure 3 A schematic diagram of a video image to be detected after vehicle detection according to an embodiment of the present disclosure;
[0082] Figure 4 A schematic diagram of a video image to be detected after the position is screened according to an embodiment of the present disclosure;
[0083] Figure 5 A schematic diagram of the structure of CSPdarknet53 in a traffic accident determination method according to an embodiment of the present disclosure;
[0084] Figure 6 A schematic diagram of a convolution operation of a dilated convolution in a traffic accident determination method according to an embodiment of the present disclosure;
[0085] Figure 7 A schematic diagram of the structure of YOLOv4 in a traffic accident determination method according to an embodiment of the present disclosure;
[0086] Figure 8 A schematic diagram of identifying a target vehicle in each frame image in a method for determining a traffic accident according to an embodiment of the present disclosure;
[0087] Fig. 9 A schematic diagram of a flow chart of determining a current door state by using a residual network in a method for determining a traffic accident according to an embodiment of the present disclosure;
[0088] Fig.10The second flowchart of the method for determining a traffic accident according to an embodiment of the present disclosure is shown;
[0089] Fig.11 A traffic accident determination device according to an embodiment of the present disclosure;
[0090] Fig.12 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0091] 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.
[0092] In the embodiments of the present disclosure, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0093] 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.
[0094] In the prior art, whether each vehicle is involved in a traffic accident is determined only by the current motion state of each vehicle. The identification result of this method is not very accurate. For example, when the driver only stops to rest on the side of the road, it will be identified as a traffic accident by this method. As a result, the accuracy of traffic accident determination is low.
[0095] Therefore, the present disclosure provides a method for determining a traffic accident, which determines whether each target vehicle has an accident based on the current door state of each target vehicle in the video image to be detected and the current motion state of each target vehicle. Since most drivers of traffic accidents will get off the vehicle to check, the current motion state and door state of the target vehicle are used to determine whether the target vehicle has an accident, thereby improving the accuracy of the traffic accident determination result. Below, the scheme of the present disclosure is described in detail in conjunction with the accompanying drawings.
[0096] like Figure 1 As shown, an application scenario of a traffic accident determination method includes a server 110, a terminal device 120 and a traffic camera 130. Figure 1 In the example, one terminal device 120 and one traffic camera 130 are used. In fact, the number of terminal devices 120 and traffic cameras 130 is not limited. The terminal device 120 can be a mobile phone, a tablet computer, a personal computer, etc. The server 110 can be implemented by a single server or multiple servers. The server 110 can be implemented by a physical server or a virtual server.
[0097] In a possible application scenario, the server 110 obtains a road section video from a traffic camera 130, and then the server 110 performs vehicle detection on the video image to be detected in the road section video using a target detection neural network model to obtain the position of each target vehicle in the video image to be detected; then the server 110 obtains the identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected; and determines the current motion state and current door state of each target vehicle in the video image to be detected through the position and identification of each target vehicle in the video image to be detected; finally, the server 110 determines whether each target vehicle has a traffic accident based on the current door state of each target vehicle in the video image to be detected and the current motion state of each target vehicle; if it is determined that a traffic accident has occurred with the target vehicle, the result of the traffic accident is sent to the terminal device 120.
[0098] Figure 2 The flowchart of the traffic accident determination method disclosed in the present invention may include the following steps:
[0099] Step 201: for a video image to be detected in a road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected is obtained;
[0100] like Figure 3 As shown, image 3a is the video image to be detected. Image 3a is input into the target detection neural network for vehicle detection to obtain the position of each target vehicle, as shown in Figure 3 As shown in the image 3b in FIG. , it can be seen that the position of each target vehicle in the video image to be detected.
[0101] according to Figure 3 It can be seen from the image 3b that there are multiple target vehicles at different positions. The positions of the target vehicles can be screened by the following method:
[0102] After the position of each target vehicle is screened by using the non-maximum suppression algorithm, the position of each target vehicle is screened again by using the confidence of the position of each target vehicle in the screened video image to be detected, so as to obtain the video image to be detected after the second screening. The confidence of the position of the target vehicle is obtained by the target detection neural network model.
[0103] Among them, the process of using the non-maximum suppression algorithm to screen the positions of each target vehicle in the video image to be detected includes: for any target vehicle, sorting each position according to the confidence corresponding to each position of the target vehicle, determining the position with the highest confidence among the positions of the target vehicle, calculating the intersection over union (IOU) of the positions of the target vehicle except the position with the highest confidence and the position with the highest confidence, deleting the positions with IOU values greater than the specified threshold, and judging whether the number of remaining positions is within the specified range; if not, returning to execute the step of sorting each position according to the confidence of each position of the target vehicle and determining the position with the highest confidence among the positions of the target vehicle, until the number of remaining positions is within the specified range, then ending.
[0104] For example, Figure 4 As shown, Figure 4 Image 4a in FIG. 4 is a video image to be detected after detection by the target detection neural network model. There are multiple target vehicles in the image. After screening the positions of multiple target vehicles in the image, as shown in FIG. Figure 4 As shown in Figure 4b, there is only one position for each target vehicle.
[0105] Since the target in this embodiment is a vehicle, some of them may be similar in shape to vehicles, and the target detection neural network model may also mistakenly identify them as vehicles. Therefore, it is necessary to delete the positions of each target vehicle whose confidence level is less than a specified threshold. Since each target vehicle has only one position, after deleting the position, the object at that position is no longer the target vehicle in this embodiment, thereby further improving the accuracy of vehicle recognition.
[0106] In one embodiment, the target detection neural network model uses the content security policy dark network CSPdarknet53 as the backbone network, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hollow convolution with a dilation rate of a set value.
[0107] It should be noted that the range of the setting value of the expansion rate in this embodiment is greater than 1. The specific expansion rate of the dilated convolution can be set according to specific needs, and this embodiment does not limit it here.
[0108] Among them, the target detection neural network model in this embodiment includes but is not limited to R-CNN (Region-Convolutional Neural Networks), Fast R-CNN (Fast Region-Convolutional Neural Networks), YOLOv4 (You Only Look Once 4th), and YOLOv3 (You Only Look Once 3rd).
[0109] like Figure 5 As shown, it is a schematic diagram of the structure of CSPdarknet53, which includes a convolutional layer and five residual blocks (i.e., a first residual block, a second residual block, a third residual block, a fourth residual block, and a fifth residual block). In this embodiment, each convolutional layer in the third residual block and / or the fourth residual block in CSPdarknet53 is replaced by a dilated convolution with a set dilation rate. Figure 5 In the figure, each convolution layer in the third residual block and the fourth residual block is replaced by a dilated convolution with a set dilation rate.
[0110] In this embodiment, each convolution layer of at least one of the third residual block and the fourth residual block in CSPdarknet5 is replaced with a dilated convolution with a set dilation rate. The convolution kernel with a dilation rate of 2 and a size of 3*3 is used as an example. Figure 6 As shown, Figure 6 Image 6a in FIG. 6 is a schematic diagram of the convolution operation of the third residual block or the fourth residual block in CSPdarknet53 in the prior art. It can be seen from Image 6a that the receptive field of the convolution operation using the convolution kernel in the prior art is 3*3. Figure 6 As shown in the image 6b in FIG, the receptive field of the convolution operation using the same convolution kernel size of 3*3 and the dilation rate of 2 is 5*5. Therefore, the improved target detection neural network in this embodiment expands the global field of view to obtain more abstract features and spatial information in the video image.
[0111] Below, taking the target detection neural network model as YOLOv4 as an example, the process of using the target detection neural network model in this application to perform vehicle detection on the video image to be detected is described in detail. Figure 7 The figure shows the structure diagram of YOLOv4, including: backbone network, SPP module (SPATIAL Pyramid Pooling), PANet network structure layer and detection layer.
[0112] Among them, the backbone network is a CSPdarknet53 network structure in this embodiment, in which each convolution layer of at least one residual block in the third residual block and the fourth residual block is a dilation rate of a set value of the hole convolution. The backbone network is mainly used to extract features of the video image to be detected in the road section video in this embodiment. The output of the backbone network is divided into three branches, and the size of the feature map output by each branch is different.
[0113] The SPP module uses three pooling layers of different sizes to perform pooling operations on the feature maps extracted by the backbone network. That is, pooling layers of 5*5, 9*9, and 15*15 are used to perform pooling operations on the feature maps extracted by the backbone network, and then the fully connected layer is used to splice the feature maps output by the three pooling layers. After splicing, the convolution layer is used to reduce the dimension. In this way, the obtained features are richer.
[0114] The PANet network structure layer mainly performs upsampling or downsampling on the feature maps obtained from each branch, then uses the fully connected layer to concatenate the corresponding feature maps, and then uses the convolutional layer to perform dimensionality reduction. Three feature maps are obtained.
[0115] The detection layer detects the target vehicle on the three feature maps obtained in the PANet network structure layer to obtain the final recognition result (i.e., the position of the target vehicle in the video image to be detected in the embodiment of the present application, i.e., Figure 3 Figure 3b).
[0116] Step 202: obtaining an identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected;
[0117] In one embodiment, each target vehicle is identified respectively by using a preset target tracking algorithm and the position of each target vehicle, so as to obtain the identification of each target vehicle in the video image to be detected.
[0118] like Figure 8 As shown, the identification of each target vehicle in the video image to be detected is obtained, that is, the target vehicle in the video image to be detected is matched with each target vehicle in the previous frame of video image.
[0119] The target tracking algorithm used in this embodiment can be DeepSort algorithm (Deep Simple Online and Realtime Tracking, deep simple online real-time tracking algorithm) to track and identify the target vehicle. Among them, other tracking algorithms in the prior art can be used as long as they can achieve tracking and identification of the target vehicle, and this embodiment does not limit the target tracking algorithm.
[0120] Step 203: determining the current motion state and the current door state of each target vehicle in the video image to be detected respectively according to the position and identification of each target vehicle in the video image to be detected;
[0121] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0122] Determine whether the target vehicle is in a parked state by:
[0123] For any target vehicle in the video image to be detected, if the position of the target vehicle in the video image to be detected is equal to the position of the target vehicle in the previous frame of the video image, it is determined that the target vehicle is in a parked state; otherwise, it is determined that the target vehicle is not in a parked state.
[0124] For example, if the position of vehicle 1 in the video image to be detected is (A, B, C, D), and the position of vehicle 1 in the previous frame of video image is also (A, B, C, D), it is determined that vehicle 1 is in a parked state.
[0125] In one embodiment, the parking duration is determined in the following manner: after determining that the target vehicle is in a parking state, the position of the target vehicle in each frame of the video image before the video image to be detected is determined based on the identification of the target vehicle; and the parking duration of the target vehicle is determined through the position of the target vehicle in each frame of the video image.
[0126] For example, if it is determined that the vehicle 1 is in a parking state in a total of 20 frames of video images, and if 1 second corresponds to 10 frames of video images, it is determined that the parking time of the vehicle 1 is 2 seconds.
[0127] In one embodiment, the current door state includes the door being open and the door being closed;
[0128] The current door status of the target vehicle is determined by:
[0129] For any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain the image of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model; the image of the target vehicle is input into a pre-trained residual network for recognition to obtain the current door state of the target vehicle.
[0130] Among them, Figure 8 FIG. 1 is a flow chart of determining the current door state, which includes the following steps:
[0131] Step 801: extracting features from the image of the target vehicle using a residual network to obtain vehicle feature information;
[0132] Step 802: matching the vehicle characteristic information with each preset vehicle characteristic information to obtain the similarity between the vehicle characteristic information and each preset vehicle characteristic information;
[0133] Step 803: Determine the door state corresponding to the preset vehicle characteristic information with the highest similarity as the current door state of the target vehicle.
[0134] Step 204: Determine whether each target vehicle has a traffic accident according to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected.
[0135] In one embodiment, step 204 can be implemented as follows: for any target vehicle in the video image to be detected, if the current door state of the target vehicle is an open state, and the current motion state of the target vehicle is a target state, it is determined that the target vehicle has a traffic accident; wherein the target state is that the target vehicle is in a parked state and the parking time is greater than a specified time; otherwise, it is determined that the target vehicle has not had a traffic accident.
[0136] For example, the designated time length is 20 minutes. If it is determined that the door state of the target vehicle is open and the parking time length is greater than 20 minutes, it is determined that the target vehicle has a traffic accident.
[0137] In one embodiment, whether a traffic accident (e.g., a rear-end collision or other traffic accident) occurs between two target vehicles can be determined in the following manner:
[0138] For any two target vehicles in the video image to be detected, the distance between the two target vehicles is determined based on the positions of the two target vehicles; based on the distance between the two target vehicles, the current motion states of the two target vehicles and the door states of the two target vehicles, it is determined whether a traffic accident occurs between the two target vehicles.
[0139] Specifically, whether the two target vehicles have a traffic accident can be determined in the following manner:
[0140] If it is determined that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is the target state and the door of at least one target vehicle is open, it is determined that a traffic accident occurs between the two target vehicles; wherein the target state is that both target vehicles are in a parked state, and the time length in the parked state is greater than a specified time length; otherwise, it is determined that no traffic accident occurs between the two target vehicles.
[0141] For example, Fig. 9 As shown, Fig. 9 The nth frame of video image in is the video image to be detected. If it is determined that the distance between the bounding boxes of vehicle 2 and vehicle 3 is within the specified range, and it is determined that the current vehicle states of vehicle 2 and vehicle 3 are both parked, and the parking time is greater than the specified time, and the door of vehicle 2 is open, it is determined that a traffic accident occurs between vehicle 2 and vehicle 3.
[0142] It should be noted that the specified range and the specified duration in this embodiment can be set according to specific actual conditions, and this embodiment does not limit the values of the specified range and the specified duration.
[0143] In order to further understand the technical solution of the present disclosure, Fig.10 A detailed description may include the following steps:
[0144] Step 1001: for a video image to be detected in a road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected is obtained;
[0145] Step 1002: for any target vehicle having a plurality of positions in the to-be-detected video image, screening the plurality of positions of the target vehicle to obtain the screened position of the target vehicle;
[0146] Step 1003: using a preset target tracking algorithm and the position of each target vehicle, identifying each target vehicle respectively, and obtaining the identification of each target vehicle in the video image to be detected;
[0147] Step 1004: determining the current motion state and the current door state of each target vehicle in the video image to be detected by the position and identification of each target vehicle in the video image to be detected, wherein the current motion state includes whether the target vehicle is in a parking state and the parking time corresponding to the target vehicle in the parking state;
[0148] Step 1005: for any target vehicle in the video image to be detected, determine whether the current motion state of the target vehicle is a target state, wherein the target state is that the target vehicle is in a parking state and the parking time is greater than a specified time; if so, execute step 1006; if not, execute step 1008;
[0149] Step 1006: Determine whether the current door state of the target vehicle is open, if so, execute step 1007, if not, execute step 1008;
[0150] Step 1007: Determine that the target vehicle has a traffic accident;
[0151] Step 1008: Determine that the target vehicle has not been involved in a traffic accident.
[0152] Based on the same disclosure concept, the traffic accident determination method described above in the present disclosure can also be implemented by a traffic accident determination device. The effect of the traffic accident determination device is similar to that of the aforementioned method, and will not be described in detail here.
[0153] Fig.11 It is a schematic diagram of the structure of a traffic accident determination device according to an embodiment of the present disclosure.
[0154] like Fig.11 As shown, the traffic accident determination device 1000 of the present disclosure may include a vehicle detection module 1110 , a target vehicle identification determination module 1120 , a current motion state determination module 1130 and a traffic accident determination module 1140 .
[0155] The vehicle detection module 1110 is used to perform vehicle detection on the video image to be detected in the road section video using a target detection neural network model to obtain the position of each target vehicle in the video image to be detected;
[0156] The target vehicle identification determination module 1120 is used to obtain the identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected;
[0157] The current motion state determination module 1130 is used to determine the current motion state and the current door state of each target vehicle in the video image to be detected according to the position and identification of each target vehicle in the video image to be detected;
[0158] The first traffic accident determination module 1140 is used to determine whether each target vehicle has a traffic accident based on the current door state of each target vehicle in the video image to be detected and the current motion state of each target vehicle, wherein the current door state is used to indicate whether the door of the target vehicle is open.
[0159] In one embodiment, the target detection neural network model uses the content security policy dark network CSPdarknet53 as the backbone network, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hollow convolution with a dilation rate of a set value.
[0160] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0161] The first traffic accident determination module 1140 is specifically used to:
[0162] For any target vehicle in the video image to be detected, if the current door state of the target vehicle is an open state and the current motion state of the target vehicle is a target state, it is determined that the target vehicle has a traffic accident; wherein the target state is that the target vehicle is in a parking state and the parking time is greater than a specified time;
[0163] Otherwise, it is determined that the target vehicle has not had a traffic accident.
[0164] In one embodiment, the target vehicle identification determination module 1120 is specifically used to:
[0165] For any target vehicle having a plurality of positions in the video image to be detected, screening the plurality of positions of the target vehicle to obtain the screened position of the target vehicle;
[0166] By using a preset target tracking algorithm and the position of each target vehicle, each target vehicle is identified respectively to obtain the identification of each target vehicle in the video image to be detected.
[0167] In one embodiment, the apparatus further comprises:
[0168] The second traffic accident determination module 1150 is used to determine the current motion state and current door state of each target vehicle in the video image to be detected based on the position and identification of each target vehicle in the video image to be detected, and then, for any two target vehicles in the video image to be detected, determine the distance between the two target vehicles based on the positions of the two target vehicles; and determine whether a traffic accident occurs between the two target vehicles based on the distance between the two target vehicles, the current motion state of the two target vehicles and the door state of the two target vehicles.
[0169] In one embodiment, the current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state;
[0170] The second traffic accident determination module 1150 is specifically used to:
[0171] If it is determined that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is a target state and the door of at least one target vehicle is in an open state, it is determined that the two target vehicles have a traffic accident; wherein the target state is that both of the two target vehicles are in a parked state, and the duration of being in the parked state is greater than a specified duration;
[0172] Otherwise, it is determined that no traffic accident occurs between the two target vehicles.
[0173] In one embodiment, the apparatus further comprises:
[0174] The current door state determination module 1160 is used to determine the current door state of the target vehicle by:
[0175] For any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain an image of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model;
[0176] The image of the target vehicle is input into a pre-trained residual network for recognition to obtain the current door state of the target vehicle.
[0177] In one embodiment, the apparatus further comprises:
[0178] The parking state determination module 1170 is used to determine whether the target vehicle is in a parking state by:
[0179] For any target vehicle in the video image to be detected, if the position of the target vehicle in the video image to be detected is equal to the position of the target vehicle in the previous frame of the video image, it is determined that the target vehicle is in a parked state;
[0180] Otherwise, it is determined that the target vehicle is not in a parked state.
[0181] In one embodiment, the apparatus further comprises:
[0182] The parking duration determination module 1180 is used to determine the parking duration by:
[0183] After determining that the target vehicle is in a parked state, determining the position of the target vehicle in each frame of video image before the video image to be detected based on the identification of the target vehicle; and,
[0184] The parking time of the target vehicle is determined by the position of the target vehicle in each frame of the video image.
[0185] After introducing a traffic accident determination method and apparatus according to an exemplary embodiment of the present disclosure, next, an electronic device according to another exemplary embodiment of the present disclosure is introduced.
[0186] 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".
[0187] In some possible implementations, 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 determination 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-204 shown in .
[0188] Refer to the following Fig.12 1200 according to this embodiment of the present disclosure is described. Fig.12 The electronic device 1200 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.
[0189] like Fig.12 As shown, the electronic device 1200 is in the form of a general electronic device. The components of the electronic device 1200 may include but are not limited to: the at least one processor 1201, the at least one computer storage medium 1202, and a bus 1203 connecting different system components (including the computer storage medium 1202 and the processor 1201).
[0190] Bus 1203 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.
[0191] Computer storage media 1202 may include readable media in the form of volatile computer storage media, such as random access computer storage media (RAM) 1221 and / or cache storage media 1222 , and may further include read-only computer storage media (ROM) 1223 .
[0192] The computer storage medium 1202 may also include a program / utility 1225 having a set (at least one) of program modules 1224, such program modules 1224 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.
[0193] The electronic device 1200 may also communicate with one or more external devices 1204 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or communicate with any device that enables the electronic device 1200 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 1205. Furthermore, the electronic device 1200 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 1206. As shown, the network adapter 1206 communicates with other modules for the electronic device 1200 via a bus 1203. 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 1200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0194] In some possible implementations, various aspects of a traffic accident determination 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 determination method according to various exemplary embodiments of the present disclosure described above in this specification.
[0195] 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.
[0196] The program product for traffic accident determination of the embodiment of the present disclosure may adopt a portable compact disk read-only computer storage medium (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0197] 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.
[0198] 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.
[0199] 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 a remote electronic device or server. 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).
[0200] 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.
[0201] 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.
[0202] 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.
[0203] 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.
[0204] 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.
[0205] 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 A step that specifies a function in one or more boxes.
[0206] 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 method for determining a traffic accident, characterized in that: The method comprises: For the video image to be detected in the road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected and the confidence of the position of each target vehicle are obtained; For any target vehicle, sort the positions according to the confidences corresponding to the positions of the target vehicle, determine the position with the highest confidence among the positions of the target vehicle, perform intersection over union (IOU) calculation on the positions of the target vehicle except the position with the highest confidence, delete the positions with IOU values greater than a specified threshold, and then determine whether the number of remaining positions is within a specified range. If not, return to the step of sorting the positions according to the confidences of the positions of the target vehicle until the number of remaining positions is within the specified range. Then, use the confidences of the positions of the target vehicles in the screened video image to be detected to screen the positions of the target vehicles again, and obtain the video image to be detected after the second screening. Based on the position of each target vehicle in the video image to be detected, obtaining the identification of each target vehicle in the video image to be detected; The current motion state and the current door state of each target vehicle in the video image to be detected are determined respectively by the position and identification of each target vehicle in the video image to be detected, wherein the current door state is determined in the following manner: for any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain the image of the target vehicle; the image of the target vehicle is subjected to feature extraction using a residual network to obtain vehicle feature information; the vehicle feature information is matched with each preset vehicle feature information to obtain the similarity between the vehicle feature information and each preset vehicle feature information; the door state corresponding to the preset vehicle feature information with the highest similarity is determined as the current door state of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model; According to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected, it is determined whether each target vehicle has a traffic accident.
2. The method according to claim 1, characterized in that The target detection neural network model uses the content security policy dark network CSPdarknet53 as the backbone network, and each convolution layer of at least one residual block in the third residual block and the fourth residual block in the CSPdarknet53 is a hollow convolution with a dilation rate of a set value.
3. The method according to claim 1, characterized in that The current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state; The step of determining whether a traffic accident occurs to each target vehicle according to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected comprises: For any target vehicle in the video image to be detected, if the current door state of the target vehicle is an open state and the current motion state of the target vehicle is a target state, it is determined that the target vehicle has a traffic accident; wherein the target state is that the target vehicle is in a parking state and the parking time is greater than a specified time; Otherwise, it is determined that the target vehicle has not had a traffic accident.
4. The method according to claim 1, characterized in that: The obtaining the identification of each target vehicle in the video image to be detected based on the position of each target vehicle in the video image to be detected includes: By using a preset target tracking algorithm and the position of each target vehicle, each target vehicle is identified respectively to obtain the identification of each target vehicle in the video image to be detected.
5. The method according to claim 1, characterized in that After respectively determining the current motion state and the current door state of each target vehicle in the video image to be detected by using the position and identification of each target vehicle in the video image to be detected, the method further includes: For any two target vehicles in the to-be-detected video image, determining a distance between the two target vehicles based on the positions of the two target vehicles; Based on the distance between the two target vehicles, the current motion states of the two target vehicles and the door states of the two target vehicles, it is determined whether a traffic accident occurs between the two target vehicles.
6. The method according to claim 5, characterized in that The current motion state includes whether the target vehicle is in a parking state and the corresponding parking time when the target vehicle is in a parking state; The determining whether a traffic accident occurs between the two target vehicles based on the distance between the two target vehicles, the current motion states of the two target vehicles, and the door states of the two target vehicles includes: If it is determined that the distance between the two target vehicles is within a specified range, and the current motion state of the two target vehicles is a target state and the door of at least one target vehicle is in an open state, it is determined that the two target vehicles have a traffic accident; wherein the target state is that both of the two target vehicles are in a parked state, and the duration of being in the parked state is greater than a specified duration; Otherwise, it is determined that no traffic accident occurs between the two target vehicles.
7. The method according to claim 3 or 6, characterized in that Determine whether the target vehicle is in a parked state by: For any target vehicle in the video image to be detected, if the position of the target vehicle in the video image to be detected is equal to the position of the target vehicle in the previous frame of the video image, it is determined that the target vehicle is in a parked state; Otherwise, it is determined that the target vehicle is not in a parked state.
8. The method according to claim 3 or 6, characterized in that The parking duration is determined by: Determine the position of the target vehicle in each frame of video image before the video image to be detected based on the identification of the target vehicle; and The parking time of the target vehicle is determined by the position of the target vehicle in each frame of the video image.
9. An electronic device, characterized in that: The device comprises a storage unit and a processor, wherein: The storage unit is configured to store the road segment video; The processor is configured to: For the video image to be detected in the road section video, a target detection neural network model is used to perform vehicle detection on the video image to be detected, and the position of each target vehicle in the video image to be detected and the confidence of the position of each target vehicle are obtained; For any target vehicle, sort the positions according to the confidences corresponding to the positions of the target vehicle, determine the position with the highest confidence among the positions of the target vehicle, perform intersection over union (IOU) calculation on the positions of the target vehicle except the position with the highest confidence, delete the positions with IOU values greater than a specified threshold, and then determine whether the number of remaining positions is within a specified range. If not, return to the step of sorting the positions according to the confidences of the positions of the target vehicle until the number of remaining positions is within the specified range. Then, use the confidences of the positions of the target vehicles in the screened video image to be detected to screen the positions of the target vehicles again, and obtain the video image to be detected after the second screening. Based on the position of each target vehicle in the video image to be detected, obtaining the identification of each target vehicle in the video image to be detected; The current motion state and the current door state of each target vehicle in the video image to be detected are determined respectively by the position and identification of each target vehicle in the video image to be detected, wherein the current door state is determined in the following manner: for any target vehicle in the video image to be detected, the video image to be detected is cropped according to the bounding box of the target vehicle to obtain the image of the target vehicle; the image of the target vehicle is subjected to feature extraction using a residual network to obtain vehicle feature information; the vehicle feature information is matched with each preset vehicle feature information to obtain the similarity between the vehicle feature information and each preset vehicle feature information; the door state corresponding to the preset vehicle feature information with the highest similarity is determined as the current door state of the target vehicle, wherein the bounding box of the target vehicle is obtained by the target detection neural network model; According to the current door state of each target vehicle and the current motion state of each target vehicle in the video image to be detected, it is determined whether each target vehicle has a traffic accident.
