Method and System for Abnormal Detection of Road Traffic Behaviors Based on Computer Vision

By continuously collecting lane images and calculating the mark distance between the intersection point of the lane line and the image, the vehicle's abnormal driving probability, trend and fluctuation parameters are obtained, and a comprehensive judgment of whether the vehicle has dangerous driving behavior is solved, the problem of single judgment basis in traditional methods is solved, and more accurate dangerous driving detection is achieved.

CN119636790BActive Publication Date: 2025-07-04SHAANXI YONGJIA TAILE ENG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510186042.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-07-04
Estimated Expiration
2045-02-20

AI Technical Summary

Technical Problem

The traditional road traffic behavior detection method based on vehicle cameras relies on the judgment of vehicle deviation from the lane, making it difficult to capture drivers' misbehavior in the lane, resulting in a single basis for judgment and susceptible to complex road conditions and individual driver differences, and insufficient accuracy.

Method used

By continuously collecting lane images, the edge detection algorithm is used to extract lane lines, calculate the mark distance between the intersection point between the lane lines and the image, obtain the abnormal driving probability, trend and fluctuation parameters of the vehicle, comprehensively determine whether the vehicle has dangerous driving behavior and issue a reminder.

Benefits of technology

It improves the accuracy of judging dangerous driving behaviors, can identify irregular operations in the lane and abnormal driving under complex road conditions, reduces false alarms, and improves driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119636790B_ABST
    Figure CN119636790B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and particularly to a method and system for detecting abnormal road traffic behaviors based on computer vision, including: continuously collecting lane images and processing them to obtain preprocessed images; obtaining a marked distance according to the distance between the lane line and the lower edge intersection of the image in the preprocessed image; obtaining a vehicle's one-time driving probability parameter according to the marked distance in the preprocessed image; obtaining a vehicle driving trend parameter according to the change trend of the marked distance in the preprocessed picture; calculating the fluctuation amplitude of the marked distance in the preprocessed picture, and obtaining a vehicle fluctuation parameter according to the fluctuation amplitude; combining the above parameters to obtain a vehicle dangerous driving behavior parameter and determining whether there is a dangerous driving behavior of the vehicle. The present invention makes the judgment of dangerous driving behaviors more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and particularly to a method and system for detecting abnormal road traffic behaviors based on computer vision. Background Art

[0002] With the increasing busyness of road traffic and the rapid growth of the number of vehicles, dangerous driving behaviors have become one of the main causes of traffic accidents, seriously threatening the safety of road traffic.

[0003] Traditional technologies mainly rely on on-vehicle cameras to judge dangerous driving behaviors during driving. Its basic principle is to capture the image data of lane lines in real time through on-vehicle cameras. Subsequently, using advanced image processing technologies, the system can detect and analyze whether the vehicle has deviated from the normal driving lane. Once the vehicle is detected to deviate from the lane, the system will immediately trigger a warning mechanism to remind the driver to pay attention to direction control in the form of sound or visual signals, thereby preventing potential road traffic accidents. However, this judgment method based solely on the situation of vehicle lane departure has certain limitations in practice, and its accuracy needs to be improved. Because in a complex road environment, it is completely reasonable and common for a vehicle to temporarily deviate from the lane due to reasons such as normal lane changing, avoiding obstacles, or following traffic instructions. Therefore, it is obviously not comprehensive and accurate enough to define dangerous driving only by whether the vehicle deviates from the lane. In addition, there is a more concealed and dangerous situation that deserves attention: even if the vehicle is driving within the lane, it may be in a highly dangerous state due to certain improper behaviors of the driver. For example, when the driver is driving under the influence of alcohol or operating irregularly, he may make irregular, frequent and small direction adjustments within the lane, or drive at a high speed when the road condition is bad. These driving behaviors also constitute dangerous driving. However, because these small changes may not cause the vehicle to deviate significantly from the lane, the traditional lane departure warning system may be difficult to capture and issue an effective alarm in time, thus increasing the hidden danger of driving safety. To sum up, although traditional technologies can assist in judging dangerous driving behaviors during driving to a certain extent, their judgment basis is relatively single and is easily affected by complex road conditions and driver individual differences. Summary of the Invention

[0004] The present invention provides a method and system for detecting abnormal road traffic behaviors based on computer vision to solve the existing problems: traditional technologies can assist in judging dangerous driving behaviors during driving to a certain extent, but their judgment basis is relatively single and is easily affected by complex road conditions and driver individual differences.

[0005] A method and system for detecting abnormal road traffic behavior based on computer vision of the present invention adopt the following technical solutions: In the first aspect of the present invention, a method for detecting abnormal road traffic behavior based on computer vision is provided. The method includes the following steps: Continuously collect lane images and perform preprocessing to obtain preprocessed images of each lane image; Obtain the marked distance of each preprocessed image according to the distance between the intersection of the lane line and the lower edge of the image in each preprocessed picture; Obtain the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed picture; Obtain the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed picture; Calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image; Set a threshold according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, and comprehensively judge whether there is dangerous driving behavior of the vehicle and issue a reminder.

[0006] Further, the method for obtaining the marked distance of each preprocessed image according to the distance between the intersection of the lane line and the lower edge of the image in each preprocessed picture includes the following specific method: Collect road images taken during vehicle driving using an in-vehicle camera at a preset time interval t. The duration of collecting road images is T. Use an edge detection algorithm to extract the lane lines of each road image, and traverse the images processed by the edge detection algorithm in the image acquisition order to obtain a series of preprocessed images with clear lane lines.

[0007] Further, the method for obtaining the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed picture includes the following specific method: Calculate the number of pixel points between the line segments connecting the two intersections where the lane line intersects the lower edge of the picture in each preprocessed picture. The number of pixel points on the line segment connecting the two intersections where the lane line intersects the lower edge of the picture in each preprocessed picture is recorded as the marked distance of the preprocessed picture.

[0008] Further, the method for obtaining the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed picture includes the following specific method: In the formula, represents the vehicle abnormal driving probability parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the i-th preprocessed image, and x represents the image acquisition serial number. Obtain the vehicle abnormal driving probability parameter of each preprocessed image during vehicle driving according to the above method.

[0009] Furthermore, the vehicle driving trend parameter of each pre-processed image is obtained according to the change trend of the mark distance of each pre-processed image, and the specific method includes: setting a data set of the mark distance data of the pre-processed image required for judging the vehicle driving trend, the length of the data set is n, and the data set contains the mark distance data of n continuous sequence pre-processed images, and the mark distance data is cleared in the data set after each calculation of the vehicle driving trend parameter, and the mark distance data is re-filled after the next calculation of the vehicle driving trend parameter; In the formula, Represents the vehicle driving trend parameter of the xth preprocessed image, represents the label distance of the x-th preprocessed image, Represents the marking distance of the jth preprocessed image, and the vehicle driving trend parameters of each preprocessed image are obtained according to the above method.

[0010] Furthermore, the method of obtaining the fluctuation amplitude of the marker distance of each pre-processed image and obtaining the vehicle fluctuation parameter of any pre-processed image according to the fluctuation amplitude of the marker distance of each pre-processed image includes the following specific methods: In the formula, represents the vehicle fluctuation parameter of the xth preprocessed image, represents the label distance of the x-th preprocessed image, represents the marker distance of the x-1th preprocessed image, represents the label distance of the I-th preprocessed image, Represents the marking distance of the I-1th preprocessed image. The vehicle fluctuation parameter of any preprocessed image is obtained according to this method.

[0011] Furthermore, the method of setting a threshold and comprehensively judging whether the vehicle has dangerous driving behavior and issuing a reminder based on the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each pre-processed image includes the following specific methods: In the formula, represents the dangerous driving behavior parameters of the vehicle in the xth preprocessed image, represents the vehicle abnormal driving probability parameter of the xth pre-processed image, Represents the vehicle driving trend parameter of the xth preprocessed image, Represents the vehicle fluctuation parameter of the xth preprocessed image, and obtains the vehicle dangerous driving behavior parameter of each preprocessed image according to the above method; sets a threshold G, and during the vehicle driving process, calculates the vehicle dangerous driving behavior parameter of the last preprocessed image each time, and compares the vehicle dangerous driving behavior parameter with the threshold G. When the vehicle dangerous driving behavior parameter is greater than or equal to the threshold G, the driver is reminded to pay attention to standard driving through the vehicle audio.

[0012] In a second aspect of the present invention, there is provided a road traffic behavior anomaly detection system based on computer vision. The system includes an image acquisition module, an image data calculation module, and a data judgment module, where: The image acquisition module is used to continuously acquire lane images and perform preprocessing to obtain preprocessed images of each lane image; The image data calculation module is used to obtain the marked distance of each preprocessed image according to the distance between the lane line and the lower edge of the image in each preprocessed picture; obtain the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed image; obtain the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image; The data judgment module is used to set a threshold according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, and comprehensively judge whether there is dangerous driving behavior of the vehicle and issue a reminder.

[0013] In a third aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned method for detecting abnormal road traffic behavior based on computer vision are implemented.

[0014] In a fourth aspect of the present invention, there is provided a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the steps of the above-mentioned method for detecting abnormal road traffic behavior based on computer vision are implemented.

[0015] The beneficial effects of the technical solution of the present invention are as follows: Continuously collect lane images and perform preprocessing to obtain the preprocessed images of each lane image, in order to judge the continuous driving state of the vehicle and exclude the influence of other factors in the image; Obtain the marked distance of each preprocessed image according to the distance between the lane line and the lower edge of the image in each preprocessed picture; The method for obtaining the marked distance is relatively simple, with less computational effort compared to traditional lane line detection methods, and is applicable to various complex road sections. Even in the case of vehicle congestion, it does not affect the judgment of the abnormal state of the vehicle; Obtain the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed image; By judging the change in the size of the marked distance, it can be determined whether the vehicle is in a position close to the center of the lane, or whether the driving direction of the vehicle is close to parallel to the lane line, and it can be preliminarily judged whether the position of the current vehicle relative to the lane line is dangerous during driving; Obtain the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; Considering that in some cases, the vehicle may temporarily deviate from the lane due to normal lane changes, avoidance of obstacles, or following traffic instructions, resulting in a relatively large abnormal driving probability parameter for the preprocessed image obtained at this time, but the vehicle is in a normal driving state at this moment; Judging whether the vehicle deviates from the lane due to reasons such as normal lane changes according to the vehicle driving trend can, to a certain extent, avoid false warnings for dangerous driving behaviors based on the relative position of the vehicle and the lane line; Obtain the fluctuation amplitude of the marked distance of each preprocessed image, and according to the fluctuation amplitude of the marked distance of each preprocessed image, obtain the vehicle fluctuation parameter of any preprocessed image; Judging whether there are irregular operation behaviors of the vehicle through vehicle running stability can, to a certain extent, identify dangerous driving behaviors such as the driver making irregular, frequent, and small steering adjustments within the lane, or driving at high speed in poor road conditions; According to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, set a threshold and comprehensively judge whether there is a dangerous driving behavior of the vehicle and issue a reminder; Comprehensively judging whether there is a dangerous driving behavior of the vehicle based on the relative position of the vehicle and the lane line, vehicle driving trend, and vehicle running stability is more accurate compared to existing dangerous driving behavior judgment methods and can better avoid the occurrence of dangerous driving behaviors. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0017] Figure 1The flowchart of the steps of a method for detecting abnormal road traffic behaviors based on computer vision according to the present invention; Figure 2 The structural block diagram of a system for detecting abnormal road traffic behaviors based on computer vision according to the present invention. Detailed implementation manners

[0018] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following combines the accompanying drawings and preferred embodiments to specifically describe a method and system for detecting abnormal road traffic behaviors based on computer vision according to the present invention, including its specific implementation manners, structures, features and effects in detail. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.

[0020] The following specifically describes the specific solutions of a method and system for detecting abnormal road traffic behaviors based on computer vision provided by the present invention with reference to the accompanying drawings.

[0021] Please refer to Figure 1 , which shows the first object of the present invention, the flowchart of the steps of a method for detecting abnormal road traffic behaviors based on computer vision. The method includes the following steps: Step S001: Continuously collect lane images and perform preprocessing to obtain the preprocessed images of each lane image.

[0022] Since the position and angle of the in-vehicle camera are fixed relative to the vehicle, the shooting lane angle of the in-vehicle camera changes with the angle of the vehicle head relative to the lane; the present invention needs to use the in-vehicle camera to continuously collect lane images during driving and extract lane lines for subsequent analysis and recognition of the vehicle driving state.

[0023] Specifically, continuously collect lane images and perform preprocessing to obtain the preprocessed images of each lane image. The specific method is as follows: Collect the road images taken during the vehicle driving process using the in-vehicle camera at a preset time interval t, the duration of collecting the road images is T, use the edge detection algorithm to extract the lane lines of each road image, and traverse the images processed by the edge detection algorithm in the image collection order to obtain a series of preprocessed images with clearly visible lane lines.

[0024] It should be noted that in this embodiment, the time interval t, the duration T for collecting road images, and the edge detection algorithm are not limited. The specific situation depends on the actual implementation. In this embodiment, the time interval is 0.2 seconds, the duration for collecting road images is 3600 seconds, and the canny algorithm is used as the edge detection algorithm.

[0025] Step S002: Obtain the marked distance of each preprocessed image according to the distance between the lane line and the lower edge of the image in each preprocessed image; obtain the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed image; obtain the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image.

[0026] It should be further noted that in the traditional technology, an in-vehicle camera is used to determine whether a vehicle deviates from the lane, so as to analyze whether there is dangerous driving behavior of the vehicle; however, this judgment method based only on the situation of vehicle lane departure has certain limitations in practice, and its accuracy needs to be improved. Because in a complex road environment, it is completely reasonable and common for a vehicle to temporarily deviate from the lane due to reasons such as normal lane change, avoiding obstacles, or following traffic instructions. Therefore, it is not comprehensive and accurate enough to define dangerous driving only by whether the vehicle deviates from the lane; when the vehicle is driving within the lane, it may also be in a highly dangerous state due to some improper behaviors of the driver. For example, when the driver is driving under the influence of alcohol or operating irregularly, the driver may make irregular, frequent and small direction adjustments within the lane, or drive at a high speed under poor road conditions. These driving behaviors also constitute dangerous driving. However, since these small changes may not cause the vehicle to deviate significantly from the lane, the traditional lane departure warning system may be difficult to capture and issue an effective alarm in time, thus increasing the hidden danger of driving safety.

[0027] It should be further noted that when the vehicle is exactly driving in the center of the lane and its traveling direction is almost completely parallel to the lane line, the visual distance between the lane lines at the bottom of the image captured by the in-vehicle camera will appear shorter or narrower; when the vehicle deviates more towards the edge of the lane and the angle between its traveling direction and the lane line is larger, the visual distance between the lane lines captured by the in-vehicle camera at the bottom of the image will appear wider or longer; therefore, the present invention needs to obtain the two intersection points between the lower edge and the lane line in the preprocessed image of each lane image, and judge the dangerous driving situation of the vehicle according to the change of the distance between the two intersection points in different preprocessed images.

[0028] Specifically, the marked distance of each preprocessed image is obtained according to the distance between the intersection point of the lane line and the lower edge of the image in each preprocessed image. The specific method is as follows: Calculate the number of pixel points between the line segments connecting the two intersection points where the lane line intersects the lower edge of the image in each preprocessed image. The number of pixel points on the line segment connecting the two intersection points where the lane line intersects the lower edge of the image in each preprocessed image is recorded as the marked distance of the preprocessed image.

[0029] It should be noted that the marked distance of each preprocessed image will change with the relative position and relative angle between the vehicle and the lane line during the vehicle's driving process. When the marked distance is smaller, it indicates that the vehicle's driving position is closer to the middle position between the two lane lines, and the driving position is relatively safe, that is, the probability of the vehicle having abnormal driving conditions is lower. Therefore, the vehicle abnormal driving probability parameter of each preprocessed image needs to be obtained according to the marked distance of each preprocessed image. The specific method is as follows: In the formula, represents the vehicle abnormal driving probability parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the i-th preprocessed image, and x represents the image acquisition serial number. The vehicle abnormal driving probability parameter of each preprocessed image during the vehicle's driving process is obtained according to the above method.

[0030] It should be noted that when the vehicle abnormal driving probability parameter of the x-th preprocessed image is larger, it indicates that the vehicle's driving position at this moment is more deviated from the middle position between the two lane lines compared to all previous moments, or the angle between the vehicle's driving direction and the lane line at this moment is larger compared to all previous moments. This makes the probability of the vehicle being in danger larger, and the possibility of the vehicle having dangerous driving behavior is higher. When the vehicle abnormal driving probability parameter of the x-th preprocessed image is smaller, it indicates that the vehicle's driving position at this moment is closer to the middle position between the two lane lines compared to all previous moments, or the angle between the vehicle's driving direction and the lane line at this moment is smaller compared to all previous moments, that is, the vehicle's driving direction is more parallel to the lane line. This makes the probability of the vehicle being in danger smaller, and the probability of the vehicle having dangerous driving behavior is lower.

[0031] It should be further noted that in some cases, the vehicle may temporarily deviate from the lane due to normal lane changes, avoiding obstacles, or following traffic instructions, resulting in a relatively large abnormal driving probability parameter for the preprocessed image obtained at this time. However, the vehicle is in a normal driving state at this moment. Therefore, it is accurate enough to judge the possibility of dangerous driving behavior of the vehicle only based on the angle between the vehicle driving direction and the lane line and the relative position of the vehicle and the lane line. Therefore, in this step, it is necessary to obtain the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image. If the marked distance of each preprocessed image changes regularly or shows a trend during the vehicle driving process, the probability that the vehicle may be driving on a complex road section or the vehicle may be changing lanes is relatively high. At this time, only judging the probability of abnormal driving of the vehicle based on the abnormal driving probability parameter of the vehicle may be on the high side.

[0032] Specifically, according to the change trend of the marked distance of each preprocessed image, obtain the vehicle driving trend parameter of each preprocessed image. The specific method is as follows: Set a data set of the marked distance data of the preprocessed images required to judge the vehicle driving trend. The length of this data set is n, and the data set contains the marked distance data of n consecutive preprocessed images. After calculating the vehicle driving trend parameter each time, the marked distance data in the data set is cleared, and the marked distance data is refilled after calculating the vehicle driving trend parameter next time. In the formula, represents the vehicle driving trend parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the j-th preprocessed image. Obtain the vehicle driving trend parameter of each preprocessed image according to the above method.

[0033] It should be noted that when the vehicle is driving, The smaller the value is, the closer the marked distance of the x-th preprocessed image is to the general level of the change of the marked distances of the n preprocessed images continuously adjacent to the x-th preprocessed image in the data set. That is, the vehicle driving state corresponding to the acquisition moment of the x-th preprocessed image conforms to the vehicle driving law more, and the probability that the vehicle may have dangerous driving behavior is lower. That is, the smaller the abnormal driving probability parameter of the vehicle at a certain moment is, the lower the probability that the vehicle may have dangerous driving behavior at this moment. In this embodiment, the length n of the data set is not limited, but it is necessary to ensure that the length n of the data set remains unchanged during the data calculation process of one start-stop period of the vehicle. In this embodiment, the length n of the data set is 20, and in other embodiments, the length of the data set depends on the specific implementation situation.

[0034] It should be further noted that to a certain extent, the vehicle driving trend parameters can be used to judge the probability of dangerous driving behavior from the change trend of the marked distance in the preprocessed images. However, the core logic of this step is to refer to the deviation degree between the predicted value and the actual value of the marked distance change during driving, without considering the stability of vehicle driving. There may be behaviors of the vehicle swaying left and right, but the swaying amplitude is relatively regular or close, resulting in the predicted value being close to the actual value and being judged as normal driving. The vehicle swaying left and right may be caused by driving too fast on an uneven road surface. At this time, the driver should be reminded to slow down. Since vehicle types may be different and the stability of the vehicle itself is also different, it is necessary to judge whether the driver's behavior belongs to dangerous driving based on the fluctuation amplitude of the marked distance corresponding to the vehicle in the preprocessed images at the current moment and the fluctuation amplitude of the marked distance corresponding to the vehicle in the preprocessed images at all previous moments.

[0035] Specifically, calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image. The specific method is as follows: In the formula, represents the vehicle fluctuation parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the (x - 1)-th preprocessed image, represents the marked distance of the I-th preprocessed image, represents the marked distance of the (I - 1)-th preprocessed image. Obtain the vehicle fluctuation parameter of any preprocessed image according to this method.

[0036] It should be noted that represents the difference between the marked distance of the x-th preprocessed image and the marked distance of the previous preprocessed image. When the vehicle fluctuation parameter of the x-th preprocessed image is smaller, it indicates that the fluctuation of the marked distance in this preprocessed image is flatter compared to the general fluctuation of the marked distances of all previous preprocessed images, which means that the driving state is safer at this time and the probability of the vehicle having dangerous driving behavior is lower. When the vehicle fluctuation parameter of the x-th preprocessed image is smaller, it indicates that the fluctuation amplitude of the marked distance in this preprocessed image is larger compared to the general fluctuation amplitude of the marked distances of all previous preprocessed images, which means that the driving state is relatively dangerous at this time and the probability of the vehicle having dangerous driving behavior is higher.

[0037] Step S003: Set a threshold and comprehensively judge whether the vehicle has dangerous driving behavior and issue a reminder according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image.

[0038] The above method obtains the vehicle abnormal driving probability parameters, vehicle driving trend parameters, and vehicle fluctuation parameters for each pre-processed image. Now it is necessary to combine the vehicle abnormal driving probability parameters, vehicle driving trend parameters and vehicle fluctuation parameters, set thresholds to comprehensively judge whether the vehicle has dangerous driving behavior, and issue reminders to the driver based on the judgment.

[0039] Specifically, according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each pre-processed image, a threshold is set and a comprehensive judgment is made as to whether the vehicle has dangerous driving behavior and a reminder is issued. The specific method is as follows: In the formula, represents the dangerous driving behavior parameters of the vehicle in the xth preprocessed image, represents the vehicle abnormal driving probability parameter of the xth pre-processed image, Represents the vehicle driving trend parameter of the xth preprocessed image, Represents the vehicle fluctuation parameter of the xth preprocessed image, and obtains the vehicle dangerous driving behavior parameter of each preprocessed image according to the above method; sets a threshold G, and during the vehicle driving process, calculates the vehicle dangerous driving behavior parameter of the last preprocessed image each time, and compares the vehicle dangerous driving behavior parameter with the threshold G. When the vehicle dangerous driving behavior parameter is greater than or equal to the threshold G, the driver is reminded to pay attention to standard driving through the vehicle audio.

[0040] It should be noted that when the vehicle abnormal driving probability parameter is larger, the vehicle driving trend parameter is larger, and the vehicle fluctuation parameter is larger, the vehicle dangerous driving behavior parameter is larger, and the probability that the vehicle has dangerous driving behavior is higher. In this embodiment, the value of the threshold G is 0.472. The value of the threshold in other embodiments depends on the specific implementation situation. At this point, the road traffic behavior anomaly detection method and system based on computer vision are completed.

[0041] See also Figure 2, which shows the second object of the present invention, a structural block diagram of a road traffic behavior anomaly detection system based on computer vision. The system includes the following modules: an image acquisition module, configured to continuously acquire lane images and perform preprocessing to obtain a preprocessed image of each lane image; an image data calculation module, configured to obtain a marked distance of each preprocessed image according to the distance between the lane line and the lower edge of the image in each preprocessed picture; obtain a vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed image; obtain a vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; obtain a vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; obtain the fluctuation amplitude of the marked distance of each preprocessed image, and obtain a vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image; a data judgment module, configured to set a threshold according to the vehicle abnormal driving probability parameter, the vehicle driving trend parameter, and the vehicle fluctuation parameter of each preprocessed image, and comprehensively judge whether there is a dangerous driving behavior of the vehicle and issue a reminder.

[0042] The third object of the embodiments of the present invention is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for detecting abnormal road traffic behavior based on computer vision are implemented.

[0043] The fourth object of the embodiments of the present invention is to provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for detecting abnormal road traffic behavior based on computer vision are implemented.

[0044] In this embodiment, lane images are continuously collected and preprocessed to obtain preprocessed images of each lane image, in order to judge the continuous driving state of the vehicle and exclude the influence of other factors in the image; the marked distance of each preprocessed image is obtained according to the distance between the lane line and the lower edge of the image in each preprocessed picture; the method for obtaining the marked distance is relatively simple, with less computational complexity compared to traditional lane line detection methods, and is applicable to various complex road sections. Even in the case of vehicle congestion, it does not affect the judgment of the abnormal state of the vehicle; the vehicle abnormal driving probability parameter of each preprocessed image is obtained according to the marked distance of each preprocessed image; by judging the change in the size of the marked distance, it can be determined whether the vehicle is in a position close to the center of the lane, or whether the driving direction of the vehicle is close to parallel to the lane line, and it can be preliminarily judged whether the position of the current vehicle relative to the lane line is dangerous during driving; according to the change trend of the marked distance of each preprocessed image, the vehicle driving trend parameter of each preprocessed image is obtained; it is considered that in some cases, the vehicle may temporarily deviate from the lane due to normal lane change, avoiding obstacles or following traffic instructions, etc., resulting in a relatively large abnormal driving probability parameter for the preprocessed image obtained at this time, but the vehicle is in a normal driving state at this moment; judging whether the vehicle deviates from the lane due to reasons such as normal lane change according to the vehicle driving trend can, to a certain extent, avoid false warnings of dangerous driving behavior based on the relative position of the vehicle and the lane line; the fluctuation range of the marked distance of each preprocessed image is obtained, and according to the fluctuation range of the marked distance of each preprocessed image, the vehicle fluctuation parameter of any preprocessed image is obtained; by judging the vehicle running stability, it can be determined whether there is an irregular operation behavior of the vehicle, and to a certain extent, it can distinguish dangerous driving behaviors such as the driver making irregular, frequent and small direction adjustments in the lane, or driving at high speed when the road conditions are bad; according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, a threshold is set and it is comprehensively judged whether there is dangerous driving behavior of the vehicle and a reminder is issued; comprehensively judging whether there is dangerous driving behavior of the vehicle based on the relative position of the vehicle and the lane line, vehicle driving trend, and vehicle running stability is more accurate than the existing dangerous driving behavior judgment methods and can better avoid the occurrence of dangerous driving behavior.

[0045] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0046] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to produce a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing the functions specified in one or more flows and / or blocks Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0047] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means for implementing the functions specified in one or more flows and / or blocks Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows and / or blocks Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific embodiments of the present invention. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.

Claims

1. A method for detecting abnormal road traffic behaviors based on computer vision, characterized in that, The method includes the following steps: continuously collecting lane images and performing preprocessing to obtain preprocessed images of each lane image; obtaining the marked distance of each preprocessed image according to the distance between the lane line and the lower edge of the image in each preprocessed picture; obtaining the vehicle abnormal driving probability parameter of each preprocessed image according to the marked distance of each preprocessed image; obtaining the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image; the specific method for obtaining the vehicle driving trend parameter of each preprocessed image according to the change trend of the marked distance of each preprocessed image is: setting a data set of marked distance data of preprocessed images required to judge the vehicle driving trend, the length of the data set is n, and the data set contains the marked distance data of n consecutive sequence preprocessed images. After calculating the vehicle driving trend parameter each time, the marked distance data in the data set is cleared, and the marked distance data is refilled after calculating the vehicle driving trend parameter next time; In the formula, represents the vehicle driving trend parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the j-th preprocessed image; calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image; according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, set a threshold and comprehensively judge whether the vehicle has dangerous driving behavior and issue a reminder.

2. The method for detecting abnormal road traffic behaviors based on computer vision according to claim 1, wherein The method for obtaining the marked distance of each pre - processed image according to the distance between the lane line and the lower edge of the image in each pre - processed image includes the following specific steps: The road images taken during the vehicle driving process are collected by the in - vehicle camera at a preset time interval t, and the duration of collecting the road images is T. The edge detection algorithm is used to extract the lane lines of each road image, and the images processed by the edge detection algorithm are traversed in the image acquisition order to obtain a series of pre - processed images with clear lane lines visible.

3. The method for detecting abnormal road traffic behaviors based on computer vision according to claim 1, characterized in that, The method for obtaining the vehicle abnormal driving probability parameter of each pre - processed image according to the marked distance of each pre - processed image includes the following specific steps: Calculate the number of pixel points between the line segments connecting the two intersection points where the lane line intersects the lower edge of the image in each pre - processed image. The number of pixel points on the line segment connecting the two intersection points where the lane line intersects the lower edge of the image in each pre - processed image is recorded as the marked distance of this pre - processed image.

4. The method for detecting abnormal road traffic behaviors based on computer vision according to claim 1, characterized in that, Obtaining the vehicle abnormal driving probability parameter for each preprocessed image, including the specific method as follows: In the formula, represents the vehicle abnormal driving probability parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the i-th preprocessed image, and x represents the image acquisition serial number.

5. The method for detecting abnormal road traffic behaviors based on computer vision according to claim 1, wherein, Calculate the fluctuation amplitude of the marked distance of each preprocessed image, and obtain the vehicle fluctuation parameter of any preprocessed image according to the fluctuation amplitude of the marked distance of each preprocessed image. The specific method includes: In the formula, represents the vehicle fluctuation parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the (x - 1)-th preprocessed image, represents the marked distance of the I-th preprocessed image, represents the marked distance of the (I - 1)-th preprocessed image.

6. The method for detecting abnormal road traffic behaviors based on computer vision according to claim 1, wherein, Setting a threshold based on the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each preprocessed image, and comprehensively determining whether there is dangerous driving behavior of the vehicle and issuing a reminder, the specific method included is as follows: In the formula, represents the vehicle dangerous driving behavior parameter of the x-th preprocessed image, represents the vehicle abnormal driving probability parameter of the x-th preprocessed image, represents the vehicle driving trend parameter of the x-th preprocessed image, represents the vehicle fluctuation parameter of the x-th preprocessed image; Set a threshold G. During the vehicle driving process, each time the vehicle dangerous driving behavior parameter of the last pre - processed image is calculated, compare the size of the vehicle dangerous driving behavior parameter with the threshold G. When the vehicle dangerous driving behavior parameter is greater than or equal to the threshold G, the driver is reminded to pay attention to driving in a standardized manner through the in - vehicle audio.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it realizes the steps of a method for detecting abnormal road traffic behavior based on computer vision according to any one of claims 1 to 6.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it realizes the steps of a method for detecting abnormal road traffic behavior based on computer vision according to any one of claims 1 to 6.

9. A road traffic behavior anomaly detection system based on computer vision, characterized in that, The system includes the following modules: An image acquisition module, which is used to continuously collect lane images and perform pre - processing to obtain the pre - processed image of each lane image; An image data calculation module, which is used to obtain the marked distance of each pre - processed image according to the distance between the lane line and the lower edge of the image in each pre - processed image; Obtain the vehicle abnormal driving probability parameter of each pre - processed image according to the marked distance of each pre - processed image; Obtain the vehicle driving trend parameter of each pre - processed image according to the change trend of the marked distance of each pre - processed image; The method for obtaining the vehicle driving trend parameters of each preprocessed image according to the change trend of the marked distance specifically includes: setting a data set of the marked distance data of the preprocessed image required to judge the vehicle driving trend. The length of the data set is n, and the data set contains the marked distance data of n consecutive sequences of preprocessed images. After each calculation of the vehicle driving trend parameters, the marked distance data in the data set is cleared, and the marked distance data is re-filled after the next calculation of the vehicle driving trend parameters; In the formula, represents the vehicle driving trend parameter of the x-th preprocessed image, represents the marked distance of the x-th preprocessed image, represents the marked distance of the j-th preprocessed image; Calculate the fluctuation amplitude of the marked distance of each pre - processed image, and obtain the vehicle fluctuation parameter of any pre - processed image according to the fluctuation amplitude of the marked distance of each pre - processed image; A data judgment module, which is used to set a threshold and comprehensively judge whether the vehicle has dangerous driving behavior and issue a reminder according to the vehicle abnormal driving probability parameter, vehicle driving trend parameter, and vehicle fluctuation parameter of each pre - processed image.

Citation Information

Patent Citations

  • Abnormal driving behavior early warning system, method and device

    CN115140068A

  • Early warning method, device and equipment for vehicle fatigue driving and readable storage medium

    CN116279561A

  • Auxiliary driving method, device and equipment and storage medium

    CN118722618A