Vehicle illegal lane-changing behavior detection method, device and computer equipment
By acquiring the target lane lines and vehicle positions in video frames, and using computer vision technology to detect illegal lane changes, the problem of low reliability of detection results in existing methods is solved, and efficient and accurate detection of illegal lane changes is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2021-08-25
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for detecting illegal lane changes by vehicles suffer from low reliability and low efficiency, especially video surveillance and inductive loop detection methods, which are costly and susceptible to malfunctions.
By acquiring adjacent video frames in the video to be detected, the target lane line is determined, and the lateral and longitudinal orientation of the target vehicle relative to the lane line is obtained. Computer vision technology is used to detect illegal lane changing behavior of vehicles, including vehicle detection and lane line detection. Neural network models and convolutional neural networks are used for image processing and feature analysis.
It improves the accuracy and reliability of detecting illegal lane changes by vehicles, reduces labor costs, and minimizes misjudgments during the detection process.
Smart Images

Figure CN115731485B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video surveillance technology, specifically to a method, device, and computer equipment for detecting illegal lane changes by vehicles. Background Technology
[0002] Frequent urban traffic accidents have become a major pain point and hidden danger in traffic management, especially illegal lane changing, which occurs more frequently than other violations such as fatigued driving and drunk driving. Therefore, the detection of illegal lane changing is particularly important.
[0003] Existing methods for detecting illegal lane changes mainly rely on video surveillance and inductive loop detectors. Video surveillance involves installing static cameras at fixed locations to monitor driving behavior, but this method is not only labor-intensive and inefficient, but also highly susceptible to subjective human factors, resulting in unreliable detection results. Inductive loop detectors, on the other hand, involve burying inductive loops in specific road sections and marking no-lane-changing zones. When a vehicle passes over these zones, the metal body cuts the magnetic field lines of the loops, generating an induced electromotive force to detect illegal lane changes. However, this method also suffers from high costs and significant limitations. For example, the high repair costs of repairing a faulty inductive loop can severely impact the reliability of detection results in the short term.
[0004] Therefore, existing methods for detecting illegal lane changes by vehicles suffer from technical problems, such as low reliability of detection results due to limitations in the detection methods. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, device, and computer equipment for detecting illegal lane changing behavior of vehicles to address the above-mentioned technical problems, so as to improve the detection accuracy of illegal lane changing behavior of vehicles, enhance the reliability of detection results, and improve the detection efficiency of illegal vehicle behavior.
[0006] Firstly, this application provides a method for detecting illegal lane changing behavior of vehicles, the method comprising:
[0007] Obtain the first and second video frames from the video to be detected. The first and second video frames are adjacent video frames in the video to be detected that contain the target vehicle.
[0008] The target lane line is determined in the first video frame and the second video frame, and the position of the target lane line is matched in the adjacent video frames;
[0009] For the first video frame and the second video frame, the lateral and longitudinal positions of the target vehicle relative to the target lane line are obtained respectively.
[0010] Based on lateral and longitudinal orientation, the illegal lane-changing behavior of the target vehicle is detected.
[0011] In some embodiments of this application, obtaining a first video frame and a second video frame from a video to be detected includes: obtaining the video to be detected; performing frame extraction on the video to be detected based on a preset frequency to obtain more than one video frame; analyzing the video frames and filtering out adjacent video frames containing the target vehicle and candidate lane lines to obtain a first video frame and a second video frame; wherein the candidate lane lines are matched in the positions of adjacent video frames.
[0012] In some embodiments of this application, analyzing video frames and filtering out adjacent video frames containing the target vehicle and candidate lane lines to obtain a first video frame and a second video frame includes: performing vehicle detection on the video frames and filtering out adjacent video frames containing the target vehicle as first candidate video frames; performing lane line detection on the first candidate video frames and filtering out first candidate video frames containing lane lines as second candidate video frames; obtaining lane line position information of each lane line in the second candidate video frames; and for the second candidate video frames, selecting lane lines whose corresponding lane line position information matches as candidate lane lines to obtain the first video frame and the second video frame.
[0013] In some embodiments of this application, obtaining lane line position information of each lane line in a second candidate video frame includes: performing binarization processing on the second candidate video frame to obtain mask information of each lane line in the second candidate video frame; performing connected component detection on the second candidate video frame based on the mask information to obtain lane line connected components; and performing straight line fitting on the centerline of the lane line connected components to filter and obtain lane line position information of each lane line.
[0014] In some embodiments of this application, the centerline of the lane line connected region is fitted with a straight line to obtain the lane line position information of each lane line. This includes: using the least squares method to analyze the pixel coordinates contained in the lane line connected region to obtain the centerline of the lane line connected region; fitting the centerline of the lane line connected region with a straight line to obtain the position information of the centerline in the corresponding second candidate video frame, the position information including the slope value of the straight line; counting the pixel coordinates to obtain the mask area of the lane line connected region; selecting the centerline with a corresponding mask area greater than or equal to a preset area threshold and a corresponding straight line slope value less than or equal to a preset slope threshold as the target centerline; and using the position information of the target centerline as the lane line position information of each lane line.
[0015] In some embodiments of this application, for a second candidate video frame, lane lines whose corresponding lane line position information matches are selected as candidate lane lines, and a first video frame and a second video frame are obtained by filtering. This includes: extracting the longitudinal intercept values of the first lane line position information and the second lane line position information respectively to obtain a first longitudinal intercept value and a second longitudinal intercept value; obtaining the absolute value of the difference between the first longitudinal intercept value and the second longitudinal intercept value to obtain a route similarity score; if the route similarity score reaches a preset score threshold, it is determined that the corresponding lane lines match; selecting the matched lane lines as candidate lane lines, and selecting a second candidate video frame containing the candidate lane lines as the first video frame and the second video frame; wherein, the first lane line position information and the second lane line position information are the lane line position information of the lane lines contained in any two adjacent video frames in the second candidate video frame, respectively.
[0016] In some embodiments of this application, determining the target lane line in the first video frame and the second video frame includes: if the first video frame and the second video frame contain at least two candidate lane lines, then obtaining the vehicle position information of the target vehicle in the first video frame and the second video frame; calculating the distance information between the vehicle position information and each candidate lane line; analyzing each distance information corresponding to each candidate lane line, and determining the candidate lane line corresponding to the minimum distance value among the distance information as the target lane line.
[0017] In some embodiments of this application, for a first video frame and a second video frame, the lateral and longitudinal positions of the target vehicle relative to the target lane line are obtained, respectively, including: for the first video frame and the second video frame, the lateral position of the target vehicle relative to the target lane line is obtained, to obtain a first lateral position of the target vehicle in the first video frame and a second lateral position of the target vehicle in the second video frame; for the first video frame and the second video frame, the longitudinal position of the target vehicle relative to the target lane line is obtained, to obtain a first longitudinal position of the target vehicle in the first video frame and a second longitudinal position of the target vehicle in the second video frame; wherein, the lateral position includes left and right positions, and the longitudinal position includes valid longitudinal position and invalid longitudinal position.
[0018] In some embodiments of this application, the lateral orientation includes a first lateral orientation and a second lateral orientation, and the longitudinal orientation includes a first longitudinal orientation and a second longitudinal orientation. Based on the lateral orientation and the longitudinal orientation, the detection of illegal lane-changing behavior of the target vehicle includes: if the first lateral orientation and the second lateral orientation do not match, then analyzing the first longitudinal orientation and the second longitudinal orientation; if the first longitudinal orientation and the second longitudinal orientation match, and both the first longitudinal orientation and the second longitudinal orientation are valid longitudinal orientations, then determining that the target vehicle has engaged in illegal lane-changing behavior; wherein, the valid longitudinal orientation is defined as the orientation where the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route, the maximum longitudinal value of the vehicle is the maximum longitudinal value of the vehicle detection box corresponding to the target vehicle, and the minimum longitudinal value of the route is the minimum longitudinal value of the target lane line.
[0019] Secondly, this application provides a device for detecting illegal lane changing behavior of vehicles, the device comprising:
[0020] The video acquisition module is used to acquire the first video frame and the second video frame in the video to be detected. The first video frame and the second video frame are adjacent video frames in the video to be detected that contain the target vehicle.
[0021] The route determination module is used to determine the target lane line in the first video frame and the second video frame, and the position of the target lane line is matched in the adjacent video frames;
[0022] The orientation acquisition module is used to acquire the lateral and longitudinal orientations of the target vehicle relative to the target lane line for the first video frame and the second video frame, respectively.
[0023] The behavior detection module is used to detect illegal lane-changing behavior of target vehicles based on lateral and longitudinal orientation.
[0024] Thirdly, this application also provides a computer device, comprising:
[0025] One or more processors;
[0026] The memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement a method for detecting illegal lane changes by vehicles.
[0027] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the method for detecting illegal lane changes by vehicles.
[0028] Fifthly, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the first aspect described above.
[0029] The aforementioned method, apparatus, and computer equipment for detecting illegal lane changes by means of a server that acquires a first video frame and a second video frame containing the target vehicle in the video to be detected, and determines the target lane line in the first and second video frames. For the first and second video frames, the server acquires the lateral and longitudinal positions of the target vehicle relative to the target lane line, respectively. Based on the lateral and longitudinal positions, the server detects the illegal lane change behavior of the target vehicle. This detection method can effectively improve the detection accuracy of illegal lane changes by vehicles, thereby improving the reliability of the detection results. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic diagram of a scenario for the vehicle illegal lane change detection method in the embodiments of this application;
[0032] Figure 2 This is a flowchart illustrating the method for detecting illegal lane changes by vehicles in this application embodiment;
[0033] Figure 3 This is a schematic diagram of the specific process of the vehicle illegal lane change detection method in the embodiments of this application;
[0034] Figure 4 This is a schematic diagram illustrating the effect of the vehicle inspection steps in the embodiments of this application;
[0035] Figure 5 This is a schematic diagram illustrating the effect of the lane line detection step in the embodiments of this application;
[0036] Figure 6 This is a schematic diagram illustrating the effect of the vehicle illegal lane change detection steps in the embodiments of this application;
[0037] Figure 7 This is a schematic diagram of the vehicle lane change violation detection device in the embodiments of this application;
[0038] Figure 8This is a schematic diagram of the structure of the computer device in the embodiments of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0041] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0042] In this application embodiment, the method for detecting illegal lane changes by vehicles mainly involves computer vision (CV) technology within artificial intelligence (AI). Artificial intelligence utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to obtain optimal results—theories, methods, technologies, and application systems. In other words, artificial intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine capable of reacting in a manner similar to human intelligence.
[0043] In this application embodiment, computer vision is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes for target recognition, tracking, and measurement, and further performs image processing to create images more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, attempting to establish artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and also common biometric recognition technologies such as face recognition and fingerprint recognition. In this application, for the video to be detected, CV mainly implements image detection within Image Semantic Understanding (ISU).
[0044] It should also be noted that the vehicle lane change violation detection method provided in this application embodiment can be applied to, for example, Figure 1 The illustrated vehicle lane change violation detection system includes a terminal 100 and a server 200. The terminal 100 can be a device that includes both receiving and transmitting hardware, meaning it has receiving and transmitting hardware capable of performing bidirectional communication over a two-way communication link. Such a device can include cellular or other communication equipment with a single-line display, a multi-line display, or no multi-line display. Specifically, the terminal 100 can be a desktop terminal or a mobile terminal, such as a mobile phone, tablet, laptop, or a camera installed at the monitoring site for information collection, storage, and transmission, or a vehicle dashcam. The server 200 can be a standalone server or a server network or server cluster, including but not limited to computers, network hosts, single network servers, multiple network server sets, or cloud servers composed of multiple servers. The cloud server consists of a large number of computers or network servers based on cloud computing.
[0045] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of computer devices shown is more or less, for example Figure 1Only one server (200) is shown; it is understandable that this vehicle lane-changing violation detection system may include one or more other servers, which are not specified here. Additionally, as... Figure 1 As shown, the vehicle lane change violation detection system may also include a memory for storing data, such as video surveillance data.
[0046] It should also be noted that, Figure 1 The schematic diagram of the vehicle lane change violation detection system shown is merely an example. The vehicle lane change violation detection system and scenario described in this embodiment are for the purpose of more clearly illustrating the technical solutions of this embodiment and do not constitute a limitation on the technical solutions provided by this embodiment. As those skilled in the art will know, with the evolution of vehicle lane change violation detection systems and the emergence of new business scenarios, the technical solutions provided by this embodiment are also applicable to similar technical problems.
[0047] See Figure 2 This application provides a method for detecting illegal lane changing behavior of vehicles. This embodiment mainly applies this method to the above-mentioned... Figure 1 Taking server 200 as an example, the method includes steps S201 to S204, as follows:
[0048] S201, acquire the first video frame and the second video frame in the video to be detected, wherein the first video frame and the second video frame are adjacent video frames in the video to be detected that contain the target vehicle.
[0049] The video to be detected includes, but is not limited to, short videos and long videos. Short videos can be less than 10 minutes long, and long videos can be more than 10 minutes long. Specifically, the video to be detected can be a traffic monitoring video, used by server 200 to detect certain violations by vehicles appearing in it, including but not limited to illegal lane changes mentioned below. The device providing the video to be detected can be a static camera as described above, or a dynamic camera mounted inside a vehicle; this application does not specify a particular device.
[0050] The first video frame and the second video frame are adjacent video frames from the same video segment to be detected, and the adjacent video frames should contain detectable vehicles and lane lines.
[0051] The target vehicle can be one that appears simultaneously in the first video frame and the second video frame, and is designated by the user or planned in the default order as the vehicle to be detected.
[0052] In specific implementation, server 200 can obtain the real-time video fed back by terminal 100 as the video to be detected. However, if server 200 is not connected to terminal 100 at the current moment, server 200 can randomly determine a traffic monitoring video in the database as the video to be detected, and then perform frame extraction processing on the video to be detected to obtain more than one video frame. Finally, the first video frame and the second video frame that can be used as the basis for subsequent processing are selected from the obtained video frames. The video frame selection steps involved in this embodiment will be described in detail below.
[0053] In one embodiment, this step includes: acquiring a video to be detected; performing frame extraction on the video to be detected based on a preset frequency to obtain more than one video frame; analyzing the video frames and filtering out adjacent video frames containing the target vehicle and candidate lane lines to obtain a first video frame and a second video frame; wherein the candidate lane lines are matched in the positions of the adjacent video frames.
[0054] The preset frequency can be the frame rate preset for frame extraction, and the frame rate should be large enough in this embodiment of the application so that the position of lane lines and vehicles in two consecutive captured frames does not change much.
[0055] In this context, candidate lane lines may or may not be target lane lines. Candidate lane lines should have matching positions in adjacent video frames to be considered as candidate routes for selecting the target lane line. For example, if the first video frame contains lane lines A, B, and C, and the second video frame contains lane lines A, C, and D, and lane lines A and C have matching positions in adjacent video frames, then lane lines A and C can be candidate lane lines, while the target lane line can be selected from lane lines A and C.
[0056] In practice, the detection and determination of illegal lane changing behavior mainly relies on the analysis and judgment of image features in the video. Therefore, after acquiring the video to be detected, the server 200 can use tools such as OpenCV or ffmpeg to perform frame extraction on the video, that is, extract more than one video frame. Then, the vehicle and lane lines are analyzed on the more than one video frame, and adjacent video frames containing the target vehicle and candidate lane lines are initially selected as the first video frame and the second video frame. Finally, the vehicles and lane lines in the first and second video frames can be analyzed to determine whether the target vehicle in the video to be detected has engaged in illegal lane changing behavior.
[0057] In one embodiment, analyzing video frames and filtering out adjacent video frames containing the target vehicle and candidate lane lines to obtain a first video frame and a second video frame includes: performing vehicle detection on the video frames and filtering out adjacent video frames containing the target vehicle as first candidate video frames; performing lane line detection on the first candidate video frames and filtering out first candidate video frames containing lane lines as second candidate video frames; obtaining lane line position information for each lane line in the second candidate video frames; and for the second candidate video frames, selecting lane lines whose corresponding lane line position information matches as candidate lane lines to obtain the first video frame and the second video frame.
[0058] The adjacent video frames include, but are not limited to, two adjacent video frames, or at least two adjacent video frames. However, this application embodiment only explains two adjacent video frames, but it does not exclude the possibility that more than two adjacent video frames can be analyzed in other embodiments, or even that two or more video frames can be extracted at intervals as adjacent video frames in a series of similar video frames.
[0059] For specific implementation details, please refer to [link / reference]. Figure 3 This application proposes using a trained neural network model to detect vehicles in video frames. Specifically, the trained neural network model is one that has undergone multiple iterations of training and possesses vehicle detection capabilities. Therefore, after acquiring more than one video frame, the server 200 can input each video frame into the aforementioned trained neural network model, causing it to output video frames with vehicle detection boxes, thus achieving the purpose of vehicle detection in the video frames.
[0060] At this point, since multiple video frames are sequentially input into the trained neural network model, the output of the trained neural network model is a sequence of video frames in the same input order. Each video frame in this sequence can be an image containing at least one vehicle detection box, meaning multiple vehicles are detected in a single frame. Alternatively, each video frame can also be an image without a vehicle detection box, meaning no vehicle is detected in a single frame. By filtering this video frame sequence, adjacent video frames containing the same target vehicle are obtained as the first candidate video frames. It is understood that the target vehicle can be a user-specified vehicle with a specific characteristic, such as color or texture features, or it can be a randomly determined vehicle.
[0061] Furthermore, after obtaining the first candidate video frame, the server 200 can perform lane line detection on it. This lane line detection step can also employ artificial intelligence technology, such as using a trained neural network model for target recognition and detection as mentioned above. Alternatively, it can utilize semantic segmentation technology based on convolutional neural networks, which will be explained in detail below. In summary, after obtaining the first candidate video frame containing the target vehicle and performing lane line detection, the server 200 can obtain a second candidate video frame containing both the target vehicle and lane lines. Then, the server 200 can further analyze the lane lines in each of the second candidate video frames to obtain lane line position information. Finally, it uses this lane line position information to filter out the first and second video frames, which will also be explained in detail below.
[0062] In one embodiment, obtaining lane line position information of each lane line in a second candidate video frame includes: performing binarization processing on the second candidate video frame to obtain mask information of each lane line in the second candidate video frame; performing connected component detection on the second candidate video frame based on the mask information to obtain lane line connected components; and performing straight line fitting on the centerline of the lane line connected components to filter and obtain lane line position information of each lane line.
[0063] The lane position information can be represented as the straight-line equation of each lane, for example, A i x+B i y+C i =0. The equation of the straight line is an image coordinate system that acts on the video frame image where the corresponding lane line is located. The origin of the image coordinate system is located at the top left corner of the video frame image. The positive horizontal axis (X) of the coordinate system is to the right of the origin, and the positive vertical axis (Y) of the coordinate system is below the origin.
[0064] For specific implementation details, please refer to [link / reference]. Figure 4 Before performing connected component detection on the second candidate video frame, server 200 can perform binarization processing on the second candidate video frame based on semantic segmentation technology using convolutional neural networks. This obtains the mask information of each lane line in the second candidate video frame, and sequentially divides the mask information into connected components to determine each connected component in the second candidate video frame. This connected component is defined as the set of boundary points of a continuous, uninterrupted region in the image, and these points have (x, y) coordinates in the image coordinate system. Then, server 200 can analyze each set of boundary points to obtain the centerline of each lane line connected component, and perform straight line fitting on each centerline to filter and obtain the lane line position information for each lane line. The lane line position information filtering step in this embodiment will be described in detail below.
[0065] In one embodiment, straight line fitting is performed on the centerline of the lane line connected region to filter and obtain the lane line position information of each lane line, including: using the least squares method to analyze the pixel coordinates contained in the lane line connected region to obtain the centerline of the lane line connected region; straight line fitting is performed on the centerline of the lane line connected region to obtain the position information of the centerline in the corresponding second candidate video frame, the position information including the slope value of the straight line; the pixel coordinates are counted to obtain the mask area of the lane line connected region; the centerlines with a corresponding mask area greater than or equal to a preset area threshold and a corresponding straight line slope value less than or equal to a preset slope threshold are selected as the target centerlines; the position information of the target centerlines is used as the lane line position information of each lane line.
[0066] The least squares method is a mathematical tool widely used in many disciplines of data processing, such as error estimation, uncertainty, system identification and prediction, and forecasting. The least squares method can also be used for curve fitting.
[0067] The preset area threshold can be the lower limit of the area of the connected component mask used to filter out invalid lane lines. It is mainly composed of the total number of pixels and can be expressed as S. min .
[0068] The preset slope threshold can be the upper limit of the slope of the centerline of the connected region used to filter out invalid lane lines, and can be expressed as G. max .
[0069] In its implementation, server 200 can use the least squares method to obtain the centerline of the connected domain of the lane lines. This requires two preconditions: Assume three points are sampled on a plane: u(10,10), v(40,42), and w(20,45); and we want to fit these three points to a straight line with the equation y = ax + b. If the values of a and b are different, then the direction and position of this line in space will also be different. Therefore, the fitting process is essentially finding a and b in the equation of the straight line. Once a and b are determined, the straight line is obtained.
[0070] Further reading is available. Figure 3 The centerline obtained by the server 200 from the pixel coordinates of the connected domain of the lane lines may not meet the actual application requirements. That is, the state of the centerline is not smooth enough. Therefore, the server 200 needs to perform a straight line fitting operation, i.e. smoothing, so that the position information (straight line equation) of each lane line in the second candidate video frame is more accurate, and a high-precision straight line slope value can be obtained. This straight line slope value can be used to screen out invalid lane lines.
[0071] Furthermore, after obtaining the pixel coordinates contained in each lane line connected region, server 200 can count the pixel coordinates, that is, obtain the sum of the pixel coordinates contained in each lane line connected region, as the mask area of each lane line connected region. Finally, server 200 can analyze the mask area and straight line slope value of each lane line connected region, and filter out those with a mask area (S) less than a preset area threshold (S). min ), or the slope value (G) of the straight line is greater than the preset slope threshold (G). max The centerline of the lane is the centerline of the lane, and the remaining centerlines are the target centerlines. The equation of the straight line corresponding to the target centerline is equivalent to the lane position information of each lane.
[0072] In one embodiment, for a second candidate video frame, lane lines whose corresponding lane line position information matches are selected as candidate lane lines, and a first video frame and a second video frame are obtained by filtering. This includes: extracting the longitudinal intercept values of the first lane line position information and the second lane line position information respectively to obtain a first longitudinal intercept value and a second longitudinal intercept value; obtaining the absolute value of the difference between the first longitudinal intercept value and the second longitudinal intercept value to obtain a route similarity score; if the route similarity score reaches a preset score threshold, it is determined that the corresponding lane lines match; selecting the matched lane lines as candidate lane lines, and selecting a second candidate video frame containing the candidate lane lines as the first video frame and the second video frame; wherein, the first lane line position information and the second lane line position information are the lane line position information of any two adjacent video frames in the second candidate video frame, respectively.
[0073] The intercept of a line is divided into the x-intercept and the y-intercept. The x-intercept is the abscissa of the point where the line intersects the x-axis, and the y-intercept is the ordinate of the point where the line intersects the y-axis. To find the x-intercept, simply set Y = 0 and find X; to find the y-intercept, set X = 0 and find Y. For example, y = x - 1 has a x-intercept of 1 and a y-intercept of -1. The intercept of a line can be positive, negative, or zero.
[0074] In practical implementation, when the frame rate is sufficiently high, it can be assumed that the spatial position of the vehicle relative to the lane lines in the video does not change significantly. Based on this prior information, the lane line position information is then updated. After analyzing each second candidate video frame and obtaining the lane line position information for each lane, server 200 needs to set a prerequisite for selecting the first and second video frames to avoid incorrectly comparing different lane lines with the target vehicle in subsequent judgments, thus leading to misjudgments of the target vehicle's location relative to the lane lines. Specifically, the first and second video frames should simultaneously contain at least one identical lane line. Therefore, server 200 can extract the longitudinal intercept values of the first and second lane line position information from two adjacent second candidate video frames, respectively, to obtain the first longitudinal intercept value of each lane line in the previous frame and the second longitudinal intercept value of each lane line in the subsequent frame.
[0075] Furthermore, the absolute value of the difference between the first y-intercept value and the second y-intercept value yields the route similarity score. If this route similarity score reaches a preset threshold, it can be determined that the lane lines corresponding to the route similarity scores reaching the threshold are the same lane lines, and thus this lane line can be used as a candidate lane line. Therefore, adjacent second candidate video frames containing the candidate lane lines can be selected as the first video frame and the second video frame.
[0076] For example, there are currently two adjacent second candidate video frames, namely frame N and frame N+1. Frame N contains N lane lines, and the first lane line position information of lane line a is A. i x+B i y+C i =0; The (N+1)th frame of the image contains N' lane lines, among which the position information of the second lane line of lane line A is A′. i x+B′ i y+C′ i =0. At this time, the first y-intercept value is "C". i / B i The second ordinate intercept is "C". i / B' i "Route similarity score "L score "represented as When the route similarity score "L" score "When the minimum score threshold required for practical application is reached, lane line a can be determined to be the same lane line as lane line A, and can be used as candidate lane line B. Therefore, server 200 can select one of the adjacent video frames that simultaneously contains candidate lane line B from each of the second candidate video frames, and use it as the first video frame and the second video frame."
[0077] S202, determine the target lane line in the first video frame and the second video frame, and match the position of the target lane line in the adjacent video frames.
[0078] Specifically, if the first video frame and the second video frame contain more than one candidate lane line, i.e., multiple candidate lane lines, the server 200 can further filter the multiple candidate lane lines according to predetermined rules to select the target lane line that can be used as a reference for detecting illegal lane changing behavior of vehicles. The target lane line filtering steps involved in this embodiment will be described in detail below.
[0079] In one embodiment, this step includes: if the first video frame and the second video frame contain at least two candidate lane lines, then obtaining the vehicle position information of the target vehicle in the first video frame and the second video frame; calculating the distance information between the vehicle position information and each candidate lane line; analyzing each distance information corresponding to each candidate lane line, and determining the candidate lane line corresponding to the minimum distance among the distance information as the target lane line.
[0080] Specifically, if the server 200 detects that its acquired first and second video frames contain more than one candidate lane line, it can analyze the distance between the point and the line based on the vehicle position information of each candidate lane line, i.e., the straight line equation of each candidate lane line, combined with the vehicle position information of the target vehicle in the image, thereby obtaining the distance information between the target vehicle and each candidate lane line. It is understood that in the preceding vehicle detection step, the server 200 obtains an output result containing vehicle detection boxes. Therefore, the vehicle position information involved in this embodiment is actually the center point of each vehicle detection box, and the coordinates of this center point can be referenced to the image coordinate system in its respective image frame.
[0081] Furthermore, after analyzing and obtaining the distance information between each candidate lane line and the target vehicle, the server 200 can sort the distance information in ascending order of numerical value to obtain a distance sequence. Then, the first value in this distance sequence, that is, the candidate lane line corresponding to the minimum distance, is selected as the target lane line.
[0082] S203, for the first video frame and the second video frame, respectively, obtain the lateral and longitudinal orientations of the target vehicle relative to the target lane line.
[0083] Specifically, the lateral orientation can be used to describe the position of the target vehicle and the target lane line on the X-axis of the image coordinate system. For example, left orientation and right orientation. The longitudinal orientation can be used to describe the position of the target vehicle and the target lane line on the Y-axis of the image coordinate system. For example, effective longitudinal orientation and invalid longitudinal orientation. The effective longitudinal orientation can further be the orientation of the target lane line within the X-axis extension range that covers the target vehicle. The orientation acquisition steps involved in this embodiment will be described in detail below.
[0084] In one embodiment, this step includes: for a first video frame and a second video frame, respectively acquiring the lateral orientation of the target vehicle relative to the target lane line, obtaining the first lateral orientation of the target vehicle in the first video frame, and obtaining the second lateral orientation of the target vehicle in the second video frame; for the first video frame and the second video frame, respectively acquiring the longitudinal orientation of the target vehicle relative to the target lane line, obtaining the first longitudinal orientation of the target vehicle in the first video frame, and obtaining the second longitudinal orientation of the target vehicle in the second video frame; wherein, the lateral orientation includes left orientation and right orientation, and the longitudinal orientation includes valid longitudinal orientation and invalid longitudinal orientation.
[0085] Specifically, to determine whether a target vehicle has engaged in illegal lane changing, server 200 needs to analyze the changes in the target vehicle's position relative to the target lane line across multiple consecutive image frames. For example, if the target vehicle's position relative to the target lane line in a previous image frame differs from its position in a subsequent image frame, it can be determined that the target vehicle has engaged in illegal lane changing.
[0086] For example, see Figure 5 The box shown represents the vehicle detection box of the target vehicle, and the center point of the vehicle detection box represents the vehicle position information of the target vehicle. The straight line shown represents the target lane line. The first lateral and first longitudinal orientations are the orientations of the target vehicle relative to the target lane line in the first video frame, while the second lateral and second longitudinal orientations are the orientations of the target vehicle relative to the target lane line in the second video frame.
[0087] S204, based on lateral and longitudinal orientation, detects illegal lane-changing behavior of target vehicles.
[0088] In practice, while theoretically any change in orientation should be considered a violation, there are exceptions, such as a vehicle crossing a lane line in an image frame. In this case, even if the vehicle's orientation relative to the lane line changes across multiple frames, it may actually be a legal lane change or an invalid lane change such as crossing a solid line, and therefore cannot be considered a violation. To address this, this application proposes splitting the orientation judgment into lateral and longitudinal orientations for comprehensive evaluation, thereby improving the detection accuracy of vehicles illegally using sidewalks.
[0089] Further, see Figure 6For a target vehicle that server 200 has determined to have violated lane-changing regulations, its associated video frame can be uploaded to the central management platform. This allows the central management platform to display the violation video frame or update the database for future management measures. More specifically, an embedded device can transmit the GPS latitude and longitude information of the vehicle recording the lane-changing violation, the camera number, and the segmented video data collected from the violation to the backend server via a 2G to 5G network. The backend server then saves the information and updates the database.
[0090] In one embodiment, the lateral orientation includes a first lateral orientation and a second lateral orientation, and the longitudinal orientation includes a first longitudinal orientation and a second longitudinal orientation. This step includes: if the first lateral orientation and the second lateral orientation do not match, then analyzing the first longitudinal orientation and the second longitudinal orientation; if the first longitudinal orientation and the second longitudinal orientation match, and both the first longitudinal orientation and the second longitudinal orientation are valid longitudinal orientations, then determining that the target vehicle has engaged in illegal lane changing behavior; wherein, the valid longitudinal orientation is defined as the orientation where the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route, the maximum longitudinal value of the vehicle is the maximum longitudinal value of the vehicle detection box corresponding to the target vehicle, and the minimum longitudinal value of the route is the minimum longitudinal value of the target lane line.
[0091] The effective longitudinal orientation can be the orientation where the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route. For example, see [reference needed]. Figure 5 ,exist Figure 5 In the corresponding image coordinate system, the maximum longitudinal value of the vehicle is the lower boundary y1 of the vehicle detection box in the image, and the minimum longitudinal value of the route is the vertex value y2 of the target lane line in the image. The effective longitudinal orientation is represented as "y1>y2", and the invalid longitudinal orientation is represented as "y1≤y2".
[0092] In specific implementation, when server 200 detects that the first lateral orientation of target vehicle A relative to the target lane line in the Nth frame image is "left", but the second lateral orientation relative to the same target lane line in the N+1th frame image is "right", if it also detects that the first longitudinal orientation of target vehicle A relative to the target lane line in the Nth frame image is "valid longitudinal orientation", and the second longitudinal orientation of target vehicle A relative to the target lane line in the N+1th frame image is also "valid longitudinal orientation", then it can be determined that the target vehicle has engaged in illegal lane changing behavior.
[0093] It is understandable that the order of change for "left position" and "right position" mentioned above can also be interchanged; the essence lies in the change of lateral position in consecutive frames of the image. The criteria for determining "left position" or "right position" in server 200 can be... Figure 5The directional symbol “d” indicates “left direction” when “d < 0” and “right direction” when “d > 0”. The change in lateral direction refers to the change in the directional symbol “d”.
[0094] The aforementioned method for detecting illegal lane changes involves the server acquiring a first video frame and a second video frame containing the target vehicle from the video to be detected. The server then determines the target lane line in both the first and second video frames. For each video frame, the server acquires the lateral and longitudinal positions of the target vehicle relative to the target lane line. Based on these lateral and longitudinal positions, the server detects the illegal lane change behavior of the target vehicle. This method not only effectively improves the accuracy of detecting illegal lane changes and thus enhances the reliability of the detection results, but also increases the efficiency of detecting illegal vehicle behavior, saving manpower and resources.
[0095] To better implement the vehicle illegal lane change detection method in this application embodiment, based on the vehicle illegal lane change detection method, this application embodiment also provides a vehicle illegal lane change detection device, such as... Figure 7 As shown, the vehicle lane change violation detection device 700 includes:
[0096] The video acquisition module 710 is used to acquire a first video frame and a second video frame in the video to be detected. The first video frame and the second video frame are adjacent video frames in the video to be detected that contain the target vehicle.
[0097] The route determination module 720 is used to determine the target lane line in the first video frame and the second video frame, and the position of the target lane line is matched in the adjacent video frames;
[0098] The orientation acquisition module 730 is used to acquire the lateral and longitudinal orientations of the target vehicle relative to the target lane line for the first video frame and the second video frame, respectively.
[0099] The behavior detection module 740 is used to detect illegal lane changing behavior of target vehicles based on lateral and longitudinal orientation.
[0100] In one embodiment, the video acquisition module 710 is further configured to acquire a video to be detected; extract frames from the video to be detected based on a preset frequency to obtain more than one video frame; analyze the video frames and filter out adjacent video frames containing the target vehicle and candidate lane lines to obtain a first video frame and a second video frame; wherein the candidate lane lines are matched in the positions of the adjacent video frames.
[0101] In one embodiment, the video acquisition module 710 is further configured to perform vehicle detection on video frames, filter out adjacent video frames containing the target vehicle as first candidate video frames; perform lane line detection on the first candidate video frames, filter out first candidate video frames containing lane lines as second candidate video frames, and obtain lane line position information of each lane line in the second candidate video frames; for the second candidate video frames, select lane lines whose corresponding lane line position information matches as candidate lane lines, and filter to obtain the first video frame and the second video frame.
[0102] In one embodiment, the video acquisition module 710 is further configured to perform binarization processing on the second candidate video frame to obtain the mask information of each lane line in the second candidate video frame; based on the mask information, perform connected component detection on the second candidate video frame to obtain the lane line connected component; and perform straight line fitting on the centerline of the lane line connected component to filter and obtain the lane line position information of each lane line.
[0103] In one embodiment, the video acquisition module 710 is further configured to use the least squares method to analyze the pixel coordinates contained in the lane line connected region to obtain the centerline of the lane line connected region; perform straight line fitting on the centerline of the lane line connected region to obtain the position information of the centerline in the corresponding second candidate video frame, the position information including the slope value of the straight line; count the pixel coordinates to obtain the mask area of the lane line connected region; filter out the centerlines whose corresponding mask area is greater than or equal to a preset area threshold and whose corresponding straight line slope value is less than or equal to a preset slope threshold as the target centerlines; and use the position information of the target centerlines as the lane line position information of each lane line.
[0104] In one embodiment, the video acquisition module 710 is further configured to extract the longitudinal intercept values of the first lane line position information and the second lane line position information respectively to obtain the first longitudinal intercept value and the second longitudinal intercept value; obtain the absolute value of the difference between the first longitudinal intercept value and the second longitudinal intercept value to obtain the route similarity score; if the route similarity score reaches a preset score threshold, it is determined that the corresponding lane lines match; the matched lane lines are used as candidate lane lines, and a second candidate video frame containing the candidate lane lines is selected as the first video frame and the second video frame; wherein, the first lane line position information and the second lane line position information are the lane line position information of the lane lines contained in any two adjacent video frames in the second candidate video frame, respectively.
[0105] In one embodiment, the route determination module 720 is further configured to: if the first video frame and the second video frame contain at least two candidate lane lines, obtain the vehicle position information of the target vehicle in the first video frame and the second video frame; calculate the distance information between the vehicle position information and each candidate lane line; analyze the distance information corresponding to each candidate lane line, and determine the candidate lane line corresponding to the minimum distance among the distance information as the target lane line.
[0106] In one embodiment, the orientation acquisition module 730 is further configured to acquire, for the first video frame and the second video frame, the lateral orientation of the target vehicle relative to the target lane line, respectively, to obtain the first lateral orientation of the target vehicle in the first video frame and the second lateral orientation of the target vehicle in the second video frame; and to acquire, for the first video frame and the second video frame, the longitudinal orientation of the target vehicle relative to the target lane line, respectively, to obtain the first longitudinal orientation of the target vehicle in the first video frame and the second longitudinal orientation of the target vehicle in the second video frame; wherein, the lateral orientation includes left orientation and right orientation, and the longitudinal orientation includes valid longitudinal orientation and invalid longitudinal orientation.
[0107] In one embodiment, the lateral orientation includes a first lateral orientation and a second lateral orientation, and the longitudinal orientation includes a first longitudinal orientation and a second longitudinal orientation. The behavior detection module 740 is further configured to analyze the first longitudinal orientation and the second longitudinal orientation if the first lateral orientation and the second lateral orientation do not match; if the first longitudinal orientation and the second longitudinal orientation match, and both the first longitudinal orientation and the second longitudinal orientation are valid longitudinal orientations, then it is determined that the target vehicle has engaged in illegal lane changing behavior; wherein, a valid longitudinal orientation is defined as an orientation in which the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route, the maximum longitudinal value of the vehicle is the maximum longitudinal value of the vehicle detection box corresponding to the target vehicle, and the minimum longitudinal value of the route is the minimum longitudinal value of the target lane line.
[0108] The above embodiments demonstrate that the vehicle lane-changing violation detection device is not only applicable to vehicle-mounted camera-based lane-changing violation detection systems, but can also be deployed at traffic intersections, highway checkpoints, and other scenarios. Furthermore, the selection of training data and model size can be tailored to different scenarios and the processing power of the processor. This allows for flexible deployment schemes based on varying task requirements. Consequently, it not only effectively improves the detection accuracy of vehicle lane-changing violations, thereby enhancing the reliability of detection results, but also increases the efficiency of vehicle violation detection, saving manpower and resources.
[0109] In some embodiments of this application, the vehicle lane-changing violation detection device 700 can be implemented as a computer program, which can be implemented in, for example... Figure 8 The device runs on the computer shown. The computer's memory can store the various program modules that make up the vehicle lane violation detection device 700, for example, Figure 7 The video acquisition module 710, route determination module 720, orientation acquisition module 730, and behavior detection module 740 are shown. The computer program comprised of these modules causes the processor to execute the steps in the vehicle lane violation detection methods of the various embodiments of this application described in this specification.
[0110] For example, Figure 8 The computer equipment shown can be used as follows Figure 7 The video acquisition module 710 of the vehicle lane change violation detection device 700 shown executes step S201. The computer device can execute step S202 via the route determination module 720. The computer device can execute step S203 via the orientation acquisition module 730. The computer device can execute step S204 via the behavior detection module 740. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communication with external computer devices via a network connection. When the computer program is executed by the processor, it implements a method for detecting vehicle lane change violations.
[0111] Those skilled in the art in this field can understand. Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0112] In some embodiments of this application, a computer device is provided, including one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processors as described in the vehicle illegal lane change detection method. The steps of the vehicle illegal lane change detection method here may be steps from the vehicle illegal lane change detection methods of the various embodiments described above.
[0113] In some embodiments of this application, a computer-readable storage medium is provided, storing a computer program. The computer program is loaded by a processor, causing the processor to execute the steps of the above-described method for detecting illegal lane changes by vehicles. The steps of this method can be those found in the methods described in the various embodiments above.
[0114] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0115] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The foregoing has provided a detailed description of a method, apparatus, and computer device for detecting illegal lane changes by vehicles, as provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for detecting illegal lane changing behavior of vehicles, characterized in that, include: The first video frame and the second video frame in the video to be detected are obtained, wherein the first video frame and the second video frame are adjacent video frames in the video to be detected that contain the target vehicle. Determine the target lane line in the first video frame and the second video frame, wherein the position of the target lane line matches in the adjacent video frame; For the first video frame and the second video frame, the lateral and longitudinal orientations of the target vehicle relative to the target lane line are obtained respectively. The longitudinal orientation includes the effective longitudinal orientation, which is defined as the orientation where the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route. The maximum longitudinal value of the vehicle is the maximum longitudinal value of the vehicle detection box corresponding to the target vehicle, and the minimum longitudinal value of the route is the minimum longitudinal value of the target lane line. Based on the lateral and longitudinal orientations, the illegal lane-changing behavior of the target vehicle is detected.
2. The method as described in claim 1, characterized in that, The step of obtaining the first and second video frames from the video to be detected includes: Obtain the video to be tested; Based on a preset frequency, the video to be detected is frame-sampling to obtain more than one video frame; Analyze the video frames and filter out adjacent video frames containing the target vehicle and candidate lane lines to obtain the first video frame and the second video frame; wherein the candidate lane lines are positioned in the adjacent video frames.
3. The method as described in claim 2, characterized in that, The analysis of the video frames, filtering out adjacent video frames containing the target vehicle and candidate lane lines to obtain the first video frame and the second video frame, includes: Vehicle detection is performed on the video frames, and adjacent video frames containing the target vehicle are selected as the first candidate video frames; Lane line detection is performed on the first candidate video frame, and the first candidate video frame containing lane lines is selected as the second candidate video frame. Obtain the lane line position information of each lane line in the second candidate video frame; For the second candidate video frame, the lane lines that match the lane line position information of each corresponding to the first video frame and the second video frame are selected.
4. The method as described in claim 3, characterized in that, The step of obtaining the lane line position information of each lane line in the second candidate video frame includes: The second candidate video frame is binarized to obtain the mask information of each lane line in the second candidate video frame; Based on the mask information, connected component detection is performed on the second candidate video frame to obtain the lane line connected component; By performing a straight-line fitting on the centerline of the lane line connected domain, the lane line position information of each lane line is obtained through filtering.
5. The method as described in claim 4, characterized in that, The process of fitting a straight line to the centerline of the connected domain of the lane lines and filtering to obtain the lane line position information of each lane line includes: The least squares method is used to analyze the pixel coordinates contained in the lane line connected region to obtain the centerline of the lane line connected region; The centerline of the lane line connected domain is fitted with a straight line to obtain the position information of the centerline in the corresponding second candidate video frame. The position information includes the slope value of the straight line. Calculate the coordinates of the pixels and obtain the mask area of the connected region of the lane line accordingly; The centerlines corresponding to the mask area being greater than or equal to a preset area threshold and the corresponding line slope value being less than or equal to a preset slope threshold are selected as the target centerlines; The position information of the target centerline is used as the lane line position information of each lane line.
6. The method as described in claim 3, characterized in that, The step of selecting the first video frame and the second video frame by filtering the lane lines whose corresponding lane line position information matches the second video frame includes: Extract the longitudinal intercept values of the first lane line position information and the second lane line position information respectively to obtain the first longitudinal intercept value and the second longitudinal intercept value; The absolute value of the difference between the first ordinate intercept value and the second ordinate intercept value is obtained to obtain the route similarity score; If the route similarity score reaches a preset score threshold, the corresponding lane lines are determined to be a match; The matching lane lines are used as candidate lane lines, and second candidate video frames containing the candidate lane lines are selected as the first video frame and the second video frame; wherein... The first lane line position information and the second lane line position information are respectively the lane line position information of any two adjacent video frames in the second candidate video frame.
7. The method as described in claim 1, characterized in that, Determining the target lane line in the first video frame and the second video frame includes: If the first video frame and the second video frame contain at least two candidate lane lines, then obtain the vehicle position information of the target vehicle in the first video frame and the second video frame; Calculate the distance information between the vehicle position information and each of the candidate lane lines; Analyze the distance information corresponding to each of the candidate lane lines, and determine the candidate lane line corresponding to the minimum distance among the distance information, which is then used as the target lane line.
8. The method according to any one of claims 1-7, characterized in that, The step of obtaining the lateral and longitudinal positions of the target vehicle relative to the target lane line for the first video frame and the second video frame, respectively, includes: For the first video frame and the second video frame, the lateral position of the target vehicle relative to the target lane line is obtained respectively, so as to obtain the first lateral position of the target vehicle in the first video frame and the second lateral position of the target vehicle in the second video frame. For the first video frame and the second video frame, the longitudinal orientation of the target vehicle relative to the target lane line is obtained respectively, so as to obtain the first longitudinal orientation of the target vehicle in the first video frame and the second longitudinal orientation of the target vehicle in the second video frame. The lateral orientation includes left and right orientations, and the longitudinal orientation also includes invalid longitudinal orientations.
9. The method according to any one of claims 1-7, characterized in that, The lateral orientation includes a first lateral orientation and a second lateral orientation, and the longitudinal orientation includes a first longitudinal orientation and a second longitudinal orientation. The detection of the target vehicle's illegal lane-changing behavior based on the lateral and longitudinal orientations includes: If the first lateral orientation does not match the second lateral orientation, then analyze the first longitudinal orientation and the second longitudinal orientation. If the first longitudinal orientation matches the second longitudinal orientation, and both the first and second longitudinal orientations are valid longitudinal orientations, then it is determined that the target vehicle has engaged in illegal lane changing behavior.
10. A device for detecting illegal lane changing behavior of vehicles, characterized in that, include: The video acquisition module is used to acquire a first video frame and a second video frame in the video to be detected, wherein the first video frame and the second video frame are adjacent video frames in the video to be detected that contain the target vehicle. A route determination module is used to determine the target lane line in the first video frame and the second video frame, wherein the position of the target lane line is matched in the adjacent video frames; The orientation acquisition module is used to acquire the lateral orientation and longitudinal orientation of the target vehicle relative to the target lane line for the first video frame and the second video frame, respectively. The longitudinal orientation includes an effective longitudinal orientation, which is defined as the orientation where the maximum longitudinal value of the vehicle is greater than the minimum longitudinal value of the route. The maximum longitudinal value of the vehicle is the maximum longitudinal value of the vehicle detection box corresponding to the target vehicle, and the minimum longitudinal value of the route is the minimum longitudinal value of the target lane line. The behavior detection module is used to detect the illegal lane-changing behavior of the target vehicle based on the lateral and longitudinal orientations.
11. A computer device, characterized in that, The computer device includes: One or more processors; The memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the vehicle lane change violation detection method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps in the vehicle lane change detection method according to any one of claims 1 to 9.