CN109532662B - Method and device for calculating distance between vehicles and collision time - Google Patents

Method and device for calculating distance between vehicles and collision time Download PDF

Info

Publication number
CN109532662B
CN109532662B CN201811457922.XA CN201811457922A CN109532662B CN 109532662 B CN109532662 B CN 109532662B CN 201811457922 A CN201811457922 A CN 201811457922A CN 109532662 B CN109532662 B CN 109532662B
Authority
CN
China
Prior art keywords
vehicle
distance
front vehicle
curve
camera
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.)
Expired - Fee Related
Application number
CN201811457922.XA
Other languages
Chinese (zh)
Other versions
CN109532662A (en
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.)
Eagle Vision Corp ltd
Original Assignee
Eagle Vision Corp 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 Eagle Vision Corp ltd filed Critical Eagle Vision Corp ltd
Priority to CN201811457922.XA priority Critical patent/CN109532662B/en
Publication of CN109532662A publication Critical patent/CN109532662A/en
Application granted granted Critical
Publication of CN109532662B publication Critical patent/CN109532662B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60QARRANGEMENT OF SIGNALLING OR LIGHTING DEVICES, THE MOUNTING OR SUPPORTING THEREOF OR CIRCUITS THEREFOR, FOR VEHICLES IN GENERAL
    • B60Q9/00Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling
    • B60Q9/008Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling for anti-collision purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • 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
    • 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/30236Traffic on road, railway or crossing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30248Vehicle exterior or interior
    • G06T2207/30252Vehicle exterior; Vicinity of vehicle

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)
  • Human Computer Interaction (AREA)
  • Mechanical Engineering (AREA)
  • Traffic Control Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a vehicle distance and collision time calculation method and device capable of improving vehicle distance calculation precision and accurately early warning in real time. The method comprises the following steps: image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle; detecting and tracking the front vehicle: detecting the position information of the characteristic points of the front vehicle by processing the image; calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle; early warning of front vehicle collision: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.

Description

Method and device for calculating distance between vehicles and collision time
Technical Field
The application relates to the technical field of intelligent traffic, in particular to a method and a device for calculating a vehicle distance and collision time.
Background
The existing vehicle-mounted system generally utilizes a vehicle-mounted radar to measure the distance of a vehicle in front, or utilizes an ultrasonic sensor and a radio frequency transmitter to detect the distance of front and rear obstacles and calculate collision time, so that collision early warning is sent out, but the equipment is expensive and is not convenient to popularize.
The other is to adopt the vehicle distance measurement and collision early warning based on monocular vision: a single camera is used for collecting front images, and a training sample method is operated to detect a front target. And calculating the distance between the two vehicles according to the pinhole imaging principle and the geometric proportion relation, and calculating the collision time by combining the current vehicle speed. And when the calculated collision time is less than the safe collision time, sending out collision early warning. However, the distance calculated by the method completely depending on the vehicle detection position in the image, the pinhole imaging principle and the geometric proportion relation has a large error in practical application due to the bumpy road surface or the vehicle detection error, and the error calculated by the pinhole imaging principle is proportional to the distance, namely, the closer the distance is, the smaller the distance is, and the farther the distance is, the larger the distance is. Therefore, the key to realize accurate real-time early warning is to improve the calculation precision of the distance of the front vehicle.
Disclosure of Invention
Therefore, it is necessary to provide a method for calculating the distance between vehicles and the collision time, which can improve the calculation accuracy of the distance between vehicles and provide accurate real-time warning.
The invention provides a method for calculating a vehicle distance and collision time, which comprises the following steps:
image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle;
detecting and tracking the front vehicle: detecting the position information of the characteristic points of the front vehicle by processing the image;
calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle;
early warning of front vehicle collision: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
Optionally, n groups of corrected vehicle distances d are adopted: d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dnwhere N is 1,2, 3, … … N, and N is the number of detected data values.
Optionally, the vehicle distance is calculated by using a pinhole imaging principle and a similar triangle principle.
Optionally, the vehicle distance is calculated according to the following formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)), wherein dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1Is the y-axis coordinate of the characteristic point at the bottom of the front vehicle, Cy is the y-axis focus of the camera, Fy is the y-axis focus of the cameraDistance.
Optionally, the calculation formula of the front vehicle width is as follows:
Figure GDA0002589373360000021
wherein, wnIs the width of the front vehicle, xn2Is the x-axis coordinate, x, of the left characteristic point of the front vehiclen1Is the x-axis coordinate of the feature point on the right of the front vehicle, dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1The coordinate of the characteristic point at the bottom of the front vehicle is shown as the y-axis coordinate, Cy is the y-axis focal point of the camera, and Fy is the y-axis focal point of the camera.
Optionally, the image processing comprises: and filtering the image of the front vehicle to obtain an initial contour of the front vehicle, and calculating according to a vehicle detection algorithm to obtain the position information of the characteristic points of the front vehicle.
Optionally, the vehicle detection algorithm comprises a pyramid optical flow algorithm and/or a mean shift target tracking algorithm.
In addition, the invention also provides a vehicle distance and collision time calculation device, which comprises:
the image acquisition unit is used for acquiring images of a front vehicle through the vehicle-mounted camera of the vehicle;
the front vehicle detection tracking unit is used for detecting the position information of the characteristic points of the front vehicle by processing the image;
the front vehicle distance calculation unit is used for taking the position information of the feature points of the front vehicle in a preset group, calculating the width and the distance of the front vehicle to obtain the average value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the average value of the width of the front vehicle;
the front vehicle collision early warning unit is used for acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
Optionally, n groups of corrected vehicle distances d are adopted:d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dnwhere N is 1,2, 3, … … N, and N is the number of detected data values.
Optionally, the leading distance calculating unit calculates the vehicle distance by the following calculation formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)), the leading vehicle distance calculating unit calculates the leading vehicle width by the following formula:
Figure GDA0002589373360000041
wherein, wnIs the width of the front vehicle, xn2Is the x-axis coordinate, x, of the left characteristic point of the front vehiclen1Is the x-axis coordinate of the feature point on the right of the front vehicle, dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1The coordinate of the characteristic point at the bottom of the front vehicle is shown as the y-axis coordinate, Cy is the y-axis focal point of the camera, and Fy is the y-axis focal point of the camera.
Therefore, by improving the inaccuracy of vehicle distance calculation caused by road surface bump and unevenness, vehicle shake or vehicle detection error, and simultaneously applying the Bezier spline curve model to improve the calculation method of the collision time of the front vehicle, the detection result is dynamically analyzed by combining the running state and the vehicle distance of the vehicle, the robustness of the algorithm is enhanced, and early warning is given to possible collision.
Drawings
FIG. 1 is a flow chart of a method for calculating vehicle distance and time to collision in one embodiment;
FIG. 2 is a flow chart of a preceding vehicle distance calculation in one embodiment;
FIG. 3 is a schematic representation of a coordinate system of a vehicle according to one embodiment;
FIG. 4 is a schematic diagram of the position of a leading vehicle in an image on a bumpy road surface in one embodiment;
FIG. 5 is an exemplary diagram of a Bezier spline fit curve with respect to vehicle distance in one embodiment;
FIG. 6 is a schematic diagram of an embodiment of a device for calculating a vehicle distance and a collision time.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the invention provides a method for calculating a vehicle distance and collision time, which comprises the following steps of:
s100, image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle;
s200, front vehicle detection and tracking: detecting the position information of the characteristic points of the front vehicle by processing the image;
s300, calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle;
s400, early warning of collision of the front vehicle: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
In one embodiment, the S100 image acquisition is to shoot the vehicle image of the current road surface through a single camera installed behind a windshield in the vehicle; s200, front vehicle detection tracking, comprising: shooting a road video by a camera; reading a current frame image, and carrying out filtering processing on the image to obtain a vehicle contour position; the real position of the target is obtained by adopting a pyramid optical flow algorithm and a target tracking algorithm of mean shift, the tracking detection of the vehicle is realized, the two algorithms are integrated, and the tracking accuracy is improved.
In one embodiment, S300 is a forward distance calculation, as shown in fig. 2, the forward feature point position information obtained by the forward vehicle detection tracking takes a series of values closest to the forward vehicle detection as a basis, and takes N values, where N is 1,2, 3, and … … N, where N is the number of detected data values, and the forward vehicle detection positions are (x) respectively12,x11,y12,y11),(x22,x21,y22,y21),…,(xn2,xn1,yn2,yn1) The position value arrangement is as follows: a left frame, a right frame, an upper frame and a lower frame, as shown in FIG. 3, the distance and the vehicle width are calculated according to the actually detected vehicle position, and the front vehicle distance of the front n frames of detection results is calculated according to the pinhole imaging principle and the similar triangle and is dy1,dy2,…,dynWidth value w1,w2,…,wn
The front vehicle distance calculation formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)) (1-1), wherein H represents the height of the camera mounting point from the ground and α represents the camera mounting pitch angle (defined as the angle between the camera's central axis and the ground vertical, which is fixed for the camera already mounted. The value can also be calculated by equivalent values of the internal parameters of the camera, the distance from the blind area point to the camera, the imaging point of the blind area point and the installation height of the camera), yn1And the coordinate of the y axis of the characteristic point of the bottom of the front vehicle is shown, Cy represents the y axis focal point of the camera, and Fy is the y axis focal point of the camera. The distance outside the blind field of view can be calculated from the above equation. In the above formula, H, alpha, Cy and Fy are all fixed, and the only change is yn1The value is obtained.
The front vehicle width calculation formula is as follows:
Figure GDA0002589373360000061
the average value of the obtained vehicle width is:
W=(w1+w2+…+wn)/n (1-3),
the average value of the vehicle width is calculated as W, and the absolute value | x of the vehicle width in the image detection can be synthesized by integrating the formulas (1-1) and (1-2) with the average value of the vehicle width depending on the width of the vehicle in front, which is constantn2-xn1L, the corrected vehicle distance can be calculated: d1,d2,…,dnThe corresponding times are respectively marked as t1,t2,…,tn
D is solved by inverse operation of a formula 1-2 for calculating the corrected vehicle distanceynSubstituting the vehicle width mean value into wnCalculating to obtain a correction value dn
Figure GDA0002589373360000062
The method comprises the steps of obtaining vehicle information, obtaining speed and brake information of a vehicle through special equipment, and using the information to early warn collision of a front vehicle;
in one embodiment, in S400, the vehicle ahead collision warning is performed, the vehicle distance between the vehicle ahead and the vehicle is directly calculated according to the position information of the feature point of the vehicle detected by the vehicle detection module, and the distance calculated by the pinhole imaging principle is different from the actual value due to the bumpy road surface, as shown in fig. 4, a false alarm is easily caused, if the distance is directly used for calculating the collision time:
Figure GDA0002589373360000063
TTC denotes collision time, D denotes relative distance, and V denotes relative velocity. Wherein
Figure GDA0002589373360000064
Where Δ d represents the change in distance over a period of time Δ t. And determining whether to trigger early warning or not by comparing the TTC value with an early warning threshold value. However, this value can only be calculated at two points, i.e., the start point and the end point of a certain period of time, and the randomness of the calculation is large due to road surface bumps and the like. The distance between vehicles can be greatly correctedReducing large fluctuations in distance.
In one embodiment, a relative vehicle distance curve is obtained, a parameter curve in a period of time is fitted through a Bezier spline curve, the Bezier spline curve generally refers to a polynomial parameter curve defined in a segmented mode, the spline curve is a curve obtained by fitting a set of discrete points, data in 3s are taken as Bezier spline fitting bases if vehicle detection time is 0.1s and n is 30, and the method can be used for well fitting detection point values and filtering excessive jitter values to avoid false reports.
Bezier spline curves are derived from a polynomial mixing function, typically with n +1 vertices defining an nth order polynomial. The mathematical expression is as follows:
Figure GDA0002589373360000071
in the formula, Di: is a position vector of each vertex, Bi,n(t): is a bernstein basis function; the expression of the bernstein basis function is:
Figure GDA0002589373360000072
the four vertices D0, D1, D2, D3 may define a cubic Bezier curve:
D(t)=(1-t)3D0+3t(1-t2)D1+3t2(1-t)D2+t3D3
Figure GDA0002589373360000073
the Bezier spline curve is piecewise defined. Given m + n +1 vertices Di (i ═ 0,1,2, …, m + n), a parametric curve of m +1 segments n times can be defined. The whole curve formed by connecting all the curve segments is called an n-th-order B-spline curve.
A cubic Bezier spline curve is adopted to fit a front vehicle distance value in a period of time, so that a relative vehicle distance fitting curve value with higher robustness is obtained. As shown in fig. 5, the horizontal axis t represents time,the vertical axis D represents the distance, and the discrete points represent the discrete values D of the distance1,d2,…,dnThe curve represents a B-spline fitted by discrete points, at the present time tnThe current distance is dn。tnAnd then, estimating a future distance value of the two vehicles according to a curve fitted by the previous n distance values, wherein the fitted curve can be used as a collision model to give an early warning.
The obtained corrected vehicle distance: d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dn(1-9),
and (3) calculating the collision time:
Figure GDA0002589373360000081
suppose the threshold for TTC is TTCthresh(this value is an empirical value, typically 2.7s or may take other values) if TTC>TTCthreshIndicating no need to send out collision warning, TTC<TTCthreshIndicating that a collision is likely to occur and a collision warning needs to be issued.
By improving the inaccuracy of vehicle distance calculation caused by road surface bump and unevenness, vehicle shake or vehicle detection errors, and simultaneously applying a Bezier spline curve model to improve the calculation method of the collision time of the preceding vehicle, the detection result is dynamically analyzed by combining the running state and the vehicle distance of the vehicle, the robustness of the algorithm is enhanced, and early warning is given to possible collision.
It should be understood that, although the steps in the flowchart are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least a portion of the sub-steps or stages of other steps.
In addition, the present invention also provides a vehicle distance and collision time calculation apparatus, as shown in fig. 6, including:
the image acquisition unit 10 is used for acquiring images of a front vehicle through a vehicle-mounted camera of the vehicle;
a preceding vehicle detection tracking unit 20, configured to detect position information of a feature point of a preceding vehicle by processing an image;
a front vehicle distance calculating unit 30, configured to obtain position information of a predetermined group of the front vehicle feature points, calculate a front vehicle width and a vehicle distance, obtain a front vehicle width mean value, and correct the vehicle distance between the vehicle and the front vehicle according to the front vehicle width mean value;
the front vehicle collision early warning unit 40 is used for acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
In one embodiment, the image acquisition unit 10 is shown as capturing a vehicle image of the current road surface with a single camera mounted behind the windshield in the vehicle; the front vehicle detection tracking unit 20 performs front vehicle detection tracking, and a camera shoots a road video; reading a current frame image, and carrying out filtering processing on the image to obtain a vehicle contour position; the real position of the target is obtained by adopting a pyramid optical flow algorithm and a target tracking algorithm of mean shift, the tracking detection of the vehicle is realized, the two algorithms are integrated, and the tracking accuracy is improved.
In one embodiment, the forward distance calculating unit 30 is used for a forward distance meterAs shown in fig. 2, the preceding vehicle feature point position information obtained by preceding vehicle detection tracking is based on a series of values in which the preceding vehicle is detected most recently, and N values are obtained, where N is 1,2, 3, and … … N, where N is the number of detected data values, and the preceding vehicle detection position is (x) each12,x11,y12,y11),(x22,x21,y22,y21),…,(xn2,xn1,yn2,yn1) The position value arrangement is as follows: a left frame, a right frame, an upper frame and a lower frame, as shown in FIG. 3, the distance and the vehicle width are calculated according to the actually detected vehicle position, and the front vehicle distance of the front n frames of detection results is calculated according to the pinhole imaging principle and the similar triangle and is dy1,dy2,…,dynWidth value w1,w2,…,wn
The front vehicle distance calculation formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)) (1-1), wherein H represents the height of the camera mounting point from the ground and α represents the camera mounting pitch angle (defined as the angle between the camera's central axis and the ground vertical, which is fixed for the camera already mounted. The value can also be calculated by equivalent values of the internal parameters of the camera, the distance from the blind area point to the camera, the imaging point of the blind area point and the installation height of the camera), yn1And the coordinate of the y axis of the characteristic point of the bottom of the front vehicle is shown, Cy represents the y axis focal point of the camera, and Fy is the y axis focal point of the camera. The distance outside the blind field of view can be calculated from the above equation. In the above formula, H, alpha, Cy and Fy are all fixed, and the only change is yn1The value is obtained.
The front vehicle width calculation formula is as follows:
Figure GDA0002589373360000101
the average value of the obtained vehicle width is:
W=(w1+w2+…+wn)/n (1-3),
calculating the average value of the vehicle width as W according to the width of the front vehicleIs constant and can be detected by integrating the formulas (1-1) and (1-2) and the absolute value | x of the vehicle width in image detection with the mean value of the vehicle widthn2-xn1L can calculate the corrected vehicle distance: d1,d2,…,dnThe corresponding times are respectively marked as t1,t2,…,tn
D is solved by inverse operation of a formula 1-2 for calculating the corrected vehicle distanceynSubstituting the vehicle width mean value into wnCalculating to obtain a correction value dn
Figure GDA0002589373360000102
The method comprises the steps of obtaining vehicle information, obtaining speed and brake information of a vehicle through special equipment, and using the information for early warning of front vehicle collision and decision-making of front vehicle starting reminding;
in one embodiment, the preceding vehicle collision warning unit 40 directly calculates the distance between the preceding vehicle and the own vehicle according to the position information of the vehicle feature point detected by the vehicle detection module, and the distance calculated by the pinhole imaging principle is different from the actual value due to the bumpy road surface, as shown in fig. 4, it is easy to cause false alarm, if it is directly used for calculating the collision time:
Figure GDA0002589373360000103
TTC denotes collision time, D denotes relative distance, and V denotes relative velocity. Wherein
Figure GDA0002589373360000111
Where Δ d represents the change in distance over a period of time Δ t. And determining whether to trigger early warning or not by comparing the TTC value with an early warning threshold value. However, this value can only be calculated at two points, i.e., the start point and the end point of a certain period of time, and the randomness of the calculation is large due to road surface bumps and the like. The vehicle distance can be greatly reduced after being corrected.
In one embodiment, the forward vehicle collision warning unit 40 obtains the relative vehicle distance curve by fitting a parameter curve within a period of time through a Bezier spline curve, the Bezier spline is generally a polynomial parameter curve defined in segments, the spline curve is a curve obtained by fitting a set of discrete points, and if the vehicle detection time is 0.1s and n is 30, data within 3s is taken as a Bezier spline fitting basis.
Bezier spline curves are derived from a polynomial mixing function, typically with n +1 vertices defining an nth order polynomial. The mathematical expression is as follows:
Figure GDA0002589373360000112
in the formula, Di: is a position vector of each vertex, Bi,n(t): is a bernstein basis function; the expression of the bernstein basis function is:
Figure GDA0002589373360000113
the four vertices D0, D1, D2, D3 may define a cubic Bezier curve:
Figure GDA0002589373360000114
the Bezier spline curve is piecewise defined. Given m + n +1 vertices Di (i ═ 0,1,2, …, m + n), a parametric curve of m +1 segments n times can be defined. The whole curve formed by connecting all the curve segments is called an n-th-order B-spline curve.
A cubic Bezier spline curve is adopted to fit a front vehicle distance value in a period of time, so that a relative vehicle distance fitting curve value with higher robustness is obtained. As shown in FIG. 5, the horizontal axis t represents time, the vertical axis D represents distance, and the discrete points represent discrete values D of distance1,d2,…,dnThe curve represents a B-spline fitted by discrete points, at the present time tnThe current distance is dn。tnThen estimating the distance value of the two vehicles in the future according to the curve fitted by the front n distance values,the fitted curve can be used as a collision model for early warning.
The obtained corrected vehicle distance: d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dn(1-9),
and (3) calculating the collision time:
Figure GDA0002589373360000121
suppose the threshold for TTC is TTCthresh(this value is an empirical value, typically 2.7s or may take other values) if TTC>TTCthreshIndicating no need to send out collision warning, TTC<TTCthreshIndicating that a collision is likely to occur and a collision warning needs to be issued
By improving the inaccuracy of vehicle distance calculation caused by road surface bump and unevenness, vehicle shake or vehicle detection errors, and simultaneously applying a Bezier spline curve model to improve the calculation method of the collision time of the preceding vehicle, the detection result is dynamically analyzed by combining the running state and the vehicle distance of the vehicle, the robustness of the algorithm is enhanced, and early warning is given to possible collision.
Each unit in the above-described device for calculating the vehicle distance and the collision time may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a vehicle distance and collision time calculation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program, as shown in fig. 1:
s100, image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle;
s200, front vehicle detection and tracking: detecting the position information of the characteristic points of the front vehicle by processing the image;
s300, calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle;
s400, early warning of collision of the front vehicle: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of:
s100, image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle;
s200, front vehicle detection and tracking: detecting the position information of the characteristic points of the front vehicle by processing the image;
s300, calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle;
s400, early warning of collision of the front vehicle: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
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 hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A vehicle distance and collision time calculation method is characterized by comprising the following steps:
image acquisition: acquiring a front vehicle image through a vehicle-mounted camera of the vehicle;
detecting and tracking the front vehicle: detecting the position information of the characteristic points of the front vehicle by processing the image;
calculating the distance between the front vehicles: taking a preset group of the position information of the characteristic points of the front vehicle, calculating the width and the distance of the front vehicle to obtain the mean value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the mean value of the width of the front vehicle;
early warning of front vehicle collision: acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value, and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
2. The vehicle distance and collision time calculation method according to claim 1, characterized in that n groups of corrected vehicle distances d: d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dnwhere N is 1,2, 3, … … N, and N is the number of detected data values.
3. The vehicle distance and collision time calculation method according to claim 2, wherein the vehicle distance is calculated using a pinhole imaging principle and a similar triangle principle.
4. The vehicle distance and collision time calculation method according to claim 3, wherein the vehicle distance is calculated by the following formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)), wherein dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1The coordinate of the characteristic point at the bottom of the front vehicle is shown as the y-axis coordinate, Cy is the y-axis focal point of the camera, and Fy is the y-axis focal point of the camera.
5. The vehicle distance and collision time calculation method according to claim 3, wherein the calculation formula for the front vehicle width is:
Figure FDA0002589373350000021
wherein, wnIs the width of the front vehicle, xn2Is the x-axis coordinate, x, of the left characteristic point of the front vehiclen1Is the x-axis coordinate of the feature point on the right of the front vehicle, dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1The coordinate of the characteristic point at the bottom of the front vehicle is shown as the y-axis coordinate, Cy is the y-axis focal point of the camera, and Fy is the y-axis focal point of the camera.
6. The vehicle distance and collision time calculation method according to any one of claims 1 to 5, wherein the image processing includes: and filtering the image of the front vehicle to obtain an initial contour of the front vehicle, and calculating according to a vehicle detection algorithm to obtain the position information of the characteristic points of the front vehicle.
7. The method of claim 6, wherein the vehicle detection algorithm comprises a pyramid optical flow algorithm and/or a mean shift target tracking algorithm.
8. A vehicle distance and collision time calculation apparatus, comprising:
the image acquisition unit is used for acquiring images of a front vehicle through the vehicle-mounted camera of the vehicle;
the front vehicle detection tracking unit is used for detecting the position information of the characteristic points of the front vehicle by processing the image;
the front vehicle distance calculation unit is used for taking the position information of the feature points of the front vehicle in a preset group, calculating the width and the distance of the front vehicle to obtain the average value of the width of the front vehicle, and correcting the distance between the front vehicle and the front vehicle according to the average value of the width of the front vehicle;
the front vehicle collision early warning unit is used for acquiring a relative vehicle distance curve, obtaining real-time relative speed according to the vehicle distance curve, calculating collision time, comparing the collision time with an early warning threshold value and judging whether to trigger early warning; the relative vehicle distance curve is obtained through Bezier spline curve fitting, and the corrected vehicle distance is used as an input value of the Bezier spline curve.
9. The apparatus according to claim 8, wherein n sets of the corrected vehicle distance d: d1,d2,…,dnAnd as an input value of a Bezier spline curve, obtaining the relative vehicle distance curve through Bezier spline curve fitting, and obtaining a relative speed value by derivation of the relative vehicle distance curve:
Vn=d'(tn)=3(1-tn)2d(n-3)+3(1-2tn)d(n-2)+(6tn-9tn 2)d(n-1)+3tn 2dnwhere N is 1,2, 3, … … N, and N is the number of detected data values.
10. The apparatus according to claim 9, wherein the preceding vehicle distance calculating unit calculates the vehicle distance by the following calculation formula:
dyn=H*tan(α-arctan((yn1-Cy)/Fy)), the leading vehicle distance calculating unit calculates the leading vehicle width by the following formula: f '(x) f (x)'
Figure FDA0002589373350000031
Wherein, wnIs the width of the front vehicle, xn2Is the x-axis coordinate, x, of the left characteristic point of the front vehiclen1Is the x-axis coordinate of the feature point on the right of the front vehicle, dynN is 1,2, 3, … … N, N is the number of detected data values, H is the mounting height of the camera, α is the pitch angle of the camera, y is the distance between the vehicle and the vehiclen1The coordinate of the characteristic point at the bottom of the front vehicle is shown as the y-axis coordinate, Cy is the y-axis focal point of the camera, and Fy is the y-axis focal point of the camera.
CN201811457922.XA 2018-11-30 2018-11-30 Method and device for calculating distance between vehicles and collision time Expired - Fee Related CN109532662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811457922.XA CN109532662B (en) 2018-11-30 2018-11-30 Method and device for calculating distance between vehicles and collision time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811457922.XA CN109532662B (en) 2018-11-30 2018-11-30 Method and device for calculating distance between vehicles and collision time

Publications (2)

Publication Number Publication Date
CN109532662A CN109532662A (en) 2019-03-29
CN109532662B true CN109532662B (en) 2020-10-27

Family

ID=65851972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811457922.XA Expired - Fee Related CN109532662B (en) 2018-11-30 2018-11-30 Method and device for calculating distance between vehicles and collision time

Country Status (1)

Country Link
CN (1) CN109532662B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110654381B (en) 2019-10-09 2021-08-31 北京百度网讯科技有限公司 Method and device for controlling a vehicle
US11680813B2 (en) 2020-01-21 2023-06-20 Thinkware Corporation Method, apparatus, electronic device, computer program, and computer readable recording medium for measuring inter-vehicle distance based on vehicle image
CN111369827A (en) * 2020-02-28 2020-07-03 华域视觉科技(上海)有限公司 Traffic safety light early warning system and method and vehicle
CN112562331A (en) * 2020-11-30 2021-03-26 的卢技术有限公司 Vision perception-based other-party vehicle track prediction method
CN113188521B (en) * 2021-05-11 2022-09-23 江晓东 Monocular vision-based vehicle collision early warning method
CN114093187B (en) * 2021-11-26 2023-02-24 交通运输部公路科学研究所 Risk early warning control method for automatic driving vehicle and intelligent network system
CN115472005B (en) * 2022-08-09 2023-12-19 东软睿驰汽车技术(上海)有限公司 Vehicle collision early warning method, device, equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102007032698B3 (en) * 2007-07-13 2008-09-25 Dr. Ing. H.C. F. Porsche Aktiengesellschaft Method for determining a display image
KR102286174B1 (en) * 2015-09-01 2021-08-06 주식회사 만도 Driving assistance apparatus and driving assistance method
CN106183979B (en) * 2016-07-07 2017-12-12 广州鹰瞰信息科技有限公司 A kind of method and apparatus reminded according to spacing vehicle
CN106952303B (en) * 2017-03-09 2020-04-24 北京旷视科技有限公司 Vehicle distance detection method, device and system
CN107622500B (en) * 2017-09-29 2023-05-23 吉林大学 Visual sensing-based rear collision early warning method and device for heavy vehicle
CN108021899A (en) * 2017-12-15 2018-05-11 郑州日产汽车有限公司 Vehicle intelligent front truck anti-collision early warning method based on binocular camera

Also Published As

Publication number Publication date
CN109532662A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109532662B (en) Method and device for calculating distance between vehicles and collision time
US11348266B2 (en) Estimating distance to an object using a sequence of images recorded by a monocular camera
EP3382336B1 (en) Stereo camera device
CN110609274B (en) Distance measurement method, device and system
JP5689907B2 (en) Method for improving the detection of a moving object in a vehicle
EP3070675B1 (en) Image processor for correcting deviation of a coordinate in a photographed image at appropriate timing
JP6950170B2 (en) Information processing device, imaging device, device control system, information processing method, and program
JP6520740B2 (en) Object detection method, object detection device, and program
JP2018060326A (en) Tracking device and program thereof
CN113240756B (en) Pose change detection method and device for vehicle-mounted BSD camera and storage medium
CN110992710B (en) Curve speed measurement early warning method and device, control equipment and readable storage medium
US10554951B2 (en) Method and apparatus for the autocalibration of a vehicle camera system
JP6552448B2 (en) Vehicle position detection device, vehicle position detection method, and computer program for vehicle position detection
CN113866783A (en) Vehicle distance measurement method and system
CN112927309A (en) Vehicle-mounted camera calibration method and device, vehicle-mounted camera and storage medium
JP2023514163A (en) A method and apparatus for calibrating the camera pitch of an automobile, and a method for continuously learning a vanishing point estimation model therefor
CN114550042A (en) Road vanishing point extraction method, vehicle-mounted sensor calibration method and device
CN114919584A (en) Motor vehicle fixed point target distance measuring method and device and computer readable storage medium
US20230281872A1 (en) System for calibrating extrinsic parameters for a camera in an autonomous vehicle
JP7003972B2 (en) Distance estimation device, distance estimation method and computer program for distance estimation
CN108108706B (en) Method and system for optimizing sliding window in target detection
CN114290995B (en) Implementation method and device of transparent A column, automobile and medium
US20230186506A1 (en) Object Detection Device and Object Detection Method
CN113942503B (en) Lane keeping method and device
CN112477868B (en) Collision time calculation method and device, readable storage medium and computer equipment

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201027