US-12626401-B2 - Method and system for detecting position relation between vehicle and lane line, and storage medium
Abstract
A method for detecting the position relation between a vehicle and a lane line includes: obtaining a vehicle model, the vehicle model being represented by multiple first coordinates in a world coordinate system; obtaining a lane line image, the lane line image being captured by a camera disposed on a vehicle; obtaining a calibration parameter of the camera; determining, according to the lane line image and the calibration parameter, a first line segment of a lane line mapped into the world coordinate system; and determining the position relation between the lane line and the vehicle according to the position relation between the first line segment and multiple first coordinates in the world coordinate system. The position relation between the lane line and the vehicle can be determined without using a positioning system, so that the construction cost of intelligent driving is reduced.
Inventors
- Zhong Cao
- Weijie Li
- Wenli SHANG
- Wenjing Zhao
- Sha HUAN
- Hai JIE
Assignees
- GUANGZHOU UNIVERSITY
Dates
- Publication Date
- 20260512
- Application Date
- 20230414
- Priority Date
- 20201016
Claims (8)
- 1 . A method for detecting a position relation between a vehicle and a lane line, characterized in that the method comprises the following steps: obtaining a vehicle model, the vehicle model being represented by a plurality of first coordinates in a world coordinate system; obtaining a lane line image, the lane line image being captured by a camera disposed on the vehicle; obtaining a calibration parameter of the camera; determining, according to the lane line image and the calibration parameter, at least one first line segment of the lane line mapped into the world coordinate system; and determining the position relation between the lane line and the vehicle according to the position relation between the at least one first line segment and the plurality of first coordinates in the world coordinate system; and wherein a head of the vehicle model is located at an origin of the world coordinate system, and an orientation of the head of the vehicle model is the same as the Y axis of the world coordinate system; and the method further comprises the following steps: determining a slope of the at least one first line segment; determining an intercept of the at least one first line segment; determining a distance between a coordinate of the head of the vehicle model and the at least one first line segment; and determining an included angle between the vehicle and the lane line according to the distance and the slope and intercept of the at least one first line segment.
- 2 . The method for detecting the position relation between the vehicle and the lane line according to claim 1 , characterized in that the vehicle model is obtained through the following steps: obtaining length and width information of the vehicle; and mapping the length and width information into the world coordinate system to obtain the vehicle model.
- 3 . The method for detecting the position relation between the vehicle and the lane line according to claim 1 , characterized in that the step of determining the position relation between the lane line and the vehicle according to the position relation between the at least one first line segment and the plurality of first coordinates in the world coordinate system comprises the following steps: determining a second coordinate of each of the first coordinates projected onto the at least one first line segment; determining the position relation between the at least one first line segment and each of the first coordinates based on the first coordinate and the second coordinate corresponding to the first coordinate; determining, in response to all of the first coordinates being located on one side of the at least one first line segment, that the vehicle is not over the line as for the position relation between the lane line and the vehicle; determining, in response to some of the first coordinates being located on one side of the at least one first line segment, that the vehicle is over the line as for the position relation between the lane line and the vehicle.
- 4 . The method for detecting the position relation between the vehicle and the lane line according to claim 1 , characterized in that the step of determining, according to the lane line image and the calibration parameter, at least one first line segment of the lane line mapped into the world coordinate system comprises the following steps: determining two third coordinates in the world coordinate system according to the lane line image and the calibration parameter; and determining the at least one first line segment according to the two third coordinates.
- 5 . The method for detecting the position relation between the vehicle and the lane line according to claim 4 , characterized in that the step of determining two third coordinates in the world coordinate system according to the lane line image and the calibration parameter comprises the following steps: determining a recognition region according to the lane line image; determining a second line segment in the recognition region by using Hough transform; determining image pixel coordinates of two endpoints of the second line segment according to the second line segment; and mapping the image pixel coordinates into the world coordinate system according to the calibration parameter to obtain the two third coordinates of the lane line in the world coordinate system.
- 6 . The method for detecting the position relation between the vehicle and the lane line according to claim 5 , characterized in that the step of determining a recognition region according to the lane line image comprises the following steps: graying the lane line image to obtain a grayscale image; filtering the grayscale image to obtain a noise reduction image; performing distortion correction on the noise reduction image to obtain a corrected image; performing edge detection on the corrected image to obtain image data; and substituting the image data into a recognition model to obtain the recognition region.
- 7 . The method for detecting the position relation between the vehicle and the lane line according to claim 1 , characterized in that before the step of determining the position relation between the lane line and the vehicle according to the position relation between the first line segment and the plurality of first coordinates in the world coordinate system, when at least one first line segment is multiple in quantity, the method further comprises: calculating a first distance between the plurality of multiple first line segments and a fourth coordinate, the fourth coordinate being any point in the world coordinate system; determining slopes of the plurality of multiple first line segments; and merging the two first line segments into a new first line segment in response to the difference between the slopes of any two first line segments being less than a first threshold and the difference between the first distances of the two first line segments being less than a second threshold.
- 8 . A non-volatile computer-readable storage medium, characterized in that: the non-volatile computer-readable storage medium stores computer-executable instructions for causing a computer to execute the method for detecting the position relation between the vehicle and the lane line according to claim 1 .
Description
TECHNICAL FIELD The present invention relates to the field of intelligent driving, in particular to a method and system for detecting the position relation between a vehicle and a lane line, and a storage medium. BACKGROUND One of the reasons why drivers can drive normally is that they can judge whether the vehicle is driving normally based on the position of the lane lines on the road relative to the vehicle they are driving. For example, when driving on a straight road, drivers can see, through the front window, the position of the lane lines on both sides of the vehicle relative to the front window, so as to determine whether the vehicle is driving in the center of the lane; when reversing into a parking space, they may also need to observe, through the left and right side mirrors, the angle between the vehicle and the parking space line, so as to determine what an angle they should use to reverse the vehicle into the parking space. If manned driving is changed to unmanned driving, judging the position relation between the vehicle and the lane line will be the key to judging whether the vehicle can drive normally. The common method for judging the position relation between the vehicle and the lane line is to use GPS or Beidou system, and install a positioning information receiver and vector-aided positioning equipment such as a gyroscope, an accelerometer and an electronic compass on the vehicle. In addition, it is necessary to obtain precise data such as the coordinates of the lane lines of a certain site in advance, and establish a site model, so as to precisely position the vehicle at the site, thereby judging the position relation between the vehicle and the lane line. However, the adoption of a positioning system requires the large-scale laying of base stations to ensure the positioning precision, and the change of the site lane line requires the re-establishment of the site model, thus increasing the construction cost. SUMMARY In order to solve at least one of the above technical problems, the present invention provides a method and system for detecting the position relation between a vehicle and a lane line, and a storage medium; according to the detection method, the position relation between the lane line and the vehicle can be determined without using a positioning system, so that the construction cost of intelligent driving is reduced. In a first aspect, the examples of the present invention provide a method for detecting the position relation between a vehicle and a lane line, which comprises the following steps: obtaining a vehicle model, the vehicle model being represented by a plurality of first coordinates in a world coordinate system;obtaining a lane line image, the lane line image being captured by a camera disposed on a vehicle;obtaining a calibration parameter of the camera;determining, according to the lane line image and the calibration parameter, a first line segment of a lane line mapped into the world coordinate system; anddetermining the position relation between the lane line and the vehicle according to the position relation between the first line segment and the plurality of first coordinates in the world coordinate system. In some examples, the vehicle model is obtained through the following steps: obtaining length and width information of the vehicle; andmapping the length and width information into the world coordinate system to obtain the vehicle model. In some examples, the step of determining the position relation between the lane line and the vehicle according to the position relation between the first line segment and the plurality of first coordinates in the world coordinate system comprises the following steps: determining a second coordinate of each of the first coordinates projected onto the first line segment;determining the position relation between the first line segment and each of the first coordinates based on the first coordinate and the second coordinate corresponding to the first coordinate;if all of the first coordinates are located on one side of the first line segment, determining that the vehicle is not over the line as for the position relation between the lane line and the vehicle; and if some of the first coordinates are located on one side of the first line segment, determining that the vehicle is over the line as for the position relation between the lane line and the vehicle. In some examples, the step of determining, according to the lane line image and the calibration parameter, a first line segment of a lane line mapped into the world coordinate system comprises the following steps: determining two third coordinates in the world coordinate system according to the lane line image and the calibration parameter; anddetermining the first line segment according to the two third coordinates. In some examples, the step of determining two third coordinates in the world coordinate system according to the lane line image and the calibration parameter c