Intersection vehicle abnormal driving detection method based on machine vision detection and road passing area modeling

Through machine vision detection and road traffic area modeling, abnormal vehicle behavior at intersections can be accurately detected, solving the problem that the existing system cannot fully reflect the traffic conditions at intersections, and improving the real-time scheduling of traffic management and the data support capabilities of smart cities.

CN120656106AActive Publication Date: 2025-09-16SHANDONG SYNTHESIS ELECTRONICS TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510791160.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-16
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The existing traffic monitoring system relies solely on conventional traffic data and cannot fully reflect the traffic conditions at intersections, resulting in abnormal traffic incidents such as speeding, abnormal parking, not ignoring green lights, running red lights, etc. not being detected in a timely manner, leading to traffic congestion and accidents.

Method used

Using a method based on machine vision detection and road traffic area modeling, the system obtains video stream information through electronic police cameras, performs preprocessing and vehicle detection, and combines perspective transformation technology to accurately determine whether the vehicle has abnormal behaviors such as speeding, abnormal parking, not waiving green lights, and running red lights.

Benefits of technology

It achieves accurate detection of abnormal vehicle behavior at intersections, provides more valuable road condition information, offers diversified data support for traffic light control and AI decision-making in smart cities, and improves the real-time scheduling capabilities of traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656106A_ABST
    Figure CN120656106A_ABST
Patent Text Reader

Abstract

An intersection vehicle abnormal driving detection method based on machine vision detection and road passing area modeling relates to the intelligent traffic technology field, and uses a machine vision algorithm to detect traffic light states and vehicle space motion information in an electric police monitoring real-time video picture of an urban road intersection; secondly, modeling is conducted on a road passing area based on perspective transformation, and the one-to-one mapping relation between video images and real road coordinates is obtained; therefore, whether abnormal driving traffic incidents such as overspeed, abnormal parking, no green light, red light running and the like exist in the detection area can be judged. More valuable road condition information can be provided for signal regulation and control and real-time scheduling of a command center; and more multivariate basic data is provided for AI decision making under the development concept of smart city construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for detecting abnormal vehicle driving at intersections based on machine vision detection and road traffic area modeling. Background Art

[0002] In recent years, with the rapid development of computer vision and deep learning technologies, intelligent traffic monitoring systems based on video analysis have become a research hotspot. These systems utilize real-time video data to automatically identify and analyze traffic light status and vehicle movement. Currently, most traffic sensing devices can accurately collect general traffic data, such as traffic flow, queue lengths, and vehicle saturation. This data provides a crucial basis for traffic light regulation. Using these common indicators, traffic management departments can optimize signal timing and alleviate some traffic congestion issues.

[0003] However, relying solely on conventional traffic data cannot fully reflect the traffic conditions at intersections, as abnormal traffic events are also a major cause of intersection congestion and accidents. For example, abnormal behaviors such as speeding, abnormal parking, not driving on green lights, and running red lights often disrupt traffic flow stability, directly causing intersection congestion and even major traffic accidents. Therefore, in addition to collecting conventional traffic data, real-time detection of abnormal events is also particularly necessary in intelligent transportation systems. Summary of the Invention

[0004] In order to overcome the shortcomings of the above technologies, the present invention provides a method for detecting abnormal vehicle driving at intersections, which can accurately determine whether a vehicle has exceeded the speed limit, stopped abnormally, failed to see a green light, or ran a red light within the detection area.

[0005] The technical solution adopted by the present invention to overcome the technical problems is: A method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling, comprising: S1. Get video stream information from electronic police cameras at intersections; S2. Preprocess the acquired video stream information to obtain Image set of frame intersection road images , , After preprocessing Frame intersection road image, ; S3. Based on the image set Calibrate the vehicle detection area , No. Lane area , red light running monitoring area , Light state detection area , in Frame intersection road image Determine the near and far coordinate points, and calculate the Frame intersection road image Middle lane width , true distance ; S4. Based on vehicle detection area Get the vehicle detection area image set , according to the light state detection area Get the light state detection area image set ; S5. Lighting state detection image set Perform visual classification to obtain the light state information management structure ; S6. Vehicle detection area image set Perform target detection and target tracking to obtain the vehicle information management structure ; S7. According to the near coordinate point, far coordinate point, lane width , true distance Calculate the distance from the vehicle to the lane stop line and the speed of vehicles approaching the intersection ; S8. Based on the distance between the motor vehicle and the lane stop line and the speed of vehicles approaching the intersection , Light status information management structure , vehicle information management structure Determine whether a motor vehicle is speeding, has stopped abnormally, has failed to respond to a green light, or has run a red light.

[0006] Furthermore, in step S1, the video stream information of the electronic police camera at the intersection is obtained through the ONVIF protocol.

[0007] Furthermore, step S2 includes the following steps: S2-1. Use the cv::cvtcolor function in the OpenCV library to convert the video stream information from YUV-NV12 format to BGR format; S2-2. Use the cv::equalizeHist function in the OpenCV library to equalize the BGR format video stream information The contrast of the frame intersection road image is enhanced to obtain the pre-processed Frame intersection road image ,all The intersection road images after frame preprocessing constitute the image set .

[0008] Furthermore, step S3 includes the following steps: S3-1. The first Frame intersection road image Middle Lane area , , is the number of lanes, Lane area It is a quadrilateral structure. Lane area The front edge is the lane stop line. lane area The domain is located at the back end of the edge and the Lane area The sides at the front are parallel and Lane area The side at the rear end and the Lane area The distance between the edges at the front is 40-60 meters. Lane area The edge at the left end is the lane line on the left side of the lane. Lane area The edge at the right end is the lane line on the right side of the lane; S3-2. The first Frame intersection road image Central red light monitoring area , the red light running monitoring area It is a quadrilateral structure located at The front end of the lane area, the red light monitoring area The width is , is the lane width, , where For the lane width, red light monitoring area The length of the lane stop line is 2-3 times the length of the vehicle. Use a GPS locator to mark a true far end line parallel to the lane stop line at 50m-100m behind the lane stop line. The width of the true far end line is equal to the width of the lane stop line. The true distance between the lane stop line and the true far end line is measured as follows: ; S3-3. The first Frame intersection road image Medium vehicle detection area , vehicle detection area For rectangular structures, all lane areas and red light monitoring areas Located in the vehicle detection area Inside; S3-4. Manually record the first Frame intersection road image Middle light detection area , light state detection area Select the rectangular structure of the traffic light at the intersection; S3-5. Frame intersection road image In the example, the lane stop line is used as the X-axis and the Y-axis is perpendicular to the lane stop line. The leftmost point of the lane stop line is marked as the near coordinate point A. , is the X-axis coordinate of the nearby coordinate point A, is the Y-axis coordinate of the near coordinate point A, and the rightmost point of the lane stop line is marked as the near coordinate point B , is the X-axis coordinate of the nearby coordinate point B, The Y-axis coordinate of the near coordinate point B is used to mark the leftmost point of the true far end line as the far coordinate point A. , is the X-axis coordinate of the distant coordinate point A, The Y-axis coordinate of the far coordinate point A, and the rightmost point of the true far end line is marked as the far coordinate point B , is the X-axis coordinate of the distant coordinate point A, is the Y-axis coordinate of the distant coordinate point A.

[0009] Furthermore, step S4 includes the following steps: S4-1. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image According to vehicle detection area Cut and get Frame vehicle detection area image ,all The frame vehicle detection area image constitutes the vehicle detection area image set , ; S4-2. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image Detection area according to light status Cut and get Frame light state detection area image ,all The frame vehicle detection area image constitutes the light state detection area image set , .

[0010] Furthermore, step S5 includes the following steps: S5-1. Set the light state detection image set Middle Frame light state detection area image Input into the Resnet-18 model and identify the Frame light status detection result list , ,in For signal light type, When it is 0, it indicates a dot signal light. When it is 1, it indicates the left turn signal light. When it is 2, it indicates the straight signal light. is the light state detection result, When it is -1, it indicates an invalid value. 0 o'clock means the light is off. When it is 1, it means green light. When it is 2, it means red light. 3 o'clock indicates yellow light; S5-2. According to Frame light status detection result list Establish the Frame light state information management structure , light state information management structure Contains the light state parameter LightInformation.Status and the current light state duration parameter LightInformation.Duration. When LightInformation.Status is -1, it indicates an invalid value. When LightInformation.Status is 0, it indicates that the dot signal light is off. When LightInformation.Status is 1, it indicates that the dot signal light is green. When LightInformation.Status is 2, it indicates that the dot signal light is red. When LightInformation.Status is 3, it indicates that the dot signal light is yellow. When LightInformation.Status is 4, it means the straight light is green. When LightInformation.Status is 5, it means the straight light is red. When LightInformation.Status is 6, it means the straight light is yellow. When LightInformation.Status is 7, it means the left turn light is green. When LightInformation.Status is 8, it means the left turn light is red. When LightInformation.Status is 9, it means the left turn light is yellow. The current light state duration parameter LightInformation.Duration records the current light state duration. Light status information management structure Constructing the light status information management structure , .

[0011] Furthermore, step S6 includes the following steps: S6-1. Set the vehicle detection area image set Middle Frame vehicle detection area image Input into the YOLOv11 model for motor vehicle target detection, and get The first frame selects the rectangular frame of the motor vehicle and constructs the Frame motor vehicle target detection list , ,in The first step for YOLOv11 model detection A motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the motor vehicle, For the The width of the rectangular frame of a motor vehicle, For the The height of the rectangular frame of a motor vehicle; S6-2. Use Deepsort algorithm to sort Frame vehicle detection area image in The motor vehicle is tracked and the Tracked motor vehicles, build the Frame motor vehicle target tracking information list , ,in For the A tracked motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The width of the rectangle of the tracked motor vehicle, For the The height of the rectangular box of the tracked motor vehicle; S6-3. Construction Frame vehicle information management structure , vehicle information management structure Include the number of the vehicle being tracked Parameters of Vehicle.k, Frame motor vehicle target tracking information list , record the The parameter Vehicle.LaneNum indicates the lane in which the tracked motor vehicle is located. Vehicle.LaneNum is When The center point of the rectangular box of the tracked vehicle is located at In the lane area, , when Vehicle.LaneNum is 0, it means the The tracked motor vehicles are not located in the lane area, all Vehicle information management structure , .

[0012] Furthermore, step S7 includes the following steps: S7-1. Set the perspective transformation matrix image corresponding points respectively 、 、 、 , , , , ; S7-2. Set the perspective transformation matrix and the corresponding points of the real scene respectively 、 、 、 , , , , ; S7-3. Use the cv::getPerspectiveTransform(srcTri, dstTri) function in the OpenCV library to convert the perspective transformation matrix image to the corresponding point 、 、 、 And the perspective transformation matrix real scene corresponding point 、 、 、 Generate a 3×3 perspective transformation matrix ; S7-4. Through the formula Calculate the first The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding horizontal coordinate , No. The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate and perspective transformation coefficients ; S7-5. The distance from the tracked vehicle to the lane stop line ; S7-6. Through the formula Calculate the first The speed of the tracked vehicles approaching the intersection , where For the The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate in The frame rate of the video stream information from the electronic police camera at the intersection.

[0013] Furthermore, step S8 includes the following steps: S8-1. If The speed of the tracked vehicles approaching the intersection If the speed is greater than the overspeed threshold for P times in a row, the The motor vehicle being tracked is speeding. Frame vehicle information management structure In the process, a vehicle abnormal behavior parameter Vehicle[k].Behavior is established and the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 1; S8-2. If The speed of the tracked vehicles approaching the intersection If the value is less than the static threshold for Q consecutive times, the The first tracked motor vehicle is stationary. When the number of tracked motor vehicles in a stationary state is greater than the abnormal parking determination threshold, the first If a tracked motor vehicle stops abnormally, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 2; S8-3. According to Frame vehicle information management structure The parameter Vehicle.LaneNum in the In which lane is the tracked motor vehicle located? The distances from the tracked motor vehicles to the lane stop line are sorted from small to large. If the The distance from the tracked vehicle to the lane stop line If it is not the minimum value, it means If there is a vehicle in front of the first motor vehicle being tracked, The distance from the tracked vehicle to the lane stop line The minimum value indicates that There is no car ahead of the tracking motor vehicle. There is no vehicle in front of the tracking motor vehicle and The tracking vehicle is stationary for longer than Frame light state information management structure The current green light duration is recorded by the current light state duration parameter LightInformation.Duration in the If the stationary time of the tracked motor vehicle is longer than the vehicle starting reaction time threshold, the If the green light of a tracked motor vehicle fails, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 3; S8-4. According to Frame light state information management structure The light state parameter LightInformation.Status in the judgment The tracked motor vehicle is in the Lane area Is it a red light? When the lane area is red, use vector cross multiplication to determine the Whether the tracked motor vehicle leaves the Lane area , if the The tracked motor vehicle drove out of Lane area Then it entered the red light monitoring area , then determine the If a tracked motor vehicle runs a red light, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 4.

[0014] Furthermore, the method further includes sending the light state information management structure to the server at a sending time interval SendTime after step S8. Vehicle Information Management Structure It is sent to downstream applications or stored in a database in the form of JSON.

[0015] The beneficial effects of the present invention are as follows: using machine vision algorithms to detect traffic light states and vehicle spatial motion information in real-time video footage monitored by electric police at urban road intersections; then, based on perspective transformation, modeling the road traffic area to obtain a one-to-one mapping relationship between the video footage and the actual road coordinates; thereby determining whether vehicles in the detection area have experienced abnormal traffic events such as speeding, abnormal parking, not turning on a green light, or running a red light. Based on intersection sensing equipment, the present invention detects and reports abnormal traffic events, providing more valuable road condition information for signal control and real-time dispatching by command centers; and, under the development concept of smart city construction, provides more diverse basic data for AI decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of the method of the present invention; Figure 2 This is a coordinate point diagram calculated for the manually calibrated perspective transformation of the present invention. DETAILED DESCRIPTION

[0017] The following is combined with Figure 1 , Attachment Figure 2 The present invention is further described.

[0018] A method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling, comprising: S1. Obtain the video stream information from the electronic police camera at the intersection.

[0019] S2. Preprocess the acquired video stream information to obtain Image set of frame intersection road images , , After preprocessing Frame intersection road image, .

[0020] S3. Based on the image set Calibrate the vehicle detection area , No. Lane area , red light running monitoring area , Light state detection area , in Frame intersection road image Determine the near and far coordinate points, and calculate the Frame intersection road image Middle lane width , true distance .

[0021] S4. Based on vehicle detection area Get the vehicle detection area image set , according to the light state detection area Get the light state detection area image set .

[0022] S5. Lighting state detection image set Perform visual classification to obtain the light state information management structure .

[0023] S6. Vehicle detection area image set Perform target detection and target tracking to obtain the vehicle information management structure .

[0024] S7. According to the near coordinate point, far coordinate point, lane width , true distance Calculate the distance from the vehicle to the lane stop line and the speed of vehicles approaching the intersection .

[0025] S8. Based on the distance between the motor vehicle and the lane stop line and the speed of vehicles approaching the intersection , Light status information management structure , vehicle information management structure Determine whether a motor vehicle is speeding, has stopped abnormally, has failed to respond to a green light, or has run a red light.

[0026] By using machine vision algorithms to detect traffic light status and vehicle spatial motion in real-time video from electronic police surveillance at urban intersections, and using perspective transformation technology to establish a one-to-one mapping between the video image and real-world road coordinates, the system can accurately determine whether vehicles within the detection area are engaging in unusual behaviors such as speeding, abnormal parking, driving on green lights, or running red lights. This detection method not only provides more valuable traffic information for traffic light control and real-time dispatch at command centers, but also provides more comprehensive data support for AI-based decision-making in smart cities.

[0027] In one embodiment of the present invention, in step S1, the video stream information of the electronic police camera at the intersection is obtained through the ONVIF protocol.

[0028] In one embodiment of the present invention, step S2 includes the following steps: S2-1. Use the cv::cvtcolor function in the OpenCV library to convert the video stream information from YUV-NV12 format to BGR format.

[0029] S2-2. Use the cv::equalizeHist function in the OpenCV library to equalize the BGR format video stream information The contrast of the frame intersection road image is enhanced to obtain the pre-processed Frame intersection road image ,all The intersection road images after frame preprocessing constitute the image set .

[0030] In one embodiment of the present invention, step S3 includes the following steps: S3-1. The first Frame intersection road image Middle Lane area , , is the number of lanes, Lane area It is a quadrilateral structure. Lane area The front edge is the lane stop line. lane area The domain is located at the back end of the edge and the Lane area The sides at the front are parallel and Lane area The side at the rear end and the Lane area The distance between the edges at the front is 40-60 meters. Lane area The edge at the left end is the lane line on the left side of the lane. Lane area The edge at the right end is the lane marking on the right side of the lane.

[0031] S3-2. The first Frame intersection road image Central red light monitoring area , the red light running monitoring area It is a quadrilateral structure located at The front end of the lane area, the red light monitoring area The width is , is the lane width, , where For the The width of each lane (the width of a single lane can be set to 3.75 meters according to the standard of trunk roads), red light running monitoring area The length of the lane stop line is 2-3 times the length of the vehicle. Use a GPS locator to mark a true far end line parallel to the lane stop line at 50m-100m behind the lane stop line. The width of the true far end line is equal to the width of the lane stop line. The true distance between the lane stop line and the true far end line is measured as follows: .

[0032] S3-3. The first Frame intersection road image Medium vehicle detection area , vehicle detection area For rectangular structures, all lane areas and red light monitoring areas Located in the vehicle detection area Inside.

[0033] S3-4. Manually record the first Frame intersection road image Middle light detection area , light state detection area Select the rectangular structure of the traffic light at the intersection.

[0034] S3-5. Frame intersection road image In the example, the lane stop line is used as the X-axis and the Y-axis is perpendicular to the lane stop line. The leftmost point of the lane stop line is marked as the near coordinate point A. , is the X-axis coordinate of the nearby coordinate point A, is the Y-axis coordinate of the near coordinate point A, and the rightmost point of the lane stop line is marked as the near coordinate point B , is the X-axis coordinate of the nearby coordinate point B, The Y-axis coordinate of the near coordinate point B is used to mark the leftmost point of the true far end line as the far coordinate point A. , is the X-axis coordinate of the distant coordinate point A, The Y-axis coordinate of the far coordinate point A, and the rightmost point of the true far end line is marked as the far coordinate point B , is the X-axis coordinate of the distant coordinate point A, is the Y-axis coordinate of the distant coordinate point A.

[0035] In one embodiment of the present invention, step S4 includes the following steps: S4-1. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image According to vehicle detection area Cut and get Frame vehicle detection area image ,all The frame vehicle detection area image constitutes the vehicle detection area image set , .

[0036] S4-2. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image Detection area according to light status Cut and get Frame light state detection area image ,all The frame vehicle detection area image constitutes the light state detection area image set , .

[0037] In one embodiment of the present invention, step S5 includes the following steps: S5-1. Set the light state detection image set Middle Frame light state detection area image Input into the Resnet-18 model and identify the Frame light status detection result list , ,in For signal light type, When it is 0, it indicates a dot signal light. When it is 1, it indicates the left turn signal light. When it is 2, it indicates the straight signal light. is the light state detection result, When it is -1, it indicates an invalid value. 0 o'clock means the light is off. When it is 1, it means green light. When it is 2, it means red light. 3 o'clock indicates a yellow light.

[0038] S5-2. According to Frame light status detection result list Establish the Frame light state information management structure , light state information management structure Contains the light state parameter LightInformation.Status and the current light state duration parameter LightInformation.Duration. When LightInformation.Status is -1, it indicates an invalid value. When LightInformation.Status is 0, it indicates that the dot signal light is off. When LightInformation.Status is 1, it indicates that the dot signal light is green. When LightInformation.Status is 2, it indicates that the dot signal light is red. When LightInformation.Status is 3, it indicates that the dot signal light is yellow. When n.Status is 4, it means the straight light is green. When LightInformation.Status is 5, it means the straight light is red. When LightInformation.Status is 6, it means the straight light is yellow. When LightInformation.Status is 7, it means the left turn light is green. When LightInformation.Status is 8, it means the left turn light is red. When LightInformation.Status is 9, it means the left turn light is yellow. The current light state duration parameter LightInformation.Duration records the current light state duration (in milliseconds). Light status information management structure Constructing the light status information management structure , .

[0039] In one embodiment of the present invention, step S6 includes the following steps: S6-1. Set the vehicle detection area image set Middle Frame vehicle detection area image Input into the YOLOv11 model for motor vehicle target detection, and get The first frame selects the rectangular frame of the motor vehicle and constructs the Frame motor vehicle target detection list , ,in The first step for YOLOv11 model detection A motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the motor vehicle, For the The width of the rectangular frame of a motor vehicle, For the The height of the rectangular frame of a motor vehicle.

[0040] S6-2. Use Deepsort algorithm to sort Frame vehicle detection area image in The motor vehicle is tracked and the Tracked motor vehicles, build the Frame motor vehicle target tracking information list , ,in For the A tracked motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The width of the rectangle of the tracked motor vehicle, For the The height of the rectangle of each tracked vehicle.

[0041] S6-3. Construction Frame vehicle information management structure , vehicle information management structure Include the number of the vehicle being tracked Parameters of Vehicle.k, Frame motor vehicle target tracking information list , record the The parameter Vehicle.LaneNum indicates the lane in which the tracked motor vehicle is located. Vehicle.LaneNum is When The center point of the rectangular box of the tracked vehicle is located at In the lane area, , when Vehicle.LaneNum is 0, it means the The tracked motor vehicles are not located in the lane area, all Vehicle information management structure , .

[0042] In one embodiment of the present invention, step S7 includes the following steps: S7-1. Set the perspective transformation matrix image corresponding points respectively 、 、 、 , , , , .

[0043] S7-2. Set the perspective transformation matrix and the corresponding points of the real scene respectively 、 、 、 , , , , .

[0044] S7-3. Use the cv::getPerspectiveTransform(srcTri, dstTri) function in the OpenCV library to convert the perspective transformation matrix image to the corresponding point 、 、 、 And the perspective transformation matrix real scene corresponding point 、 、 、 Generate a 3×3 perspective transformation matrix .

[0045] S7-4. Through the formula Calculate the first The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding horizontal coordinate , No. The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate and perspective transformation coefficients .

[0046] S7-5. The distance from the tracked vehicle to the lane stop line . S7-6. Through the formula Calculate the first The speed of the tracked vehicles approaching the intersection (unit is meter per second), where, For the The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate in The frame rate of the video stream information from the electronic police camera at the intersection.

[0047] In one embodiment of the present invention, step S8 includes the following steps: S8-1. If The speed of the tracked vehicles approaching the intersection If the speed is greater than the overspeed threshold for P times in a row, the The motor vehicle being tracked is speeding. Frame vehicle information management structure The vehicle abnormal behavior parameter Vehicle[k].Behavior is established, and the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 1. Preferably, in this embodiment, the value of P is 3, and the speeding threshold is set to 22 meters per second, that is, 80 kilometers per hour.

[0048] S8-2. If The speed of the tracked vehicles approaching the intersection If the value is less than the static threshold for Q consecutive times, the The first tracked motor vehicle is stationary. When the number of tracked motor vehicles in a stationary state is greater than the abnormal parking determination threshold, the first If a tracked motor vehicle stops abnormally, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 2. Preferably, in this embodiment, Q is set to 3, the stationary threshold is set to 1.4 m / s, i.e., 5 km / h, and the abnormal stop determination threshold is set to 180 seconds.

[0049] S8-3. According to Frame vehicle information management structure The parameter Vehicle.LaneNum in the In which lane is the tracked motor vehicle located? The distances from the tracked motor vehicles to the lane stop line are sorted from small to large. If the The distance from the tracked vehicle to the lane stop line If it is not the minimum value, it means If there is a vehicle in front of the first motor vehicle being tracked, The distance from the tracked vehicle to the lane stop line The minimum value indicates that There is no car ahead of the tracking motor vehicle. There is no vehicle in front of the tracking motor vehicle and The tracking vehicle is stationary for longer than Frame light state information management structure The current green light duration is recorded by the current light state duration parameter LightInformation.Duration in the If the stationary time of the tracked motor vehicle is longer than the vehicle starting reaction time threshold, the If the green light of the tracked motor vehicle cannot be turned off, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 3. Preferably, in this embodiment, the vehicle starting reaction time threshold is set to 5 seconds.

[0050] S8-4. According to Frame light state information management structure The light state parameter LightInformation.Status in the judgment The tracked motor vehicle is in the Lane area Is it a red light? When the lane area is red, use vector cross multiplication to determine the Whether the tracked motor vehicle leaves the Lane area , if the The tracked motor vehicle drove out of Lane area Then it entered the red light monitoring area , then determine the If a tracked motor vehicle runs a red light, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 4.

[0051] In one embodiment of the present invention, the method further includes sending the light state information management structure to the server at a sending time interval SendTime after step S8. Vehicle Information Management Structure This information is sent to downstream applications in JSON format or stored in a database. Regularly reporting abnormal vehicle traffic events at the intersection provides diverse data for signal optimization and road planning. Preferably, in this embodiment, the SendTime interval is set to 1 second. Downstream applications can use these abnormal vehicle traffic events to determine whether the lane divisions and signal timing schemes at the intersection are appropriate, providing a reference for evaluating, diagnosing, and managing traffic capacity.

[0052] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling, characterized in that: include: S1. Get video stream information from electronic police cameras at intersections; S2. Preprocess the acquired video stream information to obtain Image set of frame intersection road images , , After preprocessing Frame intersection road image, ; S3. Based on the image set Calibrate the vehicle detection area , No. Lane area , red light running monitoring area , Light state detection area , in Frame intersection road image Determine the near and far coordinate points, and calculate the Frame intersection road image Middle lane width , true distance ; S4. Based on vehicle detection area Get the vehicle detection area image set , according to the light state detection area Get the light state detection area image set ; S5. Lighting state detection image set Perform visual classification to obtain the light state information management structure ; S6. Vehicle detection area image set Perform target detection and target tracking to obtain the vehicle information management structure ; S7. According to the near coordinate point, far coordinate point, lane width , true distance Calculate the distance from the vehicle to the lane stop line and the speed of vehicles approaching the intersection ; S8. Based on the distance between the motor vehicle and the lane stop line and the speed of vehicles approaching the intersection , Light status information management structure , vehicle information management structure Determine whether a motor vehicle is speeding, has stopped abnormally, has failed to respond to a green light, or has run a red light.

2. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 1, characterized in that: In step S1, the video stream information of the electronic police camera at the intersection is obtained through the ONVIF protocol.

3. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 1, characterized in that: Step S2 includes the following steps: S2-1. Use the cv::cvtcolor function in the OpenCV library to convert the video stream information from YUV-NV12 format to BGR format; S2-2. Use the cv::equalizeHist function in the OpenCV library to equalize the BGR format video stream information The contrast of the frame intersection road image is enhanced to obtain the pre-processed Frame intersection road image ,all The intersection road images after frame preprocessing constitute the image set .

4. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 1, characterized in that: Step S3 includes the following steps: S3-1. The first Frame intersection road image Middle Lane area , , is the number of lanes, Lane area It is a quadrilateral structure. Lane area The front edge is the lane stop line. lane area The domain is located at the back end of the edge and the Lane area The sides at the front are parallel and Lane area The side at the rear end and the Lane area The distance between the edges at the front is 40-60 meters. Lane area The edge at the left end is the lane line on the left side of the lane. Lane area The edge at the right end is the lane line on the right side of the lane; S3-2. The first Frame intersection road image Central red light monitoring area , the red light running monitoring area It is a quadrilateral structure located at The front end of the lane area, the red light monitoring area The width is , is the lane width, , where For the lane width, red light monitoring area The length of the lane stop line is 2-3 times the length of the vehicle. Use a GPS locator to mark a true far end line parallel to the lane stop line at 50m-100m behind the lane stop line. The width of the true far end line is equal to the width of the lane stop line. The true distance between the lane stop line and the true far end line is measured as follows: ; S3-3. The first Frame intersection road image Medium vehicle detection area , vehicle detection area For rectangular structures, all lane areas and red light monitoring areas Located in the vehicle detection area Inside; S3-4. Manually record the first Frame intersection road image Middle light detection area , light state detection area Select the rectangular structure of the traffic light at the intersection; S3-5. Frame intersection road image In the example, the lane stop line is used as the X-axis and the Y-axis is perpendicular to the lane stop line. The leftmost point of the lane stop line is marked as the near coordinate point A. , is the X-axis coordinate of the nearby coordinate point A, is the Y-axis coordinate of the near coordinate point A, and the rightmost point of the lane stop line is marked as the near coordinate point B , is the X-axis coordinate of the nearby coordinate point B, The Y-axis coordinate of the near coordinate point B is used to mark the leftmost point of the true far end line as the far coordinate point A. , is the X-axis coordinate of the distant coordinate point A, The Y-axis coordinate of the far coordinate point A, and the rightmost point of the true far end line is marked as the far coordinate point B , is the X-axis coordinate of the distant coordinate point A, is the Y-axis coordinate of the distant coordinate point A.

5. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 1, characterized in that: Step S4 includes the following steps: S4-1. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image According to vehicle detection area Cut and get Frame vehicle detection area image ,all The frame vehicle detection area image constitutes the vehicle detection area image set , ; S4-2. Use the cv::Mat crop_img = img(detect_rect) function in the OpenCV library to crop the preprocessed Frame intersection road image Detection area according to light status Cut and get Frame light state detection area image ,all The frame vehicle detection area image constitutes the light state detection area image set , .

6. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 5, characterized in that: Step S5 includes the following steps: S5-1. Set the light state detection image set Middle Frame light state detection area image Input into the Resnet-18 model and identify the Frame light status detection result list , ,in For signal light type, When it is 0, it indicates a dot signal light. When it is 1, it indicates the left turn signal light. When it is 2, it indicates the straight signal light. is the light state detection result, When it is -1, it indicates an invalid value. 0 o'clock means the light is off. When it is 1, it means green light. When it is 2, it means red light. 3 o'clock indicates yellow light; S5-2. According to Frame light status detection result list Establish the Frame light state information management structure , light state information management structure Contains the light state parameter LightInformation.Status and the current light state duration parameter LightInformation.Duration. When LightInformation.Status is -1, it indicates an invalid value. When LightInformation.Status is 0, it indicates that the dot signal light is off. When LightInformation.Status is 1, it indicates that the dot signal light is green. When LightInformation.Status is 2, it indicates that the dot signal light is red. When LightInformation.Status is 3, it indicates that the dot signal light is yellow. When LightInformation.Status is 4, it means the straight light is green. When LightInformation.Status is 5, it means the straight light is red. When LightInformation.Status is 6, it means the straight light is yellow. When LightInformation.Status is 7, it means the left turn light is green. When LightInformation.Status is 8, it means the left turn light is red. When LightInformation.Status is 9, it means the left turn light is yellow. The current light state duration parameter LightInformation.Duration records the current light state duration. Light status information management structure Constructing the light status information management structure , .

7. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 4, characterized in that: Step S6 includes the following steps: S6-1. Set the vehicle detection area image set Middle Frame vehicle detection area image Input into the YOLOv11 model for motor vehicle target detection, and get The first frame selects the rectangular frame of the motor vehicle and constructs the Frame motor vehicle target detection list , ,in The first step for YOLOv11 model detection A motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the motor vehicle, For the The width of the rectangular frame of a motor vehicle, For the The height of the rectangular frame of a motor vehicle; S6-2. Use Deepsort algorithm to sort Frame vehicle detection area image in The motor vehicle is tracked and the Tracked motor vehicles, build the Frame motor vehicle target tracking information list , ,in For the A tracked motor vehicle, , For the The horizontal coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The vertical coordinate of the center point of the rectangular box of the tracked motor vehicle, For the The width of the rectangle of the tracked motor vehicle, For the The height of the rectangular box of the tracked motor vehicle; S6-3. Construction Frame vehicle information management structure , vehicle information management structure Include the number of the vehicle being tracked Parameters of Vehicle.k, Frame motor vehicle target tracking information list , record the The parameter Vehicle.LaneNum indicates the lane in which the tracked motor vehicle is located. Vehicle.LaneNum is When The center point of the rectangular box of the tracked vehicle is located at In the lane area, , when Vehicle.LaneNum is 0, it means the The tracked motor vehicles are not located in the lane area, all Vehicle information management structure , .

8. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 7, characterized in that: Step S7 includes the following steps: S7-1. Set the perspective transformation matrix image corresponding points respectively 、 、 、 , , , , ; S7-2. Set the perspective transformation matrix and the corresponding points of the real scene respectively 、 、 、 , , , , ; S7-3. Use the cv::getPerspectiveTransform(srcTri, dstTri) function in the OpenCV library to convert the perspective transformation matrix image to the corresponding point 、 、 、 And the perspective transformation matrix real scene corresponding point 、 、 、 Generate a 3×3 perspective transformation matrix ; S7-4. Through the formula Calculate the first The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding horizontal coordinate , No. The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate and perspective transformation coefficients ; S7-5. The distance from the tracked vehicle to the lane stop line ; S7-6. Through the formula Calculate the first The speed of the tracked vehicles approaching the intersection , where For the The front of the tracked motor vehicle is at Frame vehicle detection area image The corresponding vertical coordinate in The frame rate of the video stream information from the electronic police camera at the intersection.

9. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 7, characterized in that: Step S8 includes the following steps: S8-1. If The speed of the tracked vehicles approaching the intersection If the speed is greater than the overspeed threshold for P times in a row, the The motor vehicle being tracked is speeding. Frame vehicle information management structure In the process, a vehicle abnormal behavior parameter Vehicle[k].Behavior is established and the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 1; S8-2. If The speed of the tracked vehicles approaching the intersection If the value is less than the static threshold for Q consecutive times, the The first tracked motor vehicle is stationary. When the number of tracked motor vehicles in a stationary state is greater than the abnormal parking determination threshold, the first If a tracked motor vehicle stops abnormally, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 2; S8-3. According to Frame vehicle information management structure The parameter Vehicle.LaneNum in the In which lane is the tracked motor vehicle located? The distances from the tracked motor vehicles to the lane stop line are sorted from small to large. If the The distance from the tracked vehicle to the lane stop line If it is not the minimum value, it means If there is a vehicle in front of the first motor vehicle being tracked, The distance from the tracked vehicle to the lane stop line The minimum value indicates that There is no car ahead of the tracking motor vehicle. There is no vehicle in front of the tracking motor vehicle and The tracking vehicle is stationary for longer than Frame light state information management structure The current green light duration is recorded by the current light state duration parameter LightInformation.Duration in the If the stationary time of the tracked motor vehicle is longer than the vehicle starting reaction time threshold, the If the green light of a tracked motor vehicle fails, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 3; S8-4. According to Frame light state information management structure The light state parameter LightInformation.Status in the judgment The tracked motor vehicle is in the Lane area Is it a red light? When the lane area is red, use vector cross multiplication to determine the Whether the tracked motor vehicle leaves the Lane area , if the The tracked motor vehicle drove out of Lane area Then it entered the red light monitoring area , then determine the If a tracked motor vehicle runs a red light, the value of the vehicle abnormal behavior parameter Vehicle[k].Behavior is set to 4.

10. The method for detecting abnormal vehicle movement at intersections based on machine vision detection and road traffic area modeling according to claim 1, characterized in that: The light state information management structure is also included in step S8 and the light state information management structure is sent at a time interval SendTime. Vehicle Information Management Structure It is sent to downstream applications or stored in a database in the form of JSON.

Citation Information

Patent Citations

  • Intersection abnormal parking rapid alarm system and method with red light running picture taking function

    CN103886755A

  • Road junction traffic signal controller capable of fast finding abnormal parking and method

    CN103903442A

  • Intersection vehicle passing parameter calculation method based on target detection and time sequence analysis

    CN118097979A

  • Abnormal-driving vehicle detection system and road monitoring program

    JP2012003549A

  • Method for detecting abnormal status of traffic signal

    KR101348316B1