Vehicle ranging method, device, electronic device and storage medium

By obtaining the coordinates of the lane line image and the coordinates of the vanishing points and constructing a mapping relationship model, the problem of the vehicle ranging method in the existing technology being difficult to strike a balance between accuracy and simplicity is solved, and high-precision and simple vehicle ranging is achieved.

CN115908551BActive Publication Date: 2025-09-12YINGCHE XINGCHUANG INTELLIGENT TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211457770.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-09-12
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

The existing vehicle ranging methods are difficult to strike a balance between accuracy and simplicity. The camera calibration-based methods are complex and their accuracy depends on the calibration process. The deep learning-based methods have low accuracy and poor robustness.

Method used

By obtaining the coordinates of the lane line image and the coordinates of the vanishing points, a mapping relationship model between the image plane coordinate system and the world coordinate system is constructed. The distance between the vehicle and the ranging object is calculated based on the camera intrinsic parameters, which simplifies the calibration process and improves the ranging accuracy.

Benefits of technology

It achieves high-precision and simple vehicle ranging, simplifies the calibration process, improves the accuracy and simplicity of ranging, and reduces false alarms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908551B_ABST
    Figure CN115908551B_ABST
Patent Text Reader

Abstract

The present invention provides a vehicle ranging method, device, electronic device, and storage medium. The method comprises: acquiring a first image captured by a vehicle-mounted camera and including lane lines; determining the coordinates of the lane lines in the first image within an image plane coordinate system and the coordinates of the image vanishing points of the first image within the image plane coordinate system; acquiring a ranging object and determining the coordinates of the ranging object within the image plane coordinate system based on a mapping relationship model; and calculating the distance between the vehicle and the ranging object based on the coordinates of the ranging object within the image plane coordinate system, the coordinates of the center point of the first image, the coordinates of the image vanishing point, and the camera coordinates and camera intrinsic parameters within a world coordinate system. This method simplifies the process of acquiring each coordinate and establishing the mapping relationship model, and the acquired coordinates are relatively accurate. The camera intrinsic parameters are known, thus resolving the problem of prior art vehicle ranging that struggles to balance accuracy and simplicity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of driving assistance systems, and in particular to a vehicle ranging method, device, electronic equipment and storage medium. Background Art

[0002] The Advanced Driver Assistance System (ADAS) is an active safety technology that uses multiple sensors installed on the vehicle (cameras, navigation, radar, etc.) to timely collect environmental data inside and outside the vehicle, and perform technical processing such as identification, detection, and tracking of static and dynamic objects. It enables the driver to detect safety hazards in the shortest time possible, thereby attracting the driver's attention and improving driving safety.

[0003] In ADAS, vehicle ranging is generally achieved through two methods: inverse perspective transformation based on camera calibration and monocular image ranging based on deep learning. The inverse perspective transformation based on camera calibration relies on a calibration algorithm and requires camera calibration to obtain accurate camera intrinsic parameters. The commonly used camera calibration method is the Zhang Zhengyou camera calibration algorithm. The calibration process is complex and requires capturing multiple checkerboard images from different angles, which requires significant additional manual effort. This complex calibration process is detrimental to ADAS installation and testing, particularly for aftermarket vehicles. Furthermore, camera calibration accuracy directly impacts ranging accuracy, ADAS product performance, and product automation. Poor calibration accuracy can lead to inaccurate ranging, compromising the effectiveness of HMW (head-to-head warning), FCW (front collision warning), and LDW (lane departure warning), and even resulting in a high number of false alarms. Monocular image ranging based on deep learning requires no calibration and can predict target distances from a single image. However, this method has low accuracy, is heavily dependent on the scenario of training data, and has poor robustness and generalization.

[0004] In summary, high-accuracy vehicle ranging relies on high-precision camera calibration, which is a complex process, while calibration-free vehicle ranging has poor accuracy. Therefore, the existing vehicle ranging technology is difficult to achieve both accuracy and simplicity. Summary of the Invention

[0005] The present invention provides a vehicle ranging method, device, electronic device and storage medium, which are used to solve the defect that vehicle ranging in the prior art is difficult to achieve both accuracy and simplicity, and realize high-precision and simple vehicle ranging.

[0006] The present invention provides a vehicle ranging method, the method comprising:

[0007] Acquire a first image including lane lines, taken by a vehicle-mounted camera;

[0008] Determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point of the first image in the image plane coordinate system;

[0009] Constructing a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system;

[0010] Acquire a distance measurement object, and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model;

[0011] The distance between the vehicle and the ranging object is calculated 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 camera internal parameters in the world coordinate system.

[0012] According to a vehicle ranging method provided by the present invention, the distance between the vehicle and the ranging object is calculated, and then the method includes:

[0013] Obtaining the yaw angle of the camera;

[0014] The distance between the vehicle and the distance measurement object is corrected according to the yaw angle.

[0015] According to a vehicle ranging method provided by the present invention, constructing a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system includes:

[0016] Starting from the optical center of the camera, draw a line to each point on the first image and extend it to the world coordinate system to obtain an image projection of the first image in the world coordinate system;

[0017] A correspondence 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 is determined.

[0018] According to a vehicle ranging method provided by the present invention, the distance between the vehicle and the ranging object is calculated 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 camera intrinsic parameters in the world coordinate system, including:

[0019] The longitudinal distance between the vehicle and the ranging object in the world coordinate system is calculated based on the longitudinal coordinate of the ranging object in the image coordinate system, the longitudinal coordinate of the center point of the first image, the longitudinal coordinate of the image blanking point, and the longitudinal coordinate of the camera optical center and the camera focal length in the world coordinate system, where the longitudinal distance is along the length of the lane line.

[0020] According to a vehicle ranging method provided by the present invention, the distance between the vehicle and the ranging object is calculated 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 camera intrinsic parameters in the world coordinate system, further comprising:

[0021] The lateral distance between the vehicle and the ranging object in the world coordinate system is calculated 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 longitudinal coordinate of the optical center of the camera in the world coordinate system, the longitudinal distance and the focal length of the camera, where the lateral distance is the lane line width direction.

[0022] According to a vehicle ranging method provided by the present invention, the step of calculating the distance between the vehicle and the ranging object includes:

[0023] The distance between the vehicle and the object is calculated using the inverse perspective transformation principle.

[0024] According to a vehicle ranging method provided by the present invention, determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point of the first image in the image plane coordinate system includes:

[0025] detecting lane lines in the first image;

[0026] Determining the coordinates of the lane line in the image plane coordinate system;

[0027] Fit the lane curve and uniformly resample the lane point coordinates;

[0028] Fitting parameters of lane line or tangent line;

[0029] Calculate the intersection of any two lines according to the fitting parameters to obtain a set of intersection points;

[0030] Calculate the average value of the set of intersection points to obtain the coordinates of the image vanishing point.

[0031] The present invention also provides a vehicle distance measuring device, the device comprising:

[0032] A first acquisition module is used to acquire a first image including lane lines, taken by a vehicle-mounted camera;

[0033] a determination module, configured to determine the coordinates of the lane line in the first image in an image plane coordinate system and the coordinates of an image vanishing point of the first image in the image plane coordinate system;

[0034] A construction module, configured to construct a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system;

[0035] A second acquisition module is used to acquire a distance measurement object and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model;

[0036] The calculation module is used to calculate 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 camera internal parameters in the world coordinate system.

[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the above-described vehicle ranging methods is implemented.

[0038] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the vehicle ranging method described above is implemented.

[0039] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned vehicle distance measurement methods.

[0040] The vehicle ranging method provided by the present invention calculates the distance between the vehicle and the ranging object by acquiring the coordinates of the lane lines and the coordinates of the vanishing points of the first image in an image plane coordinate system, constructing a mapping relationship model, and combining the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, and the camera coordinates and camera intrinsic parameters in the world coordinate system. The process of acquiring each coordinate and establishing the mapping relationship model is relatively simple, and the acquired coordinates are relatively accurate. The camera intrinsic parameters are known, so the calculated distance between the vehicle and the ranging object is relatively accurate. This method combines simplicity with high precision, solving the problem of vehicle ranging in the prior art that it is difficult to strike a balance between accuracy and simplicity. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 This is one of the flow charts of the vehicle ranging method provided by the present invention;

[0043] Figure 2 This is the second flow chart of the vehicle ranging method provided by the present invention;

[0044] Figure 3The third flow chart of the vehicle ranging method provided by the present invention;

[0045] Figure 4 This is a fourth flow chart of the vehicle distance method provided by the present invention;

[0046] Figure 5 This is a fifth flow chart of the vehicle distance method provided by the present invention;

[0047] Figure 6 is a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system;

[0048] Figure 7 for Figure 6 A local enlarged schematic diagram of the image plane coordinate system in FIG;

[0049] Figure 8 A schematic structural diagram of a vehicle distance measuring device provided by the present invention;

[0050] Figure 9 It is a structural schematic diagram of the electronic device provided by the present invention.

[0051] Reference numerals:

[0052] 810: First acquisition module; 820: Determination module; 830: Construction module; 840: Second acquisition module; 850: Calculation module; 910: Processor; 920: Communication interface; 930: Memory; 940: Communication bus. DETAILED DESCRIPTION

[0053] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0054] The following combination Figures 1-9 The present invention describes a vehicle ranging method, device, electronic device and storage medium.

[0055] like Figure 1 As shown, in one embodiment, the present invention provides a vehicle ranging method, comprising the following steps:

[0056] Step S110: Acquire a first image including lane lines captured by a vehicle-mounted camera.

[0057] The first image is a virtual image of the lane marking image captured by the camera. When the camera captures the lane marking, the imaging plane is behind the camera lens, and the lane marking image on the imaging plane is an inverted real image. The second image is a virtual image on the equivalent imaging plane, that is, an upright lane marking image located in front of the camera lens.

[0058] Step S120 , determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point in the first image in the image plane coordinate system.

[0059] The image plane coordinate system is the plane coordinate system where the first image is located.

[0060] Specifically, after acquiring a first image, lane lines in the first image are detected to obtain the coordinates of the lane lines in the first image within a plane coordinate system. After obtaining the lane line coordinates within the plane coordinate system, the coordinates of the image vanishing points of the first image are calculated. Specifically, the method involves fitting a lane line curve and uniformly resampling the lane line point coordinates; fitting parameters of lane line lines or tangents; calculating the intersection of any two lines based on the fitting parameters to obtain a set of intersection points, i.e., a point set; and calculating the average of the set of intersection points to obtain the coordinates of the image vanishing points.

[0061] Step S130 : constructing a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system.

[0062] According to this mapping model, the first image has corresponding projections in the world coordinate system. That is, every point in the first image, including points on lane lines, has a corresponding projection point in the world coordinate system. Conversely, within the camera's field of view, every point in the world coordinate system has a corresponding point in the first image.

[0063] Step S140 : acquiring a distance measurement object, and determining the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model.

[0064] The object being measured can be an obstacle, another vehicle, or something else. Because the object is relatively large, it's necessary to select a point on the object to determine the corresponding point coordinates within the image plane coordinate system. This point can be the point on the object closest to the vehicle, or another point. The specific selection depends on actual needs and is not detailed here.

[0065] Step 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 center point of the first image, the coordinates of the image blanking point, and the camera coordinates and camera internal parameters in the world coordinate system.

[0066] The vehicle ranging method of the present invention obtains the coordinates of the lane lines and the vanishing point coordinates of the first image in an image plane coordinate system, constructs a mapping relationship model, and combines the coordinates of the ranging object in the image plane coordinate system, the center point coordinates of the first image, and the camera coordinates and camera intrinsic parameters in the world coordinate system to calculate the distance between the vehicle and the ranging object. The process of obtaining each coordinate and establishing the mapping relationship model is relatively simple, and the obtained coordinates are relatively accurate. The camera intrinsic parameters are known, so the calculated distance between the vehicle and the ranging object is relatively accurate. This method combines simplicity with high precision, solving the problem of vehicle ranging in the prior art that it is difficult to strike a balance between accuracy and simplicity.

[0067] like Figure 2 As shown, in one embodiment, the distance between the vehicle and the ranging object is calculated 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 camera intrinsic parameters in the world coordinate system, and then the following steps are included:

[0068] Step S210: Obtain the yaw angle of the camera.

[0069] Step S220: Correct the distance between the vehicle and the distance measurement object according to the yaw angle.

[0070] Specifically, because the plane of the first image is not necessarily perpendicular to the lane lines in the world coordinate system—that is, the camera's optical axis is not parallel to the lane lines, and there is a yaw angle—correction is required to obtain the true distance. Correcting the yaw angle further improves ranging accuracy.

[0071] like Figure 3 As shown, in one embodiment, constructing a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system includes the following steps:

[0072] Step S132 , starting from the optical center of the camera, draw a line to each point on the first image, and extend the line to the world coordinate system to obtain the image projection of the first image in the world coordinate system.

[0073] Specifically, starting from the optical center of the camera, lines are connected to each point on the first image in the image plane coordinate system, and extended to the world coordinate system. After completing the connection and extension lines to all points in the first image, an image projection is obtained in the world coordinate system, which includes the lane line projection.

[0074] Step S134 , determining the correspondence between points on the first image in the image plane coordinate system and points on the image projection in the world coordinate system.

[0075] Specifically, the image projection in the world coordinate system has corresponding points on the first image in the image plane coordinate system. The correspondence between each point on the image projection and each point on the first image is the mapping relationship model.

[0076] like Figure 4 As shown, in one embodiment, the distance between the vehicle and the ranging object is calculated 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 camera intrinsic parameters in the world coordinate system, including the following steps:

[0077] Step S152 , based on the ordinate of the distance-measuring object in the image coordinate system, the ordinate of the center point of the first image, the ordinate of the image vanishing point, and the ordinate of the optical center of the camera and the focal length of the camera in the world coordinate system, the longitudinal distance between the vehicle and the distance-measuring object in the world coordinate system is calculated using the inverse perspective transformation principle. The longitudinal distance is along the length of the lane line.

[0078] In step S154, the lateral distance between the vehicle and the distance-measuring object in the world coordinate system is calculated using the inverse perspective transformation principle based on the coordinates of the distance-measuring object in the image plane coordinate system, the coordinates of the center point of the first image, the longitudinal coordinate of the camera optical center in the world coordinate system, the longitudinal distance, and the camera focal length. The lateral distance is the lane width direction.

[0079] The coordinates of the center point of the first image in the image plane coordinate system, the coordinates of the image blanking point, the camera coordinates in the world coordinate system, and the coordinates of the object being measured in the image plane coordinate system, determined according to the mapping relationship model, are acquired in a simple and accurate manner. The camera intrinsic parameters are the original parameters of the camera. Therefore, the calculated distance between the vehicle and the object being measured is more accurate, and the measurement process is also simple. Compared with traditional vehicle ranging methods, this method does not rely on complex camera calibration, resulting in a simpler ranging process and more accurate ranging results.

[0080] like Figure 5 As shown, in a specific embodiment, the distance measurement method of the present invention includes the following steps:

[0081] Step S510: lane line detection.

[0082] Among them, lane line detection can be achieved using segmentation algorithms, deep learning networks based on point regression, etc.

[0083] Specifically, this can be achieved using the Ultra Fast Lane Detection (UFLD) algorithm. This algorithm divides the image into m*n grids, each containing two attributes: the presence of a lane line and whether it is the same lane line. The model output size is b*(m+1)*n, where b is the number of lane lines. b*1*n is used to determine the presence of each lane line in each row of the image, and b*m*n is used to determine the specific position of each lane line in each row. Lane detection allows the coordinates of each lane line to be obtained, facilitating the subsequent calculation of vanishing points in the image.

[0084] Step S520: Calculate the image vanishing point.

[0085] Specifically, it includes: 1) fitting the lane line curve to reduce the impact of outliers on the lane line detection effect; 2) uniformly resampling the coordinates of the lane line points; 3) fitting the parameters of the lane line or tangent, specifically taking the bottom 1 / 3 of the lane line for straight line fitting, and calculating the straight line fitting parameters k and b; 4) obtaining the set of intersection points of any two lines, specifically calculating all the intersection points of any two lines based on the k and b parameters, thereby obtaining the intersection point set, that is, the point set; 5) taking the average value of the point set as the image vanishing point.

[0086] Step S530: measuring distance based on the inverse perspective transformation principle.

[0087] For details, see Figure 6 and Figure 7 ,in, Figure 6 is the mapping relationship model of the lane lines in the first image in the image plane coordinate system in the world coordinate system, Figure 7 for Figure 6 A local enlarged view of the image plane coordinate system. u and v represent the horizontal and vertical coordinates respectively. The meanings of the symbols in the figure are as follows:

[0088] O c : Optical center of camera; o: Center of the first image; vp: Image vanishing point; p: Any point on the line where vp and q are located; q: Center point of the bottom of the first image; l1, l2: Two lane lines in the first image; e: Intersection point of l1 and the bottom of the first image; h: Height of the optical center of camera from the ground; L1, L2: Two lane lines in the world coordinate system; H: Vanishing point in the world coordinate system; E: Projection point of e in the world coordinate system; Q: Projection point of q in the world coordinate system; G: Projection point of o in the world coordinate system; P: Projection point of p in the world coordinate system; d1: Distance between camera and point Q in the world coordinate system; d2: Distance between camera and point P in the world coordinate system, i.e., longitudinal distance; D: Distance between the bottom point of lane line and point Q in the world coordinate system, i.e., lateral distance; D r : true lateral distance; α, β, are the angles between pP, oG, qQ and the horizontal plane respectively.

[0089] Depend on Figure 6 The mapping relationship model, combined with the trigonometric function relationship, can be obtained:

[0090]

[0091]

[0092]

[0093] Among them, v o The vertical position is point o, v vp is the vertical coordinate of the image blanking point, v p is the vertical coordinate of point p; height represents the image height, v o =height / 2, f represents the focal length of the camera.

[0094] From formula (2) and (3), we can get:

[0095]

[0096] The longitudinal distance d2 can be calculated from formula (4):

[0097]

[0098] In order to facilitate understanding and calculation of the horizontal distance, we assume that point P coincides with point Q. c The EQ plane is obtained based on the properties of parallel lines and similar triangles:

[0099]

[0100] In addition, we equate point p to a set of points on a straight line with the same horizontal or vertical coordinate. The trigonometric relationship in formula (1) only involves the vertical coordinate, so point p can be equated to a point on the line connecting vp and q. Similarly, e belongs to lane line l1, and the image can be said to be composed of countless lines parallel to l1. If l1 belongs to any of them, point e is equivalent to a point on the same horizontal coordinate as point p. Therefore, we can obtain:

[0101]

[0102] Among them, u p is the horizontal coordinate of point p, u o is the horizontal coordinate of point o.

[0103] Substituting formula (7) into formula (6), the horizontal distance D can be obtained:

[0104]

[0105] Since the camera plane of the current frame is not necessarily perpendicular to the lane line, that is, the optical axis is not parallel to the lane line and there is a yaw angle, correction is required to obtain the true lateral distance D r , the coordinates of the corrected point P in the world coordinate system are as follows:

[0106]

[0107] Among them, d r is the corrected longitudinal distance, and θ is the camera yaw angle.

[0108] The camera yaw angle θ can be calculated based on the camera focal length f and the image vanishing point:

[0109]

[0110] Among them, u vp is the horizontal coordinate of the image blanking point vp.

[0111] The camera yaw angle θ, combined with the inverse perspective transformation inference formulas (8) and (9), can be used to obtain the final corrected longitudinal distance and lateral distance, that is, the distance between the vehicle and the ranging object.

[0112] The vehicle distance measuring device provided by the present invention is described below. The vehicle distance measuring device described below and the vehicle distance measuring method described above can be referenced to each other.

[0113] like Figure 8 As shown, in one embodiment, the present invention further provides a vehicle distance measuring device, the device comprising:

[0114] The first acquisition module 810 is configured to acquire a first image including lane lines, taken by a vehicle-mounted camera.

[0115] The determination module 820 is configured to determine the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point of the first image in the image plane coordinate system.

[0116] The construction module 830 is used to construct a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system.

[0117] The second acquisition module 840 is configured to acquire the distance measurement object and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model.

[0118] The calculation module 850 is used to calculate 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 camera internal parameters in the world coordinate system.

[0119] In this embodiment, the device further includes:

[0120] The third acquisition module is used to obtain the yaw angle of the camera.

[0121] The correction module is used to correct the distance between the vehicle and the ranging object according to the yaw angle.

[0122] In this embodiment, the building blocks are specifically used to:

[0123] Starting from the optical center of the camera, draw lines to each point on the first image and extend them to the world coordinate system to obtain the image projection of the first image in the world coordinate system; determine the correspondence between the points on the first image in the image plane coordinate system and the points on the image projection in the world coordinate system.

[0124] In this embodiment, the calculation module is specifically used to:

[0125] Calculate the longitudinal distance between the vehicle and the object in the world coordinate system based on the longitudinal coordinate of the object in the image coordinate system, the longitudinal coordinate of the center point of the first image, the longitudinal coordinate of the image vanishing point, the longitudinal coordinate of the camera's optical center in the world coordinate system, and the camera's focal length. The longitudinal distance is along the length of the lane line.

[0126] Calculate the lateral distance between the vehicle and the object in the world coordinate system based on the coordinates of the object in the image plane coordinate system, the coordinates of the center point of the first image, the longitudinal coordinate of the camera's optical center in the world coordinate system, the longitudinal distance, and the camera's focal length. The lateral distance is the lane width.

[0127] The distance between the vehicle and the object is calculated using the inverse perspective transformation principle.

[0128] In this embodiment, the first acquisition module is specifically configured to:

[0129] detecting lane lines in the first image;

[0130] Obtaining the coordinates of the lane line in the image plane coordinate system;

[0131] Fit the lane curve and uniformly resample the lane point coordinates;

[0132] Fitting parameters of lane line or tangent line;

[0133] Calculate the intersection of any two lines according to the fitting parameters to obtain a set of intersection points;

[0134] Calculate the average value of the set of intersection points to obtain the coordinates of the image vanishing point.

[0135] The vehicle ranging device of the present invention calculates the distance between the vehicle and the ranging object by acquiring the coordinates of the lane line of the first image and the coordinates of the vanishing point of the first image in the image plane coordinate system, and constructing a mapping relationship model, combining the coordinates of the ranging object in the image plane coordinate system, the coordinates of the center point of the first image, and the camera coordinates and camera intrinsic parameters in the world coordinate system. The acquisition process of the center point coordinates of the first image in the image plane coordinate system, the coordinates of the image vanishing point, the camera coordinates in the world coordinate system, and the coordinates of the ranging object in the image plane coordinate system determined according to the mapping relationship model is relatively simple and accurate. The camera intrinsic parameters are the original parameters of the camera. Therefore, the calculated distance between the vehicle and the ranging object is more accurate and the measurement process is also simpler. Compared with traditional vehicle ranging methods, there is no need to rely on complex camera calibration, the ranging process is simpler, and the ranging results are more accurate.

[0136] Figure 9 An example of a physical structure diagram of an electronic device is shown below. Figure 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a 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. The processor 910 may call the logic instructions in the memory 930 to execute the vehicle distance measurement method, which includes:

[0137] Acquire a first image including lane lines, taken by a vehicle-mounted camera;

[0138] Determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point in the first image in the image plane coordinate system;

[0139] Constructing a mapping relationship model between lane lines in the first image in the image plane coordinate system and lane lines in the world coordinate system;

[0140] Acquire the distance measurement object, and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model;

[0141] The distance between the vehicle and the ranging object is calculated 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 camera internal parameters in the world coordinate system.

[0142] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0143] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the vehicle distance measurement method provided by the above methods, which includes:

[0144] Acquire a first image including lane lines, taken by a vehicle-mounted camera;

[0145] Determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point in the first image in the image plane coordinate system;

[0146] Constructing a mapping relationship model between lane lines in the first image in the image plane coordinate system and lane lines in the world coordinate system;

[0147] Acquire the distance measurement object, and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model;

[0148] The distance between the vehicle and the ranging object is calculated 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 camera internal parameters in the world coordinate system.

[0149] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the vehicle distance measurement method provided by the above methods is implemented, and the method includes:

[0150] Acquire a first image including lane lines, taken by a vehicle-mounted camera;

[0151] Determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point in the first image in the image plane coordinate system;

[0152] Constructing a mapping relationship model between lane lines in the first image in the image plane coordinate system and lane lines in the world coordinate system;

[0153] Acquire the distance measurement object, and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model;

[0154] The distance between the vehicle and the ranging object is calculated 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 camera internal parameters in the world coordinate system.

[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A vehicle ranging method, characterized in that: The method comprises: Acquire a first image including lane lines, taken by a vehicle-mounted camera; Determining the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point of the first image in the image plane coordinate system; Constructing a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system; Acquire a distance measurement object, and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model; The distance between the vehicle and the ranging object is calculated 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 camera internal parameters in the world coordinate system.

2. The vehicle distance measurement method according to claim 1, characterized in that: The step of calculating the distance between the vehicle and the distance measurement object then includes: Obtaining the yaw angle of the camera; The distance between the vehicle and the distance measurement object is corrected according to the yaw angle.

3. The vehicle distance measurement method according to claim 1, characterized in that: The constructing of a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system includes: Starting from the optical center of the camera, draw a line to each point on the first image and extend it to the world coordinate system to obtain an 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 projection of the image in the world coordinate system is determined.

4. The vehicle distance measurement method according to claim 1, characterized in that: 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 includes: The longitudinal distance between the vehicle and the ranging object in the world coordinate system is calculated based on the longitudinal coordinate of the ranging object in the image coordinate system, the longitudinal coordinate of the center point of the first image, the longitudinal coordinate of the image blanking point, and the longitudinal coordinate of the camera optical center and the camera focal length in the world coordinate system, where the longitudinal distance is along the length of the lane line.

5. The vehicle distance measurement method according to claim 4, characterized in that: The method further comprises calculating 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 internal parameters in the world coordinate system: The lateral distance between the vehicle and the ranging object in the world coordinate system is calculated 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 longitudinal coordinate of the optical center of the camera in the world coordinate system, the longitudinal distance and the focal length of the camera, where the lateral distance is the lane line width direction.

6. The vehicle distance measurement method according to claim 5, characterized in that: Calculating the distance between the vehicle and the distance measurement object includes: The distance between the vehicle and the object is calculated using the inverse perspective transformation principle.

7. The vehicle distance measurement method according to claim 1, characterized in that: The determining of the coordinates of the lane line in the first image in the image plane coordinate system and the coordinates of the image vanishing point of the first image in the image plane coordinate system includes: detecting lane lines in the first image; Determining the coordinates of the lane line in the image plane coordinate system; Fit the lane curve and uniformly resample the lane point coordinates; Fitting parameters of lane line or tangent line; Calculate the intersection of any two lines according to the fitting parameters to obtain a set of intersection points; Calculate the average value of the set of intersection points to obtain the coordinates of the image vanishing point.

8. A vehicle distance measuring device, characterized in that: The device comprises: A first acquisition module is used to acquire a first image including lane lines, taken by a vehicle-mounted camera; a determination module, configured to determine the coordinates of the lane line in the first image in an image plane coordinate system and the coordinates of an image vanishing point of the first image in the image plane coordinate system; A construction module, configured to construct a mapping relationship model of the first image in the image plane coordinate system in the world coordinate system; A second acquisition module is used to acquire a distance measurement object and determine the coordinates of the distance measurement object in the image plane coordinate system according to the mapping relationship model; The calculation module is used to calculate 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 camera internal parameters in the world coordinate system.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the vehicle ranging method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the vehicle distance measurement method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and system for detecting road barrier

    CN103176185A

  • Trajectory acquisition method, trajectory acquisition device, storage medium and electronic equipment

    CN111652072A