CN114463416A - Vehicle lane change detection method and device, electronic equipment and storage medium - Google Patents

Vehicle lane change detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114463416A
CN114463416A CN202111675191.8A CN202111675191A CN114463416A CN 114463416 A CN114463416 A CN 114463416A CN 202111675191 A CN202111675191 A CN 202111675191A CN 114463416 A CN114463416 A CN 114463416A
Authority
CN
China
Prior art keywords
vehicle
detected
lane
coordinate information
lane line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111675191.8A
Other languages
Chinese (zh)
Inventor
胡天佑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202111675191.8A priority Critical patent/CN114463416A/en
Publication of CN114463416A publication Critical patent/CN114463416A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30248Vehicle exterior or interior
    • G06T2207/30252Vehicle exterior; Vicinity of vehicle
    • G06T2207/30256Lane; Road marking

Abstract

The application relates to a vehicle lane change detection method, a vehicle lane change detection device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a video image, and acquiring coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line; calculating a body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image; screening the body type of the vehicle based on the body type index of the vehicle to obtain a vehicle to be detected; determining a lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line; and carrying out lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located. Through the method and the device, the accuracy of the vehicle lane change detection result is improved.

Description

Vehicle lane change detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of intelligent transportation technologies, and in particular, to a method and an apparatus for detecting lane change of a vehicle, an electronic device, and a storage medium.
Background
With the increase of urban vehicles, traffic is congested more and more, and violation lane changing frequently appears in actual life, so that traffic order is seriously influenced, and traffic accidents are easily caused. Therefore, the detection of the violation lane change is an important component in intelligent traffic monitoring, so that the method makes full preparation for subsequent snapshot and identification of violation vehicles and punishment of the violation vehicles, and has important significance in researching the detection method of the violation lane change.
At present, a vehicle lane change penalty technology based on video recognition is generally used for directly tracking the centroid of a detection target or the position relationship between a detection frame and a lane line to judge whether a vehicle appears in a plurality of lanes within a period of time so as to recognize whether lane change occurs. However, the lane change judgment method is too simple, and lane misjudgment is easily caused.
Disclosure of Invention
The embodiment of the application provides a vehicle lane change detection method, a vehicle lane change detection device, electronic equipment and a storage medium, and at least solves the problem of low lane judgment accuracy rate in the related art.
In a first aspect, an embodiment of the present application provides a vehicle lane change detection method, including:
acquiring a video image, and acquiring coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line;
calculating a body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image;
and carrying out lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
In some embodiments, the vehicle to be detected is screened by:
calculating a body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image;
and screening the body type of the vehicle based on the body type index of the vehicle to obtain the vehicle to be detected.
In some embodiments, the calculating the body shape indicator of the corresponding vehicle based on the coordinate information of the vehicle in the video image includes:
determining the vertex coordinates of the target detection frame corresponding to the vehicle based on the coordinate information of the vehicle in the video image;
determining the horizontal gradient ratio and/or the vertical gradient ratio of the corresponding vehicle according to the vertex coordinates of the target detection frame;
and calculating to obtain the body type index corresponding to the vehicle according to the horizontal gradient ratio and/or the vertical gradient ratio.
In some embodiments, the screening the body type of the vehicle based on the body type indicator of the vehicle to obtain the vehicle to be detected includes:
comparing the body type index of the vehicle with a preset threshold value, and determining the vehicle as a vehicle to be detected when the body type index of the vehicle is smaller than the preset threshold value; on the contrary, the method can be used for carrying out the following steps,
screening the vehicle.
In some embodiments, before determining the lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, the method further includes:
and acquiring the integrity information of the vehicle to be detected in the video image, and screening the vehicle according to the integrity information of the vehicle to be detected.
In some embodiments, the determining, according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, the lane in which the vehicle to be detected is located includes:
acquiring coordinate information of a first lane line and a second lane line; the first lane line and the second lane line are adjacent;
determining the position relation of the vehicle to be detected, the first lane line and the second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line and the second lane line;
and judging whether the vehicle to be detected is in a lane between the first lane line and the second lane line according to the position relation among the vehicle to be detected, the first lane line and the second lane line.
In some embodiments, the determining, according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line and the second lane line, the position relationship of the vehicle to be detected, the first lane line and the second lane line includes:
determining a first position relation between a center point of the vehicle to be detected and a first lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line;
determining a second position relation between the center point of the vehicle to be detected and a second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the second lane line;
and determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the first position relation and the second position relation.
In some embodiments, the performing lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located includes:
judging whether the vehicle to be detected is in a current detection queue;
when the vehicle to be detected is not in the current detection queue, adding the vehicle to be detected to the current detection queue, and determining the lane in which the vehicle to be detected is located as an initial lane;
and when the vehicle to be detected is in the current detection queue, judging whether the lane in which the vehicle to be detected is located is the same as the initial lane or not, and outputting lane change detection information according to a judgment result.
In a second aspect, an embodiment of the present application provides a vehicle lane change detection apparatus, including:
the coordinate information acquisition unit is used for acquiring a video image and acquiring coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line;
the lane determining unit is used for determining a lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line;
and the lane change detection unit is used for carrying out lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor, when executing the computer program, implements the vehicle lane change detection method according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the vehicle lane change detection method according to the first aspect.
Compared with the prior art, the method for detecting the lane change of the vehicle, provided by the embodiment of the application, acquires the coordinate information of the object to be detected according to the video image by acquiring the video image; the object to be detected comprises a vehicle to be detected and a lane line; the lane where the vehicle to be detected is located is determined according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, and lane changing detection is performed on the vehicle to be detected according to the lane where the vehicle to be detected is located, so that lane changing detection is performed on the vehicle to be detected after screening according to the body type, and the accuracy of the detection result is improved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic flow chart of a lane change detection method for a vehicle according to one embodiment of the present disclosure;
FIG. 2 is a schematic flow chart illustrating a process of calculating a body type indicator of a corresponding vehicle based on coordinate information of the vehicle in a video image according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of determining a lane where the vehicle to be detected is located according to one embodiment of the present application;
FIG. 4 is a schematic flow chart of a lane change detection method for a vehicle according to yet another embodiment of the present application;
FIG. 5 is a block diagram of a lane change detection apparatus for a vehicle according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device in one embodiment of the present application.
Description of the drawings: 21. a coordinate information acquisition unit; 22. a lane determining unit; 23. a lane change detection unit; 30. a bus; 31. a processor; 32. a memory; 33. a communication interface.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless otherwise defined, technical or scientific terms referred to herein should have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
Lane change detection can be generally realized by means of ground induction coils, radars, manual measurement, loadometer, video detection and the like. The lane change detection method based on the video detection technology is characterized in that a camera is used for shooting traffic conditions in real time, and a computer is used for automatically detecting the lane change phenomenon violating regulations in a shot video, so that a large amount of manpower resources can be saved, the detection efficiency of traffic abnormal events is improved, and meanwhile, the automatic intelligent monitoring without supervision is realized. The video detection, installation and maintenance are convenient, the investment of manpower and material resources can be reduced, the detection coverage range is wide, the accuracy and timeliness of vehicle behavior analysis can be greatly improved, and accidents are effectively prevented.
The lane change detection method can be used in intelligent traffic scenes such as maps, navigation, internet of vehicles and automatic driving, and can be used for detecting lane change behaviors of road vehicles. In fact, any application scenario requiring lane recognition is within the scope of the application scenario of the embodiment of the present application, and the embodiment of the present application is not limited to a specific application scenario.
The present embodiment provides a vehicle lane change detection method, which may be executed by an electronic device. Fig. 1 is a flowchart of a vehicle lane change detection method according to an embodiment of the present application, and as shown in fig. 1, the flowchart includes the steps of:
and step S10, acquiring a video image, and acquiring coordinate information of the object to be detected according to the video image.
In this embodiment, the electronic device may be a video capture device, or may be another computer device connected to the video capture device. In the running process of the vehicle, the video acquisition equipment can acquire and acquire video images of roads and acquire the video images through image processing to acquire detection information. Specifically, each frame of video image can be detected through an image recognition technology to identify the object to be detected in the video image.
The detection information is used for indicating the driving state of the vehicle, and may include coordinate information of an object to be detected, where the object to be detected includes the vehicle to be detected and a lane line. The vehicle to be detected may be of various types, and is not limited to a specific party. The coordinate information of the vehicle to be detected is the coordinate position of the vehicle to be detected in the image coordinate system, and can be the coordinates of four vertexes of a vehicle detection frame in the video image, and also can be the coordinates of the center of mass or the coordinates of the bottom center point. The lane lines are also called as traffic lines and lanes and are arranged on the roads for the vehicles to pass through. The lane lines can be solid lines or dotted lines, and different lane types such as a traffic lane, an emergency lane, a bus lane and the like can be divided through the lane lines. The coordinate information of the lane line may include an ID of the lane line, start point coordinates, end point coordinates of the lane line, and the like.
In other embodiments, the detection information further includes feature identification information (such as ID, name, category information) and tracking information of the object to be detected, and the application is not limited herein. The acquired object to be detected can be analyzed by using a deep learning method to obtain corresponding feature identification information or tracking information.
And step S12, determining the lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line.
In some embodiments, the relative position relationship between the vehicle to be detected and the lane line may be calculated based on the coordinate information of the vehicle to be detected and the coordinate information of the lane line, and the lane where the vehicle to be detected is located may be determined. In other embodiments, the distance between the vehicle to be detected and the lane line may also be calculated based on the coordinate information of the vehicle to be detected and the coordinate information of the lane line, so as to determine the lane where the vehicle to be detected is located. The specific implementation process of lane positioning can be implemented by using the prior art, and the application is not limited herein.
And step S14, performing lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
Specifically, in this embodiment, it is determined whether the lane where the vehicle to be detected is located changes within the detection time range, and when the lane where the vehicle to be detected is located is different from the historical lane within the detection time range, it is determined that the vehicle to be detected changes lanes, and corresponding information of the vehicle to be detected is output.
In summary, according to the lane change detection method for the vehicle provided by the embodiment of the application, the coordinate information of the object to be detected is obtained according to the video image by obtaining the video image; the object to be detected comprises a vehicle to be detected and a lane line. The lane where the vehicle to be detected is located is determined according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, and lane changing detection is performed on the vehicle to be detected according to the lane where the vehicle to be detected is located, so that lane changing detection is performed on the vehicle to be detected after screening according to the body type, and the accuracy of the detection result is improved.
The embodiments of the present application are described and illustrated below by means of preferred embodiments.
On the basis of the above embodiments, in some of the embodiments, the vehicle to be detected is obtained by screening through the following steps:
and step S101, calculating the body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image.
And S102, screening the body type of the vehicle based on the body type index of the vehicle to obtain the vehicle to be detected.
The body type index is used for indicating the body type size of the vehicle in the current frame video image, the body type index can be obtained by calculation based on coordinate information of the vehicle, and the calculation and representation mode of the body type index can be configured in a user-defined mode.
In this embodiment, due to the influence of factors such as the occurrence time and size of the vehicle, the installation angle of the video capture device, and the like, when performing lane change detection calculation according to the coordinate information of the vehicle in the video image, the lane where the vehicle is located may not be accurately obtained, and misjudgment of the lane change detection result is very likely to occur, and the problem of low accuracy of lane judgment of a large-sized vehicle cannot be solved. For example, two or more lane areas may be occupied when the vehicle body size in the video image is too large. Therefore, before lane change detection is performed, body type indexes of a vehicle in a detection scene need to be acquired so as to perform data screening according to the body type indexes.
In this embodiment, after determining the body type indicator of the vehicle, screening the body type of the vehicle based on the body type indicator of the vehicle to obtain a vehicle to be detected includes: and comparing the body type index of the vehicle with a preset threshold, when the body type index of the vehicle is smaller than the preset threshold, indicating that the body type of the vehicle meets the calculation requirement, determining the vehicle as a vehicle to be detected at the moment, and performing lane change detection on the vehicle. On the contrary, when the size index of the vehicle is smaller than the preset threshold value, the vehicle is screened out, and lane change detection is not performed on the vehicle, wherein the size index of the vehicle is larger than the preset threshold value.
Calculating a body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image through the steps; and screening the body type of the vehicle based on the body type index of the vehicle to obtain the vehicle to be detected. The method and the device realize screening of the detection data corresponding to the vehicle with the abnormal body type, and avoid the inaccurate lane result of the vehicle obtained by calculation by using the data when the proportion of the vehicle in the video image is too large, thereby reducing the probability of misjudgment of the vehicle lane change.
On the basis of the foregoing embodiments, in some embodiments, as shown in fig. 2, the calculating a body shape indicator of a corresponding vehicle based on coordinate information of the vehicle in the video image includes:
in step S1011, the vertex coordinates of the target detection frame corresponding to the vehicle are determined based on the coordinate information of the vehicle in the video image.
Generally, the target detection frame may be a rectangular frame covering the entire vehicle body or a rectangular frame covering the positions of the vehicle chassis, wheels, and the like, and may be adaptively set according to the actual situation, and the boundary information of the vehicle may be determined by performing edge recognition on the vehicle included in the video image to obtain the target detection frame. And after the detection frame corresponding to the vehicle is obtained, further obtaining four vertex coordinates of the corresponding target detection frame.
Step S1012, determining a horizontal gradient ratio and/or a vertical gradient ratio of the corresponding vehicle according to the vertex coordinates of the target detection box.
In this embodiment, the horizontal gradient ratio of the vehicle is a ratio of a width of a target detection frame where the vehicle is located in the image coordinate system to an image width, and the width of the target detection frame can be calculated by a horizontal distance between an upper left vertex and a lower right vertex of the target detection frame; the vertical gradient proportion of the vehicle is the ratio of the height of a target detection frame where the vehicle is located in the image coordinate system to the height of the image, and the height of the target detection frame can be obtained by calculating the vertical distance between the upper left vertex and the lower right vertex of the target detection frame.
And S1013, calculating to obtain the body type index corresponding to the vehicle according to the horizontal gradient proportion and/or the vertical gradient proportion.
In the present embodiment, the body type index of the vehicle is related to the width of the vehicle corresponding to the target detection frame, and also related to the height thereof. In some embodiments, the body type index corresponding to the vehicle can be calculated according to the horizontal gradient proportion of the vehicle; in other embodiments, the body type index corresponding to the vehicle may also be obtained by calculating according to the vertical gradient ratio of the vehicle, or obtained by comprehensively calculating according to the horizontal gradient ratio and the vertical gradient ratio of the vehicle.
In a specific implementation mode, the body type index corresponding to the vehicle is obtained by comprehensively calculating the horizontal gradient ratio and the vertical gradient ratio of the vehicle, and the specific calculation formula is as follows:
Figure BDA0003450963580000081
wherein, R is a body type index, FH represents the height of the video image, FW represents the width of the video image;
Figure BDA0003450963580000082
the vertical distance between the upper left vertex and the lower right vertex of the target detection frame,
Figure BDA0003450963580000083
detecting the horizontal distance between the upper left vertex and the lower right vertex of the frame for the target; a and b are coefficient factors.
Through the steps, the body type indexes of the vehicles are obtained through calculation, body type screening of the detected vehicles is facilitated, inaccurate vehicle data are filtered, and therefore the influence of the body types of the vehicles on lane change detection results is avoided.
On the basis of the foregoing embodiments, in some embodiments, before determining the lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, the method further includes: and acquiring the integrity information of the vehicle to be detected in the video image, and screening the vehicle according to the integrity information of the vehicle to be detected.
In the present embodiment, the integrity information is used to indicate the integrity of the vehicle to be detected in the video image. When the vehicle to be detected in the video image is incomplete, the target detection frame corresponding to the vehicle cannot accurately describe the position of the vehicle to be detected and the lane. In order to reduce the probability of target false detection, before lane change detection is performed, integrity information of a vehicle to be detected in a detection scene needs to be acquired, so that vehicle screening is performed according to the integrity information. In a specific embodiment, the integrity information may be obtained by a model obtained through deep learning training, and the model may output a probability value of the integrity, and regarding a value with a high probability, the target is considered to be intact, otherwise the target is not intact. In another embodiment, the vehicle to be detected may be divided into a plurality of regions to be identified in advance, and the identification condition of each region to be identified may be determined according to the image identification result, so as to obtain the integrity information. Of course, in other embodiments, the calculation manner of the integrity information is not limited in this application, as long as the calculated integrity information can indicate the integrity of the vehicle to be detected in the video image.
In the embodiment, whether the vehicle to be detected is complete is judged according to the integrity information of the vehicle to be detected, and lane change detection is performed on the vehicle to be detected when the vehicle to be detected is complete; and when the vehicle is incomplete, screening the vehicle to be detected, and not carrying out lane change detection on the vehicle to be detected.
As shown in fig. 3, on the basis of the above embodiments, in some embodiments, the determining, according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, the lane in which the vehicle to be detected is located includes:
step S121, coordinate information of a first lane line and a second lane line is obtained; the first lane line and the second lane line are adjacent.
In this embodiment, the first lane line and the second lane line may be any two adjacent lane lines of the detection area in the video image; it may also be a route line and a lane line adjacent to the route line.
And S122, determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line and the second lane line.
And S123, judging whether the vehicle to be detected is in a lane between the first lane line and the second lane line according to the position relation among the vehicle to be detected, the first lane line and the second lane line.
In this embodiment, first, a first position relationship between a center point of a vehicle to be detected and a first lane line is determined according to coordinate information of the vehicle to be detected and coordinate information of the first lane line; determining a second position relation between the center point of the vehicle to be detected and a second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the second lane line; and then determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the first position relation and the second position relation.
Specifically, the first positional relationship may be that the center point of the vehicle to be detected is located on the first lane line, on the upper side of the first lane line, or on the lower side of the first lane line; the second positional relationship may be that the center point of the vehicle to be detected is located on the second lane line, the upper side of the second lane line, or the lower side of the second lane line. After the first position relationship and the second position relationship are determined, the first lane line and the second lane line are arranged adjacently and parallelly, so that the position relationship among the vehicle to be detected, the first lane line and the second lane line can be determined, namely whether the vehicle to be detected is located between the first lane line and the second lane line is determined. It should be noted that the coordinates of the center point of the vehicle to be detected include, but are not limited to, coordinates of a center of mass, coordinates of a center point of a bottom, and the like of the target detection frame corresponding to the vehicle to be detected.
Illustratively, the calculation formula of the first positional relationship or the second positional relationship is as follows:
Figure BDA0003450963580000091
wherein M isiIndicating a position discrimination value calculated based on a center point of a vehicle to be detected and a lane line,
Figure BDA0003450963580000092
Figure BDA0003450963580000093
represents the coordinates of the start point of the ith lane line,
Figure BDA0003450963580000094
and (4) representing the coordinates of the end point of the ith lane line, and (x, y) representing the coordinates of the bottom center point of the target detection frame.
For example: m is a group of1Indicating a first lane line, M2Indicating a second lane line if M1*M2<0, the vehicle to be detected is positioned in the lane between the first lane line and the second lane line; if M is1>0 and M2>0, or M1<0 and M2<And 0, the vehicle to be detected is positioned at the same side of the first lane line and the second lane line, namely both at the upper side or both at the lower side, and the vehicle to be detected is not positioned at the lane between the first lane line and the second lane line.
On the basis of the foregoing embodiments, in some embodiments, the performing lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located includes:
and step S141, judging whether the vehicle to be detected is in the current detection queue.
And S142, when the vehicle to be detected is not in the current detection queue, adding the vehicle to be detected to the current detection queue, and determining the lane in which the vehicle to be detected is located as an initial lane.
And step S143, when the vehicle to be detected is in the current detection queue, judging whether the lane where the vehicle to be detected is located is the same as the initial lane, and outputting lane change detection information according to the judgment result.
In this embodiment, the current detection queue is used to store all the vehicles to be detected for lane change detection, including the vehicle ID and the corresponding initial lane.
After the lane where the vehicle to be detected is located is determined, whether the current lane is the initial lane can be determined by judging whether the vehicle to be detected is located in the current detection queue. And when the vehicle to be detected is not in the current detection queue, the lane in which the vehicle to be detected is located is detected for the first time, the lane is determined as the initial lane of the vehicle to be detected, and the vehicle to be detected is subjected to video tracking and written into the current detection queue.
When the vehicle to be detected is in the current detection queue, the vehicle to be detected is detected for the second time, and at this time, the initial lane of the vehicle to be detected is written into the current detection queue, and it is necessary to further judge whether the lane where the vehicle to be detected is located is the same as the initial lane in the current detection queue, so as to output lane change detection information according to the judgment result. Specifically, if the lane where the vehicle to be detected is located is different from the initial lane in the current detection queue, outputting lane change information of the vehicle to be detected, and screening the lane change information from the current detection queue; otherwise, repeating the steps to continuously execute lane change detection on the vehicle to be detected.
As shown in fig. 4, in some of the embodiments, the lane change detection method for a vehicle includes the steps of: firstly, acquiring coordinate information of a vehicle according to a video image; and calculating the body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image, and screening the body type of the vehicle based on the body type index R of the vehicle after determining the body type index R of the vehicle. And when the body type index R of the vehicle is smaller than a preset threshold value H, determining the vehicle as a vehicle to be detected, and performing lane change detection on the vehicle. Otherwise, the vehicle is screened out, and lane change detection is not carried out on the vehicle. Further, integrity information of the vehicle to be detected in the video image is acquired, and vehicle screening is performed according to the integrity information of the vehicle to be detected. When the vehicle to be detected is complete, lane change detection is performed on the vehicle to be detected; and when the vehicle is incomplete, screening the vehicle to be detected, and not carrying out lane change detection on the vehicle to be detected.
And then, determining the lane CR where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line. After determining a lane CR of a vehicle to be detected, judging whether the vehicle to be detected is in a current detection queue, adding the vehicle to be detected to the current detection queue when the vehicle to be detected is not in the current detection queue, determining the lane in which the vehicle to be detected is located as an initial lane, and updating an initial lane FR of the vehicle to be detected; and when the vehicle to be detected is in the current detection queue, judging whether the lane CR where the vehicle to be detected is located is the same as the initial lane FR, if not, outputting lane change information of the vehicle to be detected, and screening the lane change information from the current detection queue, otherwise, repeating the steps to continuously execute lane change detection on the vehicle to be detected.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The present embodiment further provides a vehicle lane change detection device, which is used to implement the foregoing embodiments and preferred embodiments, and the description of the device is omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a vehicle lane-change detecting device according to an embodiment of the present application, and as shown in fig. 5, the device includes: a coordinate information acquisition unit 21, a lane determination unit 22, and a lane change detection unit 23.
The coordinate information acquiring unit 21 is configured to acquire a video image and acquire coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line;
the lane determining unit 22 is configured to determine a lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line;
and the lane change detection unit 23 is configured to perform lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
In some of the embodiments, the coordinate information obtaining unit 21 includes: the vehicle body type index calculation module comprises a body type index calculation module and a to-be-detected vehicle acquisition module.
The body type index calculation module is used for calculating the body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image;
the vehicle to be detected acquisition module is used for screening the body type of the vehicle based on the body type index of the vehicle to obtain the vehicle to be detected;
in some embodiments, the body shape indicator calculation module comprises: the device comprises a vertex coordinate determination module, an occupation ratio determination module and an index calculation module.
The vertex coordinate determination module is used for determining vertex coordinates of the target detection frame corresponding to the vehicle based on the coordinate information of the vehicle in the video image;
the occupation ratio determining module is used for determining the horizontal gradient occupation ratio and/or the vertical gradient occupation ratio of the corresponding vehicle according to the vertex coordinates of the target detection frame;
and the index calculation module is used for calculating and obtaining the body type index corresponding to the vehicle according to the horizontal gradient proportion and/or the vertical gradient proportion.
In some embodiments, the vehicle to be detected acquisition module includes: a first screening module and a second screening module.
The first screening module is used for comparing the body type index of the vehicle with a preset threshold value, and determining the vehicle as a vehicle to be detected when the body type index of the vehicle is smaller than the preset threshold value;
and the second screening module is used for screening the vehicle when the body type index of the vehicle is greater than or equal to a preset threshold value.
In some embodiments, the lane change detection device further includes: and a completeness screening unit.
And the integrity screening unit is used for acquiring the integrity information of the vehicle to be detected in the video image and screening the vehicle according to the integrity information of the vehicle to be detected.
In some of these embodiments, the lane determination unit 22 includes: the system comprises a coordinate information acquisition module, a position relation acquisition module and a lane judgment module.
The coordinate information acquisition module is used for acquiring coordinate information of the first lane line and the second lane line; the first lane line and the second lane line are adjacent;
the position relation obtaining module is used for determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line and the second lane line;
and the lane judging module is used for judging whether the vehicle to be detected is in a lane between the first lane line and the second lane line according to the position relation among the vehicle to be detected, the first lane line and the second lane line.
In some embodiments, the position relation obtaining module includes: the device comprises a first position relation acquisition module, a second position relation acquisition module and a position relation determination module.
The first position relation acquisition module is used for determining a first position relation between a center point of the vehicle to be detected and a first lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line;
the second position relation obtaining module is used for determining a second position relation between the center point of the vehicle to be detected and a second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the second lane line;
and the position relation determining module is used for determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the first position relation and the second position relation.
In some of these embodiments, the lane change detection unit 23 includes: the device comprises a detection queue judging module, a first processing module and a second processing module.
The detection queue judging module is used for judging whether the vehicle to be detected is in a current detection queue or not;
the first processing module is used for adding the vehicle to be detected to the current detection queue when the vehicle to be detected is not in the current detection queue, and determining the lane where the vehicle to be detected is located as an initial lane;
and the second processing module is used for judging whether the lane where the vehicle to be detected is located is the same as the initial lane or not when the vehicle to be detected is in the current detection queue so as to output lane change detection information according to a judgment result.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
In addition, the vehicle lane change detection method described in the embodiment of the present application with reference to fig. 1 may be implemented by an electronic device. Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
The electronic device may comprise a processor 31 and a memory 32 in which computer program instructions are stored.
Specifically, the processor 31 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 32 may include, among other things, mass storage for data or instructions. By way of example, and not limitation, memory 32 may include a Hard Disk Drive (Hard Disk Drive, abbreviated to HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 32 may include removable or non-removable (or fixed) media, where appropriate. The memory 32 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 32 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, Memory 32 includes Read-Only Memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), Electrically rewritable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended data output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), and the like.
The memory 32 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions executed by the processor 31.
The processor 31 implements any one of the vehicle lane change detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 32.
In some of these embodiments, the electronic device may also include a communication interface 33 and a bus 30. As shown in fig. 6, the processor 31, the memory 32, and the communication interface 33 are connected via the bus 30 to complete mutual communication.
The communication interface 33 is used for implementing communication between modules, devices, units and/or equipment in the embodiment of the present application. The communication interface 33 may also enable communication with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
The bus 30 includes hardware, software, or both that couple the components of the electronic device to one another. Bus 30 includes, but is not limited to, at least one of the following: data Bus (Data Bus), Address Bus (Address Bus), Control Bus (Control Bus), Expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example, and not limitation, Bus 30 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (Front Side Bus), an FSB (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a Video Electronics Bus (audio Association) Bus, abbreviated VLB) bus or other suitable bus or a combination of two or more of these. Bus 30 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
The electronic device may execute the vehicle lane change detection method in the embodiment of the present application based on the acquired program instruction, thereby implementing the vehicle lane change detection method described in conjunction with fig. 1.
In addition, in combination with the vehicle lane change detection method in the foregoing embodiment, the embodiment of the present application may be implemented by providing a computer-readable storage medium. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the vehicle lane change detection methods in the above embodiments.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A vehicle lane change detection method is characterized by comprising the following steps:
acquiring a video image, and acquiring coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line;
determining a lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line;
and carrying out lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
2. The vehicle lane-change detection method according to claim 1, wherein the vehicle to be detected is obtained by screening through the following steps:
calculating a body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image;
and screening the body type of the vehicle based on the body type index of the vehicle to obtain the vehicle to be detected.
3. The vehicle lane change detection method according to claim 2, wherein the calculating of the body type index of the corresponding vehicle based on the coordinate information of the vehicle in the video image includes:
determining the vertex coordinates of the target detection frame corresponding to the vehicle based on the coordinate information of the vehicle in the video image;
determining the horizontal gradient ratio and/or the vertical gradient ratio of the corresponding vehicle according to the vertex coordinates of the target detection frame;
and calculating to obtain the body type index corresponding to the vehicle according to the horizontal gradient ratio and/or the vertical gradient ratio.
4. The vehicle lane change detection method according to claim 2, wherein the step of screening the vehicle body type based on the body type index of the vehicle to obtain the vehicle to be detected comprises the steps of:
comparing the body type index of the vehicle with a preset threshold value, and determining the vehicle as a vehicle to be detected when the body type index of the vehicle is smaller than the preset threshold value; on the contrary, the method can be used for carrying out the following steps,
screening the vehicle.
5. The vehicle lane-changing detection method according to claim 1, wherein before determining the lane in which the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line, the method further comprises:
and acquiring the integrity information of the vehicle to be detected in the video image, and screening the vehicle according to the integrity information of the vehicle to be detected.
6. The vehicle lane-changing detection method according to claim 1, wherein the determining the lane in which the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line comprises:
acquiring coordinate information of a first lane line and a second lane line; the first lane line and the second lane line are adjacent;
determining the position relation of the vehicle to be detected, the first lane line and the second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line and the second lane line;
and judging whether the vehicle to be detected is in a lane between the first lane line and the second lane line according to the position relation among the vehicle to be detected, the first lane line and the second lane line.
7. The vehicle lane change detection method according to claim 6, wherein the determining the position relationship among the vehicle to be detected, the first lane line, and the second lane line according to the coordinate information of the vehicle to be detected, and the coordinate information of the first lane line and the second lane line comprises:
determining a first position relation between a center point of the vehicle to be detected and a first lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the first lane line;
determining a second position relation between the center point of the vehicle to be detected and a second lane line according to the coordinate information of the vehicle to be detected and the coordinate information of the second lane line;
and determining the position relation among the vehicle to be detected, the first lane line and the second lane line according to the first position relation and the second position relation.
8. The vehicle lane change detection method according to claim 1, wherein the lane change detection of the vehicle to be detected according to the lane in which the vehicle to be detected is located comprises:
judging whether the vehicle to be detected is in a current detection queue;
when the vehicle to be detected is not in the current detection queue, adding the vehicle to be detected to the current detection queue, and determining the lane in which the vehicle to be detected is located as an initial lane;
and when the vehicle to be detected is in the current detection queue, judging whether the lane in which the vehicle to be detected is located is the same as the initial lane or not, and outputting lane change detection information according to a judgment result.
9. A vehicle lane change detection device, characterized by comprising:
the coordinate information acquisition unit is used for acquiring a video image and acquiring coordinate information of an object to be detected according to the video image; the object to be detected comprises a vehicle to be detected and a lane line;
the lane determining unit is used for determining a lane where the vehicle to be detected is located according to the coordinate information of the vehicle to be detected and the coordinate information of the lane line;
and the lane change detection unit is used for carrying out lane change detection on the vehicle to be detected according to the lane where the vehicle to be detected is located.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the vehicle lane change detection method according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a vehicle lane change detection method according to any one of claims 1 to 8.
CN202111675191.8A 2021-12-31 2021-12-31 Vehicle lane change detection method and device, electronic equipment and storage medium Pending CN114463416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111675191.8A CN114463416A (en) 2021-12-31 2021-12-31 Vehicle lane change detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111675191.8A CN114463416A (en) 2021-12-31 2021-12-31 Vehicle lane change detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114463416A true CN114463416A (en) 2022-05-10

Family

ID=81407428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111675191.8A Pending CN114463416A (en) 2021-12-31 2021-12-31 Vehicle lane change detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114463416A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116110216A (en) * 2022-10-21 2023-05-12 中国第一汽车股份有限公司 Vehicle line crossing time determining method and device, storage medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116110216A (en) * 2022-10-21 2023-05-12 中国第一汽车股份有限公司 Vehicle line crossing time determining method and device, storage medium and electronic device
CN116110216B (en) * 2022-10-21 2024-04-12 中国第一汽车股份有限公司 Vehicle line crossing time determining method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN110443225B (en) Virtual and real lane line identification method and device based on feature pixel statistics
CN110738842A (en) Accident responsibility division and behavior analysis method, device, equipment and storage medium
CN112749622B (en) Emergency lane occupation recognition method and device
CN109785637B (en) Analysis and evaluation method and device for vehicle violation
CN108932849B (en) Method and device for recording low-speed running illegal behaviors of multiple motor vehicles
CN111369801B (en) Vehicle identification method, device, equipment and storage medium
CN112131935A (en) Motor vehicle carriage manned identification method and device and computer equipment
CN114202936B (en) Traffic guidance robot and control method thereof
CN114463416A (en) Vehicle lane change detection method and device, electronic equipment and storage medium
CN112001269A (en) Vehicle identification method and device, computer equipment and storage medium
CN112861567A (en) Vehicle type classification method and device
CN109003457B (en) Method and device for recording behaviors of multiple motor vehicles illegally occupying emergency lane
CN112329886A (en) Double-license plate recognition method, model training method, device, equipment and storage medium
CN111881752A (en) Guardrail detection and classification method and device, electronic equipment and storage medium
CN111768630A (en) Violation waste image detection method and device and electronic equipment
CN116052429A (en) Road section congestion identification method and device, electronic equipment and medium
CN112507874B (en) Method and device for detecting motor vehicle jamming behavior
CN113743316B (en) Vehicle plugging behavior identification method, system and device based on target detection
CN114141022B (en) Emergency lane occupation behavior detection method and device, electronic equipment and storage medium
CN114202903A (en) DEM data-based vehicle early warning method, device, equipment and storage medium
CN114038209A (en) Bus lane occupation processing method, device and equipment
CN111754781A (en) Method, device and system for detecting vehicle violation and camera
CN112613370A (en) Target defect detection method, device and computer storage medium
CN110718064A (en) Vehicle violation detection method and device
CN116434560B (en) Method, device, equipment and storage medium for identifying illegal running

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination