A method for reconstructing 2D lane lines to 3D lane lines based on monocular images

By establishing the world coordinate system and the camera coordinate system in the monocular image detection, taking the road slope information into account, and calculating the 3D lane line coordinates, the problem of insufficient robustness of the monocular image reconstruction of the 3D lane line is solved, and the detection accuracy is improved and Reduces cost and is suitable for real driving scenarios.

CN117611438BActive Publication Date: 2024-10-11ZHEJIANG TRANSPORTATION GROUP TECHNICAL RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311658373.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2024-10-11
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

Existing 2D lane line detection based on monocular images is difficult to accurately reconstruct 3D lane lines in real driving scenarios due to uneven road surfaces, resulting in errors in detection results and affecting the safety of autonomous driving. Moreover, the cost of lidar is high and monocular image reconstruction is difficult. The method is not robust enough.

Method used

By establishing the world coordinate system and the camera coordinate system, the three-dimensional mapping points on the horizontal ground are solved, considering the slope information, the traversal method is used to solve the slope angle, the 3D lane line coordinates are calculated, and the two-dimensional point set is obtained by combining the monocular image and converted into the three-dimensional real world coordinates, adding road slope information to improve the accuracy of 3D lane line detection.

Benefits of technology

It improves the accuracy of 3D lane line detection, reduces usage costs, and is suitable for lane line detection on uneven roads in real driving scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117611438B_ABST
    Figure CN117611438B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of lane line detection technology in autonomous driving, specifically a method for reconstructing 2D lane lines to 3D lane lines based on a monocular image, which should be able to improve the accuracy of 2D to 3D coordinate mapping and reduce the use cost of 3D lane line detection. The technical solution is: a method for reconstructing 2D lane lines to 3D lane lines based on a monocular image, comprising the following steps: 1) establishing a world coordinate system and a camera coordinate system; 2) solving a 3D mapping point on a horizontal ground; 3) solving a 3D mapping point considering slope information; 4) solving the slope angle using a traversal method; 5) calculating 3D lane line coordinates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of lane line detection in autonomous driving, and in particular to a method for reconstructing 2D lane lines to 3D lane lines based on a monocular image. Background Art

[0002] Lane detection technology based on computer vision is a key task in the field of autonomous driving, especially on roads that lack high-precision maps. Lane detection results based on pure vision can provide a basis for vehicles to stay centered along the lane. 2D lane detection technology aims to accurately output a set of two-dimensional lane coordinate points on an image. This technology is relatively mature and has been implemented in many papers and open source projects. However, in real driving scenarios, there are inevitably ups and downs on the road surface, which makes it impossible to align the 2D lane lines with the 3D lane lines in the real world. There are errors in the lane detection results, which endangers the safety of autonomous driving. Therefore, the correct approach is to restore the depth information of each point on the 2D lane line, that is, to complete the 3D lane line detection.

[0003] LiDAR can provide depth information of objects. Using LiDAR to assist vision, the technical path to upgrade lane lines from 2D to 3D is relatively simple. However, LiDAR is expensive to use. Currently, the mainstream research direction in the field of 3D lane line detection still tends to use monocular cameras. Since monocular images lack depth information, it is very challenging to reconstruct 3D lane lines from monocular images based on pure vision.

[0004] The commonly used method at present is to use inverse perspective mapping (IPM) to remap 2D lane lines into 3D space. However, the premise of this method is strictly based on flat ground, and it is not robust when facing uneven roads and uphill and downhill situations in real driving scenarios. Summary of the invention

[0005] The purpose of the present invention is to overcome the deficiencies in the above-mentioned background technology and provide a method for reconstructing 2D lane lines to 3D lane lines based on monocular images. The method should be able to improve the accuracy of two-dimensional to three-dimensional coordinate mapping and reduce the cost of using 3D lane line detection.

[0006] The technical solution of the present invention is:

[0007] A method for reconstructing 2D lane lines to 3D lane lines based on a monocular image, comprising the following steps:

[0008] 1) Establish the world coordinate system and the camera coordinate system;

[0009] 2) Solve the three-dimensional mapping points on the horizontal ground;

[0010] 3) Solve the three-dimensional mapping points considering slope information;

[0011] 4) Solve the slope angle using the ergodic method;

[0012] 5) Calculate 3D lane line coordinates.

[0013] In the step 1), the origin of the world coordinate system is the center of the vehicle, and the origin of the camera coordinate system is the optical center of the camera.

[0014] The step 2) comprises:

[0015] Select the plane with z=0 in the world coordinate system. In the camera coordinate system, the coordinates of the optical center of the camera are (0,0,0) T ; A pixel point P0 on the 2D lane line has coordinates (u, v) in the pixel coordinate system, (x', y') in the image coordinate system, and (x, y, f) in the camera coordinate system. T ; In the camera coordinate system, the light corresponding to point P0 passes through the optical center of the camera, and the intersection with the camera imaging plane is (x, y, f) T ;

[0016] The vector equation of light in the camera coordinate system is:

[0017]

[0018] The mapping relationship from the world coordinate system point to the camera coordinate system is:

[0019] P c =RP w +T (2)

[0020] Where P w is a point in the world coordinate system, P c P w At the mapping point in the camera coordinate system, R is the rotation matrix and T is the offset matrix;

[0021] Rewriting formula (2) yields:

[0022] P w =R -1 (P c -T) (3)

[0023] Set the point (0,0,0) in the camera coordinate system T and (x,y,f) T Substituting into formula (3) we get:

[0024]

[0025] The vector equation of light in the world coordinate system is:

[0026] L w =Ow +(I w -O w )*t (5)

[0027] Combining the ray equation with the known plane equation:

[0028]

[0029] get:

[0030] L wz =O z +d z *t=0 (7)

[0031] Solving for x w and w :

[0032]

[0033] Get the three-dimensional mapping point P of a pixel point P0 on the 2D lane line in the world coordinate system z=0 w (x w ,y w , 0).

[0034] The step 3) comprises:

[0035] Let the direction vector of the light be for:

[0036]

[0037] According to C, P w The coordinates of the light are obtained by:

[0038]

[0039] List the ray CP w The equation for , written as a parametric equation:

[0040]

[0041] Assume that the slope plane passes through point n (n1, n2, n3), and the slope plane is obtained by rotating the horizon by an angle θ around the x-axis. The normal vector of the slope plane is:

[0042]

[0043] The point normal equation of the slope plane is:

[0044] v p1 *(x-n1)+v p2 *(y-n2)+v p3*(z-n3)=0 (13)

[0045] Combining equation (11) with equation (13), we get:

[0046]

[0047] Substituting the known quantities into equation (14), we obtain:

[0048]

[0049] Substituting t into equation (11), we obtain:

[0050]

[0051] Get the three-dimensional mapping point P(x,y,z).

[0052] The step 4) comprises: selecting two points P on the same horizontal line of the 2D lane line image i , P j , assuming P i , P j The corresponding points on the inclined road with a slope angle of θ are w i 、w j , traverse all the θ angles within a certain range, when |w i w j When |-k is the smallest, the slope θ is obtained; k is the road width.

[0053] The step 5) includes: substituting θ into equation (16) to obtain P(x, y, z).

[0054] The beneficial effects of the present invention are:

[0055] Existing research on the reconstruction of 2D lane lines to 3D lane lines in monocular images is generally modeled based on an ideal flat road surface. The so-called ideal flat road surface does not consider factors such as the slope of the road. However, in real driving scenarios, the slope information of the road cannot be ignored. The present invention proposes a 2D lane line to 3D lane line reconstruction method that considers the real road slope information. After a two-dimensional point set of the lane line is obtained on a monocular image, in order to further obtain the three-dimensional information of the lane line, the extracted two-dimensional lane line pixel coordinates are converted into real-world three-dimensional coordinates, and the road slope information is added to the coordinate conversion, which is more in line with the needs of real driving scenarios, improves the accuracy of 3D lane line detection, and reduces the cost of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flow chart of the present invention.

[0057] Figure 2It is a top view of the vehicle in the world coordinate system.

[0058] Figure 3 It is the front view of the vehicle in the world coordinate system.

[0059] Figure 4 It is the right view of the vehicle in the world coordinate system.

[0060] Figure 5 This is a schematic diagram of point P on the actual road slope.

[0061] Figure 6 This is a schematic diagram of point P0 on the 2D lane line.

[0062] Figure 7 YesP i Point, P j Schematic diagram of points on 2D lane lines.

[0063] Figure 8 yes Figure 7 Schematic diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0065] like Figure 1 As shown, a method for reconstructing 2D lane lines to 3D lane lines based on a monocular image includes the following steps

[0066] 1) Establish the world coordinate system and the camera coordinate system.

[0067] refer to Figure 2 As shown in the figure, the world coordinate system is defined as follows: point O is the origin of the world coordinate system, which is located at the center of the vehicle; the X-axis is perpendicular to the direction of the vehicle's movement and is located on the horizontal ground; the Y-axis points to the direction of the vehicle's movement, the Y-axis is located on the horizontal ground and is in the same vertical plane as the center line of the vehicle; the Z-axis is positive and points upward; point C is the camera, which is placed in the center of the vehicle's windshield.

[0068] The origin of the camera coordinate system is the optical center of the camera.

[0069] 2) Solve the three-dimensional mapping point on the horizontal ground: Solve the three-dimensional mapping point P of the pixel coordinates of the 2D lane line on the monocular image in the world coordinate system z = 0 (i.e., ideal flat road) w (x w ,y w ,0).

[0070] The pixel coordinates of the 2D lane line on the monocular image are mapped to the 3D point P under ideal flat road conditions. w (x w ,y w ,0), is to use the intersection of light and a known plane to obtain three-dimensional information. This intersection is the world coordinate corresponding to the pixel point in the image.

[0071] The measurement plane is the plane at z=0 in the world coordinate system, which is the horizontal ground.

[0072] A pixel point P0 on the 2D lane line has coordinates (u, v) in the pixel coordinate system, (x', y') in the image coordinate system, and (x, y, f) in the camera coordinate system. T , where f is the focal length of the camera. In the camera coordinate system, the light corresponding to point P0 passes through the optical center of the camera, and the intersection with the camera imaging plane is (x, y, f) T .

[0073] The light equation can be determined by two points, one of which is the optical center of the camera, and its coordinates in the camera coordinate system are (0,0,0) T , the other point is the intersection of the light ray and the imaging plane (x, y). Considering that the imaging plane is in front of the optical center (at a distance f from the optical center), the coordinates of the second point on the light ray are (x, y, f) T Since two points define a straight line, the ray passes through the point (0,0,0) T , and the direction vector of the light is:

[0074] Therefore, the vector equation of the light in the camera coordinate system is:

[0075]

[0076] Among them, t is a parameter, t∈R.

[0077] Since the final solution is the intersection point in the world coordinate system, the light equation needs to be established in the world coordinate system. The mapping relationship from the point in the world coordinate system to the camera coordinate system is:

[0078]

[0079] Where P w is a point in the world coordinate system, P c P w At the mapping point in the camera coordinate system, R is the rotation matrix and T is the offset matrix;

[0080] Rewriting formula (2) yields:

[0081] Pw =R -1 (P c -T) (3)

[0082] Set the point (0,0,0) in the camera coordinate system T and point (x,y,f) T Substitute P in the above formula C , converting it to the world coordinate system, we get:

[0083]

[0084] Where: O w ,I w They are the coordinates of the camera's optical center and intersection point in the world coordinate system;

[0085] Similarly, in the world coordinate system, two points determine a straight line, and the light passes through point O w , and the direction vector of the light is:

[0086] The vector equation of light in the world coordinate system is:

[0087] L w =O w +(I w -O w )*t (5)

[0088] Combining the ray equation with the known plane equation:

[0089]

[0090] get:

[0091] L wz =O z +d z *t=0 (7)

[0092] The above formula is the intermediate expression after the light equation and the known plane equation are combined, L wz Represents the space line L w Expressions about x and y when the z-axis is known (taken as 0).

[0093] Find the 3D mapping point P of a pixel point P0 on the 2D lane line in the world coordinate system z=0, that is, based on the ideal flat road condition w (x w ,y w ,0):

[0094]

[0095] Get the three-dimensional mapping point P of a pixel point P0 on the 2D lane line in the world coordinate system z=0 w (x w ,y w ,0).

[0096] In summary, we can get the mapping point of a pixel point on the 2D lane line in the world coordinate system z = 0. Since z = 0 is the horizontal ground, when the road slope is not considered, that is, when θ = 0, the corresponding three-dimensional mapping point on the horizontal ground is P. w (x w ,y w ,0).

[0097] 3) Solve the three-dimensional mapping point P(x, y, z) taking into account the slope information.

[0098] Solve the three-dimensional mapping point P(x,y,z) considering the slope information, refer to Figure 5 and Figure 6 , Figure 6 The P0 point on the 2D lane line image corresponds to Figure 5 The point P(x,y,z) on the slope of the road is projected onto the horizontal ground as P w (x w ,y w ,0), and step 2) has obtained P w (x w ,y w ,0).

[0099] Due to the transmission principle, points C, P, P w On a straight line, so the problem of solving the three-dimensional coordinates of point P on the slope is transformed into solving the problem of solving the straight line CP w Problem of intersection with the slope plane.

[0100] Let the direction vector of the light be for:

[0101]

[0102] According to C, P w The coordinates of the light can be used to obtain the direction vector of the light:

[0103]

[0104] It is known that the light passes through point C(x c ,y c ,z c ), and the direction vector of the light is known to be Can list light CP w The equation for , written as a parametric equation:

[0105]

[0106] Assume that the slope plane passes through point n (n1, n2, n3), and the slope plane is obtained by rotating the horizon by an angle θ around the x-axis. The normal vector of the slope plane is:

[0107]

[0108] Among them, point n is located on the horizontal ground in the world coordinate system and can be selected arbitrarily, or the origin of the world coordinate system, that is, the center of the vehicle, can be directly taken.

[0109] The point normal equation of the slope plane is:

[0110] v p1 *(x-n1)+v p2 *(y-n2)+v p3 *(z-n3)=0 (13)

[0111] Combining equation (11) with equation (13), we get:

[0112]

[0113] Substituting the known variables into equation (14), we can get that t is a function of θ:

[0114]

[0115] Among them, the known quantities include the world coordinates of point n, the world coordinates of camera C, v1, v2, and v3.

[0116] Substituting t into equation (11) yields P(x, y, z). At this point, (x, y, z) is still a function of θ.

[0117]

[0118] P(x,y,z) is the three-dimensional mapping point.

[0119] 4) Use the traversal method to solve the slope angle θ.

[0120] refer to Figure 7 , select two points P on the same horizontal line of the 2D lane line image i , P j , assuming P i , P j The corresponding points on the inclined road with a slope angle of θ are w i 、w j , from step 3), we can know that w i 、w j The coordinates of are a function of θ, wi With w j The distance between |w i w j | is also a function related to θ. Therefore, if we traverse all θ angles within a certain range (for example, 0 to 45 degrees), we can get the corresponding |w i w j |The value of |. Knowing that the actual width of the road is k, when |w i w j When the value of |-k is minimum, the angle θ is considered to be the inclination of the road.

[0121] 5) Calculate 3D lane line coordinates.

[0122] Substitute θ to calculate the specific value of P(x, y, z), and substitute θ obtained by the traversal method into formula (16) to obtain the specific value of P(x, y, z) (the 3D lane line coordinates considering the actual road slope information), thus realizing the reconstruction of 2D lane lines to 3D lane lines based on monocular images.

[0123] The following is an explanation of the conversion process from the world coordinate system to the camera coordinate system (related to the principle of solving the three-dimensional mapping points on a real flat road).

[0124] refer to Figure 5 and Figure 6 , Figure 6 The P0 point on the 2D lane line is mapped to the corresponding point on the real flat road: Figure 5 P w point.

[0125] Assume the world coordinate system is (X w ,Y w ,Z w ), the camera coordinate system is (X c ,Y c ,Z c ), the image coordinate system is (x, y), and the pixel coordinate system is (u, v). The first is the conversion from the world coordinate system to the camera coordinate system. This step belongs to the rigid body transformation, that is, the object will not be deformed, only rotation and translation are required.

[0126] The transformation from the world coordinate system to the camera coordinate system can be expressed as:

[0127]

[0128]

[0129]

[0130]

[0131] Where: T is the translation matrix, R x , R y , R z is the rotation matrix obtained by rotating the world coordinate system around the x, y, z axes by angles α, β, and γ respectively; Formula (17) can be further simplified as:

[0132]

[0133] Where: R is a 3*3 rotation matrix, T is a 3*1 translation matrix;

[0134] The conversion from camera coordinate system to image coordinate system uses the pinhole imaging principle, and the conversion expression is:

[0135]

[0136] Where: f is the focal length of the camera;

[0137] The image coordinate system and the pixel coordinate system are both on the same imaging plane, but their origins and measurement units are different. The conversion from the image coordinate system to the pixel coordinate system involves scaling and translation.

[0138] Assuming the origin of the pixel coordinate system is (u0, v0), the conversion relationship between the two can be expressed as:

[0139]

[0140] Where: dx and dy represent the number of millimeters represented by the unit pixel of each column or row, and the unit is millimeter / pixel;

[0141] The above formula can be written in matrix form as:

[0142]

[0143] Through the conversion of the above four coordinate systems, we can get the conversion relationship from the world coordinate system to the pixel coordinate system:

[0144]

[0145] Where: is the camera’s intrinsic parameter matrix, is the extrinsic matrix of the camera;

[0146] Both the intrinsic parameter matrix and the extrinsic parameter matrix can be obtained through camera calibration.

[0147] Therefore, through the above steps, the coordinates of the pixel point corresponding to a certain point in the three-dimensional world coordinate system on the two-dimensional image can be calculated.

[0148] The mapping of pixel coordinates to world coordinates described in the present invention is the inverse process of the above steps. However, in the mapping from two-dimensional to three-dimensional, the depth information Z in formula (25) cannot be obtained. c , so the mapping from two-dimensional to three-dimensional is not a simple process of inverting the matrix.

[0149] There are usually two methods for mapping pixel coordinates to world coordinates: the first method requires the use of multiple cameras to simultaneously capture two or more images of the same object in different spaces before measurement can be performed; the second method only requires a single camera to capture the object to be measured, but the object to be measured must be placed on a known plane.

[0150] The 3D lane line reconstruction involved in the present invention is based on a monocular image, so the second method is selected.

[0151] The preferred embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

Claims

1. A method for reconstructing 2D lane lines to 3D lane lines based on a monocular image, comprising the following steps: 1) Establish the world coordinate system and the camera coordinate system; 2) Solve the three-dimensional mapping points on the horizontal ground; 3) Solve the three-dimensional mapping points considering slope information; 4) Solve the slope angle using the ergodic method; 5) Calculate 3D lane line coordinates; In the step 1), the origin of the world coordinate system is the center of the vehicle, and the origin of the camera coordinate system is the optical center of the camera; The step 2) comprises: Select the plane with z=0 in the world coordinate system. In the camera coordinate system, the coordinates of the optical center of the camera are (0,0,0) T ; A pixel point P0 on the 2D lane line has coordinates (u, v) in the pixel coordinate system, (x', y') in the image coordinate system, and (x, y, f) in the camera coordinate system. T ; In the camera coordinate system, the light corresponding to point P0 passes through the optical center of the camera, and the intersection with the camera imaging plane is (x, y, f) T ; The vector equation of light in the camera coordinate system is: The mapping relationship from the world coordinate system point to the camera coordinate system is: P c =RP w +T (2) Where P w is a point in the world coordinate system, P c P w At the mapping point in the camera coordinate system, R is the rotation matrix and T is the offset matrix; Rewriting formula (2) yields: P w =R -1 (P c -T) (3) Set the point (0,0,0) in the camera coordinate system T and (x,y,f) T Substituting into formula (3) we get: The vector equation of light in the world coordinate system is: L w =O w +(I w -O w )*t (5) Combining the ray equation with the known plane equation: get: L wz =O z +d z *t=0 (7) Solving for x w and w : Get the three-dimensional mapping point P of a pixel point P0 on the 2D lane line in the world coordinate system z=0 w (x w ,y w ,0); f is the focal length of the camera; is the direction vector of the light in the camera coordinate system; t is a parameter, t∈R; O w is the optical center of the camera in the camera coordinate system (0,0,0) T Coordinates in the world coordinate system; I w is the intersection point of the light ray and the imaging plane in the camera coordinate system (x, y, f) T Coordinates in the world coordinate system; L w is the vector equation of the light in the world coordinate system; L wz is the space line L w Expressions about x and y when the z axis is known; The step 3) comprises: Let the direction vector of the light be for: According to C, P w The coordinates of the light are obtained by: List the ray CP w The equation for , written as a parametric equation: Assume that the slope plane passes through point n (n1, n2, n3), and the slope plane is obtained by rotating the horizon by an angle θ around the x-axis. The normal vector of the slope plane is: The point normal equation of the slope plane is: in p1 *(x-n1)+v p2 *(y-n2)+v p3 *(z-n3)=0 (13) Combining equation (11) with equation (13), we get: Substituting the known quantities into equation (14), we obtain: Substituting t into equation (11), we obtain: Get the three-dimensional mapping point P(x,y,z).

2. The method for reconstructing 2D lane lines to 3D lane lines based on a monocular image according to claim 1, characterized in that: The step 4) comprises: selecting two points P on the same horizontal line of the 2D lane line image i , P j , assuming P i , P j The corresponding points on the inclined road with a slope angle of θ are w i 、w j , traverse all the θ angles within a certain range, when |w i w j When |-k is the smallest, the inclination slope θ is obtained; k is the road width.

3. The method for reconstructing 2D lane lines to 3D lane lines based on a monocular image according to claim 2, characterized in that: The step 5) includes: substituting θ into equation (16) to obtain P(x, y, z).