Traffic anomaly detection method and device

By comparing the vehicle position and speed of the traffic image with the vehicle vector field, the problem of insufficient recognition accuracy of complex traffic scenes in the prior art is solved, and rapid and accurate detection of reverse direction, collision, stall and other situations are achieved. Improve the efficiency of traffic monitoring.

CN113139482BActive Publication Date: 2024-11-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110466631.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-28
Publication Date
2024-11-01
Estimated Expiration
2041-04-28

AI Technical Summary

Technical Problem

Existing computer vision technology has insufficient recognition accuracy for complex traffic scenes in traffic anomaly detection, resulting in inefficient efficiency and inability to effectively deal with complex situations such as retrograde, collision, and stall.

Method used

By acquiring at least two consecutive traffic images, identifying the position and speed of the target vehicle, and comparing it with the pre-generated vehicle vector field, determining whether the vehicle is abnormal, and analyzing the situations such as reverse travel, collision, stalling, etc.

Benefits of technology

It improves the accuracy and efficiency of traffic anomaly detection, can quickly identify and deal with abnormal situations in complex traffic scenarios, and reduces the dependence of manual judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139482B_ABST
    Figure CN113139482B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for traffic anomaly detection, which relates to the field of artificial intelligence, specifically to computer vision and deep learning technology, and can be applied to video analysis scenarios. The specific implementation scheme is: obtaining at least two frames of continuous traffic images. Identifying the positions of target vehicles from at least two frames of continuous traffic images respectively, and obtaining a set of position information. Determine the direction and speed of the target vehicle based on the set of position information. Compare the direction and speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal. This implementation can improve the speed and accuracy of traffic anomaly detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, and specifically to computer vision and deep learning technologies, which can be applied to video analysis scenarios, especially methods and devices for traffic anomaly detection. Background Art

[0002] Anomaly detection in traffic scenarios is aimed at abnormal vehicles on the main roads, such as collisions, stalls, deviations from the main roads, and driving in the opposite direction. Traditional video traffic monitoring relies on manual judgment by observers, which consumes a lot of manpower and is inefficient. The resulting visual anomaly detection system uses computer vision to detect abnormal vehicles.

[0003] Although the existing computer-based abnormal traffic incident detection methods have good robustness for different scenarios, the recognition accuracy and the abnormal situations that can be identified are not able to cope with more complex traffic scenarios. Summary of the invention

[0004] The present disclosure provides a method, apparatus, device, storage medium and computer program product for traffic anomaly detection.

[0005] According to a first aspect of the present disclosure, a method for traffic anomaly detection is provided, comprising: acquiring at least two frames of continuous traffic images; identifying the positions of target vehicles from the at least two frames of continuous traffic images respectively to obtain a position information set; determining the travel direction and speed of the target vehicle based on the position information set; and comparing the travel direction and speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal.

[0006] According to a second aspect of the present disclosure, a device for detecting traffic anomalies is provided, comprising: an acquisition unit configured to acquire at least two frames of continuous traffic images; an identification unit configured to respectively identify the positions of target vehicles from the at least two frames of continuous traffic images to obtain a position information set; a determination unit configured to determine a traveling direction and a speed of the target vehicle based on the position information set; and a detection unit configured to compare the traveling direction and the speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal.

[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods described in the first aspect.

[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method according to any one of the first aspect.

[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspects.

[0010] The method and device for traffic anomaly detection provided by the embodiments of the present disclosure obtain a vehicle vector field through vehicle tracking, and judge abnormal vehicles according to the vehicle vector field. This enables analysis of situations such as reversing, collision, stalling, and breaking down. This effectively solves the large amount of computing requirements generated by the global use of deep learning networks, and improves the current vehicle monitoring anomaly analysis situation.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0013] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0014] Figure 2 is a flow chart of an embodiment of a method for traffic anomaly detection according to the present disclosure;

[0015] Figure 3 is a schematic diagram of an application scenario of the method for traffic anomaly detection according to the present disclosure;

[0016] Figure 4 is a flow chart of another embodiment of the method for traffic anomaly detection according to the present disclosure;

[0017] Figure 5 is a schematic diagram of another application scenario of the method for traffic anomaly detection according to the present disclosure;

[0018] Figure 6 is a structural schematic diagram of an embodiment of a device for detecting traffic anomalies according to the present disclosure;

[0019] Figure 7 It is a block diagram of an electronic device used to implement the method for traffic anomaly detection according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0021] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the method or apparatus for traffic anomaly detection of the present application can be applied.

[0022] like Figure 1 As shown, the system architecture 100 may include cameras 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the cameras 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables.

[0023] Users can use cameras 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages, etc.

[0024] Cameras 101, 102, and 103 generally refer to cameras used for vehicle monitoring and capable of identifying vehicle information (e.g., license plate number, vehicle model). They may be electronic police that capture illegal vehicles (e.g., vehicles crossing the lane compaction line, driving in the opposite direction, occupying non-motorized vehicle lanes, driving against guide signs, running red lights, etc.) at intersections. They may also be checkpoint cameras installed on some key sections of highways, provincial roads, and national roads to capture speeding violations. Cameras 101, 102, and 103 may also be illegal parking capture cameras, traffic monitoring cameras, Skynet monitoring cameras, mobile capture cameras, and the like.

[0025] The server 105 may be a server that provides various services, such as a background analysis server that provides analysis of the vehicle data collected by the cameras 101, 102, and 103. The background analysis server may analyze the received vehicle data and output the processing results (such as abnormal situations such as wrong-way driving, collision, stalling, and breakdown).

[0026] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0027] It should be noted that the method for traffic anomaly detection provided in the embodiment of the present application is generally executed by the server 105 , and accordingly, the device for traffic anomaly detection is generally set in the server 105 .

[0028] It should be understood that Figure 1 The number of cameras, networks and servers in the embodiment is only for illustration. Any number of cameras, networks and servers may be provided as required.

[0029] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for detecting traffic anomalies according to the present application. The method for detecting traffic anomalies comprises the following steps:

[0030] Step 201: Acquire at least two frames of continuous traffic images.

[0031] In this embodiment, the execution subject of the method for traffic anomaly detection (for example Figure 1 The server shown in the figure can receive at least two frames of continuous traffic images from the camera through a wired connection or a wireless connection. The acquired traffic images are taken by the same camera at the same position and at the same angle. Because the driving direction and speed of the vehicle need to be determined by the image, at least two frames of images are required to determine the position change of the vehicle. In actual use, a video can be obtained, which includes multiple frames of images. The frame rate of the camera is generally 25 to 30 frames per second. The time interval between different traffic images can be determined based on the frame rate.

[0032] Step 202: Identify the positions of target vehicles from at least two consecutive frames of traffic images to obtain a set of position information.

[0033] In this embodiment, a multi-target tracking algorithm (such as a deepsort algorithm) of the prior art can be used to identify vehicles in traffic images. The target vehicle here refers to a vehicle that can be tracked and identified. Usually, there will be multiple vehicles in a traffic image, so there will be multiple target vehicles. The target vehicle can be detected in each traffic image and framed with a detection frame, and the position of the center point of the detection frame can be used as the position of the target vehicle. These center points are connected to form the trajectory of the vehicle, which can be represented by a set of position information, and each position information is the coordinate position of the center point of the detection frame in the image.

[0034] Step 203, determining the moving direction and speed of the target vehicle according to the position information set.

[0035] In this embodiment, the driving route, i.e., the direction, of the target vehicle can be determined based on the position change of the center point of the detection frame. The mapping relationship between the pixel distance and the actual distance is determined based on the known camera parameters of the camera. After the target vehicle moves, the actual distance moved by the target vehicle can be calculated based on the distance moved by the center point of the detection frame and the mapping relationship. The travel time of the target vehicle can be calculated based on the frame rate, and the speed of the target vehicle can be calculated.

[0036] Step 204 : Compare the moving direction and speed of the target vehicle with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal.

[0037] In this embodiment, the vehicle vector field can be automatically generated based on historical data or manually calibrated. The vehicle vector field includes the direction and speed of the vehicle. Figure 3 As shown in (a) in the figure. The speed can be the average speed of a large number of vehicles on the road section that has been photographed by the camera. The direction of travel of the currently detected target vehicle is compared with the direction of the vehicle vector field. If they are opposite, it means that the target vehicle is traveling in the opposite direction. The speed of the currently detected target vehicle can also be compared with the speed of the vehicle vector field. If it exceeds a certain range, it means that the target vehicle is abnormal. For example, the speed of the target vehicle is less than 0.5 times the speed of the vehicle vector field, or the speed of the target vehicle is greater than 1.5 times the speed of the vehicle vector field. If the speed of the vehicle vector field is 60km / h, then when the speed of the target vehicle is less than 30km / h (abnormally low speed) or greater than 90km / h (abnormally high speed), the speed of the target vehicle is abnormal. If the number of vehicles with abnormally low speed reaches a predetermined vehicle threshold, it means that the road section is congested, and a prompt message can be output to the monitoring personnel to prompt further inspection to see if a traffic accident has occurred.

[0038] It can also directly locate the position of abnormal vehicles to facilitate rescue. Once an abnormal vehicle is detected, the owner's information can be obtained through license plate recognition. In addition to identity information, it can also include the owner's and family's contact information, medical history (such as asthma, heart disease, etc.) and other related information. The traffic control department can also be notified for processing. The traffic control department can find the vehicle based on the location, and arrange a tow truck if the vehicle is faulty. If the owner falls ill, first aid can be provided based on the pre-identified medical history, and his family can be contacted.

[0039] The method provided by the above-mentioned embodiment of the present disclosure can quickly and accurately determine abnormal vehicles by comparing the direction and speed of the vehicle obtained by vehicle tracking detection with the known vehicle vector field, and provide relevant information for subsequent processing, so as to quickly resolve abnormal vehicles.

[0040] In some optional implementations of this embodiment, the direction and speed of the target vehicle are compared with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal, including: comparing the direction of the target vehicle with the direction of the vehicle vector field, and if the angle exceeds a predetermined threshold, determining that the trajectory of the target vehicle is abnormal. If the angle exceeds the predetermined threshold, it means that the vehicle has changed lanes. In order to filter out the situation where the vehicle changes lanes and overtakes normally, multiple frames can be monitored continuously. If the obtained trajectory is not a normal lane change trajectory, it means that the vehicle is abnormal. When the angle is about 180 degrees, it means that the vehicle is traveling in the reverse direction. In this way, abnormality detection can be performed without manually marking the direction of the vehicle's travel, which improves the flexibility of detection. This method can be applied to any unmarked road section.

[0041] In some optional implementations of this embodiment, if the number of vehicles with abnormal trajectories at the same position exceeds 2, it is determined that a vehicle collision has occurred. If the number of vehicles with abnormal trajectories at the same position in the same set of images exceeds 2, it indicates that at least 2 vehicles have collided. Figure 3 As shown in (c). Traffic accidents can be detected quickly and accurately, and the license plate of the accident vehicle can also be quickly detected, and the relevant insurance company can be notified for processing. The relevant video can be directly retained as evidence for reporting the case. There is no need for the traffic police to review the video from beginning to end to find the time of the accident. The technical solution disclosed in this disclosure can directly locate the time of the accident. It is convenient for the traffic management department to quickly investigate the cause of the accident and divide the responsibility for the accident. Improve the efficiency of handling traffic accidents.

[0042] Continue to see Figure 3 , Figure 3 FIG. 1 is a schematic diagram of an application scenario of the method for traffic anomaly detection according to this embodiment. Figure 3In the application scenario, the vehicle vector field under normal circumstances is shown in Figure (a). The white area in the figure is the road, and it can be seen that the driving direction of the vehicles on the two roads is the same. Figure (b) shows the situation where the vehicle drives out of the road. It can be judged whether the vehicle has driven out of the road based on whether the position of the vehicle detection frame is in the road area. If it drives out of the road, it means that a traffic accident has occurred. Figure (c) shows the vehicle trajectory when the two vehicles collided. The directions and vector fields of the two vehicles are different, and the deviation is large. Figure (d) shows that the vehicle is stalled or broken down. It can be determined that the vehicle has not moved and the vehicle is in the road area based on the number of frames overlapping the detection frame exceeding the predetermined frame number threshold, so as to avoid misdetection of vehicles in the parking lot.

[0043] Further references Figure 4 , which shows a process 400 of another embodiment of a method for traffic anomaly detection. The process 400 of the method for traffic anomaly detection includes the following steps:

[0044] Step 401, obtaining a traffic video of a predetermined time length.

[0045] In this embodiment, the execution subject of the method for traffic anomaly detection (for example Figure 1 The server shown in FIG. 200 can receive a traffic video of a predetermined length of time from a camera through a wired connection or a wireless connection. The length of time is related to the acquisition time. If it is a peak traffic period, a short time is required. If it is a low traffic period, a longer time is required. The same camera as step 201 is used to capture the video at the same position and the same angle. In this way, it can be ensured that the road area segmented by the video can be used in process 200.

[0046] Step 402, creating a matrix of the same size as the traffic video screen.

[0047] In this embodiment, each element in the matrix represents a pixel on the screen, and the initial value of each element is 0. For example, if the video resolution is 900*1024, a 900*1024 all-zero matrix is ​​created.

[0048] Step 403: Track and detect the vehicle in the traffic video, and set the element corresponding to the pixel point in the detection frame of the vehicle to a non-zero value.

[0049] In this embodiment, each time a vehicle is detected, the pixel in the detection box is marked as a road, and the element at the corresponding position of the matrix can be set to a non-zero value, for example, 1. Assume that the initial matrix is

[0050] If vehicles are detected at positions (0, 1), (1, 1), and (2, 1) in the image, the matrix is ​​modified to

[0051] Step 404: determine the pixel points corresponding to the non-zero values ​​in the matrix as roads, and obtain the road area.

[0052] In this embodiment, the road area is formed by connecting the pixel points with non-zero values ​​determined in step 403.

[0053] Optionally, when the abnormal detection rate increases to a predetermined threshold, the road area can be re-determined according to steps 401-404. Because the angle of the camera may change slightly due to strong winds and other reasons, the abnormal judgment based on the originally determined road area will be inaccurate, which will lead to the sudden detection of a large number of abnormal vehicles (for example, a large number of vehicles are detected to have left the road), and the road area needs to be corrected. Only by using the corrected road area can the vehicle in the currently captured image be accurately detected.

[0054] The method provided by the above embodiment of the present disclosure determines the road by the actual passing vehicles instead of using the road recognition model for road recognition, because the road recognition model may mistakenly detect the parking lot as a road. In addition, the method can re-label the road at any time according to the demand. Compared with manual labeling, the road area can be updated in time according to the current situation to avoid false detection.

[0055] Continue to see Figure 5 , Figure 5 FIG. 1 is a schematic diagram of an application scenario of the method for traffic anomaly detection according to this embodiment. Figure 5 In the application scenario, Figure (a) shows the traffic image taken by the camera. Figure (b) shows that the vehicle is detected by the tracking algorithm and the vehicle is framed with a detection frame. Figure (c) shows that the pixels in the area where the detection frame is located are filled with white. Figure (d) shows that the non-white area is set as the road area, and other color areas are set as non-road areas, all of which are unified in black.

[0056] In some optional implementations of this embodiment, the method further includes: obtaining a vehicle trajectory set according to the position change of the vehicle detection frame. Clustering analysis is performed on the vehicle trajectory set to generate a vehicle vector field. Clustering analysis can be performed using common clustering algorithms such as kmeans. The final clustering result is a trajectory classified by lane, and the trajectory includes a direction. And the average speed of vehicles passing through each lane is calculated based on the trajectory of each lane. Speed ​​and direction constitute a vector field. The vector field obtained in this way is more convenient and faster than manual labeling. And it can be updated in real time according to the current situation. For example, due to congestion and other reasons, some lanes are temporarily changed in direction (see tidal lanes). At this time, the method disclosed in this way can update the vector field in time without misjudgment.

[0057] In some optional implementations of this embodiment, the direction and speed of the target vehicle are compared with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal, including: if the position of the target vehicle is in the road area and the time when the speed is zero exceeds the predetermined time threshold, it is determined that the target vehicle is abnormally parked. If the detection frames overlap, it means that the vehicle has not moved and the speed is 0. The parking time can be determined by the number of frames overlapped by the detection frames. If the parking time exceeds the predetermined time threshold, it is still not possible to determine that the parking is abnormal, and it is necessary to further determine whether the vehicle is in the road area at this time. Parking in the road area is considered abnormal parking. If it is parked outside the road, it does not hinder the travel of other vehicles. This method can quickly and accurately detect abnormal parking, so that it can be handled as soon as possible, such as notifying other drivers through traffic broadcasts to let them pay attention to safety and be careful of collisions, and also to let them change lanes in advance.

[0058] In some optional implementations of this embodiment, the direction and speed of the target vehicle are compared with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal, including: if the target vehicle is detected to be traveling from a road area to a non-road area, it is determined that the target vehicle has gone off the road. Going off the road is also an abnormality, which may be caused by a tire blowout or other reasons. This method quickly and accurately detects that the vehicle has gone off the road, and can quickly notify the traffic control department of the location of the accident, so that rescue can be carried out in time to avoid secondary injuries.

[0059] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for traffic anomaly detection. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0060] like Figure 6 As shown, the device 600 for traffic anomaly detection of this embodiment includes: an acquisition unit 601, an identification unit 602, a determination unit 603 and a detection unit 604. Among them, the acquisition unit 601 is configured to acquire at least two frames of continuous traffic images. The identification unit 602 is configured to respectively identify the position of the target vehicle from at least two frames of continuous traffic images to obtain a position information set. The determination unit 603 is configured to determine the direction and speed of the target vehicle according to the position information set. The detection unit 604 is configured to compare the direction and speed of the target vehicle with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal.

[0061] In this embodiment, the specific processing of the acquisition unit 601, the identification unit 602, the determination unit 603 and the detection unit 604 of the traffic anomaly detection device 600 can refer to Figure 2Corresponding to step 201, step 202, step 203, and step 204 in the embodiment.

[0062] In some optional implementations of this embodiment, the device 600 further includes an extraction unit 605, which is configured to: obtain a traffic video of a predetermined time length. Create a matrix of the same size as the screen of the traffic video, wherein each element in the matrix represents a pixel point on the screen, and the initial value of each element is zero. Track and detect vehicles in the traffic video, and set the elements corresponding to the pixels in the detection frame of the vehicle to non-zero values. Determine the pixels corresponding to the non-zero values ​​in the matrix as roads, and obtain a road area.

[0063] In some optional implementations of this embodiment, the extraction unit 605 is further configured to: obtain a vehicle trajectory set according to the position change of the vehicle detection frame, and perform cluster analysis on the vehicle trajectory set to generate a vehicle vector field.

[0064] In some optional implementations of this embodiment, the detection unit 604 is further configured to: if the position of the target vehicle is in the road area and the time when the speed is zero exceeds a predetermined time threshold, determine that the target vehicle is parked abnormally.

[0065] In some optional implementations of this embodiment, the detection unit 604 is further configured to: if it is detected that the target vehicle travels from the road area to the non-road area, determine that the target vehicle has gone off the road.

[0066] In some optional implementations of this embodiment, the detection unit 604 is further configured to: compare the moving direction of the target vehicle with the direction of the vehicle vector field, and if the angle exceeds a predetermined threshold, determine that the trajectory of the target vehicle is abnormal.

[0067] In some optional implementations of this embodiment, the detection unit 604 is further configured to: determine that a vehicle collision has occurred if the number of vehicles with abnormal trajectories at the same location exceeds 2.

[0068] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0069] An electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in process 200 or process 400.

[0070] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in process 200 or process 400.

[0071] A computer program product includes a computer program, wherein the computer program implements the method described in process 200 or process 400 when executed by a processor.

[0072] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0073] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0074] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0075] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the method of traffic anomaly detection. For example, in some embodiments, the method of traffic anomaly detection may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method of traffic anomaly detection described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the method of traffic anomaly detection in any other appropriate manner (e.g., by means of firmware).

[0076] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0077] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0078] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0079] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0080] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0081] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a server of a distributed system, or a server combined with a blockchain. The server may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The server may be a server of a distributed system, or a server combined with a blockchain. The server may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0082] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0083] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for traffic anomaly detection, comprising: Acquire at least two frames of continuous traffic images; identifying the positions of the target vehicles from the at least two consecutive frames of traffic images respectively by using a deepsort algorithm to obtain a position information set; Determine the direction and speed of the target vehicle according to the position information set, and determine the parking time according to the number of overlapping frames of the detection frames; Compare the direction and speed of the target vehicle with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal. If the angle exceeds a predetermined threshold, continuously monitor multiple frames. If the obtained trajectory is not a normal lane change trajectory, it means that the vehicle is abnormal. The position of the abnormal vehicle is directly located to facilitate rescue. If the number of vehicles with abnormally low speeds reaches a predetermined vehicle threshold, it means that the road section is congested. Output prompt information to the monitoring personnel to further check whether a traffic accident has occurred. Once an abnormal vehicle is detected, the owner's information is obtained through license plate recognition. The owner's information includes the contact information and medical history of the owner and his family members, and the time of the accident. The relevant video at the time of the accident is retained as the basis for reporting the case; When the anomaly detection rate increases to a predetermined threshold, a traffic video of a predetermined time length is obtained, wherein the time length is related to the acquisition time, and if it is a traffic peak period, the time length is short, and if it is a traffic trough period, the time length is long; Creating a matrix of the same size as the screen of the traffic video, wherein each element in the matrix represents a pixel point on the screen, and the initial value of each element is zero; Tracking and detecting vehicles in the traffic video, and setting elements corresponding to pixels in a detection frame of the vehicle to non-zero values; The pixel points corresponding to the non-zero values ​​in the matrix are determined as roads to obtain a corrected road area, and the corrected road area is used to detect vehicles in the currently captured image.

2. The method according to claim 1, wherein: The method further comprises: The vehicle trajectory set is obtained according to the position change of the vehicle detection frame; The vehicle trajectory set is clustered and analyzed to generate a vehicle vector field.

3. The method according to claim 1, wherein comparing the moving direction and speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal comprises: If the position of the target vehicle is within the road area and the time when the speed is zero exceeds a predetermined time threshold, it is determined that the target vehicle is parked abnormally.

4. The method according to claim 1, wherein comparing the moving direction and speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal comprises: If it is detected that the target vehicle travels from the road area to the non-road area, it is determined that the target vehicle has gone off the road.

5. The method according to claim 1, wherein comparing the moving direction and speed of the target vehicle with a pre-generated vehicle vector field to determine whether the target vehicle is abnormal comprises: The moving direction of the target vehicle is compared with the direction of the vehicle vector field, and if the angle exceeds a predetermined threshold, it is determined that the trajectory of the target vehicle is abnormal.

6. The method according to claim 5, further comprising: If the number of vehicles with abnormal trajectories at the same location exceeds 2, it is determined that a vehicle collision has occurred.

7. A device for detecting traffic anomalies, comprising: An acquisition unit configured to acquire at least two frames of continuous traffic images; an identification unit configured to identify the positions of the target vehicles from the at least two consecutive frames of traffic images respectively by using a deepsort algorithm to obtain a position information set; a determination unit configured to determine the traveling direction and speed of the target vehicle according to the position information set, and determine the parking time according to the number of overlapping frames of the detection frames; The detection unit is configured to compare the traveling direction and speed of the target vehicle with the pre-generated vehicle vector field to determine whether the target vehicle is abnormal. If the angle exceeds a predetermined threshold, multiple frames are continuously monitored. If the obtained trajectory is not a normal lane change trajectory, it means that the vehicle is abnormal. The position of the abnormal vehicle is directly located to facilitate rescue. If the number of vehicles with abnormally low speeds reaches a predetermined vehicle threshold, it means that the road section is congested. A prompt message is output to the monitoring personnel to prompt further inspection to see if a traffic accident occurs. Once an abnormal vehicle is detected, the owner's information is obtained through license plate recognition. The owner's information includes the contact information and medical history of the owner and his family members, and the time when the accident occurs. The relevant video at the time of the accident is retained as a basis for reporting the case; The extraction unit is configured to: When the anomaly detection rate increases to a predetermined threshold, a traffic video of a predetermined time length is obtained, wherein the time length is related to the acquisition time, and if it is a traffic peak period, the time length is short, and if it is a traffic trough period, the time length is long; Creating a matrix of the same size as the screen of the traffic video, wherein each element in the matrix represents a pixel point on the screen, and the initial value of each element is zero; Tracking and detecting vehicles in the traffic video, and setting elements corresponding to pixels in a detection frame of the vehicle to non-zero values; The pixel points corresponding to the non-zero values ​​in the matrix are determined as roads to obtain a corrected road area, and the corrected road area is used to detect vehicles in the currently captured image.

8. The device according to claim 7, wherein: The extraction unit is further configured to: The vehicle trajectory set is obtained according to the position change of the vehicle detection frame; The vehicle trajectory set is clustered and analyzed to generate a vehicle vector field.

9. The device according to claim 7, wherein the detection unit is further configured to: If the position of the target vehicle is within the road area and the time when the speed is zero exceeds a predetermined time threshold, it is determined that the target vehicle is parked abnormally.

10. The device according to claim 7, wherein the detection unit is further configured to: If it is detected that the target vehicle travels from the road area to the non-road area, it is determined that the target vehicle has gone off the road.

11. The device according to claim 7, wherein the detection unit is further configured to: The moving direction of the target vehicle is compared with the direction of the vehicle vector field, and if the angle exceeds a predetermined threshold, it is determined that the trajectory of the target vehicle is abnormal.

12. The device according to claim 11, wherein the detection unit is further configured to: If the number of vehicles with abnormal trajectories at the same location exceeds 2, it is determined that a vehicle collision has occurred.

13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.