Traffic event alarm method and system

The video stream of traffic area is collected through the camera, the target box is detected and the matching degree of feature vectors is calculated, and the traffic event alarm information is generated, which solves the problems of inefficiency of the existing traffic monitoring system and the error in the judgment of events, and improves the traffic management response speed and event processing efficiency.

CN119851459AInactive Publication Date: 2025-04-18AIPARK TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411785799.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing traffic monitoring system is inefficient, unable to update traffic conditions in real time, and cannot organize and make corresponding judgments after traffic events are detected, resulting in inefficient traffic management response speed and event handling.

Method used

The video stream of the traffic area is collected through the camera, the picture frame is obtained and the target box is detected, the matching degree between the target feature vector and the alarm event list is calculated, the traffic event category is judged, and the alarm information is generated.

Benefits of technology

It realizes rapid detection of traffic events and generates alarm information, significantly improving the response speed and event processing efficiency of traffic management, and avoiding judgment errors caused by the separation of targets in the same traffic scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851459A_ABST
    Figure CN119851459A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic event alarm method and system. The method comprises the following steps: acquiring a plurality of picture frames corresponding to a video stream of a traffic area and target detection frames corresponding to the picture frames; acquiring a traffic event corresponding to each target detection frame; judging whether the traffic event corresponding to each target detection frame belongs to a violation type traffic event or not; in response to the fact that the traffic event corresponding to the target detection frame belongs to the violation type traffic event, outputting the target detection frame and the picture frames and the traffic events corresponding to other target detection frames with the same target in the target detection frame; and in response to the fact that the traffic event corresponding to the target detection frame does not belong to the violation type traffic event, outputting the traffic event corresponding to the target detection frame and a picture frame in which the target detection frame which has the same target in the target detection frame and meets the ordinal number threshold condition is located. According to the scheme, the alarm information can be formed based on the arrangement result of the traffic events, so that the response speed of traffic management and the event processing efficiency are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to the field of traffic warning technology. More specifically, the present application relates to a traffic event warning method and system. Background Art

[0002] With the rapid development of urbanization, the transportation system, as the lifeline of urban operation, carries the increasing traffic flow and complex traffic environment. However, with the increasing traffic flow and the complexity of the traffic environment, the monitoring and management of the transportation system also faces major challenges.

[0003] In the existing technology, traffic monitoring systems often rely on manual monitoring or sensor technology, which are not only inefficient but also unable to update traffic conditions in real time. At the same time, after detecting a specific traffic incident, the traffic monitoring system directly generates warning information based on the traffic incident, without organizing and judging the traffic incident accordingly.

[0004] In view of this, there is an urgent need to provide a traffic incident warning solution to quickly detect traffic incidents and form warning information according to the type of traffic incidents. Summary of the invention

[0005] In order to at least solve one or more of the technical problems mentioned above, the present application proposes a traffic incident warning solution in multiple aspects.

[0006] In a first aspect, the present application provides a traffic event warning method, comprising: collecting a video stream of a corresponding traffic area through a camera, and obtaining multiple picture frames corresponding to the video stream and one or more target detection frames corresponding to each picture frame; calculating a feature vector of a target in a target detection frame area, and performing cosine similarity matching on the feature vector of the target and the feature vector of each event in a warning event list to obtain a traffic event corresponding to each target detection frame; determining whether the traffic event corresponding to each target detection frame belongs to a violation-type traffic event; in response to a traffic event corresponding to a target detection frame belonging to a violation-type traffic event, outputting as warning information the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames having the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames having the same target as the target detection frame; in response to a traffic event corresponding to a target detection frame not belonging to a violation-type traffic event, sorting the areas corresponding to the target detection frame and other target detection frames having the same target as the target detection frame, and outputting as warning information the traffic event corresponding to the target detection frame and the picture frame where the target detection frame meeting an ordinal threshold condition is located.

[0007] In some embodiments, obtaining one or more target detection frames corresponding to each picture frame includes: obtaining initial detection frames corresponding to each picture frame; determining whether the number of corresponding initial detection frames in the picture frame is multiple; in response to the number of corresponding initial detection frames in the picture frame being multiple, using the corresponding initial detection frames in the picture frame as target detection frames; in response to the number of corresponding initial detection frames in the picture frame being multiple, merging initial detection frames whose spacings satisfy a spacing threshold condition to obtain a merged frame, and using the merged frame and the initial detection frames whose spacings do not satisfy the spacing threshold condition as target detection frames.

[0008] In some embodiments, the spacing threshold condition is: the spacing between the initial detection frames is less than the spacing threshold.

[0009] In some embodiments, the spacing between the initial detection frames is obtained by the following steps: obtaining the coordinates of the center points of each initial detection frame; obtaining the distance between the center points of each initial detection frame based on the coordinates of the center points of each initial detection frame; and using the distance between the center points of each initial detection frame as the spacing between the initial detection frames.

[0010] In some embodiments, cosine similarity matching is performed on the feature vector of the target with the feature vector of each event in the alarm event list to obtain traffic events corresponding to each target detection frame, including: calculating the cosine similarity between the feature vector of the target and the feature vector of each event in the alarm event list; determining whether there is an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition; in response to the presence of an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition, treating the event as the traffic event corresponding to the target detection frame; in response to the absence of an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition, marking the target detection frame with a marking value.

[0011] In some embodiments, the cosine similarity threshold condition is: the cosine similarity between the feature vector of the target and the feature vector of the event in the alarm event list is greater than the cosine similarity threshold.

[0012] In some embodiments, when all corresponding target detection frames in a picture frame are marked with a marking value, the picture frame is deleted.

[0013] In some embodiments, the ordinal threshold condition is: the ordinal of the area corresponding to the sorted target detection box is less than the ordinal threshold.

[0014] In some embodiments, before collecting the video stream of the corresponding traffic area through the camera, it is determined whether the camera is successfully connected. In the process of determining whether the camera is successfully connected, the following steps are performed: collecting the access information of the camera;

[0015] The camera access information is matched with the input information corresponding to the camera; when the matching degree between the camera access information and the input information corresponding to the camera is greater than the matching degree threshold, it is determined that the camera connection is successful.

[0016] In the second aspect, the present application provides a traffic incident warning system, which uses the traffic incident warning method as described in any embodiment of the first aspect to perform traffic incident warnings, and the system includes: a target detection frame acquisition module, which is used to collect a video stream of the corresponding traffic area through a successfully connected camera, and obtain multiple image frames corresponding to the video stream and one or more target detection frames corresponding to each image frame; a similarity matching module, which is used to calculate the feature vector of the target in the target detection frame area, and perform cosine similarity matching on the feature vector of the target with the feature vector of each event in the warning event list to obtain the traffic event corresponding to each target detection frame; a judgment module, which is used to judge whether the traffic event corresponding to each target detection frame is a violation A warning information output module is used for, in response to the traffic event corresponding to the target detection frame belonging to the violation type traffic event, outputting the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target as the target detection frame as warning information; in response to the traffic event corresponding to the target detection frame not belonging to the violation type traffic event, sorting the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame, and outputting the traffic event corresponding to the target detection frame and the picture frame where the target detection frame that meets the ordinal threshold condition is located as warning information.

[0017] Based on the traffic event warning method provided above, the embodiment of the present application can quickly obtain the traffic event corresponding to the target detection frame by matching the feature vector of the target with the feature vector of each event in the warning event list by cosine similarity, and can form warning information based on the classification of traffic events, so as to significantly improve the response speed of traffic management and the efficiency of event processing. Furthermore, in some embodiments, when there are multiple corresponding initial detection frames in the picture frame, the initial detection frames whose spacings meet the spacing threshold condition are merged to obtain a merged frame, which can avoid the separation of targets belonging to the same traffic scene, thereby causing the problem of misjudgment of traffic events. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0019] Figure 1 An exemplary flow chart of a traffic incident warning method according to an embodiment of the present application is shown;

[0020] Figure 2 An exemplary flow chart of determining whether a camera is successfully connected is shown in an embodiment of the present application;

[0021] Figure 3 An exemplary flow chart of obtaining target detection frames corresponding to each picture frame in an embodiment of the present application is shown;

[0022] Figure 4 An exemplary flow chart of obtaining traffic events corresponding to each target detection frame according to an embodiment of the present application is shown;

[0023] Figure 5 An exemplary structural block diagram of the traffic incident warning system in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0025] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present application indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0026] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this application specification and claims, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms. It should also be further understood that the term "and / or" used in this application specification and claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0027] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0028] The specific implementation of the present application is described in detail below with reference to the accompanying drawings.

[0029] Figure 1 An exemplary flow chart of a traffic event warning method 100 according to an embodiment of the present application is shown.

[0030] like Figure 1 As shown, in step S110, a video stream of a corresponding traffic area is collected by a camera, and a plurality of picture frames corresponding to the video stream and one or more target detection frames corresponding to each picture frame are obtained.

[0031] In an embodiment of the present application, before collecting the video stream of the corresponding traffic area through the camera, it is determined whether the camera is successfully connected. Only when it is determined that the camera is successfully connected, the camera is used to collect the video stream of the corresponding traffic area.

[0032] By using the camera to collect the video stream of the corresponding traffic area after the camera is successfully connected, erroneous data recording caused by camera disconnection or failure is avoided, and the accuracy of the collected data is improved.

[0033] By collecting video streams of corresponding traffic areas, real-time information can be provided for traffic monitoring, which helps to quickly respond to traffic incidents and thus conduct traffic management and dispatch in a timely manner.

[0034] In the embodiment of the present application, the specific process of determining whether the camera is successfully connected can be found in Figure 2 . Figure 2 An exemplary flow chart of determining whether a camera is successfully connected is shown in the embodiment of the present application. Figure 2 As shown, in step S210, the access information of the camera is collected. Then, in step S220, the access information of the camera is matched with the input information corresponding to the camera. Then, in step S230, it is determined whether the matching degree between the access information of the camera and the input information corresponding to the camera is greater than the matching degree threshold. In response to the matching degree between the access information of the camera and the input information corresponding to the camera being greater than the matching degree threshold, in step S240, it is determined that the camera connection is successful. In response to the matching degree between the access information of the camera and the input information corresponding to the camera being not greater than the matching degree threshold, in step S250, it is determined that the camera connection fails.

[0035] Specifically, the camera's access information includes key parameters such as the camera's IP address, user name, password, manufacturer, and communication protocol used.

[0036] In the embodiments of the present application, in the process of matching the access information of the camera with the input information corresponding to the camera, a string matching method, a similarity measurement matching method, a hash matching method, etc. can be used, and the present application does not limit this.

[0037] In the embodiments of the present application, the user may set the matching degree threshold according to actual needs, and the present application does not impose any limitation thereto.

[0038] In an embodiment of the present application, in the process of obtaining multiple picture frames corresponding to a video stream, the frequency of the picture frames is first extracted from the video stream. Then, according to the set frequency, the picture frames are extracted from the video stream through video processing software or API. Then, the extracted picture frames are preprocessed to obtain multiple picture frames corresponding to the video stream.

[0039] In the embodiments of the present application, the user determines the frequency of extracting picture frames from the video stream according to actual needs and application scenarios, and the present application does not impose any limitation thereto.

[0040] In an embodiment of the present application, preprocessing the extracted picture frame includes: denoising, contrast enhancement, color correction, sharpening, etc. Specifically, the denoising method used may be median filtering, Gaussian filtering, etc., which is not limited in the present application.

[0041] By preprocessing the extracted picture frames, the picture quality of the picture frames can be improved, thereby improving the acquisition efficiency and analysis effect of the target detection frame when obtaining the corresponding target detection frame in each picture frame.

[0042] In the embodiment of the present application, the specific process of obtaining one or more target detection frames corresponding to each image frame can be found in Figure 3 . Figure 3 An exemplary flowchart of obtaining target detection frames corresponding to each image frame according to an embodiment of the present application is shown.

[0043] like Figure 3As shown, in step S310, the initial detection frames corresponding to each picture frame are obtained. Then, in step S320, it is determined whether the number of the corresponding initial detection frames in the picture frame is multiple. In response to the number of the corresponding initial detection frames in the picture frame being not multiple, in step S330, the corresponding initial detection frame in the picture frame is used as the target detection frame. In response to the number of the corresponding initial detection frames in the picture frame being multiple, in step S340, the initial detection frames whose spacings satisfy the spacing threshold condition are merged to obtain a merged frame, and the merged frame and the initial detection frames whose spacings do not satisfy the spacing threshold condition are used as the target detection frame.

[0044] In an embodiment of the present application, the initial detection frame can be obtained by a deep learning method to improve the efficiency of obtaining the initial detection frame. Specifically, the initial detection frame can be obtained by a convolutional neural network algorithm, a YOLO algorithm, an SSD algorithm, etc., and the present application does not limit this.

[0045] In an embodiment of the present application, when the number of corresponding initial detection frames in a picture frame is not multiple, that is, the number of corresponding initial detection frames in a picture frame is only one, there is no problem of separating targets belonging to the same traffic scene. Therefore, it can be directly used as a target detection frame.

[0046] In an embodiment of the present application, when there are multiple corresponding initial detection frames in a picture frame, there may be a problem of separation of objects belonging to the same traffic scene. For example, traffic congestion, rear-end collision, and collision belong to the same traffic scene. If each object is analyzed separately, it may cause an error in the judgment of the traffic event, and the situation of traffic congestion, rear-end collision, and collision may not be judged. Therefore, it is necessary to judge whether the objects in each initial detection frame belong to the same scene, and place the objects belonging to the same scene in one detection frame.

[0047] Specifically, the distance between the initial detection frames is used to determine whether the targets in the initial detection frames belong to the same scene. When the distance between them meets the distance threshold condition, it is determined that the targets in the corresponding initial detection frames belong to the same scene, and the corresponding targets are placed in one detection frame.

[0048] In the embodiment of the present application, the spacing threshold condition is: the spacing between the initial detection frames is less than the spacing threshold. Specifically, the spacing threshold can be set according to actual needs, application scenarios, historical data, empirical rules, etc., and the present application does not limit it here.

[0049] In an embodiment of the present application, in the process of obtaining the spacing between the initial detection frames, the coordinates of the center points of each initial detection frame are first obtained, then the distance between the center points of each initial detection frame is obtained based on the coordinates of the center points of each initial detection frame, and then the distance between the center points of each initial detection frame is used as the spacing between the initial detection frames. By obtaining the coordinates of the center points of each initial detection frame, the specific position of each initial detection frame in the picture frame can be clearly understood. Compared with using the distance between the boundaries of the initial detection frames as the spacing between the initial detection frames, the relative positions between the initial detection frames can be better evaluated by using the distance between the center points as the spacing between the initial detection frames.

[0050] In some embodiments of the present application, in the process of merging the initial detection frames whose spacings satisfy the spacing threshold condition to obtain the merged frame, the merged frame may be obtained by obtaining the minimum bounding rectangle or the weighted average method. In other embodiments of the present application, other methods may also be used to obtain the merged frame, which is not limited in the present application.

[0051] Specifically, in the process of obtaining the merged frame by obtaining the minimum bounding rectangle, the minimum bounding rectangle of all initial detection frames that meet the spacing threshold condition is obtained and used as the merged frame. This ensures that the merged frame can contain the objects in all corresponding initial detection frames.

[0052] Specifically, in the process of obtaining the merged frame by the weighted average method, the coordinates, widths and heights of all the initial detection frames that meet the spacing threshold condition are weighted averaged according to the confidence or other weight information of all the initial detection frames that meet the spacing threshold condition, and the coordinates of the center point of the merged frame and its width and height are obtained. For example, when the merged frame is obtained according to all the initial detection frames that meet the spacing threshold condition, the confidence of each initial detection frame is used as a weight to perform weighted average on the x-axis coordinates of all the initial detection frames, and the y-axis coordinates of all the initial detection frames are weighted averaged to obtain the coordinates of the center point of the merged frame. At the same time, the confidence of each initial detection frame is used as a weight to perform weighted average on the width of all the initial detection frames to obtain the width of the merged frame, and the confidence of each initial detection frame is used as a weight to perform weighted average on the height of all the initial detection frames to obtain the height of the merged frame.

[0053] Specifically, in the aforementioned process of obtaining the initial detection frame, the confidence of each initial detection frame is obtained at the same time. For example, when processing the image frame through the YOLO algorithm, the position of the initial detection frame, the category label and the confidence of the initial detection frame are obtained.

[0054] After obtaining the target detection frame, in step S120, the feature vector of the target in the target detection frame area is calculated, and the feature vector of the target is matched with the feature vector of each event in the alarm event list by cosine similarity to obtain the traffic events corresponding to each target detection frame.

[0055] In an embodiment of the present application, in the process of calculating the feature vector of the target within the target detection frame area, a convolutional neural network can be used to perform feature extraction, region proposal, feature pooling, feature conversion, and possible feature encoding and fusion on the target detection frame to obtain the feature vector.

[0056] In the embodiment of the present application, the specific process of obtaining the traffic events corresponding to each target detection frame by cosine similarity matching can be found in Figure 4 . Figure 4 An exemplary flowchart of obtaining traffic events corresponding to each target detection frame according to an embodiment of the present application is shown.

[0057] like Figure 4 As shown, in step S410, the cosine similarity between the feature vector of the target and the feature vector of each event in the alarm event list is calculated. Then, in step S420, it is determined whether there is an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition. In response to the presence of an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition, in step S430, the event is used as the traffic event corresponding to the target detection frame. In response to the absence of an event in the alarm event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition, in step S440, the target detection frame is marked with a marking value.

[0058] In an embodiment of the present application, traffic events corresponding to the target detection frame include fog, traffic congestion, lane change on a solid line, illegal U-turn, fire, rear-end collision, and car crash.

[0059] In an embodiment of the present application, the cosine similarity between the feature vector of the target and the feature vector of each event in the alarm event list is calculated by the cosine similarity formula, and the cosine similarity formula is:

[0060] Where A is the feature vector of the target, B is the feature vector of the event in the alarm event list, A·B represents the dot product of feature vector A and feature vector B, ||A|| represents the Euclidean norm of feature vector A, ||B|| represents the Euclidean norm of feature vector B, and ||A||·||B|| represents the dot product of the Euclidean norm of feature vector A and the Euclidean norm of feature vector B.

[0061] In the embodiment of the present application, the cosine similarity threshold condition is: the cosine similarity between the feature vector of the target and the feature vector of the event in the warning event list is greater than the cosine similarity threshold. That is, when there is an event in the warning event list whose cosine similarity between the feature vector of the target and the event is greater than the cosine similarity threshold, the event is regarded as the traffic event corresponding to the target detection frame.

[0062] In the embodiments of the present application, the user sets the cosine similarity threshold according to actual needs, application scenarios, historical data, empirical rules, etc., and the present application does not limit this.

[0063] In an embodiment of the present application, when there is no event in the warning event list whose cosine similarity with the feature vector of the target satisfies the cosine similarity threshold condition, that is, there is no corresponding traffic event in the target detection frame, the target detection frame is marked with a tag value at this time, so as to determine whether the picture frame needs to be deleted for subsequent use. Specifically, the tag value can be set according to user needs, and the present application does not limit it here.

[0064] In an embodiment of the present application, after obtaining the corresponding traffic events or marking the target detection frames in all the picture frames with the tag values, it is determined whether all the corresponding target detection frames in each picture frame are marked with the tag values. In response to all the corresponding target detection frames in a certain picture frame being marked with the tag values, the picture frame is deleted. In response to some of the corresponding target detection frames in a certain picture frame being marked with the tag values ​​or all the target detection frames not being marked with the tag values, the picture frame is retained for subsequent output.

[0065] In an embodiment of the present application, by deleting picture frames in which all corresponding target detection frames are marked with a marking value, storage space can be released and the efficiency of subsequent processing of picture frames can be improved to output alarm information more quickly.

[0066] After obtaining the traffic events corresponding to the target detection frames, in step S130, it is determined whether the traffic events corresponding to the target detection frames belong to illegal traffic events.

[0067] In the embodiments of the present application, whether the traffic events corresponding to each target detection frame belong to the illegal traffic events can be determined by string matching, hash matching, etc., and the present application does not limit this. For example, when the string matching method is used to determine whether the traffic events corresponding to each target detection frame belong to the illegal traffic events, the traffic event name corresponding to the target detection frame is compared with all the keywords in the illegal traffic event list. When there is a keyword in the illegal traffic event list whose contrast with the traffic event name corresponding to the target detection frame exceeds the preset contrast value, it is determined that the traffic event corresponding to the target detection frame belongs to the illegal traffic event.

[0068] In the embodiments of the present application, traffic jams, lane changes across solid lines, illegal U-turns, rear-end collisions, and car crashes are considered illegal traffic events, while fog and fire are not considered illegal traffic events.

[0069] After executing step S130, in response to the traffic event corresponding to the target detection frame being a violation-type traffic event, in step S140, the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target as the target detection frame are output as alarm information.

[0070] In an embodiment of the present application, when the traffic event corresponding to the target detection frame belongs to a violation-type traffic event, the target in the target detection frame is continuously tracked to determine whether the target in the target detection frame is involved in other traffic events, so that when outputting the alarm information, all traffic events corresponding to the target in the target detection frame are output, and the corresponding picture frames are attached as evidence.

[0071] Specifically, by obtaining the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target in the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target in the target detection frame, the traffic events involving the same target at different time points can be captured, and this information can be integrated into a detailed warning report containing all relevant picture frames and traffic event descriptions, so that users can quickly locate the target and the traffic event involved in the target, so as to take timely measures. This not only helps to correct violations immediately, but also effectively prevent potential traffic accidents and ensure road safety.

[0072] After executing step S130, in response to the traffic event corresponding to the target detection frame not being a violation-type traffic event, in step S150, the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame are sorted, and the traffic event corresponding to the target detection frame and the picture frame where the target detection frame that meets the ordinal threshold condition is located are output as warning information.

[0073] In the embodiment of the present application, the ordinal threshold condition is: the ordinal number of the area corresponding to the sorted target detection frame is less than the ordinal threshold, that is, the image frame where the target detection frame whose ordinal number of the corresponding area is less than the ordinal threshold is output.

[0074] In the embodiment of the present application, the ordinal threshold can be set according to actual needs and the sorting method, and the present application does not limit it here. For example, when the ordinal threshold is set to 3, and the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame are sorted in order from large to small, the image frames where the corresponding area ordinal numbers of the target detection frames are 1 and 2 are located are output.

[0075] In the embodiment of the present application, when the traffic event corresponding to the target detection frame does not belong to the violation type traffic event, it is not necessary to track the target in the target detection frame, and only representative picture frames need to be output. Compared with outputting all picture frames where the target detection frame has the same target, the warning result can be conveyed more intuitively, while saving resources and time, and improving the efficiency of warning information query. Specifically, since the larger the area corresponding to the target detection frame is, the clearer the user can observe it, and thus, the picture frame where the target detection frame with a larger area is output.

[0076] In summary, the embodiments of the present application can quickly obtain the traffic event corresponding to the target detection frame by performing cosine similarity matching between the feature vector of the target and the feature vector of each event in the alarm event list, and can form alarm information based on the classification of the traffic event, so as to significantly improve the response speed of traffic management and the efficiency of event processing. Furthermore, in some embodiments, when there are multiple corresponding initial detection frames in the picture frame, the initial detection frames whose spacings meet the spacing threshold condition are merged to obtain a merged frame, which can avoid the separation of targets belonging to the same traffic scene, thereby causing the problem of misjudgment of traffic events.

[0077] The embodiment of the present application also provides a traffic incident warning system, which may use the aforementioned traffic incident warning method 100 to perform traffic incident warnings, or may use other traffic incident warning methods to perform traffic incident warnings, and the present application does not limit this.

[0078] Figure 5An exemplary structural block diagram of the traffic incident warning system in an embodiment of the present application is shown.

[0079] like Figure 5 As shown, the system 500 includes a target detection frame acquisition module 510, a similarity matching module 520, a judgment module 530, and an alarm information output module 540. In an embodiment of the present application, the target detection frame acquisition module 510, the similarity matching module 520, the judgment module 530, and the alarm information output module 540 can be separate units or integrated in the same controller.

[0080] Specifically, the target detection frame acquisition module 510 is used to collect the video stream of the corresponding traffic area through the successfully connected camera, and obtain multiple picture frames corresponding to the video stream and one or more target detection frames corresponding to each picture frame.

[0081] Specifically, the similarity matching module 520 is used to calculate the feature vector of the target within the target detection frame area output by the target detection frame acquisition module 510, and perform cosine similarity matching on the feature vector of the target with the feature vector of each event in the alarm event list to obtain the traffic events corresponding to each target detection frame.

[0082] Specifically, the judgment module 530 is used to judge whether the traffic events corresponding to each target detection frame output by the similarity matching module 520 belong to illegal traffic events.

[0083] Specifically, the warning information output module 540 is used to output the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target as the target detection frame as warning information in response to the judgment module 530 determining that the traffic event corresponding to the target detection frame is a violation-type traffic event.

[0084] The warning information output module 540 is also used to respond to the judgment module 530 determining that the traffic event corresponding to the target detection frame does not belong to a violation type traffic event, sort the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame, and output the traffic event corresponding to the target detection frame and the picture frame where the target detection frame that meets the ordinal threshold condition is located as warning information.

[0085] When the system 500 uses the aforementioned traffic incident warning method 100 to perform traffic incident warning, the target detection frame acquisition module 510 performs the aforementioned step S110, the similarity matching module 520 performs the aforementioned step S120, the judgment module 530 performs the aforementioned step S130, and the warning information output module 540 performs the aforementioned steps S140 and S150. The specific execution process can be referred to above, and will not be repeated here.

[0086] Although multiple embodiments of the present application have been shown and described herein, it is obvious to those skilled in the art that such embodiments are provided only by way of example. Those skilled in the art can think of many changes, modifications and alternatives without departing from the thought and spirit of the present application. It should be understood that in the process of practicing the present application, various alternatives to the embodiments of the present application described herein can be adopted. The attached claims are intended to limit the scope of protection of the present application, and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. A traffic incident warning method, characterized in that: include: The video stream of the corresponding traffic area is collected by the camera, and a plurality of picture frames corresponding to the video stream and one or more target detection frames corresponding to each picture frame are obtained; Calculate the feature vector of the target within the target detection frame area, and perform cosine similarity matching between the feature vector of the target and the feature vector of each event in the alarm event list to obtain the traffic events corresponding to each target detection frame; Determine whether the traffic event corresponding to each target detection frame belongs to a traffic violation event; In response to the traffic event corresponding to the target detection frame being a violation-type traffic event, the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target as the target detection frame are output as warning information; In response to the fact that the traffic event corresponding to the target detection frame does not belong to a violation type traffic event, the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame are sorted, and the traffic event corresponding to the target detection frame and the picture frame where the target detection frame that meets the ordinal threshold condition is located are output as warning information.

2. The traffic incident warning method according to claim 1, characterized in that: Obtaining one or more target detection frames corresponding to each image frame includes: Get the initial detection frames corresponding to each image frame; Determine whether the number of corresponding initial detection frames in the picture frame is multiple; In response to the number of corresponding initial detection frames in the picture frame not being multiple, using the corresponding initial detection frame in the picture frame as a target detection frame; In response to the fact that there are multiple corresponding initial detection frames in the picture frame, the initial detection frames whose spacings satisfy the spacing threshold condition are merged to obtain a merged frame, and the merged frame and the initial detection frames whose spacings do not satisfy the spacing threshold condition are used as target detection frames.

3. The traffic incident warning method according to claim 2, characterized in that: The spacing threshold condition is: the spacing between the initial detection frames is less than the spacing threshold.

4. The traffic incident warning method according to claim 2 or 3, characterized in that: Get the distance between the initial detection frames by following the steps below: Get the coordinates of the center points of each initial detection frame; Obtain the distance between the center points of each initial detection frame based on the coordinates of the center points of each initial detection frame; The distance between the center points of each initial detection frame is used as the spacing between the initial detection frames.

5. The traffic incident warning method according to claim 1, characterized in that: The feature vector of the target is matched with the feature vector of each event in the alarm event list by cosine similarity to obtain the traffic events corresponding to each target detection frame, including: Calculate the cosine similarity between the feature vector of the target and the feature vector of each event in the alarm event list; Determine whether there is an event in the alarm event list whose cosine similarity with the target's feature vector meets the cosine similarity threshold condition; In response to an event in the warning event list having a cosine similarity with a feature vector of the target satisfying a cosine similarity threshold condition, the event is used as a traffic event corresponding to the target detection frame; In response to the absence of an event in the alarm event list whose cosine similarity with a feature vector of the target satisfies a cosine similarity threshold condition, marking the target detection frame with a marking value.

6. The traffic incident warning method according to claim 5, characterized in that: The cosine similarity threshold condition is: the cosine similarity between the feature vector of the target and the feature vector of the event in the alarm event list is greater than the cosine similarity threshold.

7. The traffic incident warning method according to claim 5, characterized in that: When all corresponding target detection frames in the picture frame are marked with the marking value, the picture frame is deleted.

8. The traffic incident warning method according to claim 1, characterized in that: The ordinal threshold condition is: the ordinal of the area corresponding to the sorted target detection box is less than the ordinal threshold.

9. The traffic incident warning method according to claim 1, characterized in that: Before collecting the video stream of the corresponding traffic area through the camera, determine whether the camera is connected successfully. In the process of determining whether the camera is connected successfully, perform the following steps: Collect camera access information; Match the camera access information with the input information corresponding to the camera; When the matching degree between the camera access information and the input information corresponding to the camera is greater than the matching degree threshold, it is determined that the camera connection is successful.

10. A traffic incident warning system, characterized in that: The traffic incident warning method according to any one of claims 1 to 9 is used to warn a traffic incident, and the system comprises: The target detection frame acquisition module is used to collect the video stream of the corresponding traffic area through the successfully connected camera, and obtain multiple picture frames corresponding to the video stream and one or more target detection frames corresponding to each picture frame; A similarity matching module is used to calculate the feature vector of the target in the target detection frame area, and perform cosine similarity matching between the feature vector of the target and the feature vector of each event in the alarm event list to obtain the traffic events corresponding to each target detection frame; A judgment module is used to judge whether the traffic event corresponding to each target detection frame belongs to a violation-type traffic event; An alarm information output module is used to, in response to a traffic event corresponding to a target detection frame being a violation-type traffic event, output as alarm information the picture frame where the target detection frame is located, the traffic event corresponding to the target detection frame, the picture frame where other target detection frames with the same target as the target detection frame are located, and the traffic events corresponding to other target detection frames with the same target as the target detection frame; in response to a traffic event corresponding to a target detection frame not being a violation-type traffic event, sort the areas corresponding to the target detection frame and other target detection frames with the same target as the target detection frame, and output as alarm information the traffic event corresponding to the target detection frame and the picture frame where the target detection frame that meets the ordinal threshold condition is located.

Citation Information

Patent Citations

  • Intelligent driving control method and device, vehicle, electronic device, medium, product

    CN109159667A

  • Traffic abnormal event detection method, device, and computer storage medium

    CN113673311A

  • Vehicle illegal driving detection method and device based on AI technology

    CN115240435A

  • Event detection method, apparatus, electronic device, and storage medium

    WO2022105243A1

Cited By

  • Traffic risk real-time alarm method and system

    CN120932455A