Traffic event detection method and device, equipment, storage medium and program product

By using roadside cameras to rasterize road areas and acquire target tracking data, the problem of not being able to detect abnormal situations in autonomous driving is solved, improving the accuracy and safety of traffic incident detection.

CN119296337APending Publication Date: 2025-01-10CITIC INTELLIGENT TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411415134.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In existing autonomous driving technologies, vehicles cannot fully and accurately perceive abnormal situations in the road environment, resulting in an inability to make timely and effective decisions, which may lead to traffic congestion and safety accidents.

Method used

The target road area is rasterized by roadside cameras to establish a road surface raster network, acquire target tracking data in each sub-grid, analyze traffic conditions, and detect traffic events.

Benefits of technology

It enables refined management of road conditions, provides more comprehensive and accurate decision-making basis, improves the safety and reliability of autonomous driving, and issues timely warnings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296337A_ABST
    Figure CN119296337A_ABST
Patent Text Reader

Abstract

The invention provides a traffic event detection method and device, equipment, a storage medium and a program product, and relates to the technical field of automatic driving, and the traffic event detection method comprises the steps: obtaining target tracking data of a preset tracking target in each sub-grid in a main grid according to an image frame shot by a roadside camera in a first time window; the main grid is obtained by dividing a target road area shot by the roadside camera; according to target tracking data of a preset tracking target in the sub-grids, obtaining traffic detection data corresponding to the main grid and related to the traffic condition of the target road area and traffic detection data corresponding to each sub-grid in the main grid and related to the traffic condition of the target road area; and performing traffic event detection of the target road area according to the traffic detection data. According to the invention, traffic events can be effectively detected, early warning can be given out in time, and a more comprehensive and accurate decision basis is provided for automatic driving vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving technology, and in particular to a traffic incident detection method, device, equipment, storage medium and program product. Background Art

[0002] In existing autonomous driving technologies, the core link is that vehicles perceive the environment through sensors such as onboard cameras or lidars. However, due to the limitations of their viewing angles and inherent characteristics, vehicle-side perception devices (such as cameras or lidars) cannot fully and accurately perceive abnormal situations in the road environment, resulting in the inability of autonomous vehicles to make timely and effective decisions when encountering abnormal road events nearby. This limitation may cause a series of serious problems, including traffic congestion and safety accidents.

[0003] For example, when there are multiple illegally parked vehicles in the right-turn lane, if the autonomous vehicle relies solely on vehicle-side perception, it may get into trouble when approaching the parked vehicles due to the lack of obvious abnormal signs. At this time, the vehicle may adopt a strategy of waiting for a while and then trying to change lanes to overtake. However, once the left lane is a solid line, the lane change will violate traffic regulations and the vehicle will be in an awkward situation where it cannot move. Summary of the invention

[0004] Embodiments of the present invention provide a traffic event detection method, device, equipment, storage medium and program product to solve the problem in existing autonomous driving technology that vehicles are unable to fully and accurately perceive abnormal conditions in the road environment.

[0005] In order to solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides a traffic incident detection method, comprising:

[0007] For the image frames captured by the roadside camera in the first time window, target tracking data of a preset tracking target in each sub-grid in the main grid is obtained; wherein the main grid is obtained by dividing the target road area captured by the roadside camera, and one main grid includes at least one sub-grid;

[0008] Obtaining, according to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid;

[0009] Traffic event detection is performed in the target road area according to the traffic detection data.

[0010] Optionally, the method further comprises:

[0011] Acquire an image of the target road area taken by the roadside camera;

[0012] Drawing at least one of the main grids on the image of the target road area;

[0013] At least one sub-grid is generated in the main grid according to a preset width and a preset height.

[0014] Optionally, drawing at least one main grid on the image of the target road area includes:

[0015] Drawing at least one initial grid on the image of the target road area;

[0016] When it is determined that the shape of the initial grid is a convex polygon, the initial grid is determined to be the main grid.

[0017] Optionally, generating at least one sub-grid in the main grid according to a preset width and a preset height includes:

[0018] Converting the first pixel coordinates corresponding to the main grid into a first Universal Transverse Mercator Grid system UTM geographic coordinates;

[0019] Determine the circumscribed rectangle of the main grid in the UTM coordinate system according to the first UTM coordinate geographic coordinate;

[0020] Generating a first grid within the circumscribed rectangle according to the preset width and the preset height;

[0021] The first grid located within the main grid is determined as the sub-grid.

[0022] Optionally, converting the first pixel coordinates corresponding to the main grid into a first Universal Transverse Mercator Grid system UTM geographic coordinates includes:

[0023] Acquire a second pixel coordinate of the image of the target road photographed by the roadside camera and a geodetic coordinate corresponding to the second pixel coordinate;

[0024] Converting the geodetic coordinates into second UTM geographic coordinates;

[0025] Generate a perspective transformation matrix according to the second pixel coordinates and the second UTM geographic coordinates corresponding to the second pixel coordinates by using a perspective transformation algorithm;

[0026] The first pixel coordinates corresponding to the main grid are converted into the first UTM geographic coordinates according to the perspective transformation matrix.

[0027] Optionally, for the image frames captured by the roadside camera in the first time window, obtaining target tracking data of a preset tracking target in each sub-grid in the main grid includes:

[0028] For the image frame, using a deep learning network to detect the preset tracking target and using a preset tracking algorithm to track the preset tracking target, so as to obtain target tracking data of the preset tracking target corresponding to the image frame;

[0029] According to the target tracking data, a preset tracking target in the main grid is obtained by using a ray crossing method;

[0030] Using a ray intersection method, among the preset tracking targets in the main grid, a preset tracking target in each of the sub-grids in the main grid is obtained;

[0031] Obtain target tracking data corresponding to the preset tracking target in each of the sub-grids in the main grid.

[0032] Optionally, performing traffic event detection in the target road area according to the traffic detection data includes:

[0033] Determining, based on the traffic detection data, traffic information of the preset tracking target in the target road area within the first time window;

[0034] Determining abnormal traffic events in the target road area according to the traffic information;

[0035] The traffic information includes at least one of the following:

[0036] Travel time information;

[0037] Traffic speed information;

[0038] Traffic congestion information;

[0039] Detour probability.

[0040] Optionally, determining the traffic information of the preset tracking target in the target road area within the first time window according to the traffic detection data includes:

[0041] Obtaining a first number of times that a first preset tracking target is transferred from a first target grid to a second target grid and a second number of times that the first preset tracking target is transferred from the first target grid out of the first grid to which the first target grid belongs within the first time window; wherein the first target grid is any sub-grid, the second target grid is a sub-grid outside the first target grid, the first target grid and the second target grid belong to the same main grid, and the first preset tracking target is any preset tracking target;

[0042] A detour probability of the first preset tracking target is obtained according to the first number of times and the second number of times.

[0043] Optionally, according to the target tracking data of the preset tracking target in the sub-grid, obtaining the traffic detection data related to the traffic condition of the target road area corresponding to the main grid and the traffic detection data related to the traffic condition of the target road area corresponding to each of the sub-grids in the main grid, including:

[0044] When the target tracking data indicates that the number of preset tracking targets is greater than or equal to the preset number, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained according to the target tracking data of the preset tracking targets in the sub-grid.

[0045] In a second aspect, an embodiment of the present invention further provides a traffic event detection device, comprising:

[0046] A first acquisition module is used to acquire target tracking data of a preset tracking target in each sub-grid in a main grid for an image frame captured by a roadside camera within a first time window; wherein the main grid is obtained by dividing a target road area captured by the roadside camera, and one main grid includes at least one sub-grid;

[0047] A first processing module is used to obtain, according to the target tracking data of the preset tracking target in the sub-grid, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid;

[0048] The second processing module is used to perform traffic event detection in the target road area according to the traffic detection data.

[0049] In a third aspect, an embodiment of the present invention further provides a traffic event detection device, comprising: a processor, a memory, and a program stored on the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the traffic event detection method described in any one of the first aspects are implemented.

[0050] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium having a program stored thereon, and when the program is executed by a processor, the steps in the traffic event detection method as described in any one of the first aspects are implemented.

[0051] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in the traffic event detection method as described in any one of the first aspects.

[0052] The beneficial effects of the present invention are:

[0053] The traffic incident detection method provided by the scheme of the present invention divides the target road area photographed by the roadside camera into a main grid and into multiple sub-grids within the main grid, establishes a road surface grid network within the visible range of the roadside camera, realizes refined management of road conditions, and, for the image frames photographed by the roadside camera within the first time window, obtains target tracking data of a preset tracking target in each sub-grid in the main grid, obtains traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid according to the target tracking data, and uses the traffic detection data to detect traffic incidents in the target road area, which can effectively detect traffic incidents and issue early warnings in a timely manner, providing a more comprehensive and accurate decision-making basis for autonomous driving vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A flow chart showing a traffic incident detection method provided by an embodiment of the present invention;

[0055] Figure 2 A schematic diagram showing a tree relationship between a main grid and a sub-grid provided in an embodiment of the present invention;

[0056] Figure 3 A flow chart showing the division of a road surface grid provided by an embodiment of the present invention;

[0057] Figure 4 A schematic diagram showing the structure of a traffic incident detection device provided by an embodiment of the present invention;

[0058] Figure 5 A schematic diagram showing the structure of a traffic incident detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the technical problems, technical solutions and advantages to be solved by the application clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help fully understand the embodiments of the application. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the application. In addition, for clarity and brevity, the description of known functions and structures has been omitted.

[0060] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0061] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0062] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0063] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0064] In order to solve the blind spots and limitations existing in the environmental perception and decision-making process in the existing autonomous driving technology, the embodiments of the present invention provide a traffic event detection method, device, equipment, storage medium and program product.

[0065] like Figure 1 As shown, an embodiment of the present invention provides a traffic incident detection method, comprising:

[0066] Step 101: for an image frame captured by a roadside camera within a first time window, target tracking data of a preset tracking target in each sub-grid within a main grid is obtained; wherein the main grid is obtained by dividing a target road area captured by the roadside camera, and one main grid includes at least one sub-grid.

[0067] In this step, the target road area photographed by the roadside camera is first accurately calibrated. The target road area can also be understood as the area of ​​interest within the target road range photographed by the roadside camera. The target road area covers the key parts that are desired to be monitored and analyzed, such as motor vehicle lanes, non-motor vehicle lanes and sidewalks.

[0068] That is, roadside cameras are used to perceive traffic participants, and refined management of road conditions is achieved by establishing a road raster network covering the camera's visible range.

[0069] It should be noted that, compared with vehicle-side perception, the perception method of using roadside cameras to perceive traffic participants in the embodiments of the present invention has significant advantages. Since the roadside cameras are fixed in position and have a relatively high viewing angle, their perception range is wider and more global, which enables autonomous driving vehicles to break through the limitations of vehicle-side perception and more easily cope with various complex road scenes, thereby improving the safety and reliability of autonomous driving.

[0070] Furthermore, based on the road surface grid network, target tracking data of traffic participants (i.e., preset tracking targets) in the grid network are counted in real time, and the above target tracking data are analyzed within a set time window, wherein the first time window can be understood as the time window corresponding to the current time, and the duration of the first time window can be set according to demand.

[0071] The preset tracking targets include at least one of the following: pedestrians, cars, buses, trucks, traffic cones, roadblocks, two-wheelers, three-wheelers, and license plates.

[0072] The target tracking data includes at least one of the following: a target frame of a preset tracking target, a category of a preset tracking target, a target confidence of a preset tracking target, ground key point information of a preset tracking target, a ground key point confidence of a preset tracking target, an identity (ID) of a preset tracking target, and a motion trajectory of a preset tracking target.

[0073] The ground key point information of the preset tracking target includes four key points of a frame surrounding the preset tracking target on the ground and a center point of the preset tracking target on the ground.

[0074] Step 102: According to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained.

[0075] In this step, within the first time window, the target tracking data in the sub-grid is analyzed and processed to obtain traffic detection data related to the traffic conditions of the target road area under the road surface grid network.

[0076] The traffic detection data corresponding to the sub-grid includes at least one of the following:

[0077] The number of current preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the cumulative number of preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the cumulative number of preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the passing time of the preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the average speed of the preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the average acceleration of the preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the passage status of the preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the duration of the passage status of the preset tracking targets in the sub-grid (different preset tracking targets are recorded separately), the latest N preset tracking targets in the sub-grid (different preset tracking targets are recorded separately, N is a positive integer), and the motion trajectories of the latest N preset tracking targets in the sub-grid (different preset tracking targets are recorded separately).

[0078] Among them, the number of current preset tracking targets in the sub-grid can be directly obtained by counting; the cumulative number of preset tracking targets in the sub-grid can be understood as starting from the first image frame of the first time window, and summing the number of preset tracking targets of the same type in the same sub-grid in each image frame to obtain the cumulative number of preset tracking targets of this type in the sub-grid; the passing time of the preset tracking target in the sub-grid can be obtained by obtaining the image frame of a certain preset tracking target entering the sub-grid and the image frame of the sub-grid, according to the acquisition time corresponding to the image frame entering the sub-grid and the image frame exiting the sub-grid. The acquisition time corresponding to the frame is used to calculate the passing time of the preset tracking target in the sub-grid; the average speed of the preset tracking target in the sub-grid can be obtained by obtaining the position of a preset tracking target entering the sub-grid, the image frame entering the sub-grid, and the position and image frame exiting the sub-grid, and according to the position entering the sub-grid and the position exiting the sub-grid, the acquisition time corresponding to the image frame entering the sub-grid and the acquisition time corresponding to the image frame exiting the sub-grid, the average speed of the preset tracking target in the sub-grid is calculated; the average acceleration of the preset tracking target in the sub-grid can be obtained by obtaining a preset tracking target The position of the tracking target entering the sub-grid, the image frame entering the sub-grid, and the position of the tracking target exiting the sub-grid, the image frame exiting the sub-grid, and the average acceleration of the preset tracking target in the sub-grid is calculated according to the position of the tracking target entering the sub-grid, the position of the tracking target exiting the sub-grid, the acquisition time corresponding to the image frame entering the sub-grid, and the acquisition time corresponding to the image frame exiting the sub-grid; the passage state of the preset tracking target in the sub-grid includes at least one of the following: whether the preset tracking target is stationary, whether the preset tracking target is moving, whether the preset tracking target is moving at a uniform speed, and whether the preset tracking target is accelerating or decelerating; the preset tracking target in the sub-grid The duration of the target's passage state includes at least one of the following: the duration for which the preset tracking target remains stationary, the duration for which the preset tracking target remains in motion, the duration for which the preset tracking target remains in uniform motion, and the duration for which the preset tracking target remains in accelerated motion or decelerated motion; the N most recently appearing preset tracking targets in a sub-grid can be understood as the preset tracking targets that appear for the first time in a sub-grid in an image frame; the motion trajectories of the N most recently appearing preset tracking targets in a sub-grid can be understood as the motion trajectories of the preset tracking targets that appear for the first time in a sub-grid in an image frame in the sub-grid.

[0079] The traffic detection data corresponding to the main grid includes at least one of the following:

[0080] The number of current preset tracking targets in the main grid (different preset tracking targets are recorded separately), the cumulative number of preset tracking targets in the main grid (different preset tracking targets are recorded separately), the cumulative number of preset tracking targets in the main grid (different preset tracking targets are recorded separately), the passing time of the preset tracking targets in the main grid (different preset tracking targets are recorded separately), the average speed of the preset tracking targets in the main grid (different preset tracking targets are recorded separately), the average acceleration of the preset tracking targets in the main grid (different preset tracking targets are recorded separately), the passage status of the preset tracking targets in the main grid (different preset tracking targets are recorded separately), the duration of the passage status of the preset tracking targets in the main grid (different preset tracking targets are recorded separately), the latest N preset tracking targets in the main grid (different preset tracking targets are recorded separately, N is a positive integer), and the motion trajectories of the latest N preset tracking targets in the main grid (different preset tracking targets are recorded separately).

[0081] Among them, the number of current preset tracking targets in the main grid can be directly obtained by counting; the cumulative number of preset tracking targets in the main grid can be understood as starting from the first image frame of the first time window, and summing the number of preset tracking targets of the same type in the same main grid in each image frame to obtain the cumulative number of preset tracking targets of this type in the main grid; the passing time of the preset tracking target in the main grid can be obtained by obtaining the image frame of a preset tracking target entering the main grid and the image frame of the main grid, according to the acquisition time corresponding to the image frame entering the main grid and the image frame exiting the main grid. The acquisition time corresponding to the frame is used to calculate the passing time of the preset tracking target in the main grid; the average speed of the preset tracking target in the main grid can be obtained by obtaining the position of a preset tracking target entering the main grid, the image frame entering the main grid, and the position and image frame exiting the main grid, and the average speed of the preset tracking target in the main grid can be calculated according to the position entering the main grid, the position exiting the main grid, the acquisition time corresponding to the image frame entering the main grid, and the acquisition time corresponding to the image frame exiting the main grid; the average acceleration of the preset tracking target in the main grid can be calculated by obtaining a preset tracking target. The position of the tracking target entering the main grid, the image frame entering the main grid, and the position of the tracking target exiting the main grid, the image frame exiting the main grid, and the average acceleration of the preset tracking target in the main grid is calculated according to the position of the tracking target entering the main grid, the position of the tracking target exiting the main grid, the acquisition time corresponding to the image frame entering the main grid, and the acquisition time corresponding to the image frame exiting the main grid; the passage state of the preset tracking target in the main grid includes at least one of the following: whether the preset tracking target is stationary, whether the preset tracking target is moving, whether the preset tracking target is moving at a uniform speed, and whether the preset tracking target is accelerating or decelerating; the preset tracking target in the main grid The duration of the target's passage state includes at least one of the following: the duration for which the preset tracking target remains stationary, the duration for which the preset tracking target remains in motion, the duration for which the preset tracking target remains in uniform motion, and the duration for which the preset tracking target remains in accelerated motion or decelerated motion; the N most recently appearing preset tracking targets in the main grid can be understood as the preset tracking targets that appear for the first time in a main grid in an image frame; the motion trajectories of the N most recently appearing preset tracking targets in the main grid can be understood as the motion trajectories of the preset tracking targets that appear for the first time in a main grid in an image frame in the main grid.

[0082] In this embodiment, a road grid network is established to count and analyze traffic information in real time, thereby providing a wider and more global perception range and solving the problem of blind spots in vehicle-side perception.

[0083] Step 103: Perform traffic event detection in the target road area according to the traffic detection data.

[0084] In this step, traffic incident detection is performed using the above-mentioned traffic detection data, which can effectively detect traffic incidents and help autonomous driving vehicles respond to various complex road scenarios more accurately and quickly, thereby improving the safety and reliability of autonomous driving, providing autonomous driving vehicles with more comprehensive and accurate decision-making basis, and issuing early warnings in a timely manner.

[0085] In an optional embodiment, in order to accurately calibrate the area of ​​interest of the road surface within the shooting range of the roadside camera, the method further includes:

[0086] Acquire an image of the target road area taken by the roadside camera;

[0087] Drawing at least one main grid on the image of the target road area, specifically, drawing and indicating a main grid area on the image captured by the roadside camera with the help of a professional tool;

[0088] At least one sub-grid is generated in the main grid according to a preset width and a preset height, wherein the preset width and the preset height are both smaller values.

[0089] In a specific implementation, drawing at least one main grid on the image of the target road area includes:

[0090] Drawing at least one initial grid on the image of the target road area, specifically, manually drawing a plurality of initial grid areas on the captured image using a professional tool;

[0091] When it is determined that the shape of the initial grid is a convex polygon, the initial grid is determined to be the main grid.

[0092] That is, after the initial grid area is drawn, the greedy algorithm is used to process the initial grid area. The specific steps include:

[0093] Determine whether the initial grid is a convex polygon. There are many ways to determine a convex polygon, such as determining whether all internal angles of the initial grid area are less than 180 degrees, or checking whether the line segment formed by any two vertices of the initial grid area is inside the polygon or coincides with the boundary. If so, the initial grid is determined to be a convex polygon, that is, the main grid, to ensure the accuracy of subsequent processing.

[0094] In a specific implementation, generating at least one sub-grid in the main grid according to a preset width and a preset height includes:

[0095] The first pixel coordinates corresponding to the main grid are converted into the first Universal Transverse Mercator Grid System (UTM) geographic coordinates. Using the generated perspective transformation matrix, the tool will convert the pixel point coordinates of the main grid (first pixel coordinates) into actual geographic coordinates (first UTM geographic coordinates) in the UTM coordinate system.

[0096] The specific conversion method is: first promote the first pixel coordinate (x, y) to homogeneous coordinates: Assuming the perspective transformation matrix Apply the transformation: Finally project back to the 2D plane: (x ′ ,y ′ ) is the first UTM geographic coordinate.

[0097] For example, the main grid has four pixel coordinate corners, namely (1659, 114), (1205, 458), (2060, 491), (1864, 133), and the perspective transformation matrix is: [174.40223, -12149.77544, 530584.945079, 1156.44389, -80588.36794, 351 5827.31939, 0.00032, 0.00032, 1.0] and after applying the transformation its UTM coordinates are: (529438.48, 3515537.59), (529950.68, 3515545.50), (529951.43, 3515559.60), (529582.61, 3515563.88).

[0098] According to the first UTM coordinate geographic coordinate, determine the bounding rectangle of the main grid in the UTM coordinate system to determine its boundary range. This bounding rectangle refers to the smallest rectangle that can completely contain the main grid and whose sides are parallel to the coordinate axis. Regarding the calculation method, traverse all the vertices of the main grid. At this time, we use the UTM coordinate values ​​converted in step 2 to find the maximum and minimum x and y values. Based on these 4 values, the 4 vertices of the bounding rectangle can be determined: the upper left corner (x min ,y min ), upper right corner (x max ,y min ), lower right corner (x max ,y max ), lower left corner (x min ,y max ).

[0099] According to the preset width and the preset height, a first grid is generated within the circumscribed rectangle, that is, inside the circumscribed rectangle, a first grid is generated according to the preset width and the preset height, and each first grid is defined by four corner points. Such a design is helpful for subsequent data processing and analysis. The preset width and the preset height can be the minimum width and the minimum height in the system.

[0100] Determine that the first grid located within the main grid is the sub-grid. Specifically, for each generated first grid, check whether it is located inside the main grid. If two or more of the corner points of the first grid are located within the main grid, the first grid is considered valid and is added to the sub-grid set, that is, the first grid is a sub-grid.

[0101] It should be noted that the application of the greedy algorithm here is reflected in the selection of the current optimal solution at each step, in order to eventually reach the global optimum. The preset width and preset height mentioned above are used to determine the basic size of each cell in the grid network, and this size can be dynamically adjusted according to the actual application scenario. Usually, the preset width is set between 2 and 4 meters, and the preset height is adjusted according to the accuracy of the perspective transformation matrix generated during the roadside camera calibration process, generally between 5 and 10 meters.

[0102] Finally, in order to ensure the clarity of the data structure and the convenience of management, a tree relationship is established for the main grid and all generated sub-grids, and a globally unique identifier (ID) is assigned to each grid. This information will be saved in the configuration file for subsequent analysis and processing. Figure 2 shown.

[0103] The following is a detailed description of the perspective transformation matrix generation process:

[0104] That is, converting the first pixel coordinates corresponding to the main grid into the first Universal Transverse Mercator Grid System UTM geographic coordinates, including:

[0105] Calibration of roadside cameras mainly involves establishing a mapping relationship between the camera pixel coordinate system and the geodetic coordinate system to connect the camera pixel coordinate system with the geodetic coordinate system. The establishment of this mapping relationship is intended to ensure that each pixel point can accurately correspond to a specific geodetic coordinate, and vice versa. In order to achieve this goal, the 1984 World Geodetic Coordinate System (WGS84) was adopted as the reference standard. In the process of coordinate conversion, we chose the Universal Transverse Mercator Network (UTM) as an intermediate bridge. The specific conversion path is: first convert from pixel coordinates to UTM coordinates, and then convert from UTM coordinates to WGS 84 coordinates. Conversely, we can also trace back from WGS 84 coordinates to UTM coordinates, and finally return to pixel coordinates.

[0106] The specific process of calibrating the roadside camera includes:

[0107] The second pixel coordinates of the image of the target road taken by the roadside camera and the geodetic coordinates corresponding to the second pixel coordinates are obtained. Specifically, a carrier phase difference technology (Real-time kinematic, RTK) surveying and mapping equipment is used to perform a uniformly distributed "dotting" operation within the image range taken by the roadside camera, thereby providing multiple groups of corresponding pixel coordinates (second pixel coordinates) and WGS 84 coordinate data (i.e., geodetic coordinates).

[0108] The geodetic coordinates are converted into second UTM geographic coordinates, that is, after that, the collected WGS84 coordinates are converted into UTM coordinates using professional tools, thereby obtaining multiple sets of corresponding pixel coordinates and UTM coordinates.

[0109] By using a perspective transformation algorithm, a perspective transformation matrix is ​​generated according to the second pixel coordinates and the second UTM geographic coordinates corresponding to the second pixel coordinates. The perspective transformation matrix is ​​the required calibration result, which will ensure the precise correspondence between the two coordinate systems and provide an accurate coordinate conversion basis for subsequent work.

[0110] After the roadside camera calibration is completed, the first pixel coordinates corresponding to the main grid are converted into the first UTM geographic coordinates according to the perspective transformation matrix. For the specific process, please refer to the above specific implementation.

[0111] Combine the following Figure 3 , specifically describes the road surface grid division process provided by an embodiment of the present invention.

[0112] Calibrate the road rasterization network, generate the initial grid, and determine whether the initial grid is a convex polygon. If so, convert the corner coordinates of the main grid into UTM coordinates. If not, end the process and redraw the initial grid. After converting the corner coordinates of the main grid into UTM coordinates, calculate the circumscribed rectangle of the main grid, and then generate a sub-grid within the circumscribed rectangle.

[0113] Among them, generating a sub-grid within the circumscribed rectangle specifically includes: generating a first grid according to a preset width and a preset height, determining whether the first grid is within the circumscribed rectangle, if so, considering the first grid as a sub-grid and adding it to the sub-grid set, if not, returning to continue generating the first grid.

[0114] In an optional embodiment, for the image frame captured by the roadside camera in the first time window, obtaining target tracking data of a preset tracking target in each sub-grid in the main grid includes:

[0115] For the image frame, the preset tracking target is detected using a deep learning network and the preset tracking target is tracked using a preset tracking algorithm to obtain target tracking data of the preset tracking target corresponding to the image frame.

[0116] When performing preset tracking target detection, the deep learning network YOLO v8 is used, and in order to enhance the practicality and multi-task processing capabilities of the network, a key point detection branch (Pose Branch) is introduced based on the original target frame and category detection functions. This new branch enables the network to simultaneously detect and locate the five key points of the target, including the four corner points and one center point of the target on the ground, so as to more accurately depict the spatial position and posture information of the target.

[0117] The above network is used to detect the following different categories of preset tracking targets, including: pedestrians, cars, buses, trucks, traffic cones, roadblocks, two-wheelers, three-wheelers, and license plates.

[0118] Regarding the training process of the detection network: internal professional data sets and training methods are used to ensure the high accuracy and robustness of the model. Through the above methods, the target detection system can achieve more efficient and accurate target detection and positioning.

[0119] In the tracking algorithm (preset tracking algorithm), the "Tracking-by-Detection" method is used. The core of this method is to use the maximum matching algorithm to calculate the similarity of all targets between two adjacent frames, establish inter-frame associations for these targets, and thus achieve accurate target tracking.

[0120] In the process of similarity calculation, a comprehensive loss function is introduced, which integrates multiple key feature dimensions. Specifically, we use DIOU (Distance Intersection over Union, Distance-IoU) to measure the overlap between target boxes, while considering the consistency of target categories, the Euclidean distance between target center points, and the similarity of target image features. The features of these four dimensions are integrated into the loss function and work together in the calculation of similarity, thereby ensuring the accuracy and robustness of tracking.

[0121] With the help of this carefully designed target tracking algorithm, the target's motion trajectory can be effectively tracked, target tracking data can be obtained, and a data basis can be provided for subsequent event detection.

[0122] After obtaining the target tracking data, the calibrated road grid network is loaded, and a dedicated main grid statistical module is allocated to each main grid, and a sub-grid statistical module is configured for each sub-grid.

[0123] Obtain the video stream captured by the roadside camera and receive the above target tracking data.

[0124] For each image frame, the system determines whether the preset tracking target (or simply the target) enters the main grid. The determination is mainly based on whether the center point of the target on the ground falls within the polygonal area of ​​the main grid. If the target does not enter any calibrated main grid, the system will ignore the target.

[0125] Specifically, according to the target tracking data, the preset tracking target in the main grid is obtained by using the ray intersection method. The basic steps are to start from the point to be detected and lead a ray in any direction, usually horizontally to the right or left. Calculate the number of intersections between this ray and each edge of the main grid. If it intersects with an edge of the main grid, the number of intersections is increased by one. If the starting point of the ray is on an edge of the main grid or a vertex, special processing is required to avoid repeated counting. Next, the total number of intersections is counted. If the number of intersections is an odd number, the detection point is inside the main grid. If the number of intersections is an even number, the detection point is not inside the main grid. This method is based on a simple principle: if a point is inside a polygon, then any ray starting from the point should intersect the boundary of the polygon an odd number of times. On the contrary, if a point is outside a polygon, then any ray starting from the point should intersect the boundary of the polygon an even number of times.

[0126] Afterwards, based on the same principle as above, the preset tracking target in each of the sub-grids in the main grid is obtained by using the ray crossing method, and the target tracking data corresponding to the preset tracking target in each of the sub-grids in the main grid is obtained. That is, the ray crossing method is used to determine which sub-grid the preset tracking target has entered, and the corresponding sub-grid statistical modules are activated, which modules will obtain and record the target tracking data and the identifier (ID) of the preset tracking target in the sub-grid.

[0127] After completing the statistics of all targets at the sub-grid level, the algorithm will enter the processing stage of the main grid statistics module. This module will integrate the data of all sub-grids under its jurisdiction to calculate the target tracking data of the current main grid. In addition, key data such as the status of the main grid, status duration, detailed information of the latest N targets, and the latest M sub-grid trajectory chains will also be updated.

[0128] Further, according to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic condition of the target road area corresponding to the main grid and traffic detection data related to the traffic condition of the target road area corresponding to each of the sub-grids in the main grid are obtained, including:

[0129] According to the target tracking data of the preset tracking target in the sub-grid, the traffic detection data of the corresponding sub-grid is obtained. Exemplarily, according to the center point of the preset tracking target on the ground, it is determined whether the preset tracking target enters the sub-grid and the position of entering and exiting the sub-grid in the image frame, and the image frame in which the preset tracking target enters the sub-grid is further determined, so that the passing time, average speed, acceleration, etc. of the preset tracking target in the sub-grid can be calculated.

[0130] According to the target tracking data of the preset tracking target in all sub-grids within a main grid, the traffic detection data of the main grid is obtained, and then according to the target tracking data of the main grid, the traffic detection data of the corresponding main grid is obtained. Exemplarily, according to the center point of the preset tracking target on the ground, it is determined whether the preset tracking target in the image frame enters the main grid and the position of entering and exiting the main grid, and the image frame in which the preset tracking target enters the main grid is further determined, so that the passing time, average speed, acceleration, etc. of the preset tracking target in the main grid can be calculated.

[0131] In an optional embodiment, performing traffic event detection in the target road area according to the traffic detection data includes:

[0132] Determine the traffic information of the preset tracking target in the target road area within the first time window according to the traffic detection data, trigger event analysis based on the above traffic detection data, and determine the traffic information of the preset tracking target in the target road area within the first time window, the traffic information is used to indicate the traffic characteristics of the preset tracking target, including abnormal time consumption, congestion, illegal occupation, sudden acceleration, detour or abnormal target type, etc.;

[0133] Optionally, the traffic information includes at least one of the following:

[0134] Passing time information, which can be understood as the passing time (or passing time) of the preset tracking target in the target road area within the first time window;

[0135] Traffic speed information, including average traffic speed information and traffic acceleration information. The average traffic speed information can be understood as the average traffic speed of the preset tracking target in the target road area within the first time window, and the traffic acceleration information can be understood as the traffic acceleration of the preset tracking target in the target road area within the first time window;

[0136] Traffic congestion information, which can be understood as a preset tracking target of a moving type in a normal state, which has been in a stationary state or has an average moving speed less than a preset speed within a first time window;

[0137] The detour probability may be understood as the probability of a grid trajectory chain of a certain type of preset tracking target in a sub-grid (ie, a motion trajectory chain of the preset tracking target in the sub-grid) changing.

[0138] Abnormal traffic events in the target road area are determined according to the traffic information.

[0139] Exemplarily, for the same type of preset tracking target, if the travel time information indicates that the travel time in the first time window is greater than the historical average time for a certain length of time or less than the historical average time for a certain length of time, then it is determined that the travel time of the preset tracking target is abnormal. The historical average time can be determined by taking the average of the travel time information corresponding to the same type of preset tracking target in the second time window, and the second time window is at least one time window adjacent to the first time window. Alternatively, for a certain type of preset tracking target, if the travel speed information indicates that the travel average in the first time window is greater than the historical average speed for a certain speed or less than the historical average speed for a certain speed, then it is determined that the travel speed of the preset tracking target is abnormal. The historical average speed can be determined by taking the average of the travel speed information corresponding to the same type of preset tracking target in the second time window, and the second time window is at least one time window adjacent to the first time window. Alternatively, for a preset tracking target of a certain type, if it is determined based on the traffic information in the second time window that the preset tracking target has been in motion, and if in the first time window, the preset tracking target has been stationary or the average speed of movement is less than the preset speed, then the preset tracking target is considered to be blocked. Alternatively, for a preset tracking target of a certain type, if the detour probability is greater than a certain probability or less than a certain probability, then the preset tracking target is considered to have a detour risk.

[0140] After the above abnormal traffic event is detected according to the traffic information, the detection result of the abnormal event can be output immediately, so that the vehicle can perform subsequent processing.

[0141] Further, determining the traffic information of the preset tracking target in the target road area within the first time window according to the traffic detection data includes:

[0142] Obtaining a first number of times that a first preset tracking target is transferred from a first target grid to a second target grid and a second number of times that the first preset tracking target is transferred from the first target grid out of the first grid to which the first target grid belongs within the first time window; wherein the first target grid is any sub-grid, the second target grid is a sub-grid outside the first target grid, the first target grid and the second target grid belong to the same main grid, and the first preset tracking target is any preset tracking target;

[0143] A detour probability of the first preset tracking target is obtained according to the first number of times and the second number of times.

[0144] It should be noted that, regarding the statistical link of the grid trajectory chain, the embodiment of the present invention uses a linked list data structure to record the information of M (M is a positive integer) sub-grid trajectory chains. In this linked list, each node represents an independent sub-grid trajectory, which includes key information such as the unique identifier (ID) of the grid, the target's stay time in the grid (through time consumption), and pointers to the previous and next nodes.

[0145] When a target is observed to enter a new sub-grid, a new node is created in real time and added to the head of the linked list to ensure the real-time and accuracy of the trajectory data. Once the target leaves the main grid area, the sub-grid trajectory chain generated during this period will be immediately compared and merged with the existing M sub-grid trajectory chains. If a completely identical trajectory chain is found, the corresponding count will be increased by 1, thereby achieving effective statistics of repeated trajectories.

[0146] At the same time, the main grid statistics module will make full use of the data of the M sub-grid trajectory chains to conduct in-depth data mining and analysis. Specifically, the module will traverse all sub-grid trajectory chains, count the number of transfers from one sub-grid to its adjacent sub-grid, and then reveal the movement pattern of the target between different sub-grids. Based on the above transfer number data, the system will further calculate the transfer probability between sub-grids through the formula: P(B|A)=N(A→B)÷N(A). Among them, P(B|A) represents the probability of transferring from grid A (the first target grid) to grid B (the second target grid) (i.e., the detour probability), N(A→B) represents the number of transfers from grid A to grid B (i.e., the first number), and N(A) represents the total number of transfers from grid A (i.e., the second number). This important indicator can help predict the next sub-grid that the target is most likely to go to when it is in a sub-grid within a specific time window, and give a corresponding probability list.

[0147] In addition, by continuously observing the dynamic changes of the sub-grid trajectory chain in multiple time windows and the fluctuations of the transfer probability between sub-grids, the impact of abnormal road events on the target trajectory can be captured, thereby providing data support for subsequent anomaly detection and event analysis.

[0148] In another optional embodiment, according to the target tracking data of the preset tracking target in the sub-grid, obtaining the traffic detection data related to the traffic condition of the target road area corresponding to the main grid and the traffic detection data related to the traffic condition of the target road area corresponding to each of the sub-grids in the main grid includes:

[0149] When the target tracking data indicates that the number of preset tracking targets is greater than or equal to the preset number, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained according to the target tracking data of the preset tracking targets in the sub-grid.

[0150] Considering that in actual application scenarios, the traffic flow on some sections is relatively sparse during the early morning hours, this may result in the main grid statistics module being unable to obtain valid data within the specified time window. In order to enhance the robustness and adaptability of the system, a degradation mechanism is designed. When the statistical target tracking data (such as the target tracking data corresponding to the main grid) is insufficient, the event detection module can automatically switch to the conventional rule algorithm, which will directly use the target data obtained by target detection and tracking for event detection. This flexible switching mechanism ensures that the system can maintain efficient and stable event detection capabilities under various traffic flow conditions and output accurate results.

[0151] The embodiment of the present invention can realize all-round and no-dead-angle capture of road target information through the dual statistical modules of the main grid and the sub-grid. This ensures the integrity of data collection and provides a solid foundation for subsequent event detection; special attention is paid to the detour probability, and the possibility of the target transferring from one sub-grid to another is accurately calculated. This accuracy has significant advantages in predicting the target movement trajectory and timely discovering abnormal situations; at the main grid level, the technology can automatically generate and maintain the sub-grid trajectory chain, thereby systematically recording the target's movement trajectory. This not only simplifies the complexity of manual operation, but also improves the efficiency and accuracy of data processing; the event detection algorithm can realize efficient and real-time event recognition and feedback. This is particularly important in scenarios such as traffic congestion and frequent accidents, which helps relevant departments to respond and handle in a timely manner.

[0152] like Figure 4 As shown, an embodiment of the present invention further provides a traffic event detection device, comprising:

[0153] A first acquisition module 401 is used to acquire target tracking data of a preset tracking target in each sub-grid in a main grid for an image frame captured by a roadside camera in a first time window; wherein the main grid is obtained by dividing a target road area captured by the roadside camera, and one main grid includes at least one sub-grid;

[0154] The first processing module 402 is used to obtain, according to the target tracking data of the preset tracking target in the sub-grid, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid;

[0155] The second processing module 403 is used to perform traffic event detection in the target road area according to the traffic detection data.

[0156] Optionally, the device further comprises:

[0157] A second acquisition module, used to acquire the image of the target road area taken by the roadside camera;

[0158] A third processing module, used for drawing at least one main grid on the image of the target road area;

[0159] The fourth processing module is used to generate at least one sub-grid in the main grid according to a preset width and a preset height.

[0160] Optionally, the third processing module includes:

[0161] A first processing unit, configured to draw at least one initial grid on the image of the target road area;

[0162] The first determining unit is configured to determine the initial grid as the main grid when it is determined that the shape of the initial grid is a convex polygon.

[0163] Optionally, the fourth processing module includes:

[0164] A second processing unit, configured to convert the first pixel coordinates corresponding to the main grid into a first Universal Transverse Mercator Grid system UTM geographic coordinates;

[0165] A second determining unit is used to determine the circumscribed rectangle of the main grid in the UTM coordinate system according to the first UTM coordinate geographic coordinate;

[0166] A third processing unit, configured to generate a first grid within the circumscribed rectangle according to the preset width and the preset height;

[0167] The third determining unit is configured to determine that the first grid located within the main grid is the sub-grid.

[0168] Optionally, the second processing unit is specifically configured to:

[0169] Acquire a second pixel coordinate of the image of the target road photographed by the roadside camera and a geodetic coordinate corresponding to the second pixel coordinate;

[0170] Converting the geodetic coordinates into second UTM geographic coordinates;

[0171] Generate a perspective transformation matrix according to the second pixel coordinates and the second UTM geographic coordinates corresponding to the second pixel coordinates by using a perspective transformation algorithm;

[0172] The first pixel coordinates corresponding to the main grid are converted into the first UTM geographic coordinates according to the perspective transformation matrix.

[0173] Optionally, the first acquisition module 401 includes:

[0174] a fourth processing unit, configured to detect the preset tracking target using a deep learning network and track the preset tracking target using a preset tracking algorithm for the image frame, so as to obtain target tracking data of the preset tracking target corresponding to the image frame;

[0175] A fifth processing unit, configured to obtain a preset tracking target in the main grid by using a ray crossing method according to the target tracking data;

[0176] A sixth processing unit, configured to obtain, from the preset tracking targets in the main grid, a preset tracking target in each of the sub-grids in the main grid by using a ray crossing method;

[0177] The first acquisition unit is used to acquire the target tracking data corresponding to the preset tracking target in each of the sub-grids in the main grid.

[0178] Optionally, the second processing module 403 includes:

[0179] a fourth determining unit, configured to determine, according to the traffic detection data, the traffic information of the preset tracking target in the target road area within the first time window;

[0180] A fifth determining unit, configured to determine an abnormal traffic event in the target road area according to the traffic information;

[0181] The traffic information includes at least one of the following:

[0182] Travel time information;

[0183] Traffic speed information;

[0184] Traffic congestion information;

[0185] Detour probability.

[0186] Optionally, the fourth determining unit is specifically configured to:

[0187] Obtaining a first number of times that a first preset tracking target is transferred from a first target grid to a second target grid and a second number of times that the first preset tracking target is transferred from the first target grid out of the first grid to which the first target grid belongs within the first time window; wherein the first target grid is any sub-grid, the second target grid is a sub-grid outside the first target grid, the first target grid and the second target grid belong to the same main grid, and the first preset tracking target is any preset tracking target;

[0188] A detour probability of the first preset tracking target is obtained according to the first number of times and the second number of times.

[0189] Optionally, the first processing module 402 includes:

[0190] The seventh processing unit is used to obtain the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid based on the target tracking data of the preset tracking targets in the sub-grid, when the target tracking data indicates that the number of the preset tracking targets is greater than or equal to the preset number.

[0191] It should be noted that the traffic event detection device provided in the embodiment of the present invention is a device capable of executing the above-mentioned traffic event detection method. All embodiments of the above-mentioned traffic event detection method are applicable to the device and can achieve the same or similar technical effects.

[0192] like Figure 5 As shown, an embodiment of the present invention also provides a traffic event detection device, including: a processor 501; and a memory 503 connected to the processor 501 through a bus interface 502, wherein the memory 503 is used to store programs and data used by the processor 501 when performing operations, and the processor 501 calls and executes the programs and data stored in the memory 503.

[0193] The transceiver 504 is connected to the bus interface 502 and is used to receive and send data under the control of the processor 501. Specifically, the processor 501 is used to read the program in the memory 503 and execute the following process:

[0194] For the image frames captured by the roadside camera in the first time window, target tracking data of a preset tracking target in each sub-grid in the main grid is obtained; wherein the main grid is obtained by dividing the target road area captured by the roadside camera, and one main grid includes at least one sub-grid;

[0195] Obtaining, according to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid;

[0196] Traffic event detection is performed in the target road area according to the traffic detection data.

[0197] Optionally, the processor 501 is further configured to:

[0198] Acquire an image of the target road area taken by the roadside camera;

[0199] Drawing at least one of the main grids on the image of the target road area;

[0200] At least one sub-grid is generated in the main grid according to a preset width and a preset height.

[0201] Optionally, the processor 501 is specifically configured to:

[0202] Drawing at least one initial grid on the image of the target road area;

[0203] When it is determined that the shape of the initial grid is a convex polygon, the initial grid is determined to be the main grid.

[0204] Optionally, the processor 501 is specifically configured to:

[0205] Converting the first pixel coordinates corresponding to the main grid into a first Universal Transverse Mercator Grid system UTM geographic coordinates;

[0206] Determine the circumscribed rectangle of the main grid in the UTM coordinate system according to the first UTM coordinate geographic coordinate;

[0207] Generating a first grid within the circumscribed rectangle according to the preset width and the preset height;

[0208] The first grid located within the main grid is determined as the sub-grid.

[0209] Optionally, the processor 501 is specifically configured to:

[0210] Acquire a second pixel coordinate of the image of the target road photographed by the roadside camera and a geodetic coordinate corresponding to the second pixel coordinate;

[0211] Converting the geodetic coordinates into second UTM geographic coordinates;

[0212] Generate a perspective transformation matrix according to the second pixel coordinates and the second UTM geographic coordinates corresponding to the second pixel coordinates by using a perspective transformation algorithm;

[0213] The first pixel coordinates corresponding to the main grid are converted into the first UTM geographic coordinates according to the perspective transformation matrix.

[0214] Optionally, the processor 501 is specifically configured to:

[0215] For the image frame, using a deep learning network to detect the preset tracking target and using a preset tracking algorithm to track the preset tracking target, so as to obtain target tracking data of the preset tracking target corresponding to the image frame;

[0216] According to the target tracking data, a preset tracking target in the main grid is obtained by using a ray crossing method;

[0217] Using a ray intersection method, among the preset tracking targets in the main grid, a preset tracking target in each of the sub-grids in the main grid is obtained;

[0218] Obtain target tracking data corresponding to the preset tracking target in each of the sub-grids in the main grid.

[0219] Optionally, the processor 501 is specifically configured to:

[0220] Determining, based on the traffic detection data, traffic information of the preset tracking target in the target road area within the first time window;

[0221] Determining abnormal traffic events in the target road area according to the traffic information;

[0222] The traffic information includes at least one of the following:

[0223] Travel time information;

[0224] Traffic speed information;

[0225] Traffic congestion information;

[0226] Detour probability.

[0227] Optionally, the processor 501 is specifically configured to:

[0228] Obtaining a first number of times that a first preset tracking target is transferred from a first target grid to a second target grid and a second number of times that the first preset tracking target is transferred from the first target grid out of the first grid to which the first target grid belongs within the first time window; wherein the first target grid is any sub-grid, the second target grid is a sub-grid outside the first target grid, the first target grid and the second target grid belong to the same main grid, and the first preset tracking target is any preset tracking target;

[0229] A detour probability of the first preset tracking target is obtained according to the first number of times and the second number of times.

[0230] Optionally, the processor 501 is specifically configured to:

[0231] When the target tracking data indicates that the number of preset tracking targets is greater than or equal to the preset number, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained according to the target tracking data of the preset tracking targets in the sub-grid.

[0232] Among them, Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 501 and memory represented by memory 503. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 505. The transceiver 504 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 501 is responsible for managing the bus architecture and general processing, and the memory 503 may store data used by the processor 501 when performing operations.

[0233] In addition, a specific embodiment of the present invention further provides a readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the steps in the traffic event detection method as described above are implemented.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0236] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the resource selection method described in each embodiment of the present invention, or to perform some steps of the information sending method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0237] A specific embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0238] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles described in the present invention. These improvements and modifications are also within the scope of protection of the present invention.

Claims

1. A traffic incident detection method, characterized in that: include: For the image frames captured by the roadside camera in the first time window, target tracking data of a preset tracking target in each sub-grid in the main grid is obtained; wherein the main grid is obtained by dividing the target road area captured by the roadside camera, and one main grid includes at least one sub-grid; According to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained; Traffic event detection is performed in the target road area according to the traffic detection data.

2. The method according to claim 1, characterized in that The method further comprises: Acquire an image of the target road area taken by the roadside camera; Drawing at least one of the main grids on the image of the target road area; At least one sub-grid is generated in the main grid according to a preset width and a preset height.

3. The method according to claim 2, characterized in that Drawing at least one main grid on the image of the target road area includes: Drawing at least one initial grid on the image of the target road area; When it is determined that the shape of the initial grid is a convex polygon, the initial grid is determined to be the main grid.

4. The method according to claim 2, characterized in that: Generating at least one sub-grid in the main grid according to a preset width and a preset height, comprising: Converting the first pixel coordinates corresponding to the main grid into a first Universal Transverse Mercator Grid system UTM geographic coordinates; Determine the circumscribed rectangle of the main grid in the UTM coordinate system according to the first UTM coordinate geographic coordinate; Generating a first grid within the circumscribed rectangle according to the preset width and the preset height; The first grid located within the main grid is determined as the sub-grid.

5. The method according to claim 4, characterized in that Converting the first pixel coordinates corresponding to the main grid into the first Universal Transverse Mercator Grid System UTM geographic coordinates, including: Acquire a second pixel coordinate of the image of the target road photographed by the roadside camera and a geodetic coordinate corresponding to the second pixel coordinate; Converting the geodetic coordinates into second UTM geographic coordinates; Generate a perspective transformation matrix according to the second pixel coordinates and the second UTM geographic coordinates corresponding to the second pixel coordinates by using a perspective transformation algorithm; The first pixel coordinates corresponding to the main grid are converted into the first UTM geographic coordinates according to the perspective transformation matrix.

6. The method according to claim 1, characterized in that For the image frames captured by the roadside camera in the first time window, the target tracking data of the preset tracking target in each sub-grid in the main grid is obtained, including: For the image frame, using a deep learning network to detect the preset tracking target and using a preset tracking algorithm to track the preset tracking target, so as to obtain target tracking data of the preset tracking target corresponding to the image frame; According to the target tracking data, a preset tracking target in the main grid is obtained by using a ray crossing method; Using a ray intersection method, among the preset tracking targets in the main grid, a preset tracking target in each of the sub-grids in the main grid is obtained; Obtain target tracking data corresponding to the preset tracking target in each of the sub-grids in the main grid.

7. The method according to claim 1, characterized in that Performing traffic event detection in the target road area according to the traffic detection data includes: Determining, based on the traffic detection data, traffic information of the preset tracking target in the target road area within the first time window; Determining abnormal traffic events in the target road area according to the traffic information; The traffic information includes at least one of the following: Travel time information; Traffic speed information; Traffic congestion information; Detour probability.

8. The method according to claim 6, characterized in that Determining the traffic information of the preset tracking target in the target road area within the first time window according to the traffic detection data includes: Obtaining a first number of times that a first preset tracking target is transferred from a first target grid to a second target grid and a second number of times that the first preset tracking target is transferred from the first target grid out of the first grid to which the first target grid belongs within the first time window; wherein the first target grid is any sub-grid, the second target grid is a sub-grid outside the first target grid, the first target grid and the second target grid belong to the same main grid, and the first preset tracking target is any preset tracking target; A detour probability of the first preset tracking target is obtained according to the first number of times and the second number of times.

9. The method according to claim 1, characterized in that: According to the target tracking data of the preset tracking target in the sub-grid, traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained, including: When the target tracking data indicates that the number of preset tracking targets is greater than or equal to the preset number, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid are obtained according to the target tracking data of the preset tracking targets in the sub-grid.

10. A traffic incident detection device, characterized in that: include: A first acquisition module is used to acquire target tracking data of a preset tracking target in each sub-grid in a main grid for an image frame captured by a roadside camera within a first time window; wherein the main grid is obtained by dividing a target road area captured by the roadside camera, and one main grid includes at least one sub-grid; A first processing module is used to obtain, according to the target tracking data of the preset tracking target in the sub-grid, the traffic detection data related to the traffic conditions of the target road area corresponding to the main grid and the traffic detection data related to the traffic conditions of the target road area corresponding to each of the sub-grids in the main grid; The second processing module is used to perform traffic event detection in the target road area according to the traffic detection data.

11. A traffic incident detection device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps in the traffic event detection method according to any one of claims 1 to 9 are implemented.

12. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by a processor, the steps in the traffic event detection method according to any one of claims 1 to 9 are implemented.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the traffic event detection method according to any one of claims 1 to 9.