CN114445448A - Automatic labeling and detecting method and device for vehicle running detection and computer equipment - Google Patents

Automatic labeling and detecting method and device for vehicle running detection and computer equipment Download PDF

Info

Publication number
CN114445448A
CN114445448A CN202111593469.7A CN202111593469A CN114445448A CN 114445448 A CN114445448 A CN 114445448A CN 202111593469 A CN202111593469 A CN 202111593469A CN 114445448 A CN114445448 A CN 114445448A
Authority
CN
China
Prior art keywords
vehicle
direction vector
preset
target vehicle
detection
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
CN202111593469.7A
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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202111593469.7A priority Critical patent/CN114445448A/en
Publication of CN114445448A publication Critical patent/CN114445448A/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/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • 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
    • 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/30241Trajectory

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Multimedia (AREA)
  • Traffic Control Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an automatic labeling and detecting method, device and computer equipment for vehicle running detection, wherein the method comprises the steps of obtaining road image data; extracting a vehicle track set of a target vehicle within a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track; obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points; obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector; and marking the driving direction of the target vehicle based on the calibration direction vector.

Description

Automatic labeling and detecting method and device for vehicle running detection and computer equipment
Technical Field
The invention relates to the technical field of intelligent traffic, in particular to an automatic labeling and detecting method and device for vehicle running detection and computer equipment.
Background
The existing vehicle driving detection scheme depends on sample data formed by manual marking of road directions, but with the explosive growth of the video monitoring market, in the face of increasing camera number, the scheme lacks self-adaptive road direction marking for complex scenes, manual marking is needed in each adjustment, and higher intellectualization is difficult to realize in large-scale deployment, so that the accuracy and the processing efficiency are lower in the vehicle driving detection process.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to overcome the defects of low accuracy and low processing efficiency in the vehicle running detection process caused by manual marking of the road direction in the conventional vehicle reverse running detection, so that the invention provides an automatic marking and detecting method, a device and computer equipment for the vehicle running detection.
According to a first aspect, an embodiment of the present invention discloses an automatic labeling method for vehicle driving detection, including: acquiring road image data; extracting a vehicle track set of a target vehicle within a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track; obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points; obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector; and marking the driving direction of the target vehicle based on the calibration direction vector.
Optionally, the obtaining, based on the vehicle detection frames of the target vehicle at preset marked points, a direction vector between the vehicle detection frame of the target vehicle at each preset detection point and the vehicle detection frame of the preset marked point includes: obtaining a preset number of vehicle detection frames in a first direction and a second direction of a preset marking point in the driving track; respectively connecting the geometric center of the vehicle detection frame in the first direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a first direction vector; respectively connecting the geometric center of the vehicle detection frame in the second direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a second direction vector; and obtaining the direction vector based on the first direction vector and the second direction vector.
Optionally, the obtaining the direction vector based on the first direction vector and the second direction vector includes: screening a sub-direction vector forming an acute angle in the first sub-direction vector and the second sub-direction vector as a possible direction vector of the preset marking point; removing vectors of two side edges in the possible direction vector angle; and calculating the vector sum of the remaining possible direction vectors to obtain the direction vectors.
Optionally, the obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector includes: aligning the vehicle detection frame with the preset marking point and the corresponding road image data by a geometric center to perform equal-ratio scaling preset proportion; and obtaining the calibration direction vectors of all pixel points of the target vehicle in the zoomed road image data based on the zoomed road image data, the initial direction vector and the direction vector.
According to a second aspect, an embodiment of the present invention further discloses a vehicle driving detection method, including: acquiring a driving marking direction of a target vehicle based on image data of the target vehicle, wherein the driving marking direction is obtained by using the automatic marking method for vehicle driving detection according to the first aspect and any optional embodiment of the first aspect; and detecting the driving trend of the target vehicle based on the driving marking direction.
Optionally, the detecting the driving trend of the target vehicle based on the driving labeling direction includes: obtaining the positions of the judging points based on one vehicle track in the vehicle track set, the frame number interval of the vehicle tracks and the preset number of judging points; obtaining a direction vector of a geometric center of each judgment point based on the position of the judgment point; and detecting the driving trend of the target vehicle based on the included angle relation between the direction vector of the geometric center of the judging point and the calibration direction vector.
Optionally, the detecting the driving trend of the target vehicle based on the included angle relationship between the direction vector of the geometric center of the determination point and the calibration direction vector includes: counting the retrograde motion conditions of the target vehicle in all the judgment points; if the number of the retrograde motion conditions of the target vehicle is larger than the number of the judgment points with the preset proportion, judging that the target vehicle is in retrograde motion; and if the number of the retrograde motion conditions of the target vehicle is less than or equal to the number of the judgment points with the preset proportion, judging that the target vehicle is in non-retrograde motion.
According to a third aspect, the embodiment of the invention also discloses an automatic labeling device for vehicle running detection, which comprises: the acquisition module is used for acquiring road image data; the vehicle track set extraction module is used for extracting a vehicle track set of a target vehicle in a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track; the direction vector module is used for obtaining a direction vector of the target vehicle between the vehicle detection frames of the preset detection points and the vehicle detection frames of the preset marking points based on the vehicle detection frames of the target vehicle at the preset marking points; the preset marking point is one of the preset detection points; the calibration direction vector module is used for obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector; and the marking module is used for marking the driving direction of the target vehicle based on the calibration direction vector.
According to a fourth aspect, an embodiment of the present invention also discloses a vehicle travel detection device including: the driving annotation direction module is used for acquiring the driving annotation direction of the target vehicle based on the image data of the target vehicle, wherein the driving annotation direction is obtained by using the automatic annotation method for vehicle driving detection in any one of the first aspect and the first aspect in a selectable real-time manner; and the driving trend module is used for detecting the driving trend of the target vehicle based on the driving marking direction.
According to a fifth aspect, an embodiment of the present invention further discloses a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the automatic labeling method for vehicle driving detection as described in the first aspect or any one of the optional embodiments of the first aspect or the automatic labeling method for vehicle driving detection as described in the second aspect or any one of the optional embodiments of the second aspect.
The technical scheme of the invention has the following advantages:
the invention provides an automatic labeling and detecting method, an automatic labeling and detecting device and a computer device for vehicle running detection, wherein the method comprises the following steps: acquiring road image data; extracting a vehicle track set of a target vehicle within a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track; obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points; obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector; and marking the driving direction of the target vehicle based on the calibration direction vector. By extracting the vehicle running track in the road image and obtaining the automatic marking of the running direction of the target vehicle through the vector relation between the preset marking point and the preset detection point in the vehicle running track, the mode of manually marking the running direction of the vehicle is eliminated, the marking can be carried out in a self-adaptive manner, and the accuracy and the processing efficiency of marking the running direction of the target vehicle are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating an exemplary method for automatically labeling vehicle driving detection according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific example of a vehicle travel detection method in the embodiment of the invention;
FIG. 3 is a schematic block diagram of a specific example of an automatic labeling apparatus for vehicle driving detection according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a specific example of the vehicle travel detection apparatus in the embodiment of the invention;
FIG. 5 is a diagram showing a specific example of a computer device according to an embodiment of the present invention;
fig. 6 is a schematic diagram showing a specific example of a vehicle travel detection method in the embodiment of the invention;
FIG. 7 is a diagram illustrating an example of an automatic labeling method for vehicle driving detection according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a specific example of an automatic labeling method for vehicle driving detection according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; the two elements may be directly connected or indirectly connected through an intermediate medium, or may be communicated with each other inside the two elements, or may be wirelessly connected or wired connected. The specific meanings of the above terms in the present invention can be understood in a specific case to those of ordinary skill in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The embodiment of the invention discloses an automatic labeling method for vehicle running detection, which comprises the following steps of:
step 101: road image data is acquired. For example, the road image data may be captured by a camera device that sets up detection points above or on both sides of the road, and the road image data may be extracted from a piece of road video data captured by the camera device. The embodiment of the invention does not limit the type of the road image data, and the person skilled in the art can determine the type according to the actual requirement.
Step 102: and extracting a vehicle track set of a target vehicle in a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track.
Illustratively, the target vehicle is a vehicle which needs to be subjected to vehicle direction labeling, the preset time is a time span for acquiring road image data, the set of vehicle trajectories is travel trajectories of all vehicles in the road image data within the preset time, and vehicles corresponding to different detection points in each corresponding travel trajectory are subjected to vehicle detection frame labeling, for example, within the preset time, vehicle tracking is performed on the road image data by using a FairMot algorithm, so as to obtain a vehicle trajectory set T ═ { T (1), T (2), … …, T (i), … … }, i ∈ { infinity {1,2, 3.......... eta }, T represents a trajectory, and T ═ { box (1), box (2) … … box (i) … … }, i ∈ {1,2,3...... infinity }, box (i) represents a corresponding detected vehicle detection point of the trajectory at the ith detection point, i are arranged in time sequence, and box ═ x1, y1, x2, y2), (x1, y1) represent the coordinates of the top left vertex of the vehicle detection frame, and (x2, y2) represent the coordinates of the bottom right vertex of the frame. The type of the vehicle tracking algorithm is not limited by the embodiment of the invention, and can be determined by a person skilled in the art according to actual needs.
Step 103: obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points. Illustratively, the preset marking point is a detection point needing vehicle direction marking, the preset detection points are detection points on two sides of the preset marking point, and the direction vector corresponding to the preset marking point is obtained according to the vector relation between the detection points on the two sides and the marking point.
Step 104: and obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector. Illustratively, the initial direction vector is an initial direction vector with an indeterminate direction and the magnitude of 0 set for each pixel point in the road image data, and a vector obtained by adding the direction vector obtained in step 103 and the initial direction vector is a calibration direction vector of the target vehicle at a preset mark point.
Step 105: and marking the driving direction of the target vehicle based on the calibration direction vector. For example, the driving direction of the target vehicle is labeled by obtaining a calibration direction vector corresponding to the target vehicle, so that the implementation direction of the target vehicle is the direction of the calibration direction vector.
The invention provides an automatic labeling method for vehicle running detection, which comprises the following steps: acquiring road image data; extracting a vehicle track set of a target vehicle within a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track; obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points; obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector; and marking the driving direction of the target vehicle based on the calibration direction vector. By extracting the vehicle running track in the road image and obtaining the mark of the running direction of the target vehicle through the vector relation between the preset mark point and the preset detection point in the vehicle running track, the mode of manually marking the running direction of the vehicle is eliminated, the mark can be carried out in a self-adaptive manner, and the accuracy and the processing efficiency of marking the running direction of the target vehicle are improved.
As an alternative embodiment of the present invention, the step 103 includes: obtaining a preset number of vehicle detection frames in a first direction and a second direction of a preset marking point in the driving track; respectively connecting the geometric center of the vehicle detection frame in the first direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a first direction vector; respectively connecting the geometric center of the vehicle detection frame in the second direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a second direction vector; and obtaining the direction vector based on the first direction vector and the second direction vector.
As an optional implementation manner of the present invention, the first direction vector includes a preset number of first sub-direction vectors, and the second direction vector includes a preset number of second sub-direction vectors, and the step 103 further includes: screening a sub-direction vector forming an acute angle in the first sub-direction vector and the second sub-direction vector as a possible direction vector of the preset marking point; removing vectors of two side edges in the possible direction vector angle; and calculating the vector sum of the remaining possible direction vectors to obtain the direction vector.
For example, the first direction and the second direction of the preset marked point of the driving track are preset detection points on two sides of the preset marked point respectively, and may be preset detection points on the front side and the rear side of the preset marked point or on the left side and the right side, and the preset number of vehicle detection frames are a preset number of detection points in the first direction and the second direction, and may be vehicle detection frames extracted from 5 detection points in the front and the rear direction, for example. The number of the preset number of vehicle detection frames is not limited in the embodiment of the invention, and can be determined by a person skilled in the art according to actual needs.
Specifically, the method for calculating the direction vector is described in the following specific embodiment, for a box (i) in each track t, the geometric center b (i) of the vehicle detection frame of the labeled point is preset, the geometric centers b (i) of the first 5 vehicle detection frames are selected, the geometric centers b (i) are connected to obtain the unit direction vector, and the unit direction vector is obtained by connecting the geometric centers b (i) to the centers b (i) of the last 5 detection frames. Collecting the range of less than 45 degrees formed by the 10 vectors as the possible direction vector range of the detection frame, removing 2 vectors at the edge of the vector range, using the acute angle range formed by the remaining 8 vectors as the candidate vector range, calculating the sum of the 8 unit vectors to obtain the direction vector, namely the direction vector of box (i), fig. 7 is a determination diagram of the direction vector, because the drawing has limited space, box1 and box2 in fig. 7 respectively represent the first 5 boxes, box4 and box5 respectively represent the last 5 boxes, box3 represents the vehicle detection frame with preset marking points, the step of removing 2 vectors at the edge of the vector range is omitted, the large black arrow is the driving direction, and the thick arrow is the final unit direction vector. The second to third steps are mainly steps of unitizing each unit vector.
As an alternative embodiment of the present invention, the step 104 includes: aligning the vehicle detection frame with the preset marking point and the corresponding road image data by a geometric center to perform equal-ratio scaling preset proportion; and obtaining the calibration direction vectors of all pixel points of the target vehicle in the zoomed road image data based on the zoomed road image data, the initial direction vector and the direction vector.
For example, the vehicle detection frame and the road image data which obtain the preset marking point are aligned by the geometric center of the vehicle detection frame, and the preset proportion may be specifically set according to the size of the actual target vehicle, and may be set to 80% or 90%, for example. And after the zoomed vehicle detection frame is completely overlapped with the vehicle region in the corresponding road image data, carrying out direction marking on the pixel points in the vehicle detection frame region in the zoomed road image data to obtain the calibration direction vectors of all the pixel points, wherein the calibration direction vectors are consistent with the direction vectors of the vehicle detection frame. The embodiment of the invention does not limit the size of the preset proportion, and can be determined by a person skilled in the art according to actual needs.
Specifically, for a pixel region corresponding to box (i) in the road image data, which is denoted as B1, box (i) is scaled by 80% in an equal ratio, geometric centers are aligned, a pixel region corresponding to the obtained road image data is denoted as B2, and each pixel point in B2 is obtained, and the direction vector obtained in step 103 is added to the initial direction vector, so as to obtain a calibration direction vector of the current iteration of the pixel point.
The embodiment of the invention also discloses a vehicle running detection method, which comprises the following steps of:
step 201: and acquiring a driving marking direction of the target vehicle based on the image data of the target vehicle, wherein the driving marking direction is obtained by using the automatic marking method for vehicle driving detection in any embodiment.
Step 202: and detecting the driving trend of the target vehicle based on the driving marking direction. The target vehicle is a vehicle that needs to be subjected to vehicle driving tendency determination, wherein the driving tendency of the vehicle may be a vehicle driving direction, such as a forward direction or a reverse direction, or the vehicle is changing lanes.
The vehicle running detection method provided by the embodiment of the invention comprises the following steps: and acquiring a driving marking direction of the target vehicle based on the image data of the target vehicle, wherein the driving marking direction is obtained by using the automatic marking method for vehicle driving detection in any embodiment. And detecting the driving trend of the target vehicle based on the driving labeling direction. And obtaining the form driving marking direction in the vehicle driving track according to the obtained image data of the vehicle, and obtaining the driving trend of the vehicle more accurately according to the obtained driving marking direction.
As an alternative embodiment of the present invention, the step 202 includes: obtaining the positions of the judging points based on one vehicle track in the vehicle track set, the frame number interval of the vehicle tracks and the preset number of judging points; obtaining a direction vector of a geometric center of each judgment point based on the position of the judgment point; and detecting the driving trend of the target vehicle based on the included angle relationship between the direction vector of the geometric center of the judgment point and the calibration direction vector. Counting the retrograde motion conditions of the target vehicle in all the judgment points; if the quantity of the retrograde motion conditions of the target vehicle is larger than the quantity of the judgment points with the preset proportion, judging that the target vehicle is in retrograde motion; and if the number of the retrograde motion conditions of the target vehicle is less than or equal to the number of the judgment points with the preset proportion, judging that the target vehicle is in non-retrograde motion.
Illustratively, the vehicle track set is all vehicle tracks in the image data, the frame number interval of the vehicle tracks is the interval of the collected frame numbers in the vehicle track collection, the preset number of judgment points are detection points which need to judge the driving trend of the target vehicle, the number of the judgment points can be selected to be an odd number, and when the included angle between the geometric center of the vehicle detection frame of the judgment points and the specified direction vector in the corresponding driving labeling direction is an obtuse angle, the driving trend of the vehicle at the current judgment point is judged to be the reverse driving.
Specifically, the determination of the traveling tendency of the target vehicle is described in the following detailed description. For each track, selecting odd number of decision points, wherein the number and the positions of the decision points are determined by the following rules: if the track has n frames, selecting a frame number with an interval of m, if n is an integer, the number of points is n/m, and if n is an integer, the number of points is determined to be n/m + 1. The judgment point positions are marked as x and are respectively positioned at 1/(x +1),2/(x +1) … … x/(x + 1). And for a plurality of centers b (i) of each judgment point on a track, obtaining a direction vector of each judgment point according to the automatic labeling method for vehicle running detection, calculating an included angle between the direction vector of each judgment point and a calibration direction vector of a corresponding position, and recording as one-time reverse running when the included angle is greater than 45 degrees. And (5) counting the reverse running conditions of the x decision points. And when more than 50% of the judging points are marked as the reverse running, marking the vehicle of the track as the reverse running. Fig. 8 is a schematic diagram of a specific example of determining vehicle retrograde motion, where solid arrows are calibration direction vectors of pixel points, dashed arrows are upper and lower boundaries, and vehicle direction vectors within a 90-degree range surrounded by the upper and lower boundaries of the vectors are all in normal driving, where angles from the upper and lower boundaries of the vectors to the calibration direction vectors are all 45 degrees, and vehicle direction vectors beyond the 90-degree range are all in retrograde motion.
Specifically, according to the above-described automatic labeling method for vehicle travel detection and vehicle travel detection method, a method of determining a vehicle travel tendency can be described according to the following embodiments. Selecting road image data with preset time of 30 minutes to mark the road direction, and adopting the road image data of the next 30 minutes to judge and detect the vehicle driving trend, as shown in fig. 6, as a real-time detection result, an arrow 12, an arrow 22 and an arrow 32 are directions of the vehicle track at this time, and an arrow 11, an arrow 21 and an arrow 31 are calibration directions of the geometric center of the vehicle at this time:
the arrow 11 and the arrow 12 of the No. 1 vehicle are almost overlapped, and the vehicle runs normally; the No. 2 vehicle is calculated to stop at the side and is not completely parallel to the road direction, but the included angle between the marked direction vector arrow 21 of the central point of the vehicle and the direction vector of the vehicle at the moment is less than 45 degrees, so that the vehicle is not judged to be in the wrong direction; since the lane change of car No. 3 to the left is intended, the nominal direction vector of the center point deviates from the direction vector of the vehicle at that time, but is within 45 degrees, and therefore it is not determined to be in reverse.
The embodiment of the invention also discloses an automatic labeling device for vehicle running detection, as shown in fig. 3, the device comprises:
an obtaining module 301, configured to obtain road image data. For an exemplary detailed description, see the content of step 101 in the above-mentioned embodiment of the automatic labeling method for vehicle driving detection, and the details are not repeated here.
A vehicle track set extraction module 302, configured to extract, based on the road image data, a vehicle track set of a target vehicle within a preset time, where the vehicle track set includes a driving track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the driving track. For an exemplary purpose, the details of step 102 in the above-mentioned embodiment of the automatic labeling method for vehicle driving detection are not described herein again.
A direction vector module 303, configured to obtain, based on the vehicle detection frames of the target vehicle at preset marking points, direction vectors between the vehicle detection frames of the target vehicle at each preset detection point and the vehicle detection frames at the preset marking points; the preset marking point is one of the preset detection points. For an exemplary purpose, the details of step 103 in the above-mentioned embodiment of the automatic labeling method for vehicle driving detection are not described herein again.
A calibration direction vector module 304, configured to obtain a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector. For an exemplary purpose, the details of step 104 in the above-mentioned embodiment of the automatic labeling method for vehicle driving detection are not described herein again.
A labeling module 305, configured to label a driving direction of the target vehicle based on the calibrated direction vector. For an exemplary purpose, the details of step 105 in the above-mentioned embodiment of the automatic labeling method for vehicle driving detection are not described herein again.
The invention provides an automatic labeling device for vehicle running detection, which comprises: an obtaining module 301, configured to obtain road image data. A vehicle track set extraction module 302, configured to extract, based on the road image data, a vehicle track set of a target vehicle within a preset time, where the vehicle track set includes a driving track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the driving track. A direction vector module 303, configured to obtain, based on the vehicle detection frames of the target vehicle at preset marking points, direction vectors between the vehicle detection frames of the target vehicle at each preset detection point and the vehicle detection frames at the preset marking points; the preset marking point is one of the preset detection points. A calibrated direction vector module 304, configured to obtain a calibrated direction vector of the target vehicle based on the direction vector and the initial direction vector. A labeling module 305, configured to label a driving direction of the target vehicle based on the calibrated direction vector. By extracting the vehicle running track in the road image and obtaining the mark of the running direction of the target vehicle through the vector relation between the preset mark point and the preset detection point in the vehicle running track, the mode of manually marking the running direction of the vehicle is eliminated, the mark can be carried out in a self-adaptive manner, and the accuracy and the processing efficiency of marking the running direction of the target vehicle are improved.
As an optional implementation manner of the present invention, the direction vector module 303 includes: a preset detection frame acquisition module 301, configured to acquire a preset number of vehicle detection frames in a first direction and a second direction of a preset marking point in the driving track; the first direction vector module is used for respectively connecting the geometric center of the vehicle detection frame in the first direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a first direction vector; the second direction vector module is used for respectively connecting the geometric center of the vehicle detection frame in the second direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a second direction vector; and the combining module is used for obtaining the direction vector based on the first direction vector and the second direction vector. For example, the details of step 103 of the automatic labeling method for vehicle driving detection in the above embodiments are not described herein again.
As an optional implementation manner of the present invention, the first direction vector includes a preset number of first sub-direction vectors, and the second direction vector includes a preset number of second sub-direction vectors, and the direction vector module 303 further includes: the screening module is used for screening a sub-direction vector forming an acute angle in the first sub-direction vector and the second sub-direction vector as a possible direction vector of the preset marking point; the edge removing module is used for removing vectors of two side edges in the possible direction vector angle; and the vector sum module is used for calculating the vector sum of the residual possible direction vectors to obtain the direction vector. For example, the details of step 103 of the automatic labeling method for vehicle driving detection in the above embodiments are not described herein again.
As an optional implementation manner of the present invention, the calibration direction vector module 304 includes: the zooming module is used for aligning the vehicle detection frame of the preset marking point and the corresponding road image data by a geometric center to perform equal-ratio zooming for a preset ratio; and the calibration direction vector submodule is used for obtaining calibration direction vectors of all pixel points of the target vehicle in the zoomed road image data based on the zoomed road image data, the initial direction vector and the direction vector. For example, the details of the step 104 of the automatic labeling method for vehicle driving detection in the above embodiments are not described herein again.
The embodiment of the invention also discloses a vehicle running detection device, as shown in fig. 4, the device comprises:
a driving direction labeling module 401, configured to obtain a driving labeling direction of a target vehicle based on image data of the target vehicle, where the driving labeling direction is obtained by using the automatic labeling method for vehicle driving detection described in the above method embodiment. For an exemplary purpose, details of step 201 of the vehicle driving detection method in the foregoing embodiment are not described herein again.
A driving trend module 402, configured to detect a driving trend of the target vehicle based on the driving annotation direction. For exemplary details, see the content of step 202 of the vehicle driving detection method in the foregoing embodiment, and will not be described herein again.
The invention provides an automatic labeling device for vehicle running detection, which comprises: a driving annotation direction module 401, configured to obtain a driving annotation direction of a target vehicle based on image data of the target vehicle, where the driving annotation direction is obtained by using the automatic annotation method for vehicle driving detection in the foregoing method embodiment; a driving trend module 402, configured to detect a driving trend of the target vehicle based on the driving annotation direction. And obtaining the form driving marking direction in the vehicle driving track according to the obtained image data of the vehicle, and obtaining the driving trend of the vehicle more accurately according to the obtained driving marking direction.
As an optional embodiment of the present invention, the driving tendency module 402 includes: the judging point position module is used for obtaining the position of the judging point based on one vehicle track in the vehicle track set, the frame number interval of the vehicle track and the preset number of judging points; the judging point direction module is used for obtaining a direction vector of a geometric center of each judging point based on the position of the judging point; and the first trend judging module is used for detecting the driving trend of the target vehicle based on the included angle relationship between the direction vector of the geometric center of the judging point and the calibration direction vector. The statistical module is used for counting the retrograde motion conditions of the target vehicle in all the judgment points; the first judging module is used for judging that the target vehicle is in the reverse running state if the number of the reverse running conditions of the target vehicle is larger than the number of judging points with preset proportion; and the second determination module is used for determining that the target vehicle is not in the reverse driving state if the number of the reverse driving conditions of the target vehicle is less than or equal to the number of the determination points of the preset proportion. For exemplary details, see the content of step 202 of the vehicle driving detection method in the foregoing embodiment, and will not be described herein again.
An embodiment of the present invention further provides a computer device, as shown in fig. 5, the computer device may include a processor 501 and a memory 502, where the processor 501 and the memory 502 may be connected by a bus or in another manner, and fig. 5 takes the example of being connected by a bus as an example.
Processor 501 may be a Central Processing Unit (CPU). The Processor 501 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 502, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the automatic labeling method and the vehicle driving detection method for vehicle driving detection in the embodiments of the present invention. The processor 501 executes various functional applications and data processing of the processor by executing the non-transitory software programs, instructions and modules stored in the memory 502, that is, implements the automatic labeling method for vehicle travel detection and the vehicle travel detection method in the above-described method embodiments.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 501, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 optionally includes memory located remotely from processor 501, which may be connected to processor 501 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 502, and when executed by the processor 501, perform an automatic labeling method for vehicle driving detection and a vehicle driving detection method as in the embodiments shown in fig. 1 or fig. 2.
The details of the computer device can be understood by referring to the corresponding related descriptions and effects in the embodiments shown in fig. 1 or fig. 2, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. An automatic labeling method for vehicle travel detection, comprising:
acquiring road image data;
extracting a vehicle track set of a target vehicle within a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track;
obtaining a direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point; the preset marking point is one of the preset detection points;
obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector;
and marking the driving direction of the target vehicle based on the calibration direction vector.
2. The method according to claim 1, wherein the obtaining of the direction vector of the target vehicle between the vehicle detection frame of each preset detection point and the vehicle detection frame of the preset marking point based on the vehicle detection frame of the target vehicle at the preset marking point comprises:
obtaining a preset number of vehicle detection frames in a first direction and a second direction of a preset marking point in the driving track;
respectively connecting the geometric center of the vehicle detection frame in the first direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a first direction vector;
respectively connecting the geometric center of the vehicle detection frame in the second direction with the geometric center of the vehicle detection frame with the preset marking points to obtain a second direction vector;
and obtaining the direction vector based on the first direction vector and the second direction vector.
3. The method according to claim 2, wherein the first direction vector comprises a preset number of first sub-direction vectors and the second direction vector comprises a preset number of second sub-direction vectors,
the obtaining the direction vector based on the first direction vector and the second direction vector comprises:
screening a sub-direction vector forming an acute angle in the first sub-direction vector and the second sub-direction vector as a possible direction vector of the preset marking point;
removing vectors of two side edges in the possible direction vector angle;
and calculating the vector sum of the remaining possible direction vectors to obtain the direction vector.
4. The method of claim 1, wherein said deriving a nominal direction vector of the target vehicle based on the direction vector and an initial direction vector comprises:
aligning the vehicle detection frame with the preset marking point and the corresponding road image data by a geometric center to perform equal-ratio scaling preset proportion;
and obtaining the calibration direction vectors of all pixel points of the target vehicle in the zoomed road image data based on the zoomed road image data, the initial direction vector and the direction vector.
5. A vehicle travel detection method characterized by comprising:
acquiring a driving marking direction of a target vehicle based on image data of the target vehicle, wherein the driving marking direction is obtained by using the automatic marking method for vehicle driving detection according to any one of claims 1-4;
and detecting the driving trend of the target vehicle based on the driving labeling direction.
6. The method of claim 5, wherein the detecting a driving tendency of the target vehicle based on the driving direction includes:
obtaining the positions of the judging points based on one vehicle track in the vehicle track set, the frame number interval of the vehicle tracks and the preset number of judging points;
obtaining a direction vector of a geometric center of each judgment point based on the position of the judgment point;
and detecting the driving trend of the target vehicle based on the included angle relationship between the direction vector of the geometric center of the judgment point and the calibration direction vector.
7. The method according to claim 6, wherein the detecting the driving tendency of the target vehicle based on the included angle relationship between the direction vector of the geometric center of the determination point and the calibration direction vector comprises:
counting the retrograde motion conditions of the target vehicle in all the judgment points;
if the number of the retrograde motion conditions of the target vehicle is larger than the number of the judgment points with the preset proportion, judging that the target vehicle is in retrograde motion;
and if the number of the retrograde motion conditions of the target vehicle is less than or equal to the number of the judgment points with the preset proportion, judging that the target vehicle is in non-retrograde motion.
8. An automatic labeling device for vehicle travel detection, comprising:
the acquisition module is used for acquiring road image data;
the vehicle track set extraction module is used for extracting a vehicle track set of a target vehicle in a preset time based on the road image data, wherein the vehicle track set comprises a running track of the target vehicle and a vehicle detection frame of the target vehicle at a preset detection point of the running track;
the direction vector module is used for obtaining a direction vector of the target vehicle between the vehicle detection frames of the preset detection points and the vehicle detection frames of the preset marking points based on the vehicle detection frames of the target vehicle at the preset marking points; the preset marking point is one of the preset detection points;
the calibration direction vector module is used for obtaining a calibration direction vector of the target vehicle based on the direction vector and the initial direction vector;
and the marking module is used for marking the driving direction of the target vehicle based on the calibration direction vector.
9. A vehicle travel detection apparatus characterized by comprising:
a driving annotation direction module, configured to obtain a driving annotation direction of a target vehicle based on image data of the target vehicle, where the driving annotation direction is obtained by using the automatic annotation method for vehicle driving detection according to any one of claims 1 to 4;
and the driving trend module is used for detecting the driving trend of the target vehicle based on the driving marking direction.
10. A computer device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the automatic labeling method for vehicle travel detection of any one of claims 1-4 or the vehicle travel detection method of any one of claims 5-7.
CN202111593469.7A 2021-12-23 2021-12-23 Automatic labeling and detecting method and device for vehicle running detection and computer equipment Pending CN114445448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111593469.7A CN114445448A (en) 2021-12-23 2021-12-23 Automatic labeling and detecting method and device for vehicle running detection and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111593469.7A CN114445448A (en) 2021-12-23 2021-12-23 Automatic labeling and detecting method and device for vehicle running detection and computer equipment

Publications (1)

Publication Number Publication Date
CN114445448A true CN114445448A (en) 2022-05-06

Family

ID=81364215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111593469.7A Pending CN114445448A (en) 2021-12-23 2021-12-23 Automatic labeling and detecting method and device for vehicle running detection and computer equipment

Country Status (1)

Country Link
CN (1) CN114445448A (en)

Similar Documents

Publication Publication Date Title
Sochor et al. Comprehensive data set for automatic single camera visual speed measurement
EP3576008B1 (en) Image based lane marking classification
CN105718872B (en) Auxiliary method and system for rapidly positioning lanes on two sides and detecting vehicle deflection angle
US9154741B2 (en) Apparatus and method for processing data of heterogeneous sensors in integrated manner to classify objects on road and detect locations of objects
CN103617412B (en) Real-time lane line detection method
US7580547B2 (en) Electronic traffic monitor
US11205284B2 (en) Vehicle-mounted camera pose estimation method, apparatus, and system, and electronic device
CN112990087B (en) Lane line detection method, device, equipment and readable storage medium
CN105608431A (en) Vehicle number and traffic flow speed based highway congestion detection method
CN104376332A (en) License plate recognition method and device
CN114972490B (en) Automatic data labeling method, device, equipment and storage medium
CN108399360B (en) Continuous obstacle detection method, device and terminal
CN112347817B (en) Video target detection and tracking method and device
CN112149471B (en) Loop detection method and device based on semantic point cloud
CN112447060A (en) Method and device for recognizing lane and computing equipment
CN113468911A (en) Vehicle-mounted red light running detection method and device, electronic equipment and storage medium
CN114445448A (en) Automatic labeling and detecting method and device for vehicle running detection and computer equipment
Sala et al. Measuring traffic lane‐changing by converting video into space–time still images
Garg et al. Low complexity techniques for robust real-time traffic incident detection
CN112861570A (en) Detection method and device and road side unit
Rosebrock et al. Real-time vehicle detection with a single camera using shadow segmentation and temporal verification
CN116681955B (en) Method and computing device for identifying traffic guardrail anomalies
Vasudha et al. Carriageway Edge Detection for Unmarked Urban Roads using Deep Learning Techniques
CN113269004B (en) Traffic counting device and method and electronic equipment
CN102622888B (en) Self-learning identification method and device for licence plate based on video detection

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