CN115908551A - Vehicle distance measuring method and device, electronic equipment and storage medium - Google Patents

Vehicle distance measuring method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115908551A
CN115908551A CN202211457770.XA CN202211457770A CN115908551A CN 115908551 A CN115908551 A CN 115908551A CN 202211457770 A CN202211457770 A CN 202211457770A CN 115908551 A CN115908551 A CN 115908551A
Authority
CN
China
Prior art keywords
image
coordinate system
coordinates
vehicle
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.)
Pending
Application number
CN202211457770.XA
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.)
Inceptio Star Intelligent Technology Shanghai Co Ltd
Original Assignee
Inceptio Star Intelligent Technology Shanghai 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 Inceptio Star Intelligent Technology Shanghai Co Ltd filed Critical Inceptio Star Intelligent Technology Shanghai Co Ltd
Priority to CN202211457770.XA priority Critical patent/CN115908551A/en
Publication of CN115908551A publication Critical patent/CN115908551A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Abstract

The invention provides a vehicle distance measuring method, a vehicle distance measuring device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line; determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system; obtaining a ranging object, and determining the coordinates of the ranging object in an image plane coordinate system according to the mapping relation model; and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters. By the method, the processes of acquiring each coordinate and establishing the mapping relation model are simple, the acquired coordinates are accurate, camera parameters are known, and the problem that the accuracy and the simplicity of vehicle ranging in the prior art are difficult to take into account is solved.

Description

Vehicle distance measuring method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the technical field of driving assistance systems, and in particular, to a vehicle distance measuring method, apparatus, electronic device, and storage medium.
Background
Advanced Driver Assistance Systems (ADAS) are active safety technologies that utilize various sensors (cameras, navigation, radar, etc.) mounted on a vehicle to collect environmental data inside and outside the vehicle in time and perform technical processing such as identification, detection, tracking, etc. of static and dynamic objects, so that a Driver can perceive potential safety hazards in the shortest time to attract attention of the Driver, thereby improving driving safety.
In ADAS, vehicle ranging is generally based on camera-calibrated inverse perspective transform ranging and monocular image ranging based on deep learning in two ways. The inverse perspective transformation ranging method based on camera calibration depends on a calibration algorithm, and the camera calibration is needed to obtain accurate camera internal parameters. The commonly used camera calibration method is a Zhang Zhengyou camera calibration algorithm, the calibration process is complex, a plurality of checkerboards at different angles need to be shot, and a large amount of manual operation is additionally needed. The complex calibration process is not conducive to ADAS installation and testing, particularly to aftermarket vehicle installation and testing. In addition, the precision of camera calibration directly affects the accuracy of ranging, the ADAS product effect and the automation of the product. If the calibration precision is poor, the distance measurement is inaccurate, the effects of HMW (vehicle distance over-close alarm), FCW (front vehicle collision alarm) and LDW (lane departure alarm) can be influenced, and even a large number of false alarms can occur. The monocular image distance measurement based on the deep learning does not need any calibration operation, and the target distance can be predicted only by inputting a single picture. However, the method has low precision, depends heavily on the scene of training data, and has poor robustness and generalization.
In conclusion, the vehicle distance measurement with high accuracy depends on the calibration of a high-precision camera, the process is complex, and the vehicle distance measurement without calibration has poor accuracy, so that the vehicle distance measurement in the prior art is difficult to take into account the characteristics of accuracy and simplicity.
Disclosure of Invention
The invention provides a vehicle distance measuring method, a vehicle distance measuring device, electronic equipment and a storage medium, which are used for overcoming the defect that the vehicle distance measuring in the prior art is difficult to take accuracy and simplicity into consideration and realizing high-precision and simple distance measuring of a vehicle.
The invention provides a vehicle distance measuring method, which comprises the following steps:
acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system;
constructing a mapping relation model of a first image in the image plane coordinate system in a world coordinate system;
obtaining a ranging object, and determining the coordinate of the ranging object in the image plane coordinate system according to the mapping relation model;
and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters.
According to a vehicle ranging method provided by the present invention, the method of calculating a distance between a vehicle and a ranging object, thereafter comprises:
acquiring a yaw angle of the camera;
and correcting the distance between the vehicle and a ranging object according to the yaw angle.
According to the vehicle distance measuring method provided by the invention, the building of the mapping relation model of the first image in the world coordinate system in the image plane coordinate system comprises the following steps:
connecting lines to all points on the first image by taking the optical center of the camera as a starting point, extending the lines into a world coordinate system, and acquiring the image projection of the first image in the world coordinate system;
a correspondence is determined between points on the first image in the image plane coordinate system and points on the projection of the image in the world coordinate system.
According to the vehicle ranging method provided by the invention, the distance between the vehicle and the ranging object is calculated according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera reference in the world coordinate system, and the method comprises the following steps:
and calculating the longitudinal distance between the vehicle and the ranging object in the world coordinate system according to the ordinate of the ranging object in the image coordinate system, the ordinate of the center point of the first image, the ordinate of the image blanking point, the ordinate of the optical center of the camera in the world coordinate system and the focal length of the camera, wherein the longitudinal direction is along the length direction of the lane line.
According to the vehicle distance measuring method provided by the invention, the distance between the vehicle and the distance measuring object is calculated according to the coordinates of the distance measuring object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera internal reference in the world coordinate system, and the method further comprises the following steps:
and calculating the transverse distance between the vehicle and the ranging object in the world coordinate system according to the coordinate of the ranging object in the image plane coordinate system, the coordinate of the central point of the first image, the vertical coordinate of the optical center of the camera in the world coordinate system, the longitudinal distance and the camera focal length, wherein the transverse direction is the width direction of the lane line.
According to a vehicle ranging method provided by the invention, the calculating of the distance between the vehicle and the ranging object comprises the following steps:
and calculating the distance between the vehicle and the ranging object by adopting an inverse perspective transformation principle.
According to a distance measuring method for a vehicle provided by the invention, the determining of the coordinates of the lane line in the first image in the image plane coordinate system and the image blanking point coordinates of the first image in the image plane coordinate system comprises the following steps:
detecting a lane line in the first image;
determining the coordinates of the lane line in the image plane coordinate system;
fitting a lane line curve and uniformly resampling coordinates of lane line points;
fitting parameters of a straight line or a tangent line of the fitted lane line;
calculating the intersection point of any two lines according to the fitting parameters to obtain a set of intersection points;
and calculating the average value of the set of the intersection points to obtain the coordinates of the image blanking points.
The present invention also provides a vehicle ranging apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
the determining module is used for determining the coordinates of the lane lines in the first image in an image plane coordinate system and the coordinates of image blanking points of the first image in the image plane coordinate system;
the construction module is used for constructing a mapping relation model of the first image in the world coordinate system in the image plane coordinate system;
the second acquisition module is used for acquiring the ranging object and determining the coordinates of the ranging object in the image plane coordinate system according to the mapping relation model;
and the calculation module is used for calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the vehicle ranging method as described in any one of the above.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a vehicle ranging method as described in any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method of vehicle ranging as described in any one of the above.
The vehicle distance measuring method provided by the invention is characterized in that the distance between the vehicle and the distance measuring object is calculated by acquiring the coordinates of the lane line of the first image and the coordinates of the blanking point of the first image in the image plane coordinate system, constructing the mapping relation model and combining the coordinates of the distance measuring object in the image plane coordinate system, the coordinates of the central point of the first image and the coordinates of the camera in the world coordinate system and the camera internal parameters, wherein the coordinate acquisition and the mapping relation model are simple in establishing process, the acquired coordinates are accurate, and the camera internal parameters are known, so that the calculated distance between the vehicle and the distance measuring object is accurate, the characteristics of simplicity and high accuracy are considered, and the problem that the vehicle distance measuring in the prior art is difficult to take both the accuracy and the simplicity into consideration is solved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a vehicle ranging method provided by the present invention;
FIG. 2 is a second schematic flow chart of a vehicle distance measuring method according to the present invention;
FIG. 3 is a third schematic flowchart of a vehicle distance measuring method according to the present invention;
FIG. 4 is a fourth flowchart illustrating a vehicle distance method according to the present invention;
FIG. 5 is a fifth flowchart illustrating a vehicle distance method according to the present invention;
FIG. 6 is a model of a mapping relationship in a world coordinate system in a first image in an image plane coordinate system;
FIG. 7 is an enlarged partial schematic view of the image plane coordinate system of FIG. 6;
FIG. 8 is a schematic structural diagram of a vehicle distance measuring device according to the present invention;
fig. 9 is a schematic structural diagram of an electronic device provided by the present invention.
Reference numerals:
810: a first acquisition module; 820: a determination module; 830: building a module; 840: a second acquisition module; 850: a calculation module; 910: a processor; 920: a communication interface; 930: a memory; 940: a communication bus.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The vehicle ranging method, apparatus, electronic device, and storage medium of the present invention are described below with reference to fig. 1 to 9.
As shown in fig. 1, in one embodiment, the present invention provides a vehicle ranging method, including the following steps:
in step S110, a first image including a lane line, which is captured by a vehicle-mounted camera, is acquired.
The first image is a virtual image of a lane line image shot by the camera. When the camera shoots the lane line, the imaging plane is behind the camera lens, and the lane line image of the imaging plane is an inverted real image. The first image is a virtual image on an equivalent imaging plane, namely a lane line image positioned right in front of the camera lens.
Step S120, determining coordinates of the lane line in the first image in the image plane coordinate system and coordinates of the image blanking point of the first image in the image plane coordinate system.
Wherein, the image plane coordinate system is the plane coordinate system of the first image.
Specifically, after the first image is acquired, the lane line in the first image is detected to acquire the coordinate of the lane line in the first image in the plane coordinate system. After obtaining the lane line coordinates in the planar coordinate system, the coordinates of the image blanking points of the first image are calculated. Specifically, a lane line curve is fitted, and the coordinates of lane line points are uniformly resampled; fitting parameters of straight lines or tangent lines of the fitted lane lines; calculating the intersection point of any two lines according to the fitting parameter to obtain a set of intersection points, namely a point set; and calculating the average value of the set of the intersection points to obtain the coordinates of the image blanking point.
And step S130, constructing a mapping relation model in a world coordinate system in the first image in the image plane coordinate system.
According to the mapping relation model, the first image has corresponding projections in a world coordinate system, namely points in the first image, including points on a lane line, have corresponding projection points in the world coordinate system. In contrast, within the range of the camera view angle, there are points in the world coordinate system corresponding to the points in the first image.
And step S140, obtaining the distance measuring object, and determining the coordinate of the distance measuring object in the image plane coordinate system according to the mapping relation model.
The distance measuring object may be an obstacle or another vehicle, and therefore, the distance measuring object has a large volume, and an object point needs to be selected from the distance measuring object, so as to determine a corresponding point coordinate in the image plane coordinate system. The object point may be a point closest to the vehicle on the ranging object, or may be another point, which is determined according to actual requirements and is not described herein again.
And S150, calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal reference.
According to the vehicle distance measuring method, the coordinates of the lane line of the first image in the image plane coordinate system and the coordinates of the blanking point of the first image are obtained, the mapping relation model is built, the distance between the vehicle and the distance measuring object is calculated by combining the coordinates of the distance measuring object in the image plane coordinate system, the coordinates of the center point of the first image and the coordinates of the camera in the world coordinate system and the camera internal reference, wherein the coordinate obtaining and mapping relation model is simple in establishing process, the obtained coordinates are accurate, and the camera internal reference is known, so that the calculated distance between the vehicle and the distance measuring object is accurate, the characteristics of simplicity and high accuracy are achieved, and the problem that the vehicle distance measuring in the prior art is difficult to take both accuracy and simplicity is solved.
As shown in fig. 2, in one embodiment, the distance between the vehicle and the ranging object is calculated according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera coordinates and the camera parameters in the world coordinate system, and then the following steps are included:
in step S210, a yaw angle of the camera is acquired.
And S220, correcting the distance between the vehicle and the distance measurement object according to the yaw angle.
Specifically, since the plane where the first image is located is not necessarily perpendicular to the lane line in the world coordinate system, that is, the optical axis of the camera is not parallel to the lane line, and a yaw angle exists, the plane needs to be corrected to obtain a true distance. The accuracy of distance measurement is further improved through correction of the yaw angle.
As shown in fig. 3, in one embodiment, constructing a mapping relation model of the first image in the world coordinate system in the image plane coordinate system includes the following steps:
step S132, connecting the points on the first image by taking the optical center of the camera as a starting point, extending the points into the world coordinate system, and acquiring the image projection of the first image in the world coordinate system.
Specifically, a camera optical center is taken as a starting point, a connecting line is made to each point on a first image in an image plane coordinate system, an extending line is made to a world coordinate system, the connecting line and the extending line to all the points in the first image are completed, and an image projection is obtained in the world coordinate system, wherein the image projection comprises lane line projection.
In step S134, the correspondence between the point on the first image in the image plane coordinate system and the point on the image projection in the world coordinate system is determined.
Specifically, the image projection in the world coordinate system has corresponding points on the first image in the image plane coordinate system, and the corresponding relationship between each point on the image projection and each point on the first image is the mapping relationship model.
As shown in fig. 4, in one embodiment, calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera coordinates and the camera parameters in the world coordinate system comprises the following steps:
and S152, calculating the longitudinal distance between the vehicle and the ranging object in the world coordinate system by adopting an inverse perspective transformation principle according to the vertical coordinate of the ranging object in the image coordinate system, the vertical coordinate of the central point of the first image, the vertical coordinate of the image blanking point, the vertical coordinate of the optical center of the camera in the world coordinate system and the focal length of the camera, wherein the longitudinal direction is along the length direction of the lane line.
And step S154, calculating the transverse distance between the vehicle and the ranging object in the world coordinate system by adopting an inverse perspective transformation principle according to the coordinate of the ranging object in the image plane coordinate system, the coordinate of the central point of the first image, the longitudinal coordinate of the optical center of the camera in the world coordinate system, the longitudinal distance and the camera focal length, wherein the transverse direction is the width direction of the lane line.
The coordinate of the central point of the first image in the image plane coordinate system, the coordinate of the image blanking point, the coordinate of the camera in the world coordinate system and the coordinate of the ranging object in the image plane coordinate system determined according to the mapping relation model have the advantages that the acquisition process is simple and accurate, and the camera is used as the original parameter of the camera, so the calculated distance between the vehicle and the ranging object is accurate, and the measuring process is simple. Compared with the traditional vehicle distance measurement method, the method does not need to depend on complex camera calibration, the distance measurement process is simpler, and the distance measurement result is more accurate.
As shown in fig. 5, in a specific embodiment, the ranging method of the present invention includes the following steps:
step S510, lane line detection.
The lane line detection can be realized by using a segmentation algorithm, a point regression-based deep learning network and the like.
Specifically, the Detection can be realized by an Ultra Fast Lane Detection (UFLD) algorithm. The algorithm divides the picture into m x n grids, each grid containing two attributes: whether the lane line exists or not and whether the same lane line exists or not, the output size of the model is b (m + 1) n, and b is the number of the lane lines. b 1*n is used for judging whether each lane line exists in each row in the image or not, and b m n is used for obtaining the specific position of each lane line in each row. Through the lane line detection, the coordinates of each lane line can be obtained, and the calculation of the blanking point of the subsequent image is facilitated.
In step S520, image blanking points are calculated.
Specifically, the method comprises the following steps: 1) Fitting a lane line curve to reduce the influence of outliers on the detection effect of the lane line; 2) Uniformly resampling the coordinates of the lane line points; 3) Fitting parameters of a straight line or a tangent line of the lane line, specifically, taking 1/3 point at the bottom of the lane line for straight line fitting, and calculating straight line fitting parameters k and b; 4) Acquiring a set of intersection points of any two lines, specifically calculating the intersection points of all any two lines according to the k and b parameters, thereby obtaining an intersection point set, namely a point set; 5) And taking the average value of the point set as the image blanking point.
Step S530, ranging is carried out based on the principle of inverse perspective transformation.
Specifically, refer to fig. 6 and 7, where fig. 6 is a mapping relationship model of a lane line in a first image in an image plane coordinate system in a world coordinate system, and fig. 7 is a partial enlarged view of the image plane coordinate system of fig. 6. Wherein u and v respectively represent an abscissa and an ordinate, and the meanings of symbols in the figure are as follows:
O c : a camera optical center; o: a first image center; vp is as follows: an image blanking point; p: any point on the straight line where vp and q are located; q: a first image bottom center point; l 1 、l 2 : two lane lines in the first image; e: l 1 Intersecting with the bottom of the first image; h: the height of the camera optical center from the ground; l is 1 、L 2 : two lane lines in the world coordinate system; h: a blanking point in a world coordinate system; e: e projected points on a world coordinate system; q: q projected points on a world coordinate system; g: o projected points on a world coordinate system; p: p projected points on a world coordinate system; d 1 : the distance between the camera and the point Q in the world coordinate system; d is a radical of 2 : the distance between the camera and the point P in the world coordinate system, namely the longitudinal distance; d: the distance between the bottom point of the lane line and the point Q in the world coordinate system, namely the transverse distance; d r : the true lateral distance; alpha, beta,
Figure BDA0003953739890000104
Are respectively asThe included angles of pP, oG and qQ and the horizontal plane.
From the mapping relationship model of fig. 6, in combination with trigonometric function relationships, one can obtain:
Figure BDA0003953739890000101
Figure BDA0003953739890000102
Figure BDA0003953739890000103
wherein v is o Longitudinal sitting at o point, v vp As ordinate of the image blanking point, v p Is the ordinate of the p point; height indicates image height, v o = height/2,f denotes the camera focal length.
The compound is obtained by the following formulas (2) and (3):
Figure BDA0003953739890000111
the longitudinal distance d can be calculated from equation (4) 2
Figure BDA0003953739890000112
For ease of understanding and calculation of the lateral distance, we assume that the P point coincides with the Q point, at O c The EQ plane is obtained from the parallel-line similar triangular nature:
Figure BDA0003953739890000113
in addition, we can equate p points to a set of points on a straight line with the same abscissa or ordinate, and the trigonometric function relationship of equation (1) only relates to the ordinate, so that p points can be equated to one on the line connecting vp and qAnd (4) point. For the same reason, e belongs to lane line l 1 The image can be represented by an infinite number of bars and a 1 Parallel lines of composition,/ 1 Belonging to any one of them, point e is equivalent to a point on the same abscissa as point p, and thus:
Figure BDA0003953739890000114
wherein u is p Is the abscissa of point p, u o Is the abscissa of the o point.
By substituting equation (7) into equation (6), the lateral distance D can be obtained:
Figure BDA0003953739890000121
because the plane of the current frame camera is not necessarily perpendicular to the lane line, namely the optical axis is not parallel to the lane line, a yaw angle exists, and the true transverse distance D can be obtained only by correction r The coordinates of the corrected point P in the world coordinate system are as follows:
Figure BDA0003953739890000122
wherein, d r And theta is the corrected longitudinal distance and the camera yaw angle.
The camera yaw angle θ can be calculated according to the camera focal length f and the image blanking point:
Figure BDA0003953739890000123
wherein u is vp The abscissa of the image blanking point vp.
The final corrected longitudinal distance and transverse distance, namely the distance between the vehicle and the ranging object, can be obtained by combining the camera yaw angle theta with inverse perspective transformation inference formulas (8) and (9).
The following describes the vehicle distance measuring device provided by the present invention, and the vehicle distance measuring device described below and the vehicle distance measuring method described above may be referred to in correspondence with each other.
As shown in fig. 8, in one embodiment, the present invention also provides a vehicle ranging apparatus, including:
the first acquiring module 810 is configured to acquire a first image including a lane line, which is captured by a vehicle-mounted camera.
A determining module 820, configured to determine coordinates of a lane line in the first image in an image plane coordinate system and coordinates of an image blanking point of the first image in the image plane coordinate system.
The building module 830 is configured to build a mapping relationship model of the first image in the world coordinate system in the image plane coordinate system.
The second obtaining module 840 is configured to obtain the ranging object and determine the coordinates of the ranging object in the image plane coordinate system according to the mapping relationship model.
And the calculating module 850 is used for calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera coordinates and the camera internal parameters in the world coordinate system.
In this embodiment, the apparatus further includes:
and the third acquisition module is used for acquiring the yaw angle of the camera.
And the correction module is used for correcting the distance between the vehicle and the ranging object according to the yaw angle.
In this embodiment, the building block is specifically configured to:
connecting lines to all points on the first image by taking the optical center of the camera as a starting point, extending the lines into a world coordinate system, and acquiring image projection of the first image in the world coordinate system; a correspondence between points on the first image in the image plane coordinate system and points on the image projection in the world coordinate system is determined.
In this embodiment, the calculation module is specifically configured to:
calculating the longitudinal distance between the vehicle and the ranging object in the world coordinate system according to the vertical coordinate of the ranging object in the image coordinate system, the vertical coordinate of the center point of the first image, the vertical coordinate of the image blanking point, the vertical coordinate of the optical center of the camera in the world coordinate system and the focal length of the camera, wherein the longitudinal direction is along the length direction of the lane line;
according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the vertical coordinates of the optical center of the camera in the world coordinate system, the longitudinal distance and the camera focal length, the transverse distance between the vehicle and the ranging object in the world coordinate system is calculated, and the transverse direction is the width direction of the lane line;
and calculating the distance between the vehicle and the ranging object by adopting an inverse perspective transformation principle.
In this embodiment, the first obtaining module is specifically configured to:
detecting a lane line in the first image;
acquiring the coordinates of the lane line in the image plane coordinate system;
fitting a lane line curve and uniformly resampling coordinates of lane line points;
fitting parameters of a straight line or a tangent line of the fitted lane line;
calculating the intersection point of any two lines according to the fitting parameters to obtain a set of intersection points;
and calculating the average value of the set of the intersection points to obtain the coordinates of the image blanking point.
The vehicle distance measuring device disclosed by the invention is used for calculating the distance between the vehicle and the distance measuring object by acquiring the coordinates of the lane line of the first image and the coordinates of the blanking point of the first image in the image plane coordinate system, constructing a mapping relation model, combining the coordinates of the distance measuring object in the image plane coordinate system, the coordinates of the central point of the first image and the coordinates of the camera in the world coordinate system and the internal parameters of the camera. The coordinate of the central point of the first image in the image plane coordinate system, the coordinate of the image blanking point, the coordinate of the camera in the world coordinate system and the coordinate of the ranging object in the image plane coordinate system determined according to the mapping relation model have the advantages of simple and accurate acquisition process, and the camera is used as the original parameter of the camera, so the calculated distance between the vehicle and the ranging object is accurate, and the measuring process is simple. Compared with the traditional vehicle distance measurement method, the method does not need to depend on complex camera calibration, the distance measurement process is simpler, and the distance measurement result is more accurate.
Fig. 9 illustrates a physical structure diagram of an electronic device, and as shown in fig. 9, the electronic device may include: a processor (processor) 910, a communication Interface (Communications Interface) 920, a memory (memory) 930, and a communication bus 940, wherein the processor 910, the communication Interface 920, and the memory 930 communicate with each other via the communication bus 940. Processor 910 may invoke logic instructions in memory 930 to perform a vehicle ranging method comprising:
acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system;
constructing a mapping relation model of a lane line in a first image in an image plane coordinate system and a lane line in a world coordinate system;
obtaining a ranging object, and determining the coordinates of the ranging object in an image plane coordinate system according to the mapping relation model;
and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal reference.
Furthermore, the logic instructions in the memory 930 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing the vehicle ranging method provided by the above methods, the method comprising:
acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system;
constructing a mapping relation model of a lane line in a first image in an image plane coordinate system and a lane line in a world coordinate system;
obtaining a ranging object, and determining the coordinates of the ranging object in an image plane coordinate system according to the mapping relation model;
and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal reference.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the vehicle ranging method provided by the above methods, the method comprising:
acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system;
constructing a mapping relation model of a lane line in a first image in an image plane coordinate system and a lane line in a world coordinate system;
obtaining a ranging object, and determining the coordinate of the ranging object in an image plane coordinate system according to the mapping relation model;
and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A vehicle ranging method, characterized in that the method comprises:
acquiring a first image which is shot by a vehicle-mounted camera and comprises a lane line;
determining the coordinates of a lane line in the first image in an image plane coordinate system and the coordinates of an image blanking point of the first image in the image plane coordinate system;
constructing a mapping relation model of a first image in the image plane coordinate system in a world coordinate system;
obtaining a distance measurement object, and determining the coordinate of the distance measurement object in the image plane coordinate system according to the mapping relation model;
and calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the central point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters.
2. The vehicle ranging method according to claim 1, wherein the calculating of the distance of the vehicle from the ranging object thereafter comprises:
acquiring a yaw angle of the camera;
and correcting the distance between the vehicle and a ranging object according to the yaw angle.
3. The vehicle distance measuring method according to claim 1, wherein said constructing a mapping relation model of the first image in the world coordinate system in the image plane coordinate system comprises:
connecting lines to all points on the first image by taking the optical center of the camera as a starting point, extending the lines into a world coordinate system, and acquiring the image projection of the first image in the world coordinate system;
a correspondence between points on the first image in the image plane coordinate system and points on the image projection in the world coordinate system is determined.
4. The vehicle ranging method of claim 1, wherein the calculating of the distance between the vehicle and the ranging object based on the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the camera coordinates and the camera reference in the world coordinate system comprises:
and calculating the longitudinal distance between the vehicle and the ranging object in the world coordinate system according to the ordinate of the ranging object in the image coordinate system, the ordinate of the center point of the first image, the ordinate of the image blanking point, the ordinate of the optical center of the camera in the world coordinate system and the focal length of the camera, wherein the longitudinal direction is along the length direction of the lane line.
5. The vehicle ranging method according to claim 4, wherein the calculating of the distance between the vehicle and the ranging object based on the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, and the coordinates of the camera and the camera reference in the world coordinate system further comprises:
and calculating the transverse distance between the vehicle and the ranging object in the world coordinate system according to the coordinate of the ranging object in the image plane coordinate system, the coordinate of the central point of the first image, the vertical coordinate of the optical center of the camera in the world coordinate system, the longitudinal distance and the camera focal length, wherein the transverse direction is the width direction of the lane line.
6. The vehicle ranging method of claim 5, wherein the calculating of the distance of the vehicle from the ranging object comprises:
and calculating the distance between the vehicle and the ranging object by adopting an inverse perspective transformation principle.
7. The vehicle ranging method of claim 1, wherein the determining coordinates of a lane line in the first image within an image plane coordinate system and image blanking point coordinates of the first image within the image plane coordinate system comprises:
detecting a lane line in the first image;
determining the coordinates of the lane line in the image plane coordinate system;
fitting a lane line curve and uniformly resampling coordinates of lane line points;
fitting parameters of straight lines or tangent lines of the fitted lane lines;
calculating the intersection point of any two lines according to the fitting parameters to obtain a set of intersection points;
and calculating the average value of the set of the intersection points to obtain the coordinates of the image blanking points.
8. A vehicle ranging apparatus, comprising:
the first acquisition module is used for acquiring a first image which is shot by the vehicle-mounted camera and comprises a lane line;
the determining module is used for determining the coordinates of the lane line in the first image in an image plane coordinate system and the coordinates of the image blanking point of the first image in the image plane coordinate system;
the construction module is used for constructing a mapping relation model of the first image in the world coordinate system in the image plane coordinate system;
the second acquisition module is used for acquiring the ranging object and determining the coordinates of the ranging object in the image plane coordinate system according to the mapping relation model;
and the calculation module is used for calculating the distance between the vehicle and the ranging object according to the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image blanking point, the coordinates of the camera in the world coordinate system and the camera internal parameters.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements a vehicle ranging method as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the vehicle ranging method according to any one of claims 1 to 7.
CN202211457770.XA 2022-11-21 2022-11-21 Vehicle distance measuring method and device, electronic equipment and storage medium Pending CN115908551A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211457770.XA CN115908551A (en) 2022-11-21 2022-11-21 Vehicle distance measuring method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211457770.XA CN115908551A (en) 2022-11-21 2022-11-21 Vehicle distance measuring method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115908551A true CN115908551A (en) 2023-04-04

Family

ID=86492955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211457770.XA Pending CN115908551A (en) 2022-11-21 2022-11-21 Vehicle distance measuring method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115908551A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116620360A (en) * 2023-05-17 2023-08-22 中建三局信息科技有限公司 Rail car positioning system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116620360A (en) * 2023-05-17 2023-08-22 中建三局信息科技有限公司 Rail car positioning system and method
CN116620360B (en) * 2023-05-17 2024-04-23 中建三局信息科技有限公司 Rail car positioning system and method

Similar Documents

Publication Publication Date Title
CN111583663B (en) Monocular perception correction method and device based on sparse point cloud and storage medium
US20210358153A1 (en) Detection methods, detection apparatuses, electronic devices and storage media
CN112802092B (en) Obstacle sensing method and device and electronic equipment
CN115797454B (en) Multi-camera fusion sensing method and device under bird's eye view angle
CN113625288A (en) Camera and laser radar pose calibration method and device based on point cloud registration
CN111680574A (en) Face detection method and device, electronic equipment and storage medium
CN114217665A (en) Camera and laser radar time synchronization method, device and storage medium
CN115908551A (en) Vehicle distance measuring method and device, electronic equipment and storage medium
CN114550042A (en) Road vanishing point extraction method, vehicle-mounted sensor calibration method and device
CN114120149A (en) Oblique photogrammetry building feature point extraction method and device, electronic equipment and medium
CN115410167A (en) Target detection and semantic segmentation method, device, equipment and storage medium
CN110796604A (en) Image correction method and device
CN114972941A (en) Decision fusion method and device for three-dimensional detection of shielded vehicle and electronic equipment
CN114919584A (en) Motor vehicle fixed point target distance measuring method and device and computer readable storage medium
CN112529011A (en) Target detection method and related device
CN113140002A (en) Road condition detection method and system based on binocular stereo camera and intelligent terminal
CN115546216B (en) Tray detection method, device, equipment and storage medium
CN114648639B (en) Target vehicle detection method, system and device
TWI796952B (en) Object detection device and object detection method
CN115100287A (en) External reference calibration method and robot
CN116245730A (en) Image stitching method, device, equipment and storage medium
CN115719388A (en) Camera external reference acquisition method and device, electronic equipment and storage medium
CN115564836B (en) Monocular coordinate conversion method and device for curtain wall robot and electronic equipment
CN114612544B (en) Image processing method, device, equipment and storage medium
CN115439561B (en) Robot sensor calibration method, robot 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