CN114549645A - Method and device for calculating course angle of target vehicle based on visual information - Google Patents

Method and device for calculating course angle of target vehicle based on visual information Download PDF

Info

Publication number
CN114549645A
CN114549645A CN202210182625.9A CN202210182625A CN114549645A CN 114549645 A CN114549645 A CN 114549645A CN 202210182625 A CN202210182625 A CN 202210182625A CN 114549645 A CN114549645 A CN 114549645A
Authority
CN
China
Prior art keywords
wheels
frame
vehicle
target
course angle
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
CN202210182625.9A
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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202210182625.9A priority Critical patent/CN114549645A/en
Publication of CN114549645A publication Critical patent/CN114549645A/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
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C1/00Measuring angles

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Traffic Control Systems (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method for calculating a target vehicle course angle based on visual information, which comprises the steps of obtaining a target whole frame and a body frame, a tail frame, a head frame and a wheel frame of a target vehicle from a target detection network, calculating intersection and parallel ratios of the body frame, the tail frame, the head frame and the wheel frame with the target whole frame according to pixel coordinates of the body frame, the tail frame, the head frame and the wheel frame, judging the position of a detected part of the target vehicle, and calculating course angles under different driving conditions by adopting different calculation methods according to different detected parts and the number conditions of detected wheels. The invention also discloses a related device for realizing the method, so that the detection is more comprehensive, and the result is accurate and reliable.

Description

Method and device for calculating course angle of target vehicle based on visual information
Technical Field
The invention relates to the technical field of intelligent driving of automobiles, in particular to a method and a device for calculating a target vehicle course angle based on visual information.
Background
In the case of the automated driving vehicle exterior vision, the attitude estimation and the attribute calculation of other target vehicles on the road are necessary. The target vehicle can be effectively avoided and the target vehicle behavior can be responded in time to ensure the safety of the vehicle by utilizing the attribute of the target. Where the heading angle is an important point in the target vehicle attribute. The course angle is an included angle of the body direction of the target vehicle relative to the body direction of the vehicle under a ground coordinate system.
For the related technical scheme of the current stage of calculating the target vehicle course angle, the Chinese patent with publication number CN111291786A discloses a vehicle-mounted vision real-time multi-target course angle estimation method and device, wherein the course angle is directly output by a neural network and a data label through deep learning and the network, but the method needs a large amount of calibration data support and a model training process; chinese patent application No. CN110962844A discloses a method for correcting a vehicle heading angle, a system storage medium, and a terminal, wherein the calculation of the heading angle only refers to the case when wheels on the same side are detected at the same time, but does not refer to the case when two wheels are not detected, which has certain limitations.
Disclosure of Invention
Aiming at the defects of the prior art, the technical problems to be solved by the invention are as follows: how to provide a method for calculating course angles under different driving conditions by adopting different calculation methods according to different types of vehicle conditions.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for calculating a target vehicle course angle based on visual information is characterized in that: the method comprises the following steps:
(1) acquiring a detection frame of a target vehicle from a target detection network, wherein the detection frame comprises a target whole frame, a tail frame, a head frame and a wheel frame, respectively detecting pixel coordinates of a left upper point and a right lower point of a frame rectangle of the target whole frame, the body frame, the tail frame, the head frame and the wheel frame, calculating pixel coordinate information of a required grounding point of the detection frame, and converting the pixel coordinates into distance information of a world coordinate system by calling a coordinate conversion function;
(2) according to the pixel coordinates of the vehicle body frame, the vehicle tail frame, the vehicle head frame and the vehicle wheel frame, calculating the intersection ratio of the vehicle tail frame, the vehicle head frame and the vehicle wheel frame with the whole target frame respectively, integrating the detected target frames of the same target, and judging the position of the detected part of the target vehicle, if the vehicle tail frame is detected, executing the step (3), if the vehicle head frame is detected, executing the step (4), and if only the whole target frame is detected, executing the step (5);
(3) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the number of the detected wheels is more than or equal to 2, the wheels with the transverse distances between the grounding points C (X, Y) of the tailstock and the grounding points of the wheels which are both more than 0 or both less than 0 are taken as the wheels on the same side, otherwise, the wheels on different sides;
if the wheels are the same-side wheels, two wheels with the largest distance between the wheel grounding points of all the wheels, namely the wheel A (X1, Y1) and the wheel B (X2, Y2), are selected, and the orientation of the wheels is judged according to the distance between the two wheels and the grounding point C (X, Y) of the tail frame, for example
Figure BDA0003522377550000021
The wheel B is a wheel close to the tail frame, and the direction vector pointing to the head determined by the two wheels is
Figure BDA0003522377550000022
The direction vector of the vehicle is the unit vector
Figure BDA0003522377550000023
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure BDA0003522377550000024
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure BDA0003522377550000025
if it is
Figure BDA0003522377550000026
Then theta is equal to theta, otherwise theta is equal to theta;
If the wheels are different-side wheels, the coordinates of the connecting line between the midpoint of the connecting line of the wheels N (X1, Y1) and the wheels M (X2, Y2) and the grounding point C (X, Y) of the tail frame are calculated, and the direction vector pointing to the head frame of the target vehicle, namely the direction vector
Figure BDA0003522377550000027
Using target vehicle direction vector
Figure BDA0003522377550000028
Direction vector of the vehicle
Figure BDA0003522377550000029
Calculating the magnitude of a course angle according to a formula I and a formula II;
if the number of the detected wheels is 1, judging the position of the wheels according to the difference of the lateral distance between the grounding point C (X, Y) of the tail frame and the grounding point of the wheels, and if the difference is more than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X1, Y1) of the right lower point of the tail frame and the coordinates A (X2, Y2) of the grounding point of the wheels
Figure BDA00035223775500000210
Using target vehicle direction vector
Figure BDA00035223775500000211
Direction vector of the vehicle
Figure BDA00035223775500000212
Calculating the magnitude of a course angle according to a formula I and a formula II; if the difference is less than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X3, Y3) of the left lower corner point of the tail frame and the coordinates A (X2, Y2) of the wheel grounding point
Figure BDA00035223775500000213
Using target vehicle direction vector
Figure BDA00035223775500000214
Direction vector of the vehicle
Figure BDA00035223775500000215
Calculating the magnitude of the course angle according to a formula I and a formula II
If the number of the detected wheels is 0, judging according to the intersection ratio of the tail frame and the target whole frame, if the intersection ratio of the tail frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the tail part of the target vehicle is opposite to the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the tail frame and the whole target frame is less than or equal to k, the range of k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(4) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the number of the detected wheels is more than or equal to 2, the wheels with the transverse distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels being both more than 0 or both less than 0 are taken as the same-side wheels, otherwise, the wheels are taken as different-side wheels;
if the wheels are the same-side wheels, two wheels with the largest distance between the wheel contact points of all the wheels, namely the wheel A (X1, Y1) and the wheel B (X2, Y2), are selected, and the orientation of the wheels is judged according to the distance between the two wheels and the head frame contact point C (X, Y), such as
Figure BDA0003522377550000031
The wheel A is the wheel close to the frame of the vehicle head, and the direction vector pointing to the vehicle head determined by the two wheels is
Figure BDA0003522377550000032
The direction vector of the vehicle is the unit vector
Figure BDA0003522377550000033
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure BDA0003522377550000034
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure BDA0003522377550000035
if it is
Figure BDA0003522377550000036
Theta is equal to theta, otherwise theta is equal to theta;
if the wheels are different-side wheels, the coordinates of the connecting line between the midpoint of the connecting line of the wheel N (X1, Y1) and the wheel M (X2, Y2) and the head frame grounding point C (X, Y) are calculated, and the direction vector pointing to the head frame of the target vehicle, i.e. the direction vector
Figure BDA0003522377550000037
Using target vehicle direction vector
Figure BDA0003522377550000038
Direction vector of the vehicle
Figure BDA0003522377550000039
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 1, judging the positions of the wheels according to the difference of the lateral distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels, and if the number of the detected wheels is more than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X1, Y1) of the right lower point of the head frame and the coordinates A (X2, Y2) of the grounding points of the wheels
Figure BDA00035223775500000310
Using target vehicle direction vector
Figure BDA00035223775500000311
Direction vector of the vehicle
Figure BDA00035223775500000312
And calculating the magnitude of the course angle according to the formula (III) and the formula (IV). If the difference is less than 0, the coordinate of the pixel Z (X3, Y3) of the left lower corner point of the head frame and the coordinate A (X2, Y2) of the grounding point of the wheel are countedCalculating the direction vector of the vehicle
Figure BDA00035223775500000313
Using target vehicle direction vector
Figure BDA00035223775500000314
Direction vector of the vehicle
Figure BDA00035223775500000315
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 0, judging according to the intersection ratio of the head frame and the target whole frame, if the intersection ratio of the head frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the head part of the target vehicle is over against the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the head frame and the whole target frame is less than or equal to k, the range of the k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the magnitude of the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(5) if two wheels are detected, determining the direction vector of the target vehicle according to the connecting line of the two wheels and the direction of the longitudinal speed of the target vehicle
Figure BDA00035223775500000316
Using target vehicle direction vector
Figure BDA00035223775500000317
Direction vector of the vehicle
Figure BDA00035223775500000318
Calculating the magnitude of the course angle according to a formula I and a formula II;
if only one wheel is detected, the transverse speed and the longitudinal speed of the target vehicle are obtained according to the tracking logic, and the course angle of the target vehicle is obtained by combining the longitudinal speed of the vehicle and calculating by utilizing a trigonometric function.
As optimization, if any one of the detection conditions in the steps (3) to (5) cannot be satisfied, the heading angle is 0.
As an optimization, in the step (3), if the number of detected wheels is greater than or equal to 2, the confidence of the course angle is 1, if the number of detected wheels is 1 and the difference between the lateral distance between the grounding point of the tailstock and the grounding point of the wheels is greater than 0, the confidence of the course angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the tailstock and the target whole frame is greater than k, the confidence of the course angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the tailstock and the target whole frame is less than or equal to k, the confidence of the course angle is 0;
in the step (4), if the number of detected wheels is more than or equal to 2, the confidence coefficient of the course angle is 1, if the number of detected wheels is 1 and the difference between the transverse distance between the grounding point of the tail frame and the grounding point of the wheels is more than 0, the confidence coefficient of the course angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is more than k, the confidence coefficient of the course angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is less than or equal to k, the confidence coefficient of the course angle is 0;
in the step (5), if two wheels are detected, the confidence coefficient of the course angle is 1, and if only one wheel is detected, the confidence coefficient of the course angle is 0;
if any detection condition from the step (3) to the step (5) cannot be met, the confidence coefficient of the course angle is 0;
if the confidence coefficient of the course angle of five continuous detection periods is always 0 and the calculated course angle does not jump, directly outputting the calculated course angle; and otherwise, the course angle is the sum of products of the calculated course angle value and the confidence coefficient of the course angle in five continuous detection periods, and then the sum of the confidence coefficients of the five detection periods is divided for carrying out sliding window filtering.
An electronic device implementing a method for calculating a target vehicle heading angle based on visual information includes a memory configured to store executable instructions;
a processor configured to execute executable instructions stored in the memory to implement the one method of calculating a target vehicle heading angle based on visual information described above.
A computer readable storage medium having computer program instructions stored thereon for performing the above-described method for calculating a target vehicle heading angle based on visual information.
In conclusion, the beneficial effects of the invention are as follows: the invention utilizes the information detected by the detection network, calculates the course angles of the target vehicles under different working conditions according to different output results of the detection frames, and has more comprehensive detection and accurate and reliable result.
Drawings
For purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made in detail to the present invention as illustrated in the accompanying drawings, in which:
FIG. 1 is a schematic view of a course angle calculation process according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, a method for calculating a target vehicle heading angle based on visual information in the present embodiment is characterized in that: the method comprises the following steps:
(1) acquiring a detection frame of a target vehicle from a target detection network, wherein the detection frame comprises a target whole frame, a tail frame, a head frame and a wheel frame, respectively detecting pixel coordinates of a left upper point and a right lower point of a frame rectangle of the target whole frame, the body frame, the tail frame, the head frame and the wheel frame, calculating pixel coordinate information of a required grounding point of the detection frame, and converting the pixel coordinates into distance information of a world coordinate system by calling a coordinate conversion function;
(2) according to the pixel coordinates of the vehicle body frame, the vehicle tail frame, the vehicle head frame and the vehicle wheel frame, calculating the intersection ratio of the vehicle tail frame, the vehicle head frame and the vehicle wheel frame with the whole target frame respectively, integrating the detected target frames of the same target, and judging the position of the detected part of the target vehicle, if the vehicle tail frame is detected, executing the step (3), if the vehicle head frame is detected, executing the step (4), and if only the whole target frame is detected, executing the step (5);
(3) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the number of the detected wheels is more than or equal to 2, the wheels with the transverse distances between the grounding points C (X, Y) of the tailstock and the grounding points of the wheels which are both more than 0 or both less than 0 are taken as the wheels on the same side, otherwise, the wheels on different sides;
if the wheels are the same-side wheels, two wheels with the largest distance between the wheel grounding points of all the wheels, namely the wheel A (X1, Y1) and the wheel B (X2, Y2), are selected, and the orientation of the wheels is judged according to the distance between the two wheels and the grounding point C (X, Y) of the tail frame, for example
Figure BDA0003522377550000051
The wheel B is a wheel close to the tail frame, and the direction vector pointing to the head determined by the two wheels is
Figure BDA0003522377550000052
The direction vector of the vehicle is the unit vector
Figure BDA0003522377550000053
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure BDA0003522377550000054
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure BDA0003522377550000055
if it is
Figure BDA0003522377550000056
Theta is equal to theta, otherwise theta is equal to theta;
if the wheels are different side wheels, the coordinates of the connecting line of the midpoint of the connecting line of the wheel N (X1, Y1) and the wheel M (X2, Y2) and the grounding point C (X, Y) of the tail frame are calculated, and the connecting line points to the direction vector of the head frame of the target vehicle, namely the direction vector
Figure BDA0003522377550000057
Using target vehicleVector of direction
Figure BDA0003522377550000058
Direction vector of the vehicle
Figure BDA0003522377550000059
Calculating the magnitude of a course angle according to a formula I and a formula II;
if the number of the detected wheels is 1, judging the position of the wheels according to the difference of the lateral distances between the grounding points C (X, Y) of the tail frame and the grounding points of the wheels, and if the number of the detected wheels is more than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X1, Y1) of the right lower point of the tail frame and the coordinates A (X2, Y2) of the grounding points of the wheels
Figure BDA00035223775500000510
Using target vehicle direction vector
Figure BDA00035223775500000511
Direction vector of the vehicle
Figure BDA00035223775500000512
Calculating the magnitude of a course angle according to a formula I and a formula II; if the difference is less than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X3, Y3) of the left lower corner point of the tail frame and the coordinates A (X2, Y2) of the wheel grounding point
Figure BDA00035223775500000513
Using target vehicle direction vector
Figure BDA00035223775500000514
Direction vector of the vehicle
Figure BDA00035223775500000515
Calculating the magnitude of the course angle according to a formula I and a formula II
If the number of the detected wheels is 0, judging according to the intersection ratio of the tail frame and the target whole frame, if the intersection ratio of the tail frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the tail part of the target vehicle is opposite to the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the tail frame and the whole target frame is less than or equal to k, the range of k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(4) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the number of the detected wheels is more than or equal to 2, the wheels with the transverse distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels being both more than 0 or both less than 0 are taken as the same-side wheels, otherwise, the wheels are taken as different-side wheels;
if the wheels are the same-side wheels, two wheels with the largest distance between the wheel contact points of all the wheels, namely the wheel A (X1, Y1) and the wheel B (X2, Y2), are selected, and the orientation of the wheels is judged according to the distance between the two wheels and the head frame contact point C (X, Y), such as
Figure BDA0003522377550000061
The wheel A is the wheel close to the frame of the vehicle head, and the direction vector pointing to the vehicle head determined by the two wheels is
Figure BDA0003522377550000062
The direction vector of the vehicle is the unit vector
Figure BDA0003522377550000063
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure BDA0003522377550000064
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure BDA0003522377550000065
if it is
Figure BDA0003522377550000066
Theta is equal to theta, otherwise theta is equal to theta;
if the wheels are different-side wheels, the coordinates of the connecting line between the midpoint of the connecting line of the wheel N (X1, Y1) and the wheel M (X2, Y2) and the head frame grounding point C (X, Y) are calculated, and the direction vector pointing to the head frame of the target vehicle, i.e. the direction vector
Figure BDA0003522377550000067
Using target vehicle direction vector
Figure BDA0003522377550000068
Direction vector of the vehicle
Figure BDA0003522377550000069
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 1, judging the positions of the wheels according to the difference of the lateral distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels, and if the number of the detected wheels is more than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X1, Y1) of the right lower point of the head frame and the coordinates A (X2, Y2) of the grounding points of the wheels
Figure BDA00035223775500000610
Using target vehicle direction vector
Figure BDA00035223775500000611
Direction vector of the vehicle
Figure BDA00035223775500000612
And calculating the magnitude of the course angle according to the formula (III) and the formula (IV). If the difference is less than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X3, Y3) of the left lower corner point of the head frame and the coordinates A (X2, Y2) of the grounding point of the wheel
Figure BDA00035223775500000613
Using target vehicle direction vector
Figure BDA00035223775500000614
Direction vector of the vehicle
Figure BDA00035223775500000615
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 0, judging according to the intersection ratio of the head frame and the target whole frame, if the intersection ratio of the head frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the head part of the target vehicle is over against the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the head frame and the whole target frame is less than or equal to k, the range of the k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the magnitude of the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(5) if two wheels are detected, determining the direction vector of the target vehicle according to the connecting line of the two wheels and the direction of the longitudinal speed of the target vehicle
Figure BDA0003522377550000071
Using target vehicle direction vector
Figure BDA0003522377550000072
Direction vector of the vehicle
Figure BDA0003522377550000073
Calculating the magnitude of a course angle according to a formula I and a formula II;
if only one wheel is detected, the transverse speed and the longitudinal speed of the target vehicle are obtained according to the tracking logic, and the course angle of the target vehicle is obtained by combining the longitudinal speed of the vehicle and calculating by utilizing a trigonometric function.
In this embodiment, if any one of the detection conditions in the steps (3) to (5) cannot be satisfied, the course angle is 0.
In this embodiment, in the step (3), if the number of detected wheels is greater than or equal to 2, the confidence of the heading angle is 1, if the number of detected wheels is 1 and the difference between the lateral distance between the grounding point of the car tail frame and the grounding point of the wheels is greater than 0, the confidence of the heading angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the car tail frame and the target whole frame is greater than k, the confidence of the heading angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the car tail frame and the target whole frame is less than or equal to k, the confidence of the heading angle is 0; in the step (4), if the number of detected wheels is more than or equal to 2, the confidence coefficient of the course angle is 1, if the number of detected wheels is 1 and the difference between the transverse distance between the grounding point of the tail frame and the grounding point of the wheels is more than 0, the confidence coefficient of the course angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is more than k, the confidence coefficient of the course angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is less than or equal to k, the confidence coefficient of the course angle is 0;
in the step (5), if two wheels are detected, the confidence coefficient of the course angle is 1, and if only one wheel is detected, the confidence coefficient of the course angle is 0;
if any detection condition from the step (3) to the step (5) cannot be met, the confidence coefficient of the course angle is 0;
if the confidence coefficient of the course angle of five continuous detection periods is always 0 and the calculated course angle does not jump, directly outputting the calculated course angle; and otherwise, the course angle is the sum of products of the calculated course angle value and the confidence coefficient of the course angle in five continuous detection periods, and then the sum of the confidence coefficients of the five detection periods is divided for carrying out sliding window filtering.
The invention also discloses electronic equipment for realizing the method for calculating the target vehicle course angle based on the visual information, which comprises a memory, a first display unit and a second display unit, wherein the memory is configured to store executable instructions;
a processor configured to execute executable instructions stored in the memory to implement the one method of calculating a target vehicle heading angle based on visual information described above.
The invention also discloses a computer readable storage medium having computer program instructions stored thereon for executing the above-mentioned method for calculating the course angle of the target vehicle based on the visual information.
Finally, it is noted that the above-mentioned embodiments illustrate rather than limit the invention, and that, while the invention has been described with reference to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (5)

1. A method for calculating a target vehicle course angle based on visual information is characterized in that: the method comprises the following steps:
(1) acquiring a detection frame of a target vehicle from a target detection network, wherein the detection frame comprises a target whole frame, a tail frame, a head frame and a wheel frame, respectively detecting pixel coordinates of a left upper point and a right lower point of a frame rectangle of the target whole frame, the body frame, the tail frame, the head frame and the wheel frame, calculating pixel coordinate information of a required grounding point of the detection frame, and converting the pixel coordinates into distance information of a world coordinate system by calling a coordinate conversion function;
(2) according to the pixel coordinates of the vehicle body frame, the vehicle tail frame, the vehicle head frame and the vehicle wheel frame, calculating the intersection ratio of the vehicle tail frame, the vehicle head frame and the vehicle wheel frame with the whole target frame respectively, integrating the detected target frames of the same target, and judging the position of the detected part of the target vehicle, if the vehicle tail frame is detected, executing the step (3), if the vehicle head frame is detected, executing the step (4), and if only the whole target frame is detected, executing the step (5);
(3) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the number of the detected wheels is more than or equal to 2, the wheels with the transverse distances between the grounding points C (X, Y) of the tailstock and the grounding points of the wheels which are both more than 0 or both less than 0 are taken as the wheels on the same side, otherwise, the wheels on different sides;
if the wheels are the same-side wheels, two wheels with the largest distance between the wheel grounding points of all the wheels, namely the wheel A (X1, Y1) and the wheel B (X2, Y2), are selected, and the orientation of the wheels is judged according to the distance between the two wheels and the grounding point C (X, Y) of the tail frame, for example
Figure FDA0003522377540000011
The wheel B is the wheel close to the tail frame, and the direction vector pointing to the head determined according to the two wheels is
Figure FDA0003522377540000012
The direction vector of the vehicle is the unit vector
Figure FDA0003522377540000013
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure FDA0003522377540000014
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure FDA0003522377540000015
if it is
Figure FDA0003522377540000016
Theta is equal to theta, otherwise theta is equal to theta;
if the wheels are different-side wheels, the coordinates of the connecting line between the midpoint of the connecting line of the wheels N (X1, Y1) and the wheels M (X2, Y2) and the grounding point C (X, Y) of the tail frame are calculated, and the direction vector pointing to the head frame of the target vehicle, namely the direction vector
Figure FDA0003522377540000017
Using target vehicle direction vector
Figure FDA0003522377540000018
Direction vector of the vehicle
Figure FDA0003522377540000019
Calculating the magnitude of the course angle according to a formula I and a formula II;
if the number of the detected wheels is 1, judging the position of the wheels according to the difference of the lateral distances between the grounding points C (X, Y) of the tail frame and the grounding points of the wheels, and if the number of the detected wheels is more than 0, judging the position of the wheels according to the pixel coordinates of the lower right point of the tail frameZ (X1, Y1) and coordinates A (X2, Y2) of the wheel grounding point calculate the direction vector of the vehicle
Figure FDA00035223775400000110
Using target vehicle direction vector
Figure FDA00035223775400000111
Direction vector of the vehicle
Figure FDA00035223775400000112
Calculating the magnitude of a course angle according to a formula I and a formula II; if the difference is less than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X3, Y3) of the left lower corner point of the tail frame and the coordinates A (X2, Y2) of the wheel grounding point
Figure FDA00035223775400000113
Using target vehicle direction vector
Figure FDA00035223775400000114
Direction vector of the vehicle
Figure FDA00035223775400000115
Calculating course angle according to formula (I) and formula (II)
If the number of the detected wheels is 0, judging according to the intersection ratio of the tail frame and the target whole frame, if the intersection ratio of the tail frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the tail part of the target vehicle is opposite to the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the tail frame and the whole target frame is less than or equal to k, the range of k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(4) judging the number of the detected wheels, if the number of the detected wheels is more than or equal to 2, and if the lateral distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels are both more than 0 or both less than 0, determining the wheels as same-side wheels, otherwise, determining the wheels as different-side wheels;
if the wheels are the same-side wheels, two wheels having the largest distance between the wheel contact points among all the wheels, i.e., wheel A (X1, Y1) and wheel B (X2, Y2), are selected, and the orientation of the wheel is determined based on the distance between the two wheels and the head frame contact point C (X, Y), e.g., the wheel is determined
Figure FDA0003522377540000021
The wheel A is the wheel close to the frame of the vehicle head, and the direction vector pointing to the vehicle head determined by the two wheels is
Figure FDA0003522377540000022
The direction vector of the vehicle is the unit vector
Figure FDA0003522377540000023
Calculating an included angle between the vehicle and the target vehicle according to the cosine function:
Figure FDA0003522377540000024
according to the fact that the panoramic course angle coverage angle of the vehicle is-360 degrees, the sine function is used for calculating the positive and negative of the angle:
Figure FDA0003522377540000025
if it is
Figure FDA0003522377540000026
Theta is equal to theta, otherwise theta is equal to theta;
if the wheel is a different side wheel, the coordinate of the line connecting the midpoint of the line connecting the wheel N (X1, Y1) and the wheel M (X2, Y2) and the head frame grounding point C (X, Y) is calculated, and the direction vector pointing to the head frame of the subject vehicle, i.e., the direction vector
Figure FDA0003522377540000027
Using target vehicleVector of direction
Figure FDA0003522377540000028
Direction vector of the vehicle
Figure FDA0003522377540000029
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 1, judging the positions of the wheels according to the difference of the lateral distances between the grounding points C (X, Y) of the head frame and the grounding points of the wheels, and if the number of the detected wheels is more than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X1, Y1) of the right lower point of the head frame and the coordinates A (X2, Y2) of the grounding points of the wheels
Figure FDA00035223775400000210
Using target vehicle direction vector
Figure FDA00035223775400000211
Direction vector of the vehicle
Figure FDA00035223775400000212
And calculating the magnitude of the course angle according to the formula (III) and the formula (IV). If the difference is less than 0, calculating the direction vector of the vehicle according to the pixel coordinates Z (X3, Y3) of the left lower corner point of the head frame and the coordinates A (X2, Y2) of the grounding point of the wheel
Figure FDA00035223775400000213
Using target vehicle direction vector
Figure FDA00035223775400000214
Direction vector of the vehicle
Figure FDA00035223775400000215
Calculating the magnitude of the course angle according to a formula (III) and a formula (IV);
if the number of the detected wheels is 0, judging according to the intersection ratio of the head frame and the target whole frame, if the intersection ratio of the head frame and the target whole frame is larger than k, and the range of the k value is 0.93-0.95, judging that the head part of the target vehicle is over against the vehicle, and determining the course angle of the target vehicle according to the camera of the vehicle; if the intersection ratio of the head frame and the whole target frame is less than or equal to k, the range of the k value is 0.93-0.95, the transverse speed and the longitudinal speed of the target vehicle are obtained, and the magnitude of the course angle of the target vehicle is calculated by combining the longitudinal speed of the vehicle and utilizing a trigonometric function;
(5) if two wheels are detected, determining the direction vector of the target vehicle according to the connecting line of the two wheels and the direction of the longitudinal speed of the target vehicle
Figure FDA0003522377540000031
Using target vehicle direction vector
Figure FDA0003522377540000032
Direction vector of the vehicle
Figure FDA0003522377540000033
Calculating the magnitude of a course angle according to a formula I and a formula II;
if only one wheel is detected, the transverse speed and the longitudinal speed of the target vehicle are obtained according to the tracking logic, and the course angle of the target vehicle is obtained by combining the longitudinal speed of the vehicle and calculating by utilizing a trigonometric function.
2. The method of claim 1, wherein the step of calculating the target vehicle heading angle based on the visual information comprises: and (5) if any detection condition from the step (3) to the step (5) cannot be met, the course angle is 0.
3. The method of claim 2, wherein the step of calculating the target vehicle heading angle based on the visual information comprises: in the step (3), if the number of detected wheels is more than or equal to 2, the confidence coefficient of the course angle is 1, if the number of detected wheels is 1 and the difference between the lateral distance between the grounding point of the tailstock frame and the grounding point of the wheels is more than 0, the confidence coefficient of the course angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the tailstock frame and the target whole frame is more than k, the confidence coefficient of the course angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the tailstock frame and the target whole frame is less than or equal to k, the confidence coefficient of the course angle is 0;
in the step (4), if the number of detected wheels is more than or equal to 2, the confidence coefficient of the course angle is 1, if the number of detected wheels is 1 and the difference between the transverse distance between the grounding point of the tail frame and the grounding point of the wheels is more than 0, the confidence coefficient of the course angle is 0.1, if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is more than k, the confidence coefficient of the course angle is 1, and if the number of detected wheels is 0 and the intersection ratio of the head frame and the target whole frame is less than or equal to k, the confidence coefficient of the course angle is 0;
in the step (5), if two wheels are detected, the confidence coefficient of the course angle is 1, and if only one wheel is detected, the confidence coefficient of the course angle is 0;
if any detection condition from the step (3) to the step (5) cannot be met, the confidence coefficient of the course angle is 0;
if the confidence coefficient of the course angle of five continuous detection periods is always 0 and the calculated course angle does not jump, directly outputting the calculated course angle; and otherwise, the course angle is the sum of products of the calculated course angle value and the confidence coefficient of the course angle in five continuous detection periods, and then the sum of the confidence coefficients of the five detection periods is divided for carrying out sliding window filtering.
4. An electronic device for realizing a method for calculating a target vehicle course angle based on visual information is characterized in that: comprising a memory configured to store executable instructions;
a processor configured to execute executable instructions stored in the memory to implement the method of any one of claims 1 to 3.
5. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: the computer program instructions perform the method of any of the preceding claims 1 to 3.
CN202210182625.9A 2022-02-27 2022-02-27 Method and device for calculating course angle of target vehicle based on visual information Pending CN114549645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210182625.9A CN114549645A (en) 2022-02-27 2022-02-27 Method and device for calculating course angle of target vehicle based on visual information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210182625.9A CN114549645A (en) 2022-02-27 2022-02-27 Method and device for calculating course angle of target vehicle based on visual information

Publications (1)

Publication Number Publication Date
CN114549645A true CN114549645A (en) 2022-05-27

Family

ID=81679489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210182625.9A Pending CN114549645A (en) 2022-02-27 2022-02-27 Method and device for calculating course angle of target vehicle based on visual information

Country Status (1)

Country Link
CN (1) CN114549645A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115817463A (en) * 2023-02-23 2023-03-21 禾多科技(北京)有限公司 Vehicle obstacle avoidance method and device, electronic equipment and computer readable medium
CN115861975A (en) * 2023-02-28 2023-03-28 杭州枕石智能科技有限公司 Obstacle vehicle pose estimation method and device
CN116681884A (en) * 2023-08-02 2023-09-01 腾讯科技(深圳)有限公司 Object detection method and related device
CN117553695A (en) * 2024-01-11 2024-02-13 摩斯智联科技有限公司 Method, apparatus and computer storage medium for calculating vehicle height based on aspect ratio suppression noise
CN117553695B (en) * 2024-01-11 2024-05-03 摩斯智联科技有限公司 Method and device for calculating vehicle height and computer storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115817463A (en) * 2023-02-23 2023-03-21 禾多科技(北京)有限公司 Vehicle obstacle avoidance method and device, electronic equipment and computer readable medium
CN115861975A (en) * 2023-02-28 2023-03-28 杭州枕石智能科技有限公司 Obstacle vehicle pose estimation method and device
CN116681884A (en) * 2023-08-02 2023-09-01 腾讯科技(深圳)有限公司 Object detection method and related device
CN116681884B (en) * 2023-08-02 2023-12-08 腾讯科技(深圳)有限公司 Object detection method and related device
CN117553695A (en) * 2024-01-11 2024-02-13 摩斯智联科技有限公司 Method, apparatus and computer storage medium for calculating vehicle height based on aspect ratio suppression noise
CN117553695B (en) * 2024-01-11 2024-05-03 摩斯智联科技有限公司 Method and device for calculating vehicle height and computer storage medium

Similar Documents

Publication Publication Date Title
CN114549645A (en) Method and device for calculating course angle of target vehicle based on visual information
CN106256606B (en) A kind of lane departure warning method based on vehicle-mounted binocular camera
CN102591332B (en) Device and method for local path planning of pilotless automobile
CN110745140B (en) Vehicle lane change early warning method based on continuous image constraint pose estimation
Noda et al. Vehicle ego-localization by matching in-vehicle camera images to an aerial image
CN111521195B (en) Intelligent robot
CN103679119B (en) Self adaptation slope road detection method and device
CN111098815A (en) ADAS front vehicle collision early warning method based on monocular vision fusion millimeter waves
CN110738181B (en) Method and device for determining vehicle orientation information
CN111563474A (en) Obstacle detection method and system based on vehicle-mounted fisheye lens under motion background
EP4296713A1 (en) Target detection method, storage medium, electronic device, and vehicle
CN113920198B (en) Coarse-to-fine multi-sensor fusion positioning method based on semantic edge alignment
CN112927309A (en) Vehicle-mounted camera calibration method and device, vehicle-mounted camera and storage medium
CN110738668A (en) method and system for intelligently controlling high beam and vehicle
CN110555801A (en) Correction method, terminal and storage medium for track deduction
CN116543032B (en) Impact object ranging method, device, ranging equipment and storage medium
CN111046809B (en) Obstacle detection method, device, equipment and computer readable storage medium
Eraqi et al. Static free space detection with laser scanner using occupancy grid maps
CN108454619B (en) Driving assistance method and system
CN116189150A (en) Monocular 3D target detection method, device, equipment and medium based on fusion output
CN114037977B (en) Road vanishing point detection method, device, equipment and storage medium
CN114495038B (en) Post-processing method for automatic driving detection marking data
CN115848359A (en) Parking space self-adaptive parking route planning method, vehicle and storage medium
CN110033493B (en) Camera 3D calibration method and terminal
CN114972427A (en) Target tracking method based on monocular vision, terminal equipment and storage medium

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