Traffic conflict detection method based on low-level monitoring

Through low-level monitoring technology, networks such as yolov5s and Resnet50 are used to detect and classify traffic targets, and combined with the KPDEM_model network to obtain vehicle motion parameters, the problems of high costs and low accuracy in the existing technology are solved, and more accurate traffic conflict detection is achieved.

CN118887629APending Publication Date: 2024-11-01SUZHOU HONGMU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410791256.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing traffic conflict calculation technology is cost-effective, difficult to implement and low detection accuracy, so it is impossible to effectively obtain vehicle motion parameters.

Method used

Using a low-level monitoring method, traffic target detection and classification are carried out through the yolov5s network, and the vehicle's characteristic information and key point coordinates are obtained in combination with the Resnet50 and KPDEM_model networks, and the vehicle's motion parameters are calculated to judge conflicts.

Benefits of technology

It reduces application difficulty and cost, improves the accuracy of traffic conflict detection, and fully considers the impact of vehicle length and width on conflict events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887629A_ABST
    Figure CN118887629A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic conflict detection method based on low-order monitoring. The method comprises the following steps: acquiring a current monitoring image frame; performing traffic target detection and traffic target classification on the current monitoring image frame to obtain positioning frame information of traffic targets and types of the traffic targets; cutting each traffic target from the current monitoring image frame according to the positioning frame information of the traffic target to obtain a plurality of traffic target images, and performing feature detection on each traffic target image by adopting a Resnet50 network to obtain feature information of each traffic target; matching the traffic target in the previous monitoring image frame with the traffic target in the current monitoring image frame, and updating the existing traffic target sequence; key point coordinates are determined; calculating a motion parameter of each traffic target in the traffic target sequence by using the coordinates of the key points converted to the world latitude and longitude coordinates; and obtaining a conflict result according to the motion parameters of every two traffic targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of traffic detection, and in particular relates to a traffic conflict detection method based on low-level monitoring. Background Art

[0002] Existing traffic conflict calculation technology focuses on using drones to collect high-position images for calculation, which increases the cost and difficulty of implementation in actual applications. At the same time, traditional traffic flow and traffic event detection equipment generally uses the center point of the positioning frame as the mass point. This positioning method cannot obtain vehicle motion parameters that may affect traffic conflict events. Therefore, the detection accuracy of existing traffic conflict calculation technology is low. Summary of the invention

[0003] Purpose of the invention: In order to solve the problems of high application cost, great implementation difficulty, low traffic conflict detection accuracy, etc. in the existing traffic conflict calculation technology, the present invention proposes a traffic conflict detection method based on low-level monitoring.

[0004] Technical solution: A traffic conflict detection method based on low-level monitoring, comprising the following steps:

[0005] Step 1: Get the current monitoring image frame;

[0006] Step 2: Using the yolov5s network, the current monitoring image frame is subjected to traffic target detection and traffic target classification, and the positioning frame information and traffic target category of the traffic target are obtained; the traffic target category includes personnel and vehicles;

[0007] Step 3: According to the positioning frame information of the traffic target, each traffic target is cropped from the current monitoring image frame to obtain multiple traffic target images. The Resnet50 network is used to perform feature detection on each traffic target image to obtain the feature information of each traffic target.

[0008] Step 4: According to the positioning frame information of each traffic target in the previous monitoring image frame, the positioning frame information of each traffic target in the current monitoring image frame, the feature information of each traffic target in the previous monitoring image frame and the feature information of each traffic target in the current monitoring image frame, the traffic target in the previous monitoring image frame is matched with the traffic target in the current monitoring image frame, and the existing traffic target sequence is updated, wherein the traffic target sequence includes the sequence number and sequence number status of the traffic target, and one traffic target has only one sequence number;

[0009] Step 5: For traffic targets of the category of personnel, the coordinates of the bottom center point of the positioning frame of the traffic target are taken as the key point coordinates of the traffic target; for traffic targets of the category of vehicles, the KPDEM_model network is used to detect the key points in the traffic target image to obtain the key point coordinates;

[0010] Step 6: Convert the positioning frame information and key point coordinates of the traffic target to world longitude and latitude coordinates;

[0011] Step 7: For a traffic target of vehicle category, assuming that the number of key points monitored is k, determine whether k is less than the set number of key points. If so, the traffic target is determined to be blocked; otherwise, the traffic target is determined to be unblocked. Only when the traffic target is blocked, the world longitude and latitude coordinates of the blocked key points are calculated using the world longitude and latitude coordinates of other key points of the traffic target;

[0012] Step 8: Calculate the motion parameters of each traffic target in the traffic target sequence using the key point coordinates converted to world longitude and latitude coordinates; the motion parameters include: motion direction, motion speed and motion acceleration;

[0013] Step 9: Obtain the conflict result based on the motion parameters of the two traffic targets.

[0014] Furthermore, the yolov5s network is used to detect and classify traffic targets on the current monitoring image frame, and the positioning frame information and the category of the traffic target are obtained, which specifically includes:

[0015] Scale the current monitoring image frame to 640*640 size, and convert the color space to RGB space; divide the matrix values ​​of each channel in the RGB space by 256 to normalize them to the range of [0,1] to obtain the detection image frame;

[0016] Send the detected image frame into the yolov5s network to obtain the positioning frame information and category of the traffic target;

[0017] Scale the positioning frame information of the traffic target to the size of the current monitoring image frame.

[0018] Furthermore, the traffic targets in the previous monitoring image frame are matched with the traffic targets in the current monitoring image frame according to the positioning frame information of each traffic target in the previous monitoring image frame, the positioning frame information of each traffic target in the current monitoring image frame, the feature information of each traffic target in the previous monitoring image frame, and the feature information of each traffic target in the current monitoring image frame, and the existing traffic target sequence is updated. The specific operations include:

[0019] S10: Take a traffic target from the previous monitoring image frame and a traffic target from the current monitoring image frame, and match the two traffic targets according to the following steps:

[0020] The distance between the two traffic target features is calculated using the following cosine distance formula:

[0021]

[0022] In the formula, p n represents the nth feature vector of the traffic target in the previous monitoring image frame; q n Represents the nth feature vector of the traffic target in the current monitoring image frame; n represents the number of feature vectors; the distance between the positioning frame information of the two traffic targets is calculated using the following Mahalanobis distance formula:

[0023]

[0024] Wherein, η represents the positioning frame information of the traffic target in the previous monitoring image frame, δ represents the positioning frame information of the traffic target in the current monitoring image frame; A represents the covariance matrix, A=L×8 / l, where L represents the set distance, and l represents the frame rate;

[0025] The following Hungarian algorithm is used to match two traffic targets:

[0026] C=μd1+(1-μ)d2

[0027] In the formula, μ represents the weight, 0<μ<1;

[0028] When C is greater than the threshold, it is determined that the two traffic targets are matched successfully and are the same traffic target; when C is not greater than the threshold, it is determined that the match is unsuccessful;

[0029] S20: looping through S10 until all traffic targets in the previous monitoring image frame are matched with all traffic targets in the current monitoring image frame;

[0030] S30: For the traffic target in the current monitoring image frame that has not been successfully matched with the traffic target in the previous monitoring image frame, a serial number is assigned to it and it is added to the existing traffic target sequence; for the traffic target in the previous monitoring image frame that has not been successfully matched with the traffic target in the current monitoring image frame, the sequence status of the traffic target is set to sequence termination.

[0031] Furthermore, for traffic targets of vehicle category, the key points include: the center points of the four front, rear, left and right headlights, the center points of the four front, rear, left and right wheel hubs, and the four front, rear, left and right points of the roof.

[0032] Furthermore, the KPDEM_model network is used to detect key points in the traffic target image to obtain the coordinates of the key points. The specific operations include:

[0033] Multiple traffic target images are uniformly scaled to 64*64 size, the color space is converted to bgr space, the mean of each channel in bgr space is subtracted by 123, 117, and 104 respectively, and the image is normalized to the range of [0,1] by multiplying by 0.224 to obtain the KPDEM_model network input image;

[0034] Input the KPDEM_model network input image into the KPDEM_model network to obtain the key point coordinates;

[0035] Among them, the KPDEM_model network is obtained by adding the dsnt network layer on the basis of the Resnet50 network structure.

[0036] Furthermore, the above-mentioned conversion of the positioning frame information and key point coordinates of the traffic target into world longitude and latitude coordinates includes:

[0037] Using high-precision satellite maps and camera images, select a number of calibration points on the road at random;

[0038] The latitude and longitude coordinates of the calibration points and the pixel coordinates of the calibration points are used as the basis for coordinate system conversion;

[0039] Obtaining the height information, translation information, and rotation information of the camera that captured the surveillance image frame;

[0040] Based on the pinhole imaging affine transformation principle, the positioning frame information and key point coordinates of the traffic target are converted into the world longitude and latitude coordinates based on the camera as the origin;

[0041] Based on the benchmark of coordinate system conversion, the world longitude and latitude coordinates based on the camera as the origin are converted to world longitude and latitude coordinates.

[0042] Furthermore, based on the pinhole imaging affine transformation principle, the positioning frame information and key point coordinates of the traffic target are converted into world longitude and latitude coordinates based on the camera as the origin. The specific operations include:

[0043] The key point coordinates (u, v) are converted into camera coordinates (X C , Y C , Z C );

[0044]

[0045] Using the camera coordinates (X C , Y C , Z C ), determine the world longitude and latitude coordinates of the key points based on the camera as the origin;

[0046]

[0047] In the formula, Z C represents the depth value measured by the camera, u0 and v0 represent the center coordinates of the camera's highest resolution, f represents the camera's focal length, and d x d y represents the camera sensor size divided by the camera's maximum resolution, ζ represents the camera's rotation information, Represents the camera translation information;

[0048] The coordinate system conversion-based benchmark converts the world longitude and latitude coordinates based on the camera as the origin into the world longitude and latitude coordinates, specifically including:

[0049] According to the following formula, the world longitude and latitude coordinates are determined using the world longitude and latitude coordinates based on the camera as the origin:

[0050] Lat=K1X+K2Y+K3

[0051] Long=K4X+K5Y+K6

[0052] In the formula, K1, K2, K3, K4, K5 and K6 are all proportional coefficients, which are calculated by substituting several calibration points into the above formula; Lat represents latitude, and Long represents longitude.

[0053] Furthermore, only when the traffic target is blocked, the world longitude and latitude coordinates of the blocked key point are calculated using the world longitude and latitude coordinates of other key points of the traffic target. The specific operations include:

[0054] Given the coordinates of k key points, determine the length or width of the traffic target;

[0055] Determine the moving direction angle alpha of the traffic target according to the difference between the world longitude and latitude coordinates of the key point of the traffic target in the previous monitoring image frame and the world longitude and latitude coordinates of the key point in the current monitoring image frame;

[0056] Determine the orientation angle beta of the traffic target according to the difference between the world longitude and latitude coordinates of two key points corresponding to the traffic target in the current monitoring image frame;

[0057] According to the moving direction angle alpha and the orientation angle beta of the traffic target, the corresponding angle c of the current monitoring image frame is obtained;

[0058] According to the trigonometric functions x=s×sinc and y=s×cosc, the world latitude and longitude coordinates (x, y) of the occluded key point are obtained.

[0059] Furthermore, the motion parameters of each traffic target in the traffic target sequence are calculated by using the key point coordinates converted to the world longitude and latitude coordinates, and the specific operations include:

[0060] The moving distance dt of each traffic target in the traffic target sequence is calculated using the following formula:

[0061] dt=arccos((sin(Lat1)×sin(Lat2))+(cos(Lat1)×cos(Lat2)×cos(Long2-Long1)×R

[0062] Wherein, Lat1 represents the latitude of the traffic target in the previous monitoring image frame, Lat2 represents the latitude of the traffic target in the current monitoring image frame, Long2 represents the longitude of the traffic target in the current monitoring image frame, Long1 represents the longitude of the traffic target in the previous monitoring image frame, and R is the radius of the earth;

[0063] The moving speed v of each traffic target in the traffic target sequence is calculated by v=dt / Δt, where Δt represents the time difference between the previous monitoring image frame and the current monitoring image frame;

[0064] The motion acceleration a of each traffic target in the traffic target sequence is calculated by a=Δv / Δt, where Δv represents the speed difference between the previous monitoring image frame and the current monitoring image frame of the same traffic target;

[0065] The moving direction TN of the traffic target in the current monitoring image frame is calculated according to the following formula:

[0066] cos(TP)=cos(90°-Lat1)*cos(90°-Lat2)+sin(90°-Lat2)*sin(90°-Lat1)*cos(Lat1-Lat2)

[0067] cos(90°-Lat1)=cos(90°-Lat2)*cos(TP)+sin(90°-Lat2)*sin(TP)*cos(TN)

[0068] Where TP represents the intermediate variable.

[0069] Furthermore, the conflict result is obtained according to the motion parameters of the two traffic targets, and the specific operations include:

[0070] Assume that the moving direction of traffic target 1 in the current monitoring image frame is TN1, and the moving direction of traffic target 2 in the current monitoring image frame is TN2. Define the true north direction angle of the line connecting the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 as β1, and define the true north direction angle of the line connecting the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 as β2; then the angle θ1 between the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 is TN1=TN1-β1, and the angle θ2 between the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 is TN2-β2;

[0071] When |θ1-θ2|=0, the conflict between traffic target 1 and traffic target 2 is characterized as a positive conflict;

[0072] When |θ1-θ2|=180 and the moving speed of the rearward traffic target is greater than the moving speed of the forward traffic target, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a rear-end collision.

[0073] When |θ1-θ2| is between 0 and 180 and θ1 and θ2 have opposite signs, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a lateral conflict;

[0074] When there is a positive conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0075] t=3.6×(d×|cosθ|-5) / (v1+v2)

[0076] Where d represents the distance between two traffic targets, v1 represents the running speed of traffic target 1, v2 represents the running speed of traffic target 2, and θ = |θ1-θ2|;

[0077] When there is a rear-end collision, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0078] t=3.6×(d×|cosθ|-5) / |v1-v2|

[0079] When there is a lateral conflict and |θ1-θ2|<90, the following formula is used to calculate the distances from traffic target 1 and traffic target 2 to the conflict point:

[0080] S1=d×|cosθ1|-d×sin|θ1| / tan(θ)

[0081] S2=d×sin|θ1| / sin(θ)

[0082] When there is a lateral conflict and |θ1-θ2|=90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point:

[0083] S1=d×cos|θ1|

[0084] S2=d×cos|θ2|

[0085] When there is a lateral conflict and |θ1-θ2|>90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point:

[0086] S1=d×cos|θ1|+d×sin|θ1| / tan(180°-θ)

[0087] S2=d×sin|θ1| / sin(180°-θ)

[0088] Among them, S1 and S2 represent the distances from traffic target 1 and traffic target 2 to the conflict point respectively;

[0089] When there is a lateral conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0090] t1=3.6×(S1-2.5) / v1

[0091] t2=3.6×(S2-2.5) / v2

[0092] In the formula, if the difference between t1 and t2 is less than the time difference threshold, it is considered that there is a conflict;

[0093] The traffic conflict is qualitatively characterized based on the time when traffic target 1 and traffic target 2 reach the conflict point.

[0094] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0095] (1) The method of the present invention uses low-level monitoring to calculate conflicts between targets, which can greatly reduce the difficulty and cost of practical application;

[0096] (2) The method of the present invention calculates the motion parameters of the vehicle by detecting the key point information of the vehicle, fully considering the impact of the vehicle length and width on the collision event, and can greatly improve the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Figure 1 A flow chart of a traffic conflict detection method based on low-level monitoring proposed by the present invention;

[0098] Figure 2 It is a schematic diagram of the relationship between the conflict point and the speed;

[0099] Figure 3 Schematic diagram of head-on collision, rear-end collision and lateral collision. DETAILED DESCRIPTION

[0100] The technical solution of the present invention is now further described in conjunction with the accompanying drawings and embodiments.

[0101] like Figure 1 As shown, this embodiment proposes a traffic conflict detection method based on low-level monitoring, and its main steps include:

[0102] Step 1: Get the current monitoring image frame, scale the current monitoring image frame to 640*640 size, convert the color space to RGB space, divide the matrix values ​​of each RGB channel by 256 to normalize it to the range of [0,1], and obtain the detection image frame; use the deep learning yolov5s network to detect and classify the traffic targets in the detection image frame, obtain the positioning frame information and the category of the traffic targets, and scale the positioning frame information of the traffic targets to the size of the current monitoring image frame.

[0103] The deep learning yolov5s network used in this step is obtained by changing its SiLU activation layer to a ReLU activation layer on the basis of the original yolov5s network; the positioning frame information of the traffic target includes the x-axis component coordinate of the traffic target based on the upper left corner of the detection image frame, the y-axis component coordinate of the traffic target based on the upper left corner of the detection image frame, the width of the traffic target based on the detection image frame size, and the height of the traffic target based on the detection image frame size; in this embodiment, the categories of traffic targets are divided into personnel, motor vehicles and non-motor vehicles, among which motor vehicles can be further subdivided into large buses, large trucks, medium-sized buses, medium-sized trucks, small buses and small trucks, and non-motor vehicles can be further subdivided into covered tricycles, uncovered tricycles, battery vehicles and bicycles;

[0104] Step 2: According to the positioning frame information of the traffic target, the traffic target is cropped out from the current monitoring image frame, and uniformly scaled to 64*128 size, and the color space is converted to RGB space to obtain the input image sent to the deep learning Resnet50 network; the deep learning Resnet50 network performs feature detection on the input image, and each traffic target outputs 1*128-dimensional feature information; and the deepsort algorithm is used to match the traffic targets in the previous monitoring image frame with the traffic targets in the current monitoring image frame using the positioning frame information of each traffic target in the previous monitoring image frame, the positioning frame information of each traffic target in the current monitoring image frame, the feature information of each traffic target in the previous monitoring image frame, and the feature information of each traffic target in the current monitoring image frame, and update the existing traffic target sequence to achieve tracking management; the specific operations include:

[0105] S10: Take a traffic target from the previous monitoring image frame and a traffic target from the current monitoring image frame, and match the two traffic targets according to the following steps:

[0106] The distance between the two traffic target features is calculated using the following cosine distance formula:

[0107]

[0108] In the formula, p n represents the nth feature vector of the traffic target in the previous monitoring image frame; q n Indicates the nth feature vector of the traffic target in the current monitoring image frame; n represents the number of feature vectors, which is 128;

[0109] The distance between the positioning frame information of the two traffic targets is calculated using the following Mahalanobis distance formula:

[0110]

[0111] Wherein, η represents the positioning frame information of the traffic target in the previous monitoring image frame, δ represents the positioning frame information of the traffic target in the current monitoring image frame; A represents the covariance matrix. Since there is a frame rate difference in real-time monitoring, this embodiment introduces the time feature into the covariance matrix A, A=L×8 / l, where L represents the set distance, which is set to 1 / 160 here, and l represents the frame rate;

[0112] Finally, the following Hungarian algorithm is used to match the two traffic targets:

[0113] C=μd1+(1-μ)d2

[0114] Wherein, μ represents the weight, 0<μ<1, and in this embodiment, μ is set to 0.2;

[0115] When C is greater than the threshold, it is determined that the two traffic targets are matched successfully and are the same traffic target, and the threshold is set to 0.8; when C is not greater than the threshold, it is determined that the match is unsuccessful;

[0116] S20: looping through S10 until all traffic targets in the previous monitoring image frame are matched with all traffic targets in the current monitoring image frame;

[0117] S30: For the traffic targets in the current monitoring image frame that have not been successfully matched with the traffic targets in the previous monitoring image frame, a sequence number is assigned to them and they are added to the existing traffic target sequence. For the traffic targets in the previous monitoring image frame that have not been successfully matched with the traffic targets in the current monitoring image frame, their sequence status is set to sequence termination.

[0118] Step 3: For traffic targets of the category of personnel, the coordinates of the bottom center point of the positioning frame of the traffic target are taken as the key point coordinates of the traffic target; for traffic targets of the category of vehicles, the KPDEM_model network is used to detect the key points in the traffic target image to obtain the key point coordinates;

[0119] The main network of the deep learning KPDEM_model network used in this embodiment is obtained by adding Resnet50 to the dsnt network layer. The input of the deep learning KPDEM_model network is to crop the traffic target from the current monitoring image frame according to the positioning frame information of the traffic target, scale it to 64*64 size, convert the color space to BGR space, subtract the mean 123, 117, and 104 from each channel of the BGR space, and multiply it by 0.224 to normalize the image to the range of [0,1].

[0120] In this step, for traffic targets of vehicle category, the key points include: the center points of the four front, rear, left, and right lights, the center points of the four front, rear, left, and right wheel hubs, and the four front, rear, left, and right points on the roof, a total of 12 key points; by considering the situation of occlusion in low-level monitoring, the coordinates of the key points that are not exposed are set to (-1, -1). The purpose of setting the coordinates of the key points that are not exposed here is to occupy the position first, and then determine the world longitude and latitude coordinates of the occluded key points through subsequent calculations. The reason for occupying the position is that the points detected by the model are sequential. If they are not detected, they need to be occupied by (-1, -1) and then calculated later. In use, the meaning of the key points is determined by the serial number, for example, the first point represents the left front headlight point.

[0121] Step 4: Using high-precision satellite maps and camera images, select 6 calibration points from the road at random, use these 6 calibration points to calibrate the coordinates, and use the latitude and longitude coordinates of the calibration points and their corresponding pixel coordinates as the basis for coordinate system conversion. Use the camera installation height information, translation information, rotation information, etc. measured when setting up the camera, and according to the pinhole imaging affine transformation principle, convert the positioning frame information and key point coordinates of the traffic target into world longitude and latitude coordinates based on the camera as the origin; then, based on the basis of the coordinate system conversion, convert the world longitude and latitude coordinates based on the camera as the origin into world longitude and latitude coordinates.

[0122] Specifically, the key point coordinates (u, v) are converted to camera coordinates (X C , Y C , Z C ), then converted to world longitude and latitude coordinates based on the camera as the origin, and finally converted to world longitude and latitude coordinates:

[0123]

[0124]

[0125] In the formula, Z C represents the depth value measured by the camera, u0 and v0 represent the center coordinates of the camera's highest resolution, f represents the camera's focal length, and d x d y represents the camera sensor size divided by the camera's maximum resolution, ζ represents the camera rotation information, Represents camera translation information.

[0126] According to the following formula, the world longitude and latitude coordinates are determined using the world longitude and latitude coordinates based on the camera as the origin:

[0127] Lat=K1X+K2Y+K3

[0128] Long=K4X+K5Y+K6

[0129] Wherein, K1, K2, K3, K4, K5 and K6 are all proportional coefficients, which are calculated by substituting 6 sets of calibration points into the above formula; Lat represents latitude, and Long represents longitude.

[0130] When calculating the scale factor, Lat and Long are the longitude and latitude coordinates of the fixed point on the high-precision satellite map, and X and Y are the world longitude and latitude coordinates based on the camera as the origin;

[0131] Lat means latitude and Long means longitude.

[0132] When the target is blocked, at least three point coordinates can be detected, otherwise the target cannot be detected in step 1 due to insufficient vehicle information. If the coordinates of any three points are known, the length or width of the target can be known. According to the difference between the world longitude and latitude coordinates of the key point of the traffic target in the previous monitoring image frame and the world longitude and latitude coordinates of the key point in the current monitoring image frame, the moving direction angle alpha of the traffic target is determined; according to the difference between the world longitude and latitude coordinates of the two key points corresponding to the traffic target in the current monitoring image frame, the orientation angle beta of the traffic target is determined; according to the moving direction angle alpha and the orientation angle beta of the traffic target, the corresponding angle c of the current monitoring image frame is obtained; according to the trigonometric functions x=s×sinc and y=s×cosc, the world longitude and latitude coordinates (x, y) of the blocked key point are obtained.

[0133] Step 5: Using the key point coordinates converted to the world longitude and latitude coordinates, calculate the motion parameters such as the motion direction, motion speed, and motion acceleration of each traffic target in the traffic target sequence. The specific calculation process includes:

[0134] The moving distance dt of each traffic target in the traffic target sequence is calculated using the following formula:

[0135] dt=arccos((sin(Lat1)×sin(Lat2))+(cos(Lat1)×cos(Lat2)×cos(Long2-Long1)×R

[0136] Wherein, Lat1 represents the latitude of the traffic target in the previous monitoring image frame, Lat2 represents the latitude of the traffic target in the current monitoring image frame, Long2 represents the longitude of the traffic target in the current monitoring image frame, Long1 represents the longitude of the traffic target in the previous monitoring image frame, and R is the radius of the earth;

[0137] The moving speed v of each traffic target in the traffic target sequence is calculated by v=dt / Δt, where Δt represents the time difference between the previous monitoring image frame and the current monitoring image frame;

[0138] The motion acceleration a of each traffic target in the traffic target sequence is calculated by a=Δv / Δt, where Δv represents the speed difference between the previous monitoring image frame and the current monitoring image frame of the same traffic target;

[0139] The moving direction TN of the traffic target in the current monitoring image frame is calculated according to the following formula, which is the required true north direction angle: cos(TP)=cos(90°-Lat1)*cos(90°-Lat2)+sin(90°-Lat2)*sin(90°-Lat1)*cos(Lat1-Lat2)

[0140] cos(90°-Lat1)=cos(90°-Lat2)*cos(TP)+sin(90°-Lat2)*sin(TP)*cos(TN)

[0141] In the formula, TP represents the intermediate variable;

[0142] Step 6: Use technical indicators such as TTC (Time-To-Collision) and drac (Deceleration Rate to Avoid Crash) to detect traffic conflicts, such as Figure 2 As shown, taking TTC as an example, TTC calculation is performed on each pair of targets according to the motion parameters obtained in step 5 to characterize the conflict. The specific operations include:

[0143] like Figure 3As shown, assuming that the moving direction of traffic target 1 in the current monitoring image frame is TN1, and the moving direction of traffic target 2 in the current monitoring image frame is TN2, the true north direction angle of the line connecting the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 is defined as β1, and the true north direction angle of the line connecting the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 is defined as β2; then the angle θ1 between the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 is equal to TN1-β1, and the angle θ2 between the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 is equal to TN2-β2;

[0144] When |θ1-θ2|=0, the conflict between traffic target 1 and traffic target 2 is characterized as a positive conflict;

[0145] When |θ1-θ2|=180 and the moving speed of the rearward traffic target is greater than the moving speed of the forward traffic target, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a rear-end collision.

[0146] When |θ1-θ2| is between 0 and 180 and θ1 and θ2 have opposite signs, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a lateral conflict;

[0147] When there is a positive conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0148] t=3.6×(d×|cosθ|-5) / (v1+v2)

[0149] Where d represents the distance between two traffic targets, v1 represents the running speed of traffic target 1, v2 represents the running speed of traffic target 2, and θ = |θ1-θ2|;

[0150] When there is a rear-end collision, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0151] t=3.6×(d×|cosθ|-5) / |v1-v2|

[0152] When there is a lateral conflict and |θ1-θ2| is less than 90, the following formula is used to calculate the distance:

[0153] S1=d×|cosθ1|-d×sin|θ1| / tan(θ)

[0154] S2=d×sin|θ1| / sin(θ)

[0155] When there is a lateral conflict and |θ1-θ2|=90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point:

[0156] S1=d×cos|θ1|

[0157] S2=d×cos|θ2|

[0158] When there is a lateral conflict and |θ1-θ2|>90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point:

[0159] S1=d×cos|θ1|+d×sin|θ1| / tan(180°-θ)

[0160] S2=d×sin|θ1| / sin(180°-θ)

[0161] Among them, S1 and S2 represent the distances from traffic target 1 and traffic target 2 to the conflict point respectively;

[0162] When there is a lateral conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point:

[0163] t1=3.6×(S1-2.5) / v1

[0164] t2=3.6×(S2-2.5) / v2

[0165] Where v1 and v2 represent the speeds of traffic target 1 and traffic target 2. If the difference between t1 and t2 is less than the time difference threshold, it is considered that there is a conflict. The time difference threshold is 2s.

[0166] When the time to reach the conflict point is within 1 second, it is defined as a violent conflict; when the time to reach the conflict point is 1-1.5 seconds, it is defined as a general conflict; when the time to reach the conflict point is 1.5-4 seconds, it is defined as a minor conflict.

[0167] In this embodiment, the deceleration a during risk avoidance behavior is calculated using the following formula: - To assist TTC in determining the conflict situation, any condition that meets the requirement can be considered as a conflict risk:

[0168] a - =(v2-v1) 2 / 2×[X1-X2]-L1

[0169] Where L1 is the length of the preceding vehicle, X1 and X2 represent the vehicle positions of traffic target 1 and traffic target 2 respectively, v1 and v2 represent the speeds of traffic target 1 and traffic target 2 respectively. _ When the value is greater than 5, it is determined that there is a conflict risk.

[0170] In the embodiment, the alarm threshold can be determined in combination with the target characteristics and the road environment to give the conflict risk assessment result. For example, according to the category of traffic targets, it can be divided into conflicts between people and large motor vehicles (including large buses and large trucks), conflicts between people and motor vehicles (including medium and small buses, medium and small trucks), conflicts between people and non-motor vehicles, conflicts between non-motor vehicles and non-motor vehicles, conflicts between non-motor vehicles and large motor vehicles, conflicts between non-motor vehicles and motor vehicles, conflicts between motor vehicles and motor vehicles, conflicts between motor vehicles and large motor vehicles, and conflicts between large motor vehicles and large motor vehicles; according to the collision position of the vehicles, it can be divided into forward conflicts, rear-end conflicts, and lateral conflicts; according to the time when the vehicles reach the conflict point, it can be divided into minor conflicts, general conflicts, and severe conflicts. Among them, the time threshold of TTC is also adjusted accordingly according to different weather conditions. The above is the threshold under normal weather conditions. For example, the conflict time threshold in rainy and snowy weather increases by 2s, and the time threshold in the road icing state increases by 5s.

Claims

1. A traffic conflict detection method based on low-level monitoring, characterized in that: The following steps are involved: Step 1: Get the current monitoring image frame; Step 2: Using the yolov5s network, the current monitoring image frame is subjected to traffic target detection and traffic target classification, and the positioning frame information and traffic target category of the traffic target are obtained; the traffic target category includes personnel and vehicles; Step 3: According to the positioning frame information of the traffic target, each traffic target is cropped out from the current monitoring image frame to obtain multiple traffic target images. The Resnet50 network is used to perform feature detection on each traffic target image to obtain the feature information of each traffic target. Step 4: According to the positioning frame information of each traffic target in the previous monitoring image frame, the positioning frame information of each traffic target in the current monitoring image frame, the feature information of each traffic target in the previous monitoring image frame and the feature information of each traffic target in the current monitoring image frame, the traffic target in the previous monitoring image frame is matched with the traffic target in the current monitoring image frame, and the existing traffic target sequence is updated, wherein the traffic target sequence includes the sequence number and sequence number status of the traffic target, and one traffic target has only one sequence number; Step 5: For traffic targets of the category of personnel, the coordinates of the bottom center point of the positioning frame of the traffic target are taken as the key point coordinates of the traffic target; for traffic targets of the category of vehicles, the KPDEM_model network is used to detect the key points in the traffic target image to obtain the key point coordinates; Step 6: Convert the positioning frame information and key point coordinates of the traffic target to world longitude and latitude coordinates; Step 7: For a traffic target of vehicle category, assuming that the number of key points monitored is k, determine whether k is less than the set number of key points. If so, the traffic target is determined to be blocked. Otherwise, the traffic target is deemed not to be blocked; only when the traffic target is blocked, the world longitude and latitude coordinates of the blocked key point are calculated using the world longitude and latitude coordinates of other key points of the traffic target; Step 8: Calculate the motion parameters of each traffic target in the traffic target sequence using the key point coordinates converted to the world longitude and latitude coordinates; the motion parameters include: motion direction, motion speed and motion acceleration; Step 9: Obtain the conflict result based on the motion parameters of the two traffic targets.

2. The traffic conflict detection method based on low-level monitoring according to claim 1 is characterized in that: The yolov5s network is used to detect and classify traffic targets on the current monitoring image frame, and the positioning frame information and the category of the traffic target are obtained, which specifically includes: Scale the current monitoring image frame to 640*640 size, and convert the color space to RGB space; divide the matrix values ​​of each channel in the RGB space by 256 to normalize them to the range of [0,1] to obtain the detection image frame; Send the detected image frame into the yolov5s network to obtain the positioning frame information and category of the traffic target; Scale the positioning frame information of the traffic target to the size of the current monitoring image frame.

3. The traffic conflict detection method based on low-level monitoring according to claim 1 is characterized in that: The method of matching the traffic targets in the previous monitoring image frame with the traffic targets in the current monitoring image frame according to the positioning frame information of each traffic target in the previous monitoring image frame, the positioning frame information of each traffic target in the current monitoring image frame, the feature information of each traffic target in the previous monitoring image frame, and the feature information of each traffic target in the current monitoring image frame, and updating the existing traffic target sequence, specifically includes: S10: Take a traffic target from the previous monitoring image frame and a traffic target from the current monitoring image frame, and match the two traffic targets according to the following steps: The distance between the two traffic target features is calculated using the following cosine distance formula: In the formula, p n represents the nth feature vector of the traffic target in the previous monitoring image frame; q n Represents the nth feature vector of the traffic target in the current monitoring image frame; n represents the number of feature vectors; The distance between the positioning frame information of the two traffic targets is calculated using the following Mahalanobis distance formula: Wherein, η represents the positioning frame information of the traffic target in the previous monitoring image frame, δ represents the positioning frame information of the traffic target in the current monitoring image frame; A represents the covariance matrix, A=L×8 / l, where L represents the set distance, and l represents the frame rate; The following Hungarian algorithm is used to match two traffic targets: C=μd1+(1-μ)d2 In the formula, μ represents the weight, 0<μ<1; When C is greater than the threshold, it is determined that the two traffic targets are matched successfully and are the same traffic target; when C is not greater than the threshold, it is determined that the match is unsuccessful; S20: looping through S10 until all traffic targets in the previous monitoring image frame are matched with all traffic targets in the current monitoring image frame; S30: For the traffic target in the current monitoring image frame that has not been successfully matched with the traffic target in the previous monitoring image frame, a serial number is assigned to it and it is added to the existing traffic target sequence; for the traffic target in the previous monitoring image frame that has not been successfully matched with the traffic target in the current monitoring image frame, the sequence status of the traffic target is set to sequence termination.

4. The traffic conflict detection method based on low-level monitoring according to claim 1 is characterized in that: For traffic targets of vehicle category, the key points include: the center points of the four front, rear, left and right headlights, the center points of the four front, rear, left and right wheel hubs, and the four front, rear, left and right points on the roof.

5. The traffic conflict detection method based on low-level monitoring according to claim 4 is characterized in that: The KPDEM_model network is used to detect key points in the traffic target image to obtain the coordinates of the key points. The specific operations include: Multiple traffic target images are uniformly scaled to 64*64 size, the color space is converted to bgr space, the mean of each channel in bgr space is subtracted by 123, 117, and 104 respectively, and the image is normalized to the range of [0,1] by multiplying by 0.224 to obtain the KPDEM_model network input image; Input the KPDEM_model network input image into the KPDEM_model network to obtain the key point coordinates; Among them, the KPDEM_model network is obtained by adding the dsnt network layer on the basis of the Resnet50 network structure.

6. The traffic conflict detection method based on low-level monitoring according to claim 1 is characterized in that: The specific operations of converting the positioning frame information and key point coordinates of the traffic target into world longitude and latitude coordinates include: Using high-precision satellite maps and camera images, select a number of calibration points on the road at random; The latitude and longitude coordinates of the calibration points and the pixel coordinates of the calibration points are used as the basis for coordinate system conversion; Obtaining the height information, translation information, and rotation information of the camera that captured the surveillance image frame; Based on the pinhole imaging affine transformation principle, the positioning frame information and key point coordinates of the traffic target are converted into the world longitude and latitude coordinates based on the camera as the origin; Based on the benchmark of coordinate system conversion, the world longitude and latitude coordinates based on the camera as the origin are converted to world longitude and latitude coordinates.

7. The method for detecting traffic conflicts based on low-level monitoring according to claim 6, characterized in that: The pinhole imaging affine transformation principle is used to convert the positioning frame information and key point coordinates of the traffic target into the world longitude and latitude coordinates based on the camera as the origin. The specific operations include: The key point coordinates (u, v) are converted into camera coordinates (X C , Y C , Z C ); Using the camera coordinates (X C , Y C , Z C ), determine the world longitude and latitude coordinates of the key points based on the camera as the origin; In the formula, Z C represents the depth value measured by the camera, u0 and v0 represent the center coordinates of the camera's highest resolution, f represents the camera's focal length, and d x d y represents the camera sensor size divided by the camera's maximum resolution, ζ represents the camera's rotation information, Represents the camera translation information; The coordinate system conversion-based benchmark converts the world longitude and latitude coordinates based on the camera as the origin into the world longitude and latitude coordinates, specifically including: According to the following formula, the world longitude and latitude coordinates are determined using the world longitude and latitude coordinates based on the camera as the origin: Lat=K1X+K2Y+K3 Long=K4X+K5Y+K6 In the formula, K1, K2, K3, K4, K5 and K6 are all proportional coefficients, which are calculated by substituting several calibration points into the above formula; Lat represents latitude, and Long represents longitude.

8. The traffic conflict detection method based on low-level monitoring according to claim 1 is characterized in that: The above-mentioned method of calculating the world longitude and latitude coordinates of the blocked key point by using the world longitude and latitude coordinates of other key points of the traffic target only when the traffic target is blocked includes: Given the coordinates of k key points, determine the length or width of the traffic target; Determine the moving direction angle alpha of the traffic target according to the difference between the world longitude and latitude coordinates of the key point of the traffic target in the previous monitoring image frame and the world longitude and latitude coordinates of the key point in the current monitoring image frame; Determine the orientation angle beta of the traffic target according to the difference between the world longitude and latitude coordinates of two key points corresponding to the traffic target in the current monitoring image frame; According to the moving direction angle alpha and the orientation angle beta of the traffic target, the corresponding angle c of the current monitoring image frame is obtained; According to the trigonometric functions x=s×sinc and y=s×cosc, the world latitude and longitude coordinates (x, y) of the occluded key point are obtained.

9. The method for detecting traffic conflicts based on low-level monitoring according to claim 7, characterized in that: The motion parameters of each traffic target in the traffic target sequence are calculated by using the key point coordinates converted to the world longitude and latitude coordinates. The specific operations include: The moving distance dt of each traffic target in the traffic target sequence is calculated using the following formula: dt=arccos((sin(Lat1)×sin(Lat2))+(cos(Lat1)×cos9Lat2)×cos(Long2-Long1)×R Wherein, Lat1 represents the latitude of the traffic target in the previous monitoring image frame, Lat2 represents the latitude of the traffic target in the current monitoring image frame, Long2 represents the longitude of the traffic target in the current monitoring image frame, Long1 represents the longitude of the traffic target in the previous monitoring image frame, and R is the radius of the earth; The moving speed v of each traffic target in the traffic target sequence is calculated by v=dt / Δt, where Δt represents the time difference between the previous monitoring image frame and the current monitoring image frame; The motion acceleration a of each traffic target in the traffic target sequence is calculated by a=Δv / Δt, where Δv represents the speed difference between the previous monitoring image frame and the current monitoring image frame of the same traffic target; The moving direction TN of the traffic target in the current monitoring image frame is calculated according to the following formula: cos(TP)=cos(90°-Lat1)*cos(90°-Lat2)+sin(90°-Lat2)*sin(90°-Lat1)*cos(Lat1-Lat2) cos(90°-Lat1)=cos(90°-Lat2)*cos(TP)+sin(90°-Lat2)*sin(TP)*cos(TN) Where TP represents the intermediate variable.

10. The traffic conflict detection method based on low-level monitoring according to claim 1, characterized in that: The conflict result is obtained according to the motion parameters of the two traffic targets, and the specific operations include: Assume that the moving direction of traffic target 1 in the current monitoring image frame is TN1, and the moving direction of traffic target 2 in the current monitoring image frame is TN2. Define the true north direction angle of the line connecting the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 as β1, and define the true north direction angle of the line connecting the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 as β2; then the angle θ1 between the moving direction TN1 of traffic target 1 and the moving direction TN2 of traffic target 2 is TN1=TN1-β1, and the angle θ2 between the moving direction TN2 of traffic target 2 and the moving direction TN1 of traffic target 1 is TN2-β2; When |θ1-θ2|=0, the conflict between traffic target 1 and traffic target 2 is characterized as a positive conflict; When |θ1-θ2|=180 and the moving speed of the rearward traffic target is greater than the moving speed of the forward traffic target, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a rear-end collision. When |θ1-θ2| is between 0 and 180 and θ1 and θ2 have opposite signs, it means that the conflict between traffic target 1 and traffic target 2 is characterized as a lateral conflict; When there is a positive conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point: t=3.6×(d×|cosθ|-5) / (v1+v2) Where d represents the distance between two traffic targets, v1 represents the running speed of traffic target 1, v2 represents the running speed of traffic target 2, and θ = |θ1-θ2|; When there is a rear-end collision, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point: t=3.6×(d×|cosθ|-5) / |v1-v2| When there is a lateral conflict and θ1-θ2|<90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point: S1=d×|cosθ1|-d×sinθ1| / tan(θ) S2=d×sin|θ1| / sin(θ) When there is a lateral conflict and |θ1-θ2|=90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point: S1=d×cos|θ1| S2=d×cos|θ2| When there is a lateral conflict and |θ1-θ2|>90, the following formula is used to calculate the distances of traffic target 1 and traffic target 2 to the conflict point: S1=d×cos|θ1|+d×sin|θ1| / tan(180°-θ) S2=d×sin|θ1| / sin(180°-θ) Among them, S1 and S2 represent the distances from traffic target 1 and traffic target 2 to the conflict point respectively; When there is a lateral conflict, the following formula is used to calculate the time it takes for traffic target 1 and traffic target 2 to reach the conflict point: t1=3.6×(S1-2.5) / v1 t2=3.6×(S2-2.5) / v2 In the formula, if the difference between t1 and t2 is less than the time difference threshold, it is considered that there is a conflict; The traffic conflict is qualitatively characterized based on the time when traffic target 1 and traffic target 2 reach the conflict point.