A road monitoring and recognition system and method based on computer vision
By using a computer vision-based road monitoring and recognition system, traffic accidents can be identified in real time through analysis of road images, the impact level can be determined, and warnings can be issued to target vehicles. This solves the problems of information delay and large coverage in existing technologies and improves traffic safety.
Patent Information
- Application Number
- CN202410494734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-04-24
AI Technical Summary
Current technologies primarily rely on driver alarms or manual identification via video surveillance to confirm road traffic accidents. This results in long reporting times and a wide coverage, but lacks specificity and may lead to secondary accidents.
A computer vision-based road monitoring and recognition system is adopted. The image acquisition module acquires road images in real time, the image processing module analyzes and identifies traffic accidents, the impact generation module determines the impact level of the accident, and the result generation module sends precise reminders to the target vehicles.
It enables accurate judgment and precise alerts for traffic accidents, reduces the occurrence of secondary accidents, and optimizes traffic flow.
Smart Images

Figure CN118379692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road traffic, and in particular to a road monitoring and recognition system and method based on computer vision. Background Art
[0002] With the rapid development of social economy and the improvement of people's living standards, more and more people buy private cars, resulting in a continuous increase in the number of cars owned and a continuous increase in the incidence of traffic accidents in modern traffic operations.
[0003] In real life, when a traffic accident occurs, the accident lane is closed, and a certain spatial impact range is formed upstream of the accident road. Within this range, traffic is in a low-speed congested state, while traffic outside the range is in a free-flow state. Upstream vehicles in a free-flow state will inevitably need to decelerate sharply when entering the accident impact range. This strong speed difference along the longitudinal direction will produce a greater risk of secondary accidents, which is very likely to cause secondary road accidents.
[0004] At present, the main way to confirm road accidents is to rely on drivers who encounter accidents to actively report to the police or to deploy video surveillance systems in key monitoring areas, and rely on personnel in the monitoring center to identify and determine the occurrence of accidents from the monitoring images, and then release traffic accident information through traffic broadcasts and other methods. This increases the time cycle for information reporting and the accident notification method has a large coverage range and is not targeted. It often fails to provide effective reminders and may even cause secondary accidents. Summary of the invention
[0005] The purpose of the present invention is to provide a road monitoring and recognition system and method based on computer vision to solve the following technical problems:
[0006] At present, the main way to confirm road accidents is to rely on drivers who encounter accidents to actively report to the police or to deploy video surveillance systems in key monitoring areas, and rely on personnel in the monitoring center to identify and determine the occurrence of accidents from the monitoring images, and then release traffic accident information through traffic broadcasts and other methods. This increases the time cycle for information reporting and the accident notification method has a large coverage range and is not targeted. It often fails to provide effective reminders and may even cause secondary accidents.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A road monitoring and recognition system based on computer vision, comprising:
[0009] An image acquisition module, used to acquire road images in real time through road monitoring and generate road image sequences;
[0010] An image processing module is used to analyze the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtain the road position (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude;
[0011] An impact generation module is used to mark the road section from the road location where the traffic accident occurred to the upstream entrance of the accident road as the upstream section of the accident, obtain the vehicle flow monitored by several roads in the upstream section of the accident in real time, obtain the average vehicle flow of the upstream section of the accident, and determine the accident impact level according to the number of accident lanes and the average vehicle flow;
[0012] The result generation module is used to mark the upstream section of the accident and the road associated with the upstream entrance as the accident impact range, and send accident status information to the target vehicle within the accident impact range according to the impact level.
[0013] As a further solution of the present invention: in the image processing module, the process of identifying the accident on the current road is:
[0014] S1, grayscale processing is performed on the road image to obtain a road grayscale image, a rectangular coordinate system is established with the central pixel point of the road grayscale image as the origin, the coordinates (x, y) of all pixel points in the road grayscale image are generated, and the grayscale values Pi (x, y) of all pixel points in the road grayscale image are identified, i = 1, ..., n, i represents the order of the road grayscale image where the pixel point is located in the sequence, and the grayscale difference D of the pixel points at the same position between adjacent road grayscale images is calculated by the grayscale difference formula D = |Pi+1 (x, y)-Pi (x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel point is a vehicle pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel point is a road surface area pixel.
[0015] S2, merge adjacent vehicle pixels, and circumscribe a minimum circumscribed rectangle around the merged vehicle pixel area to obtain a pixel rectangle of any vehicle in the road grayscale image; if there is an overlap between any vehicle pixel rectangle and any other vehicle pixel rectangle in any road image, mark the vehicle and the vehicle that overlaps with the vehicle as target vehicles;
[0016] S3, real-time tracking of the target vehicle is performed, a preset observation time T is set, and the speed of all target vehicles within the observation time T is calculated. If there is any target vehicle whose speed is lower than a preset threshold within the observation time T, it is determined that a traffic accident occurs on the current road.
[0017] As a further solution of the present invention: the process of calculating the speed of the target vehicle is:
[0018] Extract the pixel rectangle corresponding to any target vehicle, select the midpoint pixel of the rectangle from the pixel rectangle and mark it as the reference point; extract the real-time road image sequence of the target vehicle within the observation time T, select the position information of the reference point in each frame of the road image in the road image sequence, and calculate the average speed of the position change of the target vehicle in each frame of the road image according to the position change between adjacent frames and mark it as V, and use the average speed V as the vehicle speed of the target vehicle.
[0019] As a further solution of the present invention: in the image processing module, the process of obtaining the road location where the accident occurred and the occupied lane is:
[0020] S1, according to the real-time tracking of the target vehicle, obtain the monitoring point where the target vehicle is monitored at the end of the observation time T and mark it as the observation monitoring point, obtain the geographical location information of the observation monitoring point and mark it as (J, W); generate a road image of the observation monitoring point at the end of the observation time T and mark it as the observation image I;
[0021] S2, selecting any target vehicle in the observation image I, and obtaining the reference point coordinates of the target vehicle in the observation image I according to the rectangular coordinate system of the pixel points, marked as (X, Y);
[0022] S3, obtaining the angle between the shooting angle of the current monitoring point and the road and marking it as Q, obtaining the camera height of the current monitoring point and marking it as H, calculating the image coordinate conversion coefficient β according to Q and H, and converting the reference point coordinates (X, Y) of the target vehicle into geographic location information (J) according to the image conversion coefficient X ,W Y ), get the road location where the traffic accident occurred;
[0023] S4, according to the angle Q between the shooting angle of the current monitoring point and the current road, the observation image I is subjected to image tilt correction to obtain the observation image I' whose shooting angle is perpendicular to the current road, the number of lanes U of the current road is obtained, and the observation image I' is evenly cut into U sub-observation images in the horizontal direction according to the number of lanes U, each sub-observation image corresponds to a separate lane, any sub-observation image is selected, the area occupied by any target vehicle in the sub-observation image is extracted, the width of the area occupied by the target vehicle perpendicular to the road is calculated and marked as the occupied width d, if the occupied width d is greater than a preset threshold, the lane corresponding to the sub-observation image is determined to be an accident lane;
[0024] S5, calculating the number of all sub-observation images corresponding to the accident lanes determined as the accident lanes, and marking the number as the number F of accident lanes.
[0025] As a further solution of the present invention: if in any sub-observation image, there are areas of multiple target vehicles and the occupied width d of each target vehicle is less than a preset threshold, then the area of any target vehicle is selected as the standard area, and the areas of the remaining other target vehicles in the sub-mapping image are translated along the lane direction so that the center points of the sub-mapping image areas occupied by each target vehicle remain on the same straight line, and the width of the translated area perpendicular to the road is calculated to obtain the final occupied width. If the final occupied width is greater than the preset threshold, then the lane corresponding to the sub-observation image is determined to be an accident lane; if the final occupied width is less than or equal to the preset threshold, then the lane corresponding to the sub-observation image is determined not to be an accident lane.
[0026] As a further solution of the present invention: the calculation process of the average vehicle flow is:
[0027] Obtain the road images generated by all road monitoring points upstream of the current road accident at the end of observation time T and mark them as images to be tested W1, W2, W3, ..., We, where e is the number of all road monitoring points upstream of the current road accident to the upstream entrance of the accident road. Perform vehicle pixel rectangle extraction on any road image to be tested We to obtain the vehicle flow R in the image to be tested. According to the formula (R1+R2+, ..., Re) / e, calculate the average vehicle flow Rv of the upstream section of the accident.
[0028] As a further solution of the present invention: in the impact generation module, the specific process of obtaining the accident impact level is:
[0029] The congestion coefficient γ of the current accident section is obtained by dividing the number of accident roads F by the number of lanes U of the current road, and the accident road impact value is calculated according to the calculation Rv*γ. If the accident road impact value is greater than a, the accident impact level of the current accident road is determined to be A; if the accident road impact value is greater than b and less than a, the accident impact level of the current accident road is determined to be B; if the accident road impact value is greater than c and less than b, the accident impact level of the current accident road is determined to be C, wherein a, b and c are preset impact value thresholds, and a>b>c.
[0030] As a further solution of the present invention: the result generation module also includes classifying the impact range according to the road information, marking the target vehicle located at the upstream of the accident road to the upstream entrance of the accident road as a direct vehicle, and marking the target vehicle on the road associated with the upstream entrance of the accident road as an indirect vehicle, issuing accident status information to the direct vehicle to remind the driver to pay attention to driving and slow down; issuing accident status information to the indirect vehicle according to the accident impact level, if the accident impact level is A or B, issuing accident status information to the indirect vehicle, and suggesting to detour the current accident road; if the accident impact level is C, issuing accident status information to the indirect vehicle.
[0031] A road monitoring recognition method based on computer vision comprises the following steps:
[0032] S1, acquiring road images in real time through road monitoring and generating road image sequences;
[0033] S2, analyzing the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtaining the road location (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude;
[0034] S3, marking the road section from the location of the traffic accident to the upstream entrance of the accident road as the upstream section of the accident, obtaining the vehicle flow of several roads monitored in the upstream section of the accident in real time, obtaining the average vehicle flow of the upstream section of the accident, and determining the accident impact level according to the number of accident lanes and the average vehicle flow;
[0035] S4, marking the road section upstream of the accident and the road associated with the upstream entrance as the accident impact range, and sending accident status information to the target vehicles within the accident impact range according to the impact level.
[0036] Beneficial effects of the present invention:
[0037] The present invention acquires and analyzes road images in real time, makes judgments based on the frame difference grayscale value in the road images, identifies the road surface area and the vehicle area in the image, makes a preliminary judgment on whether the vehicle area interacts, obtains the target vehicle, tracks the target vehicle and identifies the speed change, and can determine whether a traffic accident occurs on the current road. By extracting the geographical location information of the monitoring point and the position of the target vehicle in the monitoring image and performing position coordinate conversion, the specific location of the accident can be obtained, and the lanes of the road monitoring image can be identified to obtain the lanes occupied by the specific road accident, the number of accident lanes and the average vehicle flow rate determine the accident impact level, and accurately remind the target vehicles in the impact range according to the impact level. The present invention realizes accurate judgment of traffic accidents and accurately reminds the target vehicles in the impact range according to the impact level, which helps to optimize the flow of traffic accident roads and reduce the occurrence of secondary accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The present invention will be further described below in conjunction with the accompanying drawings.
[0039] Figure 1 It is a flow chart of a road monitoring and recognition system based on computer vision of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] See also Figure 1 As shown, the present invention is a road monitoring and recognition system based on computer vision, comprising:
[0042] An image acquisition module, used to acquire road images in real time through road monitoring and generate road image sequences;
[0043] An image processing module is used to analyze the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtain the road position (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude;
[0044] An impact generation module is used to mark the road section from the road location where the traffic accident occurred to the upstream entrance of the accident road as the upstream section of the accident, obtain the vehicle flow monitored by several roads in the upstream section of the accident in real time, obtain the average vehicle flow of the upstream section of the accident, and determine the accident impact level according to the number of accident lanes and the average vehicle flow;
[0045] The result generation module is used to mark the upstream section of the accident and the road associated with the upstream entrance as the accident impact range, and send accident status information to the target vehicle within the accident impact range according to the impact level.
[0046] In a preferred embodiment of the present invention, in the image processing module, the process of identifying the accident on the current road is:
[0047] S1, grayscale processing is performed on the road image to obtain a road grayscale image, a rectangular coordinate system is established with the central pixel point of the road grayscale image as the origin, the coordinates (x, y) of all pixel points in the road grayscale image are generated, and the grayscale values Pi (x, y) of all pixel points in the road grayscale image are identified, i = 1, ..., n, i represents the order of the road grayscale image where the pixel point is located in the sequence, and the grayscale difference D of the pixel points at the same position between adjacent road grayscale images is calculated by the grayscale difference formula D = |Pi+1 (x, y)-Pi (x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel point is a vehicle pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel point is a road surface area pixel.
[0048] S2, merge adjacent vehicle pixels, and circumscribe a minimum circumscribed rectangle around the merged vehicle pixel area to obtain a pixel rectangle of any vehicle in the road grayscale image; if there is an overlap between any vehicle pixel rectangle and any other vehicle pixel rectangle in any road image, mark the vehicle and the vehicle that overlaps with the vehicle as target vehicles;
[0049] S3, real-time tracking of the target vehicle is performed, a preset observation time T is set, and the speed of all target vehicles within the observation time T is calculated. If there is any target vehicle whose speed is lower than a preset threshold within the observation time T, it is determined that a traffic accident occurs on the current road.
[0050] The grayscale difference formula is used to calculate the grayscale difference of pixels at the same position between adjacent road grayscale images, which can effectively identify vehicle pixels and road area pixels. The vehicle can be distinguished from the road surface, and the adjacent vehicle pixels are merged and circumscribed with a minimum circumscribed rectangle. The pixel rectangle of any vehicle in the road grayscale image can be obtained, and the vehicle can be accurately located and tracked. By judging whether there is an overlapping area with the target vehicle, the situation where a traffic accident may occur can be discovered, the target vehicle can be tracked in real time, and the speed of all target vehicles within the observation time T can be calculated. It can further determine whether the current target vehicle has a traffic accident, making the final judgment result more accurate and reasonable.
[0051] In another preferred embodiment of the present invention, the process of calculating the speed of the target vehicle is:
[0052] Extract the pixel rectangle corresponding to any target vehicle, select the midpoint pixel of the rectangle from the pixel rectangle and mark it as the reference point; extract the real-time road image sequence of the target vehicle within the observation time T, select the position information of the reference point in each frame of the road image in the road image sequence, and calculate the average speed of the position change of the target vehicle in each frame of the road image according to the position change between adjacent frames and mark it as V, and use the average speed V as the vehicle speed of the target vehicle.
[0053] By extracting the pixel rectangle corresponding to any target vehicle and selecting the midpoint pixel of the rectangle as the reference point, the position of the target vehicle in the road image can be determined, the real-time road image sequence of the target vehicle within the observation time T can be extracted, and the position information of the reference point in each frame of the road image can be selected. By calculating the position change between adjacent frames, the position change of the target vehicle in each frame of the road image can be obtained. According to the position change between adjacent frames, the average speed of the position change of the target vehicle in each frame of the road image is calculated. The average speed V is used as the speed of the target vehicle, which can accurately describe the motion state of the target vehicle.
[0054] In a preferred embodiment of the present invention, in the image processing module, the process of obtaining the road location where the accident occurred and the occupied lane is:
[0055] S1, according to the real-time tracking of the target vehicle, obtain the monitoring point where the target vehicle is monitored at the end of the observation time T and mark it as the observation monitoring point, obtain the geographical location information of the observation monitoring point and mark it as (J, W); generate a road image of the observation monitoring point at the end of the observation time T and mark it as the observation image I;
[0056] S2, selecting any target vehicle in the observation image I, and obtaining the reference point position information of the target vehicle in the observation image I according to the rectangular coordinate system of the pixel points, marked as (X, Y);
[0057] S3, obtaining the angle between the shooting angle of the current monitoring point and the road and marking it as Q, obtaining the camera height of the current monitoring point and marking it as H, calculating the image coordinate conversion coefficient β according to Q and H, and converting the reference point position information (X, Y) of the target vehicle into the geographical location information (J) according to the image conversion coefficient X ,W Y ), get the road location where the traffic accident occurred;
[0058] S4, according to the angle Q between the shooting angle of the current monitoring point and the current road, the observation image I is subjected to image tilt correction to obtain the observation image I' whose shooting angle is perpendicular to the current road, the number of lanes U of the current road is obtained, and the observation image I' is evenly cut into U sub-observation images in the horizontal direction according to the number of lanes U, each sub-observation image corresponds to a separate lane, any sub-observation image is selected, the area occupied by any target vehicle in the sub-observation image is extracted, the width of the area occupied by the target vehicle perpendicular to the road is calculated and marked as the occupied width d, if the occupied width d is greater than a preset threshold, the lane corresponding to the sub-observation image is determined to be an accident lane;
[0059] S5, calculating the number of all sub-observation images corresponding to the accident lanes determined as the accident lanes, and marking the number as the number F of accident lanes.
[0060] First, the position of the monitoring point where the target vehicle is monitored is extracted, and then the position of the target vehicle in the road image is obtained, the angle between the shooting angle of the current monitoring point and the road is obtained and marked as Q, the camera height of the current monitoring point is obtained and marked as H, the image coordinate conversion coefficient β is calculated according to the Q and H, the pixel coordinates are converted according to the image coordinate conversion coefficient β to obtain the road position where the actual traffic accident occurred, and the observation image I is corrected for image tilt according to the angle Q between the shooting angle of the current monitoring point and the current road to obtain the observation image I' whose shooting angle is perpendicular to the current road, the number of lanes U of the current road is obtained, and the observation image I' is evenly cut into U sub-observation images in the horizontal direction according to the number of lanes U, each sub-observation image corresponds to a separate lane, and the vertical road width of the area occupied by the target vehicle in each lane is calculated. If the occupied width is greater than the preset threshold, it means that the lane corresponding to the sub-mapping image is occupied by the target vehicle and is not suitable for other vehicles to pass.
[0061] In another preferred embodiment of the present invention, if in any sub-observation image, there are areas of multiple target vehicles and the occupied width d of each target vehicle is less than a preset threshold, then the area of any target vehicle is selected as the standard area, and the areas of the remaining other target vehicles in the sub-mapping image are translated along the lane direction so that the center points of the sub-mapping image areas occupied by each target vehicle remain on the same straight line, and the width of the translated area perpendicular to the road is calculated to obtain the final occupied width. If the final occupied width is greater than the preset threshold, the lane corresponding to the sub-observation image is determined to be an accident lane. If the final occupied width is less than or equal to the preset threshold, then the lane corresponding to the sub-observation image is determined not to be an accident lane.
[0062] In a preferred embodiment of the present invention, the calculation process of the average vehicle flow is:
[0063] Obtain the road images generated by all road monitoring points upstream of the current road accident at the end of observation time T and mark them as images to be tested W1, W2, W3, ..., We, where e is the number of all road monitoring points upstream of the current road accident to the upstream entrance of the accident road. Perform vehicle pixel rectangle extraction on any road image to be tested We to obtain the vehicle flow R in the image to be tested. According to the formula (R1+R2+, ..., Re) / e, calculate the average vehicle flow Rv of the upstream section of the accident.
[0064] In a preferred embodiment of the present invention, in the impact generation module, the specific process of obtaining the accident impact level is:
[0065] The congestion coefficient γ of the current accident section is obtained by dividing the number of accident roads F by the number of lanes U of the current road, and the accident road impact value is calculated according to the calculation Rv*γ. If the accident road impact value is greater than a, the accident impact level of the current accident road is determined to be A; if the accident road impact value is greater than b and less than a, the accident impact level of the current accident road is determined to be B; if the accident road impact value is greater than c and less than b, the accident impact level of the current accident road is determined to be C, wherein a, b and c are preset impact value thresholds, and a>b>c.
[0066] In a preferred embodiment of the present invention, the result generation module also includes calibrating the impact range according to the road information, marking the target vehicle located at the upstream of the accident road to the upstream entrance of the accident road as a direct vehicle, and marking the target vehicle on the road associated with the upstream entrance of the accident road as an indirect vehicle, issuing accident status information to the direct vehicle to remind the driver to pay attention to driving and slow down; issuing accident status information to the indirect vehicle according to the accident impact level, if the accident impact level is A or B, issuing accident status information to the indirect vehicle, and suggesting to detour the current accident road; if the accident impact level is C, issuing accident status information to the indirect vehicle.
[0067] By calibrating the target vehicles as direct vehicles and indirect vehicles, it is possible to accurately distinguish between vehicles upstream of the accident road and related roads, improve the accuracy of information transmission, and send accident status information to direct vehicles to remind drivers to pay attention to driving and slow down, which helps reduce the occurrence of secondary accidents. It also sends corresponding accident status information to indirect vehicles based on the accident impact level, and can provide targeted suggestions or warnings based on the specific accident circumstances, helping drivers make correct decisions, avoid entering the accident road, and improve traffic safety.
[0068] A road monitoring recognition method based on computer vision comprises the following steps:
[0069] S1, acquiring road images in real time through road monitoring and generating road image sequences;
[0070] S2, analyzing the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtaining the road location (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude;
[0071] S3, marking the road section from the location of the traffic accident to the upstream entrance of the accident road as the upstream section of the accident, obtaining the vehicle flow of several roads monitored in the upstream section of the accident in real time, obtaining the average vehicle flow of the upstream section of the accident, and determining the accident impact level according to the number of accident lanes and the average vehicle flow;
[0072] S4, marking the road section upstream of the accident and the road associated with the upstream entrance as the accident impact range, and sending accident status information to the target vehicles within the accident impact range according to the impact level.
[0073] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A road monitoring and recognition system based on computer vision, characterized in that: include: An image acquisition module, used to acquire road images in real time through road monitoring and generate road image sequences; An image processing module is used to analyze the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtain the road position (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude; An impact generation module is used to mark the road section from the road location where the traffic accident occurred to the upstream entrance of the accident road as the upstream section of the accident, obtain the vehicle flow R monitored by several roads in the upstream section of the accident in real time, obtain the average vehicle flow Rv of the upstream section of the accident, and determine the accident impact level according to the number of accident lanes and the average vehicle flow; A result generation module is used to mark the upstream road section of the accident and the road associated with the upstream entrance as the accident impact range, and send accident status information to the target vehicle in the accident impact range according to the impact level; In the image processing module, the specific process of determining the accident lane is as follows: S1, according to the real-time tracking of the target vehicle, obtain the monitoring point where the target vehicle is monitored at the end of the observation time T and mark it as the observation monitoring point, obtain the geographical location information of the observation monitoring point and mark it as (J, W), and generate a road image of the observation monitoring point at the end of the observation time T and mark it as the observation image I; S2, grayscale processing is performed on the road image to obtain a road grayscale image, a rectangular coordinate system is established with the central pixel point of the road grayscale image as the origin, any target vehicle in the observation image I is selected and the reference point coordinates of the target vehicle in the observation image I are obtained according to the rectangular coordinate system of the pixel point and marked as (X, Y); S3, obtaining the angle between the shooting angle of the current monitoring point and the road and marking it as Q, obtaining the camera height of the current monitoring point and marking it as H, calculating the image coordinate conversion coefficient β according to Q and H, and converting the reference point coordinates (X, Y) of the target vehicle into geographic location information (J) according to the image conversion coefficient β X ,W Y ), get the road location where the traffic accident occurred; S4, according to the shooting angle of the current monitoring point and the angle Q between the current road, the observation image I is subjected to image tilt correction to obtain the observation image I' whose shooting angle is perpendicular to the current road, and the number of lanes U of the current road is obtained, and the observation image I' is evenly cut into U sub-observation images in the horizontal direction according to the number of lanes U, each sub-observation image corresponds to a separate lane, and any sub-observation image is selected to extract the area occupied by any target vehicle in the sub-observation image, and the width of the area occupied by the target vehicle perpendicular to the road is calculated and marked as the occupied width d, and if the occupied width d is greater than a preset threshold, the lane corresponding to the sub-observation image is determined to be an accident lane; S5, calculating the number of all sub-observation images corresponding to the accident lanes determined as the accident lanes, and marking the number as the number of accident lanes F; If in any sub-observation image, there are multiple target vehicle areas and the occupied width d of each target vehicle is less than the preset threshold, then the area of any target vehicle is selected as the standard area, and the areas of the remaining other target vehicles in the sub-observation image are translated along the lane direction so that the center points of the sub-observation image areas occupied by each target vehicle remain on the same straight line. The width of the translated area perpendicular to the road is calculated to obtain the final occupied width. If the final occupied width is greater than the preset threshold, the lane corresponding to the sub-observation image is determined to be the accident lane. If the final occupied width is less than or equal to the preset threshold, the lane corresponding to the sub-observation image is determined not to be the accident lane.
2. A road monitoring and recognition system based on computer vision according to claim 1, characterized in that: In the image processing module, the process of identifying the accident on the current road is: S1, grayscale processing is performed on the road image to obtain a road grayscale image, a rectangular coordinate system is established with the central pixel point of the road grayscale image as the origin, the coordinates (x, y) of all pixel points in the road grayscale image are generated, and the grayscale values Pi (x, y) of all pixel points in the road grayscale image are identified, i = 1, ..., n, i represents the order of the road grayscale image where the pixel point is located in the sequence, and the grayscale difference D of the pixel points at the same position between adjacent road grayscale images is calculated by the grayscale difference formula D = |Pi+1 (x, y)-Pi (x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel point is a vehicle pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel point is a road surface area pixel. S2, merge adjacent vehicle pixels, and circumscribe a minimum circumscribed rectangle around the merged vehicle pixel area to obtain a pixel rectangle of any vehicle in the road grayscale image; if there is an overlap between any vehicle pixel rectangle and any other vehicle pixel rectangle in any road image, mark the vehicle and the vehicle that overlaps with the vehicle as target vehicles; S3, real-time tracking of the target vehicle is performed, a preset observation time T is set, and the speed of all target vehicles within the observation time T is calculated. If there is any target vehicle whose speed change is greater than a preset threshold within the observation time T, it is determined that a traffic accident occurs on the current road.
3. A road monitoring and recognition system based on computer vision according to claim 2, characterized in that: The process of calculating the speed of the target vehicle is: Extract the pixel rectangle corresponding to any target vehicle, select the midpoint pixel point of the rectangle from the pixel rectangle and mark it as the reference point, extract the real-time road image sequence of the target vehicle within the observation time T, select the position information of the reference point in each frame of the road image in the road image sequence, and calculate the average speed of the target vehicle's position change in each frame of the road image based on the position change between adjacent frames and mark it as V, and use the average speed V as the vehicle speed of the target vehicle.
4. The road monitoring and recognition system based on computer vision according to claim 1, characterized in that: The calculation process of the average vehicle flow is: Obtain the road images generated by all road monitoring points upstream of the current road accident at the end of observation time T and mark them as images to be tested W1, W2, W3, ..., We, where e is the number of all road monitoring points upstream of the current road accident to the upstream entrance of the accident road. Perform vehicle pixel rectangle extraction on any road image to be tested We to obtain the vehicle flow R in the image to be tested. According to the formula (R1+R2+, ..., Re) / e, calculate the average vehicle flow Rv of the upstream section of the accident.
5. A road monitoring and recognition system based on computer vision according to claim 4, characterized in that: In the impact generation module, the specific process of obtaining the accident impact level is as follows: The congestion coefficient γ of the current accident section is obtained by dividing the number of accident roads F by the number of lanes U of the current road, and the accident road impact value is calculated according to the calculation Rv*γ. If the accident road impact value is greater than a, the accident impact level of the current accident road is determined to be A; if the accident road impact value is greater than b and less than a, the accident impact level of the current accident road is determined to be B; if the accident road impact value is greater than c and less than b, the accident impact level of the current accident road is determined to be C, wherein a, b and c are preset impact value thresholds, and a>b>c.
6. A road monitoring and recognition system based on computer vision according to claim 5, characterized in that: The result generation module also includes marking the target vehicle located at the upstream of the accident road to the upstream entrance of the accident road as a direct vehicle, and marking the target vehicle on the road associated with the upstream entrance of the accident road as an indirect vehicle, sending accident status information to the direct vehicle to remind the driver to drive carefully and slow down; sending accident status information to the indirect vehicle according to the accident impact level, if the accident impact level is A or B, sending accident status information to the indirect vehicle, and suggesting to detour the current accident road; if the accident impact level is C, sending accident status information to the indirect vehicle.
7. A road monitoring and recognition method based on computer vision, characterized in that: The following steps are involved: S1, acquiring road images in real time through road monitoring and generating road image sequences; S2, analyzing the road video image sequence to identify whether there is a traffic accident on the current road, and if there is a traffic accident, obtaining the road location (J, W) where the traffic accident occurred and the number of occupied accident lanes F, where J is longitude and W is latitude; S3, used to mark the road section from the road location where the traffic accident occurred to the upstream entrance of the accident road as the upstream section of the accident, obtain the vehicle flow R of several roads monitored in the upstream section of the accident in real time, obtain the average vehicle flow Rv of the upstream section of the accident, and determine the accident impact level according to the number of accident lanes and the average vehicle flow; S4, used for marking the road section upstream of the accident and the road associated with the upstream entrance as the accident impact range, and sending accident status information to the target vehicle in the accident impact range according to the impact level; In S2, the specific process of determining the accident lane is as follows: S11, according to the real-time tracking of the target vehicle, obtain the monitoring point where the target vehicle is monitored at the end of the observation time T and mark it as the observation monitoring point, obtain the geographical location information of the observation monitoring point and mark it as (J, W), and generate a road image of the observation monitoring point at the end of the observation time T and mark it as the observation image I; S12, grayscale processing is performed on the road image to obtain a road grayscale image, a rectangular coordinate system is established with the central pixel point of the road grayscale image as the origin, any target vehicle in the observation image I is selected, and the reference point coordinates of the target vehicle in the observation image I are obtained according to the rectangular coordinate system of the pixel point and marked as (X, Y); S13, obtaining the angle between the shooting angle of the current monitoring point and the road and marking it as Q, obtaining the camera height of the current monitoring point and marking it as H, calculating the image coordinate conversion coefficient β according to Q and H, and converting the reference point coordinates (X, Y) of the target vehicle into geographic location information (J) according to the image conversion coefficient β X ,W Y ), get the road location where the traffic accident occurred; S14, according to the shooting angle of the current monitoring point and the angle Q between the current road, the observation image I is subjected to image tilt correction to obtain the observation image I' whose shooting angle is perpendicular to the current road, and the number of lanes U of the current road is obtained, and the observation image I' is evenly cut into U sub-observation images in the horizontal direction according to the number of lanes U, each sub-observation image corresponds to a separate lane, and any sub-observation image is selected to extract the area occupied by any target vehicle in the sub-observation image, and the width of the area occupied by the target vehicle perpendicular to the road is calculated and marked as the occupied width d, and if the occupied width d is greater than a preset threshold, the lane corresponding to the sub-observation image is determined to be an accident lane; S15, calculating the number of all sub-observation images corresponding to the accident lanes determined as the accident lanes, and marking the number as the number of accident lanes F; If in any sub-observation image, there are multiple target vehicle areas and the occupied width d of each target vehicle is less than the preset threshold, then the area of any target vehicle is selected as the standard area, and the areas of the remaining other target vehicles in the sub-observation image are translated along the lane direction so that the center points of the sub-observation image areas occupied by each target vehicle remain on the same straight line. The width of the translated area perpendicular to the road is calculated to obtain the final occupied width. If the final occupied width is greater than the preset threshold, the lane corresponding to the sub-observation image is determined to be the accident lane. If the final occupied width is less than or equal to the preset threshold, the lane corresponding to the sub-observation image is determined not to be the accident lane.
