Method, medium and equipment for detecting traffic accident based on video
By combining segmentation of video images and multi-level detection models, the problems of misjudgment and misjudgment in traffic accidents in video detection are solved, and higher detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510673677.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-23
AI Technical Summary
In the prior art, the method of detecting traffic accidents based on video has high misjudgment and misjudgment rates, resulting in poor reliability of traffic accident detection and it is difficult to support more intelligent traffic accident monitoring.
By segmenting the target video, multiple sub-images to be detected are obtained, and the sub-images are detected using the trained traffic accident detection model and classification model to generate traffic accident warning information.
It improves the comprehensiveness and accuracy of traffic accident detection, effectively reduces missed inspections, and enhances the reliability of inspections.
Smart Images

Figure CN120580653A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method, medium and device for detecting traffic accidents based on video. Background Art
[0002] With the increasing complexity of urban traffic, the development of intelligent transportation systems (ITS) has become crucial for alleviating traffic pressure and improving traffic safety. ITS utilizes various technologies to improve traffic management and operations, and video-based accident detection is a key component of these systems. Surveillance cameras installed at key road locations (such as intersections and highways) capture video data, which is then analyzed using algorithms to quickly and accurately detect traffic accidents. For example, in urban traffic management centers, this technology can be used to monitor traffic conditions in real time, eliminating the need for extensive manual monitoring. Once an accident is detected, timely dispatch can be made, minimizing its impact on traffic.
[0003] In the existing technology, video-based traffic accident detection can usually be achieved through target detection models, etc., which can effectively mark the bounding box information of the accident area in the image, facilitating manual verification by management personnel. However, due to the complexity and diversity of traffic accidents, the accuracy of the detection model is often difficult to guarantee, and the error and missed judgment rates of the detection model output results are high, resulting in poor reliability of traffic accident detection and difficulty in effectively supporting more intelligent traffic accident monitoring.
[0004] Therefore, how to improve the reliability of traffic accident detection has become an urgent problem to be solved. Summary of the Invention
[0005] In response to the above technical problems, the technical solution adopted by the present invention is a method for detecting traffic accidents based on video, which includes:
[0006] S101: Acquire a target video and determine an image to be detected from the target video.
[0007] S102 , performing segmentation processing on the image to be detected to obtain M sub-images to be detected, where M is a positive integer.
[0008] S103 : For any sub-image to be detected, input the sub-image to be detected into a trained traffic accident detection model to obtain a first detection result, wherein the first detection result includes N bounding box information.
[0009] S104 : Crop N to-be-confirmed images from the to-be-detected sub-images according to the N bounding box information.
[0010] S105 : For any image to be confirmed, input the image to be confirmed into a trained traffic accident classification model to obtain a second detection result.
[0011] S106: When the second detection result meets the preset conditions, traffic accident warning information is generated.
[0012] The present invention also provides a device for detecting traffic accidents based on video, the device for detecting traffic accidents based on video comprising:
[0013] The present invention also provides a non-transitory computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned method for video-based traffic accident detection.
[0014] The present invention also provides an electronic device comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0015] Compared with the prior art, the present invention has significant benefits. By means of the above technical solution, the method for detecting traffic accidents based on video provided by the present invention can achieve considerable technological advancement and practicality, and has wide industrial application value. It has at least the following beneficial effects:
[0016] By acquiring a target video, determining an image to be detected from the target video, and performing segmentation processing on the image to be detected, M sub-images to be detected are obtained, where M is a positive integer. For any sub-image to be detected, the current sub-image to be detected is input into a trained traffic accident detection model to obtain a first detection result. N images to be confirmed are cropped from the sub-image to be detected based on N bounding box information. For any image to be confirmed, the image to be confirmed is input into a trained traffic accident classification model to obtain a second detection result. When the second detection result meets a preset condition, traffic accident warning information is generated. It can be seen that by segmenting the image to be detected into multiple sub-images to be detected and then detecting the sub-images to be detected using the traffic accident detection model, missed detections caused by a small area of the accident area in the image to be detected can be avoided, thereby improving the comprehensiveness of traffic accident detection. Moreover, after obtaining the first detection result output by the traffic accident detection model, multiple images to be confirmed are cropped from the sub-image to be detected, and the images to be confirmed are detected by classification, which can further verify the first detection result, effectively improving the accuracy and reliability of traffic accident detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0018] Figure 1 A flowchart of a method for detecting traffic accidents based on video provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0020] Example 1
[0021] This embodiment provides a method for detecting traffic accidents based on video. Figure 1 , which is a flow chart of a method for detecting traffic accidents based on video provided by an embodiment of the present invention, including:
[0022] S101: Acquire a target video and determine an image to be detected from the target video.
[0023] S102 , performing segmentation processing on the image to be detected to obtain M sub-images to be detected, where M is a positive integer.
[0024] S103 : For any sub-image to be detected, input the current sub-image to be detected into a trained traffic accident detection model to obtain a first detection result, wherein the first detection result includes N bounding box information.
[0025] S104 : Crop N to-be-confirmed images from the to-be-detected sub-images according to the N bounding box information.
[0026] S105 , for any image to be confirmed, input the current image to be confirmed into a trained traffic accident classification model to obtain a second detection result.
[0027] S106: When the second detection result meets the preset conditions, traffic accident warning information is generated.
[0028] The target video may refer to a traffic video collected by a camera deployed in a traffic area, the target video may include multiple frames of images, and the image to be detected may refer to an image that needs to be used for traffic accident detection.
[0029] The sub-image to be detected may refer to an image input into a trained traffic accident detection model. Usually, a trained traffic accident detection model has limitations on the size of the input image. Dividing the image to be detected into M sub-images to be detected can make the size of each sub-image to be detected meet the requirements of the input image size.
[0030] The traffic accident detection model may be a target detection model, and the target detection model may adopt a YOLO model, an RCNN model, etc. In this embodiment, the traffic accident detection model adopts a YOLO model.
[0031] The bounding box information may include the horizontal coordinate value and the vertical coordinate value of the center point of the bounding box, and the length and width of the bounding box.
[0032] The image to be confirmed may refer to an image that needs to be input into a trained traffic accident classification model for detection through classification, and the second detection result may refer to a classification result corresponding to the image to be confirmed.
[0033] Traffic accident warning information can be used to provide management personnel with confirmation and then conduct accident-related dispatch.
[0034] Specifically, since the sizes of images captured by different cameras are different, this embodiment first standardizes the size of the captured image captured by the camera through scaling processing. For example, the short side of the captured image is standardized to a preset value, and then the long side is scaled according to the ratio of the image length and width. It should be noted that the preset value set in this embodiment is greater than the side length of the sub-image to be detected, thereby improving the image segmentation efficiency and avoiding excessive loss of image information due to scaling processing. In this embodiment, the length and width of the sub-image to be detected are the same. As an example, the side length of the sub-image to be detected can be 512 pixels, and the preset value can be 800 pixels. The implementer can adjust the side length of the sub-image to be detected and the preset value according to the requirements of the actual traffic accident detection model and actual conditions.
[0035] In this embodiment, there are only two categories of bounding boxes in the traffic accident detection model, accident category and normal category. Therefore, the bounding box category does not need to be included in the bounding box information. By default, the bounding box category corresponding to the bounding box information in the first detection result is the accident category.
[0036] In a specific embodiment, S101 includes the following steps:
[0037] Obtain the target video and sample the image to be detected from the target video according to the preset sampling time interval.
[0038] Among them, since multiple frames of images are usually collected in one second during camera acquisition, if all these images are processed, more computing resources are required. Considering that the occurrence and end of a traffic accident are not completed in a short time, this embodiment samples the image to be detected from the target video according to a preset sampling time interval, and the preset sampling time interval can be two seconds.
[0039] In a specific embodiment, S102 includes the following steps:
[0040] S1021, obtaining the length information L and width information W of the image to be detected.
[0041] S1022 : Determine a first segmentation quantity A and A first starting segmentation positions according to L and a preset length P of the sub-image to be detected.
[0042] S1023 : Determine a second segmentation quantity B and B second starting segmentation positions according to W and a preset width Q of the sub-image to be detected.
[0043] S1024 : Determine A×B starting segmentation coordinates according to the A first starting segmentation positions and the B second starting segmentation positions, where A×B=M.
[0044] S1025 , segmenting the image to be detected to obtain A×B sub-images to be detected according to the A×B starting segmentation coordinates.
[0045] Among them, when segmenting the image, it can be processed separately from the horizontal axis direction and the vertical axis direction. The number of sub-images to be detected on the horizontal axis and the first starting segmentation position of each sub-image to be detected, that is, the horizontal coordinate of the upper left corner point of each sub-image to be detected, can be determined based on the length information L of the image to be detected and the preset length P of the sub-image to be detected.
[0046] Similarly, the number of sub-images to be detected on the vertical axis and the second starting segmentation position of each sub-image to be detected, that is, the vertical coordinate of the upper left corner point of each sub-image to be detected, can be determined based on the width information W of the image to be detected and the preset width Q of the sub-image to be detected.
[0047] Specifically, based on A first starting segmentation positions and B second starting segmentation positions, it is obvious that A×B starting segmentation coordinates can be combined to obtain A×B starting segmentation coordinates. Then, based on the A×B starting segmentation coordinates, the preset length P of the sub-image to be detected, and the width Q of the sub-image to be detected, A×B sub-images to be detected are determined.
[0048] In a specific embodiment, determining the first number of segments A and the A first starting segmentation positions according to L and a preset length P of the sub-image to be detected includes:
[0049] A first division number A=f(L / P) is determined, where f() is a ceiling function.
[0050] The first offset step size C=A-(A×PL) / (A-1) is determined.
[0051] According to the initial segmentation position D and the first offset step, a first starting segmentation position D+a×C is obtained, where a is an integer in the range of [0, A-1].
[0052] In this embodiment, the initial segmentation position D may be 0, and the A first starting segmentation positions may include 0, C, 2C, . . . , (A-1)×C.
[0053] In a specific implementation, S1023 includes the following steps:
[0054] The second division number B=f(W / Q) is determined, where f() is a ceiling function.
[0055] The second offset step size E=B-(B×QW) / (B-1) is determined.
[0056] According to the initial segmentation position F and the second offset step, a second starting segmentation position F+b×E is obtained, where b is an integer in the range of [0, B-1].
[0057] In this embodiment, the initial segmentation position F may be 0, and the B second starting segmentation positions may include 0, E, 2E, . . . , (B-1)×E.
[0058] In a specific embodiment, S103 includes the following steps:
[0059] For any sub-image to be detected, the sub-image to be detected is input into the trained traffic accident detection model to obtain the accident prediction probabilities corresponding to R initial bounding boxes in the sub-image to be detected, where R is a positive integer.
[0060] The first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold.
[0061] Among them, in the target detection model, the output prediction result usually includes the location information and confidence of the bounding box. In this embodiment, the confidence is also the accident prediction probability. By setting the first probability threshold, the initial bounding boxes with a smaller accident prediction probability can be screened out, thereby reducing the number of bounding boxes that need to be re-detected by the traffic accident classification model, thereby improving the overall traffic accident detection efficiency.
[0062] In a specific embodiment, S103 further includes the following steps:
[0063] For any initial bounding box whose accident prediction probability is not greater than the first probability threshold and greater than a preset second probability threshold, the image coordinates corresponding to the center point of the current initial bounding box in the image to be detected are determined.
[0064] According to a preset mapping function, the area of the current initial bounding box is mapped to the search radius, wherein the mapping function includes a mapping relationship between the area of the initial bounding box and the search radius.
[0065] According to the image coordinates and the search radius, the search domain of the current initial bounding box in the image to be detected is determined.
[0066] If the search domain contains image coordinates corresponding to other initial bounding boxes whose accident prediction probabilities are greater than the second probability threshold, the current initial bounding box is determined to be the reference bounding box.
[0067] Accordingly, the first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold, including:
[0068] The first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold and all reference bounding boxes.
[0069] Among them, since the segmentation of the sub-image to be detected may cause the traffic accident area to be divided into different sub-images to be detected, and since the traffic accident area contained in a single sub-image to be detected is not complete, the accident prediction probability of the initial bounding box detected by the sub-image to be detected may not be as high as expected. In order to avoid such situations, this embodiment re-judges the initial bounding box whose accident prediction probability is not greater than the first probability threshold and greater than the preset second probability threshold through searching to avoid missed judgments.
[0070] Specifically, the mapping function may compare the area of the initial bounding box with the area of a preset basic bounding box to obtain an area ratio, and multiply the area ratio by a preset radius to obtain a search radius.
[0071] Based on the image coordinates and the search radius, the search domain of the initial bounding box in the image to be detected is obtained. At this time, it is only necessary to detect whether there are other image coordinates corresponding to the initial bounding box whose accident prediction probability is greater than the second probability threshold in the search domain. If so, it can be considered that the traffic accident area is divided into different sub-images to be detected, and the initial bounding box is still considered to be capable of secondary detection.
[0072] In a specific embodiment, the second detection result includes an accident type and a normal type, and S106 includes the following steps:
[0073] When the second detection result is an accident type, traffic accident warning information is generated.
[0074] Among them, the traffic accident classification model can be a binary classification model. Since the cost of sample labeling and training of the classification model is lower than that of the detection model, this embodiment can improve the accuracy of traffic accident detection only by continuously iterating the classification model, thereby improving the practicality of traffic accident detection based on the neural network model.
[0075] It can be seen that this embodiment divides the image to be detected into multiple sub-images to be detected and then detects the sub-images to be detected through the traffic accident detection model, which can avoid missed detection due to the small area of the accident area in the image to be detected, thereby improving the comprehensiveness of traffic accident detection. Moreover, after obtaining the first detection result output by the traffic accident detection model, multiple images to be confirmed are cropped from the sub-image to be detected, and the images to be confirmed are detected by classification, which can further verify the first detection result, thereby effectively improving the accuracy and reliability of traffic accident detection.
[0076] Example 2
[0077] This second embodiment provides a device for detecting traffic accidents based on video. The device for detecting traffic accidents based on video includes:
[0078] The data acquisition module is used to acquire the target video and determine the image to be detected from the target video.
[0079] The image segmentation module is used to segment the image to be detected to obtain M sub-images to be detected, where M is a positive integer.
[0080] The image detection module is used to input the current sub-image to be detected into a trained traffic accident detection model for any sub-image to be detected to obtain a first detection result, wherein the first detection result includes N bounding box information.
[0081] The image cropping module is used to crop N to-be-confirmed images from the to-be-detected sub-images based on the N bounding box information.
[0082] The image classification module is used to input the current image to be confirmed into a trained traffic accident classification model for any image to be confirmed, and obtain a second detection result.
[0083] The information generation module is used to generate traffic accident warning information when the second detection result meets the preset conditions.
[0084] In a specific embodiment, the data acquisition module includes:
[0085] The image sampling submodule is used to obtain the target video and sample the image to be detected from the target video according to a preset sampling time interval.
[0086] In a specific embodiment, the image segmentation module includes:
[0087] The image information acquisition submodule is used to obtain the length information L and width information W of the image to be detected.
[0088] The first segmentation information acquisition submodule is used to determine a first segmentation quantity A and A first starting segmentation positions according to L and a preset length P of the sub-image to be detected.
[0089] The second segmentation information acquisition submodule is used to determine the second segmentation quantity B and B second starting segmentation positions according to W and a preset width Q of the sub-image to be detected.
[0090] The segmentation coordinate acquisition submodule is used to determine A×B starting segmentation coordinates according to A first starting segmentation positions and B second starting segmentation positions, where A×B=M.
[0091] The image segmentation submodule is used to segment the image to be detected to obtain A×B sub-images to be detected according to A×B starting segmentation coordinates.
[0092] In a specific embodiment, the first segmentation information acquisition submodule includes:
[0093] The first segmentation number acquisition submodule is used to determine the first segmentation number A=f(L / P), where f() is a round-up function.
[0094] The first offset step length acquisition submodule is used to determine the first offset step length C=A-(A×PL) / (A-1).
[0095] The first starting segmentation position determination submodule is configured to obtain a first starting segmentation position D+a×C according to the initial segmentation position D and the first offset step, where a is an integer in the range of [0, A-1].
[0096] In a specific embodiment, the second segmentation information acquisition submodule includes:
[0097] The second segmentation number acquisition submodule is used to determine the second segmentation number B=f(W / Q), where f() is a round-up function.
[0098] The second offset step length acquisition submodule is used to determine the second offset step length E=B-(B×QW) / (B-1).
[0099] The second starting segmentation position determination submodule is configured to obtain a second starting segmentation position F+b×E according to the initial segmentation position F and the second offset step, where b is an integer in the range of [0, B-1].
[0100] In a specific embodiment, the image detection module includes:
[0101] The probability prediction submodule is used to input any sub-image to be detected into the trained traffic accident detection model to obtain the accident prediction probabilities corresponding to R initial bounding boxes in the sub-image to be detected, where R is a positive integer.
[0102] The first detection result acquisition submodule is configured to form a first detection result based on the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold.
[0103] In a specific embodiment, the image detection module further includes:
[0104] The image coordinate acquisition submodule is used to determine the image coordinates corresponding to the center point of the current initial bounding box in the image to be detected for any initial bounding box whose accident prediction probability is not greater than the first probability threshold and greater than the preset second probability threshold.
[0105] The search radius acquisition submodule is used to map the area of the current initial bounding box to the search radius according to a preset mapping function, wherein the mapping function includes a mapping relationship between the area of the initial bounding box and the search radius.
[0106] The search domain acquisition submodule is used to determine the search domain of the current initial bounding box in the image to be detected based on the image coordinates and the search radius.
[0107] The reference bounding box acquisition submodule is used to determine the current initial bounding box as the reference bounding box if the search domain contains image coordinates corresponding to other initial bounding boxes whose accident prediction probability is greater than the second probability threshold.
[0108] Accordingly, the first detection result acquisition submodule includes:
[0109] The first detection result acquisition unit is configured to form a first detection result based on the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold and all reference bounding boxes.
[0110] In a specific embodiment, the second detection result includes an accident type and a normal type, and the information generation module includes:
[0111] The information generation submodule is used to generate traffic accident warning information when the second detection result is an accident type.
[0112] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0113] Example 3
[0114] A third embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the following steps:
[0115] S101: Acquire a target video and determine an image to be detected from the target video.
[0116] S102 , performing segmentation processing on the image to be detected to obtain M sub-images to be detected, where M is a positive integer.
[0117] S103 : For any sub-image to be detected, input the current sub-image to be detected into a trained traffic accident detection model to obtain a first detection result, wherein the first detection result includes N bounding box information.
[0118] S104 : Crop N to-be-confirmed images from the to-be-detected sub-images according to the N bounding box information.
[0119] S105 , for any image to be confirmed, input the current image to be confirmed into a trained traffic accident classification model to obtain a second detection result.
[0120] S106: When the second detection result meets the preset conditions, traffic accident warning information is generated.
[0121] Those skilled in the art will appreciate that all or part of the processes in the above-described embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described embodiments. Any reference to memory, storage, database, or other media used in the embodiments provided herein may include both non-volatile and volatile memory.
[0122] Those skilled in the art will clearly understand that for the sake of convenience and brevity in description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0123] Example 4
[0124] A fourth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium according to the third embodiment of the present invention.
[0125] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above in terms of preferred embodiments, they are not intended to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for detecting traffic accidents based on video, characterized in that: The method for detecting traffic accidents based on video includes: S101, obtaining a target video, and determining an image to be detected from the target video; S102, performing segmentation processing on the image to be detected to obtain M sub-images to be detected, where M is a positive integer; S103: For any sub-image to be detected, input the current sub-image to be detected into a trained traffic accident detection model to obtain a first detection result, wherein the first detection result includes N bounding box information; S104, cropping N to-be-confirmed images from the to-be-detected sub-images according to the N bounding box information; S105, for any image to be confirmed, input the current image to be confirmed into the trained traffic accident classification model to obtain a second detection result; S106: When the second detection result meets a preset condition, generate traffic accident warning information.
2. The method for detecting traffic accidents based on video according to claim 1, characterized in that: S101 includes the following steps: A target video is acquired, and the image to be detected is sampled from the target video at a preset sampling time interval.
3. The method for detecting traffic accidents based on video according to claim 1, characterized in that: S102 includes the following steps: S1021, obtaining length information L and width information W of the image to be detected; S1022, determining a first number of segments A and A first starting segmentation positions according to L and a preset length P of the sub-image to be detected; S1023, determining a second number of segments B and B second starting segmentation positions according to W and a preset width Q of the sub-image to be detected; S1024, determining A×B starting segmentation coordinates based on A first starting segmentation positions and B second starting segmentation positions, where A×B=M; S1025 , segmenting the image to be detected to obtain A×B sub-images to be detected according to the A×B starting segmentation coordinates.
4. The method for detecting traffic accidents based on video according to claim 3, characterized in that: S1022 includes the following steps: Determine a first number of divisions A=f(L / P), where f() is a ceiling function; Determine the first offset step size C = A - (A × PL) / (A - 1); According to the initial segmentation position D and the first offset step, a first starting segmentation position D+a×C is obtained, where a is an integer in the range of [0, A-1].
5. The method for detecting traffic accidents based on video according to claim 3, characterized in that: S1023 includes the following steps: Determine the second number of divisions B=f(W / Q), where f() is a ceiling function; Determine the second offset step size E = B - (B × QW) / (B - 1); According to the initial segmentation position F and the second offset step, a second starting segmentation position F+b×E is obtained, where b is an integer in the range of [0, B-1].
6. The method for detecting traffic accidents based on video according to claim 1, characterized in that: S103 includes the following steps: For any sub-image to be detected, the sub-image to be detected is input into the trained traffic accident detection model to obtain the accident prediction probability corresponding to the R initial bounding boxes in the sub-image to be detected, where R is a positive integer; The first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold.
7. The method for detecting traffic accidents based on video according to claim 6, characterized in that: S103 also includes the following steps: For any initial bounding box whose accident prediction probability is not greater than the first probability threshold and greater than a preset second probability threshold, determining the image coordinates corresponding to the center point of the current initial bounding box in the image to be detected; Mapping the area of the current initial bounding box to a search radius according to a preset mapping function, wherein the mapping function includes a mapping relationship between the area of the initial bounding box and the search radius; Determining a search domain of a current initial bounding box in the image to be detected according to the image coordinates and the search radius; If the search domain contains image coordinates corresponding to other initial bounding boxes whose accident prediction probability is greater than the second probability threshold, determining the current initial bounding box as the reference bounding box; Accordingly, the first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold, including: The first detection result is formed by the bounding box information of all initial bounding boxes whose accident prediction probabilities are greater than a preset first probability threshold and all reference bounding boxes.
8. The method for detecting traffic accidents based on video according to claim 1, characterized in that: The second detection result includes an accident type and a normal type, and S106 includes the following steps: When the second detection result is an accident type, traffic accident warning information is generated.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method for detecting traffic accidents based on video as described in any one of claims 1-8.
10. An electronic device, characterized in that: The device comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Image processing method and device and computer readable storage medium
CN112597960A
Behavior detection method, device and equipment
CN112686114A
Video-based instance tracking method and device, equipment and storage medium
CN113822134A
Image type identification method and device, equipment, medium and product
CN114708539A
Target identification method and device for multi-camera spliced high-resolution video
CN118247495A