Road condition detection method, device, equipment and medium
By performing vehicle detection and trajectory grouping of video images collected by the camera, calculating the average vehicle speed to judge the road conditions, the problems of complex operation and poor versatility in the prior art are solved, and simple and efficient road conditions detection is achieved.
Patent Information
- Application Number
- CN202311492520.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-16
AI Technical Summary
In the existing road condition detection tasks, corresponding reference standards need to be set according to different shooting scenes, resulting in complex operations and poor versatility.
By performing vehicle detection on the multi-frame video images collected by the target camera, the vehicle's driving trajectory is determined, and the trajectory is grouped based on the first angle of the trajectory, and the average vehicle speed of the trajectory group is calculated to judge the road conditions.
There is no need to set reference standards based on shooting scenes, which simplifies the operation process and improves the versatility of detection, and is suitable for multiple camera shooting scenes.
Smart Images

Figure CN120014817A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of road condition detection, and in particular to a road condition detection method, device, equipment and medium. Background Art
[0002] The road condition detection task is to analyze the video streams collected by road network cameras to obtain the real parameter values under the preset reference standards (for example, the average speed, vehicle queue length, space occupancy rate, etc. in the monitored section). Then, based on the real parameter values of each reference standard, the road condition detection result of whether the standard monitored section is congested is determined (for example, whether the traffic in the monitored section is unobstructed, whether the vehicle congestion is serious, etc.).
[0003] In current road condition detection tasks, it is often necessary to set corresponding reference standards based on the actual shooting scene of the camera. The reference standards in different shooting scenes are different. When the shooting scene changes, the reference standards need to be reset, which has the problems of complex operation and poor versatility. Summary of the invention
[0004] The embodiments of the present application provide a road condition detection method, device, equipment and medium, which are used to solve the problem that in the current road condition detection task, corresponding reference standards need to be set for different shooting scenes, which has the problems of complex operation and poor versatility.
[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application discloses a road condition detection method, comprising:
[0007] In response to the detection instruction, performing vehicle detection on multiple frames of video images captured by the target camera to obtain a detection frame of each vehicle in the multiple frames of video images;
[0008] Determining a driving trajectory of the vehicle in the multiple frames of video images according to a center point of a detection frame of each vehicle in the multiple frames of video images;
[0009] The driving trajectories are grouped based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range;
[0010] Determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group;
[0011] A road condition detection result indicating whether a road section corresponding to the trajectory group is congested is determined based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
[0012] In some possible embodiments, the grouping of the driving trajectories based on the first angle of each driving trajectory to obtain at least one trajectory group includes:
[0013] For any two trajectories to be processed, determining a second angle between the trajectory lines of the two trajectories to be processed;
[0014] If the second angle is less than the angle threshold, it is determined that the two to-be-processed trajectories are in the same trajectory group; wherein the to-be-processed trajectories are driving trajectories whose first angle is within a preset angle range, or driving trajectories whose first angle is outside the preset angle range.
[0015] In some possible embodiments, determining the average vehicle speed of the trajectory group according to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group includes:
[0016] For any driving track in the track group, determining the acquisition time difference between a first image and a second image corresponding to the driving track; wherein the first image is a video image at a starting point of the driving track, and the second image is a video image at an end point of the driving track;
[0017] Determine the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory;
[0018] The average value of the driving speeds of the vehicles corresponding to the driving trajectories in the trajectory group is taken as the average vehicle speed of the trajectory group.
[0019] In some possible embodiments, determining the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory includes:
[0020] Determine the displacement distance of the vehicle corresponding to the driving trajectory in the multiple frames of video images according to the trajectory starting point and the trajectory end point;
[0021] Selecting a minimum detection frame with the smallest size from all the detection frames included in the multiple frames of video images, and determining the vehicle length value in the multiple frames of video images according to the minimum detection frame;
[0022] The driving speed is determined according to the vehicle length value, the displacement distance and the acquisition time difference.
[0023] In some possible embodiments, determining the vehicle length value in the multiple frames of video images according to the minimum detection frame includes:
[0024] If the detection frame height of the minimum detection frame is greater than the detection frame width of the minimum detection frame, the detection frame height is used as the vehicle length value;
[0025] Otherwise, the detection frame width is used as the vehicle length value.
[0026] In some possible embodiments, determining the road condition detection result indicating whether the road section corresponding to the trajectory group is congested based on the average vehicle speed includes:
[0027] Determine a reference coordinate axis of the trajectory group in an image coordinate system corresponding to the plurality of frames of video images according to a first angle of any driving trajectory in the trajectory group;
[0028] Determine the length of the vehicle queue of the trajectory group according to the coordinate value of the detection frame corresponding to the center point of the detection frame of each driving trajectory in the trajectory group under the reference coordinate axis;
[0029] The road condition detection result is determined according to the total number of vehicles in the trajectory group, the length of the vehicle queue and the average vehicle speed; wherein the total number of vehicles is determined according to the number of driving trajectories in the trajectory group.
[0030] In some possible embodiments, determining the reference coordinate axis of the trajectory group in the image coordinate system corresponding to the multiple frames of video images according to the first angle of any driving trajectory in the trajectory group includes:
[0031] If the first angle is outside the preset angle interval, the vertical axis in the image coordinate system is used as the reference coordinate axis;
[0032] Otherwise, the horizontal axis in the image coordinate system is used as the reference coordinate axis.
[0033] In some possible embodiments, before determining the driving trajectory of the vehicle in the multiple frames of video images according to the center point of the detection box of each vehicle in the multiple frames of video images, the method further includes:
[0034] Performing clustering calculation on the center points of each detection frame based on a density clustering function to obtain discrete points in the center points of each detection frame;
[0035] The discrete points within the center points of each detection frame are eliminated.
[0036] In a second aspect, the embodiment of the present application further provides a road condition detection device, including:
[0037] The vehicle detection unit is configured to: in response to the detection instruction, perform vehicle detection on the multiple frames of video images captured by the target camera to obtain a detection frame of each vehicle in the multiple frames of video images;
[0038] A trajectory acquisition unit is configured to: determine the driving trajectory of the vehicle in the multiple frames of video images according to the center point of the detection frame of each vehicle in the multiple frames of video images;
[0039] The track grouping unit is configured to: group the driving tracks based on the first angles of the driving tracks to obtain at least one track group; wherein the first angle is the angle between the track line of the driving track and the longitudinal axis of the image coordinate system of the video image, and the track line is a line with the track start point and the track end point of the driving track as endpoints; the first angles of the driving tracks in any track group are all within a preset angle range or are all outside the preset angle range;
[0040] A vehicle speed acquisition unit is configured to: determine an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group;
[0041] The road condition detection unit is configured to: determine a road condition detection result indicating whether the road section corresponding to the trajectory group is congested based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
[0042] In a third aspect, an embodiment of the present application further provides an electronic device, including a data transmission unit and a processor:
[0043] The data transmission unit is configured to: receive a detection indication;
[0044] The processor is configured to: perform vehicle detection on multiple frames of video images captured by a target camera to obtain a detection frame of each vehicle in the multiple frames of video images;
[0045] Determining a driving trajectory of the vehicle in the multiple frames of video images according to a center point of a detection frame of each vehicle in the multiple frames of video images;
[0046] The driving trajectories are grouped based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range;
[0047] Determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group;
[0048] A road condition detection result indicating whether a road section corresponding to the trajectory group is congested is determined based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
[0049] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any one of the methods of the first aspect described above.
[0050] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes any one of the methods of the first aspect mentioned above.
[0051] In an embodiment of the present application, vehicle detection is performed on multiple frames of video images captured by a target camera to obtain a detection frame for each vehicle in the video image. The driving trajectory of each vehicle is then determined based on the center point of the detection frame of the vehicle in the video image. Each driving trajectory is then grouped based on the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system, and then the driving trajectories with the same driving direction are grouped into the same trajectory group. Next, the average speed of the trajectory group is determined based on the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group, and the road condition detection result of whether the corresponding road section of the trajectory group is congested is determined based on the average speed. The above process does not need to set the reference standard for road condition detection according to the shooting scene, and is easy to operate and applicable to a variety of camera shooting scenes.
[0052] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 Provide a schematic diagram of the detection area for the embodiment of the present application;
[0054] Figure 2 A schematic diagram showing that the detection area provided in the embodiment of the present application is not compatible with the monitoring screen;
[0055] Figure 3 An overall flow chart of a road condition detection method provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a detection frame provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of a driving trajectory provided in an embodiment of the present application;
[0058] Figure 6 A schematic diagram of determining discrete points based on a density clustering function provided in an embodiment of the present application;
[0059] Figure 7 A schematic diagram of a driving trajectory provided in an embodiment of the present application;
[0060] Figure 8 A schematic diagram of a first angle of a driving trajectory provided in an embodiment of the present application;
[0061] Fig. 9 A schematic diagram of determining the driving direction of a vehicle trajectory according to a preset angle interval provided in an embodiment of the present application;
[0062] Fig.10 A schematic diagram of a second angle between driving trajectories provided in an embodiment of the present application;
[0063] Fig.11 A schematic diagram of a process for obtaining the average vehicle speed of a trajectory group provided in an embodiment of the present application;
[0064] Fig.12 A schematic diagram of a process for obtaining a vehicle speed of a vehicle trajectory provided in an embodiment of the present application;
[0065] Fig.13 A schematic diagram of a process for obtaining a road condition detection result of a road section corresponding to a trajectory group provided in an embodiment of the present application;
[0066] Fig.14 A schematic diagram of obtaining the length of a vehicle queue when the reference coordinate axis provided in an embodiment of the present application is the vertical axis;
[0067] Fig.15 A schematic diagram of obtaining the length of a vehicle queue when the reference coordinate axis provided in an embodiment of the present application is the horizontal axis;
[0068] Fig.16 A structural diagram of a road condition detection device provided in an embodiment of the present application;
[0069] Fig.17 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0071] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0072] Before introducing a parking recommendation method for a shared parking platform provided in an embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail.
[0073] As mentioned above, the road condition detection task needs to set the corresponding reference standard according to the actual shooting scene of the camera. For example, in the high-point Eagle Eye shooting scene, it is necessary to set parameters such as the vehicle queue length and space occupancy rate in the monitored section as the reference standard for road condition detection. In the low-point checkpoint shooting scene, the vehicle speed and vehicle queue length in the monitored section will be set as the reference standard for road condition detection.
[0074] After the setting is completed, the video stream collected by the camera is analyzed to obtain the real parameter value under each reference standard, and then the road condition detection result of whether the standard monitoring section is congested is determined based on the real parameter value of each reference standard.
[0075] In addition, current road condition detection tasks often require manual labeling of detection areas for cameras, such as Figure 1As shown in the figure, the detection area is equivalent to the lane area in the camera monitoring screen. After the detection area is set, only the video content in the detection area in the camera monitoring screen is analyzed. This can avoid detecting video content outside the lane that is difficult to reflect the road conditions, which can reduce the amount of detection data and improve detection accuracy.
[0076] When the posture of the road network camera changes, relevant personnel are required to reset the detection area. Otherwise, the monitoring screen after the camera posture changes will produce Figure 2 The offset shown causes the originally set detection area to be incompatible with the lane area in the current monitoring image, affecting the detection accuracy.
[0077] From the above content, we can see that the current road condition detection process has the following problems: First, the rotation, zoom and other posture changes of the camera will affect the fit between the detection area and the monitoring screen. When the fit is too low, the camera needs to be manually re-marked for the detection area, otherwise it will seriously affect the detection accuracy. Secondly, it is necessary to set corresponding reference standards for different shooting scenes. When the shooting scene changes, the reference standards need to be reset, which has the problems of complex operation and poor versatility.
[0078] To solve the above problems, the invention of the present application is as follows: by performing vehicle detection on multiple frames of video images captured by a target camera, a detection frame of each vehicle in the video image is obtained. Then, the driving trajectory of the vehicle is determined according to the center point of the detection frame of each vehicle in the video image. Then, the driving trajectories are grouped based on the first angle of the driving trajectory to obtain at least one trajectory group. According to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group, the average speed of the trajectory group is determined, and based on the average speed, a road condition detection result of whether the road section corresponding to the trajectory group is congested is determined.
[0079] The driving tracks in the track group are all within the road section corresponding to the track group. Therefore, the road section corresponding to the track group is the driving area of the vehicle corresponding to each driving track in the track group in the multi-frame video, which is equivalent to the camera detection area manually set in the traditional road condition detection task. It can be seen that in the technical solution of this application, there is no need to set a detection area for the camera, nor is there a need to set a corresponding reference standard according to the shooting scene. It is easy to operate and applicable to a variety of camera shooting scenes.
[0080] Next, Figure 3 As shown, Figure 3 The overall process of a road condition detection method provided by the present application is shown, including the following steps:
[0081] Step 301: In response to a detection instruction, performing vehicle detection on a plurality of video frames captured by a target camera to obtain a detection frame of each vehicle in the plurality of video frames;
[0082] The multi-frame video images in the embodiments of this application are images collected by a target camera within a preset time period. During implementation, it can be set to obtain each frame of video image collected by the target camera within 3 minutes by default after receiving a detection instruction.
[0083] After obtaining the multi-frame video images collected by the target camera, a target detection network (such as Farst-Rnn, yolo series, etc.) can be used to perform vehicle detection on each frame of video image to obtain the detection box (Anchor) of each vehicle included in each frame of video image. Among them, Figure 4 Exemplarily shows the output of the target detection network for performing vehicle detection on a frame of video image, as Figure 4 shown, the target detection network will mark the detection box of each vehicle that appears in the frame of video image to indicate the specific position of each vehicle in the video image.
[0084] Step 302: Determine the driving trajectory of the vehicle in the multi-frame video images according to the center point of the detection box of each vehicle in the multi-frame video images;
[0085] The sizes of each frame of video image collected by the target camera are the same, that is, the image coordinate systems of the frames of video images collected by the camera are shared. Therefore, by mapping the coordinates of the center point of each detection box of each vehicle in the multi-frame video images into the image coordinate system, the driving trajectory coordinates of the vehicle can be obtained.
[0086] Figure 5 Exemplarily shows the specific process of obtaining the driving trajectory of vehicle A. Since the acquisition time of each frame of video image is known, the coordinates of the center point of the detection box of vehicle A in each frame of video image are mapped into the image coordinate system frame by frame in the order from early to late acquisition time, and the driving trajectory of vehicle A can be obtained. Further, each vehicle that appears in the multi-frame video images is processed in the same way, and the driving trajectories of each vehicle that appears in the multi-frame video images can be obtained.
[0087] In addition, before executing step 302, clustering calculation can also be performed on the center points of each detection box based on a density clustering function to obtain the discrete points among the center points of each detection box. The density clustering function formula can be shown as the following formula (1):
[0088] N ε (P) = {q ∈ D丨dist(p,q} ≤ ε(1)
[0089] where, N ε (P) is the center of the detection box of each vehicle in the multi-frame video images, ε is the minimum aggregation radius, which is a preset value. D is the set of coordinate points of all vehicles, q is the coordinate point of a certain vehicle, and dist(p,q) ≤ ε means the points that are directly density-reachable with ε as the aggregation radius.
[0090] like Figure 6 As shown, three types of points are defined in the density clustering function, namely discrete points, boundary points and core points. The division of these three points is determined based on the number of other detection frame center points contained in the circular area formed by the preset clustering radius ε with the center point of each detection frame as the center. Since the density clustering function is a commonly used function in clustering algorithms, this application does not explain its calculation logic. Through the density distance function, discrete points representing noise can be found from the numerous detection frame center points of many vehicles, and then the discrete points in the detection frame center points can be eliminated to improve the accuracy of the driving trajectory.
[0091] Step 303: grouping the driving trajectories based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range;
[0092] To facilitate understanding of the grouping process of step 303, the trajectory line and the first angle of the driving trajectory are first described respectively.
[0093] The trajectory line of the driving trajectory is the line between the starting point and the end point of the driving trajectory. The starting point of the trajectory is the center point of the first detection frame of the vehicle corresponding to the driving trajectory in the multi-frame video image. The end point of the trajectory is the center point of the last detection frame of the vehicle corresponding to the driving trajectory in the multi-frame video image.
[0094] With the aforementioned Figure 5 Taking vehicle A as an example, Figure 7 As shown in the figure, vehicle A only appears in video images 1 to 3 (i.e., the first three frames of video images), so the starting point of the driving trajectory of vehicle A is the center point of the first detection frame in the image (video image 1) where vehicle A first appears. The end point of the driving trajectory of vehicle A is the center point of the last detection frame in the image (video image 3) where vehicle A last appears. The line (line segment) with the starting point and the end point as endpoints is the trajectory line of the driving trajectory.
[0095] The first angle of the driving trajectory is as follows Figure 8 As shown, the first angle is the angle between the track line of the driving track and the vertical axis of the image coordinate system of the video image. Fig. 9As shown, in the embodiment of the present application, a preset angle interval is set for determining the direction of vehicle travel. The value of the preset angle interval is [45°, 135°]. When the first angle of the driving trajectory line is within the preset angle interval, it means that the driving direction of the vehicle corresponding to the driving trajectory in the video image is: from left to right along the horizontal direction of the video image, or from right to left. When the first angle of the driving trajectory line is outside the preset angle interval, it means that the driving direction of the vehicle corresponding to the driving trajectory in the video image is: from bottom to top along the vertical direction of the video image, or from top to bottom.
[0096] When executing step 303, the first angle of each driving trajectory may be obtained in advance, and then the driving trajectories whose first angles are within the preset angle range and the driving trajectories whose first angles are outside the preset angle range are grouped and processed respectively.
[0097] During implementation, each driving trajectory whose first angle is within the preset angle range can be used as a trajectory to be processed in trajectory set 1 to be processed, and each driving trajectory whose first angle is outside the preset angle range can be used as a trajectory to be processed in trajectory set 2 to be processed.
[0098] Next, for each set of trajectories to be processed, the second angle between each two trajectories to be processed in the set of trajectories to be processed is calculated. The second angle between any two trajectories to be processed is the angle between the trajectory lines of the two trajectories to be processed along the specified direction. The specified direction in the embodiment of the present application is the direction from the starting point of the trajectory to the end point of the trajectory.
[0099] It should be noted that the specified direction is set based on actual business needs. In addition to setting the direction from the starting point of the track to the end point of the track as the specified direction, the direction from the end point of the track to the starting point of the track can also be set as the specified direction. This application does not limit the setting method of the specified direction.
[0100] Next, we will take the direction from the starting point of the track to the end point of the track as an example to illustrate the specified direction. Fig.10 As shown, Fig.10 The second angle between the two driving tracks is shown, and the second angle is the angle formed by a track line 1 of one driving track and a track line 2 of another driving track, from the starting point of the track to the end point of the track.
[0101] In the same set of trajectories to be processed (the aforementioned set of trajectories to be processed 1 and set of trajectories to be processed 2), if the second angle between any two trajectories to be processed is less than the preset angle threshold of 90°, it means that the driving directions of the vehicles corresponding to the two trajectories to be processed in the multi-frame video images are the same, and the two trajectories to be processed are grouped together. In this way, the trajectories to be processed with the same driving direction in the same set of trajectories to be processed can be grouped together. For example, the driving direction of the vehicle corresponding to each trajectories to be processed in the aforementioned set of trajectories to be processed 1 is from left to right or from right to left along the horizontal direction of the video image. Through the grouping logic of the above-mentioned second angle, the driving trajectories from left to right in the horizontal direction can be divided into the same trajectory group, and the driving trajectories from right to left in the horizontal direction can be divided into the same trajectory group.
[0102] Step 304: determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group;
[0103] When implemented, it can be Fig.11 The process shown in the figure obtains the average vehicle speed of the trajectory group, including the following steps:
[0104] Step 111: for any driving track in the track group, determining the acquisition time difference between the first image and the second image corresponding to the driving track; wherein the first image is a video image at the starting point of the driving track, and the second image is a video image at the end point of the driving track;
[0105] With the aforementioned Figure 6 As an example, the acquisition time difference here is the time difference between video image 3 and video Figure 1 The difference in acquisition time.
[0106] Step 112: determining the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory;
[0107] When executing step 112, the specific method may be as follows: Fig.12 As shown, the following steps 121 to 123 are included:
[0108] Step 121: determining the displacement distance of the vehicle corresponding to the driving trajectory in the multiple frames of video images according to the trajectory starting point and the trajectory end point of the driving trajectory;
[0109] The displacement distance here refers to the displacement distance of the vehicle in the video image, so the unit is pixel. Figure 6 Taking the driving trajectory shown in FIG. 1 as an example, the displacement distance here is the straight-line distance between the starting point and the end point of the trajectory.
[0110] Step 122: Select a minimum detection frame with the smallest size from all detection frames in the multi-frame video images, and determine the vehicle length value in the multi-frame video images according to the minimum detection frame.
[0111] During implementation, a minimum detection frame with the smallest vehicle detection frame size is selected from each vehicle included in the multiple frames of video images, and then it is determined whether the detection frame height of the minimum detection frame is greater than the detection frame width of the minimum detection frame.
[0112] If the height of the minimum detection frame is greater than the width, it indicates that the vehicle in the minimum detection frame is traveling from top to bottom or from bottom to top along the video image. In this case, the height of the minimum detection frame is used as the vehicle length value L. Correspondingly, if the height of the minimum detection frame is not greater than the width, it indicates that the vehicle in the minimum detection frame is traveling from left to right or from right to left along the video image. In this case, the width of the minimum detection frame is used as the vehicle length value L.
[0113] It should be understood that the vehicle length value L obtained here is the number of pixels occupied by the vehicle with the smallest detection frame size among all vehicles appearing in the multi-frame video image. In the embodiment of the present application, the vehicle length value L represents the number of pixels occupied by the vehicle in the video image, that is, the number of pixels occupied by any vehicle in the video image is L.
[0114] Step 123: determining the driving speed of the vehicle corresponding to the driving trajectory according to the vehicle length value, the displacement distance and the acquisition time difference;
[0115] In the above steps 121 to 122, the acquisition time difference and displacement distance of the driving track, as well as the vehicle length value applicable to all driving tracks, are obtained. Next, for each driving track, the driving speed of the vehicle corresponding to the driving track is determined based on the vehicle length value, the acquisition time difference and displacement distance of the driving track. The specific calculation process can be shown in the following formula (2):
[0116]
[0117] Among them, V is the driving speed of the vehicle corresponding to the driving trajectory, △S is the displacement distance, △t is the acquisition time difference, L is the vehicle length value, and β is the actual length corresponding to the vehicle length value.
[0118] Here, β is explained. As mentioned above, L represents the number of pixels occupied by a vehicle in a video image, that is, the number of pixels occupied by a vehicle of length β in a video image is L. β here is an empirical value set artificially, and in the embodiment of the present application, β is 6 meters.
[0119] Step 113: taking the average of the driving speeds of the vehicles corresponding to the driving trajectories in the trajectory group as the average vehicle speed of the trajectory group.
[0120] After obtaining the driving speed of each vehicle corresponding to a driving trajectory in the trajectory group through the above process, the average driving speed of each vehicle is taken as the average vehicle speed V of the driving trajectory group. avg .
[0121] Step 305: determining a road condition detection result indicating whether the road section corresponding to the trajectory group is congested based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group;
[0122] First, the road section corresponding to the track group in step 305 is explained. As mentioned above, each track group is a collection of driving tracks in the same driving direction. In the embodiment of the present application, each driving track in any track group is located in the road section corresponding to the driving track group. It can be seen that the road section corresponding to the track group is actually the road section where each driving track in the track group corresponds to the vehicle in the video image.
[0123] Next, how to determine the road condition detection result of the corresponding road section of the trajectory group in step 305 is explained:
[0124] After a large number of tests, the embodiment of the present application sets reference speed thresholds for reflecting whether a road section is congested, which are V1 (15Km / h), V2 (30Km / h) and V3 (40Km / h). When executing step 305, the above three reference speed thresholds can be converted into units to obtain the pixel displacement speed corresponding to each reference speed threshold. In specific implementation, the unit conversion can be performed in the manner of 1km / h=1000m / 3600m / s. The following formula (3) shows the conversion formula for obtaining the pixel displacement speed corresponding to the reference speed threshold:
[0125]
[0126] Among them, V n is the reference speed threshold (including V1, V2 and V3), is the reference speed threshold v n The pixel displacement speed is , L is the aforementioned vehicle length value, and β is the actual length corresponding to the vehicle length value.
[0127] When the average vehicle speed of the trajectory group obtained in step 304 When , it is determined that the road section corresponding to the trajectory group is in a serious congestion state. When , it is determined that the road section corresponding to the trajectory group is in a normal congestion state. When , it is determined that the road section corresponding to the trajectory group is in a slow-moving state. , it is determined that the road section corresponding to the trajectory group is in a smooth traffic state.
[0128] In order to apply to more application scenarios, the embodiment of the present application also provides a method for calculating the length N of the vehicle queue and the average vehicle speed V of the trajectory group. avg The detection process of comprehensively evaluating the road condition detection results of the corresponding road section of the trajectory group is as follows: Fig.13 As shown, the following steps are included:
[0129] Step 131: for any trajectory group, according to the first angle of any driving trajectory in the trajectory group, determine the reference coordinate axis of the trajectory group in the image coordinate system corresponding to the multi-frame video image;
[0130] As mentioned above, the first angles of each driving track in the same track group are all within the preset angle range or are all outside the preset angle range. Therefore, when obtaining the reference coordinate axis of the track group through step 131, it is only necessary to select any driving track from the track group and determine the reference coordinate axis of the track group according to the first angle of the driving track.
[0131] During implementation, a driving track is selected from the track group, and the first angle of the driving track is detected to see whether it is within the preset angle range. If the first angle is outside the preset angle range, it means that the driving directions of the driving tracks in the track group are all: from top to bottom or from bottom to top in the video image. At this time, the vertical axis (y axis) of the image coordinate system is used as the reference coordinate axis.
[0132] Correspondingly, if the first angle is within the preset angle range, it means that the driving direction of each driving track in the track group is: from left to right or from right to left in the video image. At this time, the horizontal axis (x axis) of the image coordinate system is used as the reference coordinate axis.
[0133] Step 132: determining the length of the vehicle queue of the trajectory group according to the coordinate value of the detection frame corresponding to the center point of the detection frame of each driving trajectory in the trajectory group on the reference coordinate axis;
[0134] A track group contains multiple driving tracks, each driving track is composed of multiple detection frame center points, and each detection frame center point corresponds to a detection frame. The purpose of step 132 is to obtain the mapping length of all detection frames in the track group on the reference coordinate axis.
[0135] Specific examples include Fig.14 As shown, Fig.14 The track group shown includes track 1 and track 2. Assuming that the reference coordinate axis of the track group is the y-axis, the mapping length of all detection boxes in track 1 and track 2 on the y-axis is obtained, that is, Fig.14L1+L2+...+L8 shown in FIG. The mapping length of all detection boxes under the trajectory group on the y-axis is the vehicle queue length N of the trajectory group. Fig.14 Taking the trajectory group containing two driving trajectories as an example, when the reference coordinate axis is the x-axis, it can be as follows Fig.15 As shown in , by obtaining the mapping lengths of all detection boxes in each driving trajectory in the trajectory group on the x-axis, the vehicle queue length N of the trajectory group is obtained.
[0136] Step 133: Determine the road condition detection result of the trajectory group according to the total number of vehicles, the length of the vehicle queue and the average vehicle speed of the trajectory group; wherein the total number of vehicles is determined according to the number of driving trajectories in the trajectory group.
[0137] The total number of vehicles M in the trajectory group is determined according to the number of driving tracks in the trajectory group. Each driving track corresponds to a vehicle, so the total number of vehicles M in the trajectory group can be obtained according to the number of driving tracks in the trajectory group.
[0138] As mentioned above, the purpose of step 133 is to calculate the vehicle queue length N and average vehicle speed V of the trajectory group. avg Based on this, the embodiment of the present application aims at the parameters of the above three dimensions (N, M and V avg ) set the corresponding weights W1~W3.
[0139] During implementation, the three-dimensional parameters (N, M and V) are first normalized based on a commonly used normalization algorithm. avg ) is normalized to the interval [0,1] to obtain the normalized vehicle queue length N0, the total number of vehicles M0, and the average vehicle speed V avg0 .
[0140] Then the sum of the products of each normalized result and the corresponding parameter is calculated. Specifically, P = W1×N0+W2×M0+W3×V avg0 If P≥0.85, the road traffic status is severe congestion; if 0.65≤P<0.85, the road traffic status is normal congestion; if 0.4≤P<0.65, the road section corresponding to the trajectory group is in a slow-moving state; if P<0.4, the road section corresponding to the trajectory group is in a slow-moving state.
[0141] In the above-mentioned road condition detection process, there is no need to set a detection area for the camera, nor is there a need to set corresponding reference standards according to the shooting scene. The operation is simple and applicable to a variety of camera shooting scenes.
[0142] Based on the same inventive concept, the present application also provides a road condition detection device, specifically, Fig.16 As shown, including:
[0143] The vehicle detection unit 161 is configured to: in response to the detection instruction, perform vehicle detection on the multiple frames of video images captured by the target camera to obtain a detection frame of each vehicle in the multiple frames of video images;
[0144] The trajectory acquisition unit 162 is configured to: determine the driving trajectory of the vehicle in the multiple frames of video images according to the center point of the detection frame of each vehicle in the multiple frames of video images;
[0145] The track grouping unit 163 is configured to: group the driving tracks based on the first angles of the driving tracks to obtain at least one track group; wherein the first angle is the angle between the track line of the driving track and the longitudinal axis of the image coordinate system of the video image, and the track line is a line with the track start point and the track end point of the driving track as endpoints; the first angles of the driving tracks in any track group are all within a preset angle range or are all outside the preset angle range;
[0146] The vehicle speed acquisition unit 164 is configured to: determine the average vehicle speed of the trajectory group according to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group;
[0147] The road condition detection unit 165 is configured to: determine a road condition detection result indicating whether the road section corresponding to the trajectory group is congested based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
[0148] In some possible embodiments, the grouping of the driving trajectories based on the first angle of each driving trajectory is performed to obtain at least one trajectory group, and the trajectory grouping unit 163 is configured as follows:
[0149] For any two trajectories to be processed, determining a second angle between the trajectory lines of the two trajectories to be processed;
[0150] If the second angle is less than the angle threshold, it is determined that the two to-be-processed trajectories are in the same trajectory group; wherein the to-be-processed trajectories are driving trajectories whose first angle is within a preset angle range, or driving trajectories whose first angle is outside the preset angle range.
[0151] In some possible embodiments, the determination of the average vehicle speed of the trajectory group according to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group is performed, and the vehicle speed acquisition unit 164 is configured as follows:
[0152] For any driving track in the track group, determining the acquisition time difference between a first image and a second image corresponding to the driving track; wherein the first image is a video image at a starting point of the driving track, and the second image is a video image at an end point of the driving track;
[0153] Determine the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory;
[0154] The average value of the driving speeds of the vehicles corresponding to the driving trajectories in the trajectory group is taken as the average vehicle speed of the trajectory group.
[0155] In some possible embodiments, the determining of the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, the trajectory end point and the acquisition time difference of the driving trajectory is performed, and the vehicle speed acquisition unit 164 is configured as follows:
[0156] Determine the displacement distance of the vehicle corresponding to the driving trajectory in the multiple frames of video images according to the trajectory starting point and the trajectory end point;
[0157] Selecting a minimum detection frame with the smallest size from all the detection frames included in the multiple frames of video images, and determining the vehicle length value in the multiple frames of video images according to the minimum detection frame;
[0158] The driving speed is determined according to the vehicle length value, the displacement distance and the acquisition time difference.
[0159] In some possible embodiments, the vehicle speed acquisition unit 164 is configured to:
[0160] If the detection frame height of the minimum detection frame is greater than the detection frame width of the minimum detection frame, the detection frame height is used as the vehicle length value;
[0161] Otherwise, the detection frame width is used as the vehicle length value.
[0162] In some possible embodiments, the road condition detection result indicating whether the road section corresponding to the trajectory group is congested is determined based on the average vehicle speed, and the road condition detection unit 165 is configured as follows:
[0163] Determine a reference coordinate axis of the trajectory group in an image coordinate system corresponding to the plurality of frames of video images according to a first angle of any driving trajectory in the trajectory group;
[0164] Determine the length of the vehicle queue of the trajectory group according to the coordinate value of the detection frame corresponding to the center point of the detection frame of each driving trajectory in the trajectory group under the reference coordinate axis;
[0165] The road condition detection result is determined according to the total number of vehicles in the trajectory group, the length of the vehicle queue and the average vehicle speed; wherein the total number of vehicles is determined according to the number of driving trajectories in the trajectory group.
[0166] In some possible embodiments, the determination of the reference coordinate axis of the trajectory group in the image coordinate system corresponding to the multiple frames of video images is performed according to the first angle of any driving trajectory in the trajectory group, and the road condition detection unit 165 is configured as follows:
[0167] If the first angle is outside the preset angle interval, the vertical axis in the image coordinate system is used as the reference coordinate axis;
[0168] Otherwise, the horizontal axis in the image coordinate system is used as the reference coordinate axis.
[0169] In some possible embodiments, before determining the driving trajectory of the vehicle in the multiple frames of video images according to the center point of the detection box of each vehicle in the multiple frames of video images, the trajectory acquisition unit 162 is further configured to:
[0170] Performing clustering calculation on the center points of each detection frame based on a density clustering function to obtain discrete points in the center points of each detection frame;
[0171] The discrete points within the center points of each detection frame are eliminated.
[0172] Based on the same inventive concept, the present application embodiment also provides an electronic device, specifically Fig.17 As shown, it includes a data transmission unit 171 and a processor 172:
[0173] The data transmission unit 171 is configured to: receive a detection indication;
[0174] The processor 172 is configured to: perform vehicle detection on multiple frames of video images captured by the target camera to obtain a detection frame of each vehicle in the multiple frames of video images;
[0175] Determining a driving trajectory of the vehicle in the multiple frames of video images according to a center point of a detection frame of each vehicle in the multiple frames of video images;
[0176] The driving trajectories are grouped based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range;
[0177] Determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group;
[0178] A road condition detection result indicating whether a road section corresponding to the trajectory group is congested is determined based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
[0179] In some possible embodiments, the processor 172 is configured to: group the driving trajectories based on the first angle of each driving trajectory to obtain at least one trajectory group.
[0180] For any two trajectories to be processed, determining a second angle between the trajectory lines of the two trajectories to be processed;
[0181] If the second angle is less than the angle threshold, it is determined that the two to-be-processed trajectories are in the same trajectory group; wherein the to-be-processed trajectories are driving trajectories whose first angle is within a preset angle range, or driving trajectories whose first angle is outside the preset angle range.
[0182] In some possible embodiments, to determine the average vehicle speed of the trajectory group according to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group, the processor 172 is configured to:
[0183] For any driving track in the track group, determining the acquisition time difference between a first image and a second image corresponding to the driving track; wherein the first image is a video image at a starting point of the driving track, and the second image is a video image at an end point of the driving track;
[0184] Determine the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory;
[0185] The average value of the driving speeds of the vehicles corresponding to the driving trajectories in the trajectory group is taken as the average vehicle speed of the trajectory group.
[0186] In some possible embodiments, the processor 172 is configured to:
[0187] Determine the displacement distance of the vehicle corresponding to the driving trajectory in the multiple frames of video images according to the trajectory starting point and the trajectory end point;
[0188] Selecting a minimum detection frame with the smallest size from all the detection frames included in the multiple frames of video images, and determining the vehicle length value in the multiple frames of video images according to the minimum detection frame;
[0189] The driving speed is determined according to the vehicle length value, the displacement distance and the acquisition time difference.
[0190] In some possible embodiments, to determine the vehicle length value in the multiple frames of video images according to the minimum detection frame, the processor 172 is configured to:
[0191] If the detection frame height of the minimum detection frame is greater than the detection frame width of the minimum detection frame, the detection frame height is used as the vehicle length value;
[0192] Otherwise, the detection frame width is used as the vehicle length value.
[0193] In some possible embodiments, to perform the road condition detection result indicating whether the road section corresponding to the trajectory group is congested based on the average vehicle speed, the processor 172 is configured to:
[0194] Determine a reference coordinate axis of the trajectory group in an image coordinate system corresponding to the plurality of frames of video images according to a first angle of any driving trajectory in the trajectory group;
[0195] Determine the length of the vehicle queue of the trajectory group according to the coordinate value of the detection frame corresponding to the center point of the detection frame of each driving trajectory in the trajectory group under the reference coordinate axis;
[0196] The road condition detection result is determined according to the total number of vehicles in the trajectory group, the length of the vehicle queue and the average vehicle speed; wherein the total number of vehicles is determined according to the number of driving trajectories in the trajectory group.
[0197] In some possible embodiments, the processor 172 is configured to:
[0198] If the first angle is outside the preset angle interval, the vertical axis in the image coordinate system is used as the reference coordinate axis;
[0199] Otherwise, the horizontal axis in the image coordinate system is used as the reference coordinate axis.
[0200] In some possible embodiments, before determining the driving trajectory of the vehicle in the multiple frames of video images according to the center point of the detection box of each vehicle in the multiple frames of video images, the processor 172 is further configured to:
[0201] Performing clustering calculation on the center points of each detection frame based on a density clustering function to obtain discrete points in the center points of each detection frame;
[0202] The discrete points within the center points of each detection frame are eliminated.
[0203] The embodiment of the present application further provides a computer storage medium, in which computer program instructions are stored. When the instructions are executed on a computer, the computer executes the steps of the above-mentioned traffic signal control method.
[0204] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0205] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0208] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A road condition detection method, characterized in that: The method comprises: In response to the detection instruction, performing vehicle detection on multiple frames of video images captured by the target camera to obtain a detection frame of each vehicle in the multiple frames of video images; Determining a driving trajectory of the vehicle in the multiple frames of video images according to a center point of a detection frame of each vehicle in the multiple frames of video images; The driving trajectories are grouped based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range; Determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group; A road condition detection result indicating whether a road section corresponding to the trajectory group is congested is determined based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
2. The method according to claim 1, characterized in that The step of grouping the driving trajectories based on the first angle of each driving trajectory to obtain at least one trajectory group includes: For any two trajectories to be processed, determining a second angle between the trajectory lines of the two trajectories to be processed; If the second angle is less than the angle threshold, it is determined that the two to-be-processed trajectories are in the same trajectory group; wherein the to-be-processed trajectories are driving trajectories whose first angle is within a preset angle range, or driving trajectories whose first angle is outside the preset angle range.
3. The method according to claim 1, characterized in that The step of determining the average vehicle speed of the trajectory group according to the detection frame of the vehicle corresponding to each driving trajectory in the trajectory group includes: For any driving track in the track group, determining the acquisition time difference between a first image and a second image corresponding to the driving track; wherein the first image is a video image at a starting point of the driving track, and the second image is a video image at an end point of the driving track; Determine the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, trajectory end point and the acquisition time difference of the driving trajectory; The average value of the driving speeds of the vehicles corresponding to the driving trajectories in the trajectory group is taken as the average vehicle speed of the trajectory group.
4. The method according to claim 3, characterized in that The determining the driving speed of the vehicle corresponding to the driving trajectory based on the trajectory starting point, the trajectory end point and the acquisition time difference of the driving trajectory includes: Determine the displacement distance of the vehicle corresponding to the driving trajectory in the multiple frames of video images according to the trajectory starting point and the trajectory end point; Selecting a minimum detection frame with the smallest size from all the detection frames included in the multiple frames of video images, and determining the vehicle length value in the multiple frames of video images according to the minimum detection frame; The driving speed is determined according to the vehicle length value, the displacement distance and the acquisition time difference.
5. The method according to claim 4, characterized in that The determining the vehicle length value in the multiple frames of video images according to the minimum detection frame includes: If the detection frame height of the minimum detection frame is greater than the detection frame width of the minimum detection frame, the detection frame height is used as the vehicle length value; Otherwise, the detection frame width is used as the vehicle length value.
6. The method according to claim 2, characterized in that The determining, based on the average vehicle speed, a road condition detection result indicating whether the road section corresponding to the trajectory group is congested includes: Determine a reference coordinate axis of the trajectory group in an image coordinate system corresponding to the plurality of frames of video images according to a first angle of any driving trajectory in the trajectory group; Determine the length of the vehicle queue of the trajectory group according to the coordinate value of the detection frame corresponding to the center point of the detection frame of each driving trajectory in the trajectory group under the reference coordinate axis; The road condition detection result is determined according to the total number of vehicles in the trajectory group, the length of the vehicle queue and the average vehicle speed; wherein the total number of vehicles is determined according to the number of driving trajectories in the trajectory group.
7. The method according to claim 6, characterized in that The step of determining the reference coordinate axis of the trajectory group in the image coordinate system corresponding to the multiple frames of video images according to the first included angle of any driving trajectory in the trajectory group includes: If the first angle is outside the preset angle interval, the vertical axis in the image coordinate system is used as the reference coordinate axis; Otherwise, the horizontal axis in the image coordinate system is used as the reference coordinate axis.
8. The method according to any one of claims 1 to 7, characterized in that: Before determining the driving track of the vehicle in the multiple frames of video images according to the center point of the detection frame of each vehicle in the multiple frames of video images, the method further includes: Performing clustering calculation on the center points of each detection frame based on a density clustering function to obtain discrete points in the center points of each detection frame; The discrete points within the center points of each detection frame are eliminated.
9. An electronic device, characterized in that: Including data transmission unit and processor: The data transmission unit is configured to: receive a detection indication; The processor is configured to: perform vehicle detection on multiple frames of video images captured by a target camera to obtain a detection frame of each vehicle in the multiple frames of video images; Determining a driving trajectory of the vehicle in the multiple frames of video images according to a center point of a detection frame of each vehicle in the multiple frames of video images; The driving trajectories are grouped based on the first angles of the driving trajectories to obtain at least one trajectory group; wherein the first angle is the angle between the trajectory line of the driving trajectory and the longitudinal axis of the image coordinate system of the video image, and the trajectory line is a line with the trajectory start point and the trajectory end point of the driving trajectory as endpoints; the first angles of the driving trajectories in any trajectory group are all within a preset angle range or are all outside the preset angle range; Determining an average vehicle speed of the trajectory group according to a detection frame of a vehicle corresponding to each driving trajectory in the trajectory group; A road condition detection result indicating whether a road section corresponding to the trajectory group is congested is determined based on the average vehicle speed; wherein the driving trajectories in any trajectory group are located in the road section corresponding to the trajectory group.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 8.