Lane line detection method and device based on trajectory extension

By using a lane detection method based on trajectory extension, the near-field lane lines in front of the vehicle are first detected, and then extended along the trajectory direction, which solves the accuracy problem of lane detection and achieves high-precision lane detection.

CN121921748APending Publication Date: 2026-04-24WESTERN CHINA SCI CITY INNOVATION CENT OF INTELLIGENT & CONNECTED VEHICLES (CHONGQING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WESTERN CHINA SCI CITY INNOVATION CENT OF INTELLIGENT & CONNECTED VEHICLES (CHONGQING) CO LTD
Filing Date
2025-12-29
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing lane line detection methods cannot adapt to changes in lane line curvature and far-field extension, which can easily lead to missed detections of far-field lane lines, affecting the reliability of lane keeping and path planning.

Method used

The lane detection method based on trajectory extension is adopted. First, the two middle lane lines in the near field in front of the vehicle are detected. Then, the lane lines are extended to a distance according to their trajectory direction. The distribution probability of white pixels is statistically analyzed by sliding window to gradually expand the detection area until the preset maximum distance is reached to obtain a complete set of lane line points.

Benefits of technology

It achieves continuous high-precision detection of lane lines from the near field to the far field, adapts to different lane scenarios, and improves the accuracy and reduces the detection range of lane lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921748A_ABST
    Figure CN121921748A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a lane line detection method and device based on trajectory extension, and the method comprises the steps: determining an initial detection region in front of a vehicle, and carrying out the detection of the initial detection region, and obtaining a lane line point set of a middle lane line; for each middle lane line, sequentially determining a next detection area corresponding to the middle lane line, and carrying out lane line detection on the next detection area to obtain a complete point set of each middle lane line; based on the two middle lane lines, according to a sequence from near to far, two corresponding center points of the two middle lane lines are determined in sequence, according to the transverse distance between the two center points, the next detection area to which the two center points belong is expanded outwards in the transverse direction, and two lane line detection areas on the outer side are obtained; and detecting the detection area of each two lane lines on the outer side to obtain a lane line point set of each two lane lines on the outer side. By applying the scheme provided by the embodiment of the invention, the accuracy of lane line detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lane line detection technology, and more specifically, to a lane line detection method and apparatus based on trajectory extension. Background Technology

[0002] In the field of autonomous driving, autonomous vehicles need to perceive their surrounding environment and output the perception results to the autonomous driving system. The safe and efficient operation of autonomous vehicles depends on high-precision, all-distance lane detection technology, and the detection results directly affect the reliability of core functions such as lane keeping and path planning.

[0003] Known lane detection methods primarily rely on regions of interest (ROIs) for lane detection. Specifically, a fixed ROI can be selected, and lane lines can be extracted using edge detection, Hough transform, and other techniques. However, this method is limited by the fixed ROI setting and cannot adapt to changes in lane line curvature and far-field extension, easily leading to missed detections of far-field lane lines. Therefore, improving the accuracy of lane detection has become a pressing technical problem. Summary of the Invention

[0004] This application provides a lane line detection method and apparatus based on trajectory extension to improve the accuracy of lane line detection. The specific technical solution is as follows.

[0005] In a first aspect, embodiments of this application provide a lane line detection method based on trajectory extension, the method being applied to an autonomous vehicle, the method comprising: S1: Determine the initial detection area in front of the vehicle, and execute the lane line detection strategy according to the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point in the binary image based on the pixel distribution probability of the binary image. S2: For each of the middle lane lines, determine the next detection area corresponding to the middle lane line in sequence according to the far-end trajectory direction of the middle lane line; S3: Based on the current binary image corresponding to the next detection region, execute the lane line detection strategy, update the obtained lane line points to the lane line point set corresponding to the middle lane line, until the next detection region reaches the preset maximum detection distance, and obtain the complete point set of each middle lane line; S4: Based on the two middle lane lines, determine the corresponding two center points of the two middle lane lines in order from near to far. According to the lateral distance between the two center points, expand the next detection area to which the two center points belong to the next detection area in the lateral direction to obtain the detection area of ​​the two outer lane lines. S5: Based on the binary image of the region corresponding to each of the outer two lane detection regions, execute the lane detection strategy to obtain the lane point set of each of the outer two lanes.

[0006] In one embodiment of this application, the step of executing a lane line detection strategy based on the initial binary image corresponding to the initial detection region to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located includes: Determine the ordinate of the lower boundary of the initial detection area; the direction of the ordinate is the forward direction of the vehicle; the lower boundary of the initial detection area is the boundary of the initial detection area closest to the vehicle side. Based on the ordinate of the lower boundary of the initial detection area, determine the size of the square sliding frame and the sliding step size; Based on the size of the square sliding frame and the sliding step size, the initial binary image is subjected to sliding window detection starting from the upper left corner of the image and proceeding from left to right and from top to bottom. The distribution probability of white pixels in each sliding window is counted, and lane line point detection is performed based on the distribution probability to obtain the lane line point set of the two middle lanes of the current lane of the vehicle.

[0007] In one embodiment of this application, the step of determining the size of the square sliding frame and the sliding step size based on the ordinate of the lower boundary of the initial detection area includes: Determine the size of the square slider using the following formula. and sliding step size : ; ; Where k0, k1, and b are all constants; y0 is the ordinate of the lower boundary of the initial detection region.

[0008] In one embodiment of this application, the step of statistically analyzing the distribution probability of white pixels in each sliding window includes: For each sliding window, count the number of white pixels within that window, and the total number of pixels within that window; The ratio of the number of white pixels to the total number of pixels is used as the distribution probability of white pixels within the sliding window.

[0009] In one embodiment of this application, the step of sequentially determining the next detection area corresponding to each middle lane line based on the far-end trajectory direction of the middle lane line includes: For each of the aforementioned middle lane lines, calculate the far-end trajectory direction of that middle lane line; Determine the ordinate of the upper boundary of the current detection area, and calculate the size of the next detection area corresponding to the middle lane line based on the ordinate. The size of the next detection area includes the height and width of the rectangular detection area; the height is the dimension along the ordinate direction, and the width is the dimension along the lateral direction. Determine the farthest point in the current lane line point set of the middle lane line. Based on the farthest point, the direction of the farthest trajectory, and the height of the rectangular detection area, calculate the center point coordinates of the next detection area. Based on the center point coordinates and the size of the next detection area, determine the next detection area corresponding to the middle lane line.

[0010] In one embodiment of this application, the step of calculating the far-end trajectory direction of each of the middle lane lines includes: For each of the middle lane lines, determine the farthest point and the nearest point in the lane line point set corresponding to the middle lane line, and calculate the angle between the line connecting the farthest point and the nearest point and the vertical coordinate axis, which is used as the far-end trajectory direction of the middle lane line.

[0011] In one embodiment of this application, the step of calculating the size of the next detection area corresponding to the middle lane line based on the ordinate includes: Calculate the height of the rectangular detection area using the following formula. and width : ; ; in, , , and All are constants; The ordinate of the upper boundary of the current detection area; The step of calculating the coordinates of the center point of the next detection region based on the farthest point, the direction of the farthest trajectory, and the height of the rectangular detection region includes: Determine the ordinate of the farthest point x-axis The ordinate of the center point P1 of the next detection area is calculated according to the following formula. and x-axis : ; ; in, The direction of the far-end trajectory.

[0012] Secondly, embodiments of this application provide a lane detection device based on trajectory extension, the device being applied to an autonomous vehicle, the device comprising: The middle lane detection module is used to determine the initial detection area in front of the vehicle, and execute the lane line detection strategy according to the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point existing in the binary image according to the pixel distribution probability of the binary image. The next detection area determination module is used to determine the next detection area corresponding to each of the middle lane lines in turn, based on the far-end trajectory direction of the middle lane line. The middle lane detection module is further configured to execute the lane detection strategy based on the current binary image corresponding to the next detection area, update the obtained lane line points to the lane line point set corresponding to the middle lane line, until the next detection area reaches the preset farthest detection distance, and obtain the complete point set of each middle lane line. The outer lane line detection module is used to determine the corresponding two center points of the two middle lane lines in order from near to far based on the two middle lane lines. According to the lateral distance between the two center points, the next detection area to which the two center points belong is extended outward in the lateral direction to obtain the outer two lane line detection area. According to the binary image of the region corresponding to each outer two lane line detection area, the lane line detection strategy is executed to obtain the lane line point set of each outer two lane line.

[0013] In one embodiment of this application, the middle lane line detection module includes: The boundary determination submodule is used to determine the ordinate of the lower boundary of the initial detection area; the direction of the ordinate is the forward direction of the vehicle; the lower boundary of the initial detection area is the boundary of the initial detection area closest to the vehicle side. The parameter calculation submodule is used to determine the size of the square sliding frame and the sliding step size based on the ordinate of the lower boundary of the initial detection area; The lane line detection submodule is used to perform sliding window detection on the initial binary image starting from the upper left corner of the image and proceeding from left to right and from top to bottom, based on the size of the square sliding box and the sliding step size. In each sliding window, the distribution probability of white pixels is counted, and lane line point detection is performed based on the distribution probability to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located.

[0014] In one embodiment of this application, the parameter calculation submodule is specifically used for: Determine the size of the square slider using the following formula. and sliding step size : ; ; Where k0, k1, and b are all constants; y0 is the ordinate of the lower boundary of the initial detection region.

[0015] In one embodiment of this application, the lane line detection submodule is specifically used for: For each sliding window, count the number of white pixels within that window, and the total number of pixels within that window; The ratio of the number of white pixels to the total number of pixels is used as the distribution probability of white pixels within the sliding window.

[0016] In one embodiment of this application, the next detection region determination module includes: The trajectory direction calculation submodule is used to calculate the far-end trajectory direction of each of the middle lane lines. The region parameter calculation submodule is used to determine the ordinate of the upper boundary of the current detection region, and calculate the size of the next detection region corresponding to the middle lane line based on the ordinate. The size of the next detection region includes the height and width of the rectangular detection region; the height is the dimension along the ordinate direction, and the width is the dimension along the lateral direction. The detection area determination submodule is used to determine the farthest point in the current lane line point set of the middle lane line, calculate the center point coordinates of the next detection area based on the farthest point, the far-end trajectory direction and the height of the rectangular detection area, and determine the next detection area corresponding to the middle lane line based on the center point coordinates and the size of the next detection area.

[0017] In one embodiment of this application, the trajectory direction calculation submodule is specifically used for: For each of the middle lane lines, determine the farthest point and the nearest point in the lane line point set corresponding to the middle lane line, and calculate the angle between the line connecting the farthest point and the nearest point and the vertical coordinate axis, which is used as the far-end trajectory direction of the middle lane line.

[0018] In one embodiment of this application, the region parameter calculation submodule is specifically used for: Calculate the height of the rectangular detection area using the following formula. and width : ; ; in, , , and All are constants; The ordinate of the upper boundary of the current detection area; The detection area determination submodule is specifically used for: Determine the ordinate of the farthest point x-axis The ordinate of the center point P1 of the next detection area is calculated according to the following formula. and x-axis : ; ; in, The direction of the far-end trajectory.

[0019] Thirdly, embodiments of this application provide a computer device, including: a memory and a processor, wherein the memory and the processor are coupled together; The memory is used to store one or more computer instructions; The processor is used to execute one or more computer instructions to implement the lane line detection method based on trajectory extension as described in the first aspect.

[0020] Fourthly, embodiments of this application provide a computer-readable storage medium having stored thereon one or more computer instructions that are executed by a processor to implement the lane line detection method based on trajectory extension as described in the first aspect above.

[0021] Fifthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the lane line detection method based on trajectory extension described in the first aspect.

[0022] In this embodiment, two middle lane lines in a certain area in front of the vehicle, i.e., the near field, can be detected first. Then, based on the detected middle lane lines, the detection extends longitudinally forward and laterally to both sides to detect the complete middle lane lines and the outer lane lines. This method achieves continuous high-precision detection of lane lines from the near field to the far field, adapts to different lane scenarios such as curves and long straight roads, and greatly reduces the detection range, thereby improving the accuracy of lane line detection. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0024] Figure 1 A schematic flowchart of a lane line detection method based on trajectory extension provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of the binarized image corresponding to the initial detection region in an embodiment of this application. Figure 3 A schematic diagram of the sliding window detection process in an embodiment of this application is shown; Figure 4 This illustration shows a schematic diagram of the detection results for the two middle lane lines in an embodiment of this application. Figure 5 This illustration shows a schematic diagram of the next detection region determination result in an embodiment of this application. Figure 6 This illustration shows a schematic diagram of the determination result of the outer lane line detection area in an embodiment of this application; Figure 7 A schematic diagram of the structure of a lane line detection device based on trajectory extension provided in an embodiment of this application is shown; Figure 8 A schematic diagram of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0026] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0027] This application discloses a lane line detection method and apparatus based on trajectory extension, which can improve the accuracy of lane line detection. The embodiments of this application are described in detail below.

[0028] Figure 1 This illustration shows a flowchart of a lane line detection method based on trajectory extension provided in an embodiment of this application. The method is applied to autonomous vehicles and includes the following steps: S1: Determine the initial detection area in front of the vehicle, and execute the lane line detection strategy based on the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point in the binary image based on the pixel distribution probability of the binary image. S2: For each middle lane line, determine the next detection area corresponding to the middle lane line in sequence according to the far-end trajectory direction of the middle lane line; S3: Based on the current binary image corresponding to the next detection area, execute the lane line detection strategy, update the obtained lane line points to the lane line point set corresponding to the middle lane line, until the next detection area reaches the preset farthest detection distance, and obtain the complete point set of each middle lane line; S4: Based on the two middle lane lines, determine the two corresponding center points of the two middle lane lines in order from near to far. According to the lateral distance between the two center points, expand the next detection area to which the two center points belong to the next detection area in the lateral direction to obtain the detection area of ​​the two outer lane lines. S5: Based on the binary image of the region corresponding to each outer two lane line detection area, execute the lane line detection strategy to obtain the lane line point set of each outer two lane line.

[0029] In this embodiment, to improve the accuracy of lane line detection, a trajectory extension method can be used for lane line detection. Specifically, lane lines within a certain range in front of the vehicle can first be detected. It is understood that the accuracy of lane line detection at close range can usually be maintained at a high level. Then, the detected lane lines are extended to a distance along their trajectory direction, and lane line detection is performed again in the extended area until the detection distance reaches the maximum distance, thus obtaining a complete lane line detection result.

[0030] Specifically, a fixed area in front of the vehicle can be used as the initial detection area. The initial detection area is converted into a binary image. Then, lane line points are filtered by statistically analyzing the distribution probability of white points through a sliding window to obtain the point set of the two middle lane lines, which are the two lane lines of the lane where the vehicle is currently located. In this embodiment, these can be referred to as the middle lane lines.

[0031] The specific calculation process for processing the initial detection region's RGB image into a grayscale image is as follows: Calculate the grayscale histogram, divide the grayscale image into L grayscale levels [1,2,...,L], and define the number of pixels in the i-th grayscale level as e. i Then the total number of pixels E is as shown in the following formula: ; The grayscale histogram is shown in the following formula: ; This represents the pixel probability value for the i-th gray level; The grayscale value is calculated using the following formula: ; In the formula, gray represents the gray value of a pixel, and R, G, and B represent the RGB values ​​of the pixel.

[0032] An adaptive threshold is calculated using the OTSU (Otsu algorithm) thresholding method to perform binarization segmentation on the grayscale image, obtaining a binary image. The specific calculation process is as follows: Calculate the segmentation threshold K, and classify all pixels into two classes, C0 and C1, where the gray value of C0 pixels is less than or equal to K, and the gray value of C1 pixels is greater than K. Calculate the inter-class variance of the two classes of pixels, and obtain the segmentation threshold K using the following formula: ; In the formula The inter-class variance of two classes of pixels is obtained by the following formula: ; In the formula The probability distribution of the two types of pixels is represented by the following formula: ; In the formula The mean value of two types of pixels is calculated using the following formula: ; Obtain a binarized image by converting a grayscale image into a binarized image using the following formula; ; In the formula This represents the grayscale value of a pixel.

[0033] The initial detection region grayscale image is converted into a binary image based on the steps described above, as illustrated. Figure 2 As shown.

[0034] After converting the RGB image corresponding to the initial detection area into a binary image, which can be called the initial binary image, the lane line detection strategy can be executed based on the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located.

[0035] In one implementation, the step of executing a lane line detection strategy based on the initial binary image corresponding to the initial detection region to obtain the lane line point set of the two middle lanes of the current lane of the vehicle may include: determining the ordinate of the lower boundary of the initial detection region; the direction of the ordinate is the direction of the vehicle's movement; the lower boundary of the initial detection region is the side boundary of the initial detection region closest to the vehicle; determining the size of the square sliding box and the sliding step size based on the ordinate of the lower boundary of the initial detection region; and performing sliding window detection on the initial binary image starting from the upper left corner of the image in a direction from left to right and from top to bottom, according to the size of the square sliding box and the sliding step size, calculating the distribution probability of white pixels in each sliding window, and performing lane line point detection based on the distribution probability to obtain the lane line point set of the two middle lanes of the current lane of the vehicle.

[0036] For example, such as Figure 3 As shown, the ordinate y0 of the lower boundary of the initial detection area can be determined first, and then the size of the square sliding frame (sliding window) can be determined according to the following formula. and sliding step size : ; ; Wherein, k0, k1 and b are all constants, and their specific values ​​can be set according to the actual situation. This application does not limit their specific values.

[0037] After calculating the sliding window size and sliding step size, as follows Figure 3 As shown, a sliding window detection can be performed on the binary image starting from the top left corner, proceeding from left to right and from top to bottom. Within each sliding window, the probability distribution of white pixels is calculated. If the probability exceeds a set threshold, the window is considered to contain a lane line region. All white pixels within the sliding window are then captured, and their center is calculated as the lane point. ; ; In the formula, P represents the probability distribution of white pixels in the sliding window. This represents the number of white pixels in the sliding window. This represents the total number of pixels in the sliding window. The set probability threshold.

[0038] During the sliding window process, lane points can be classified according to the Euclidean distance D between them. If the distance to the tail of the lane line point queue is less than a set value, it is considered to belong to that lane line. The calculation process of the Euclidean distance D is as follows: ; ; In the formula, , The pixel coordinates of the newly detected valid lane line points. , D0 represents the pixel coordinates of the tail point of the lane line point set queue, and D0 is the set distance threshold.

[0039] By using sliding window detection, information on all lane points corresponding to each lane line within the region can be obtained. After classification, the initial detection region results are saved, but only the lane point sets corresponding to the middle two lane lines are saved, such as... Figure 4 As shown.

[0040] After detecting the two middle lane lines in the initial detection area, they can be further extended to obtain a complete set of lane line points. Specifically, for each middle lane line, the next detection area corresponding to that middle lane line can be determined sequentially based on the far-end trajectory direction of that middle lane line. Then, based on the current binary image corresponding to the next detection area, a lane line detection strategy can be executed to update the lane line point set corresponding to that middle lane line with the obtained lane line points, until the next detection area reaches the preset maximum detection distance, thus obtaining the complete set of points for each middle lane line.

[0041] In one implementation, the step of determining the next detection area corresponding to each middle lane line based on the far-end trajectory direction of the middle lane line may include: calculating the far-end trajectory direction of each middle lane line; determining the ordinate of the upper boundary of the current detection area, calculating the size of the next detection area corresponding to the middle lane line based on the ordinate, wherein the size of the next detection area includes the height and width of the rectangular detection area; the height is the dimension along the ordinate direction, and the width is the dimension along the lateral direction; determining the farthest point in the current lane line point set of the middle lane line, calculating the center point coordinates of the next detection area based on the farthest point, the far-end trajectory direction, and the height of the rectangular detection area, and determining the next detection area corresponding to the middle lane line based on the center point coordinates and the size of the next detection area.

[0042] Specifically, you can first calculate the direction of the lane lines. (Far-end trajectory direction): Obtain the farthest point P detected in the current area of ​​the lane line point set. far And the nearest point P near Calculate the angle between the line connecting the two points and the vertical axis as the direction of the lane line. ,like Figure 5 As shown.

[0043] Furthermore, such as Figure 5 As shown, the height of the rectangular detection area can be calculated using the following formula. and width : ; ; in, , , and These are all constants, and are related to the camera resolution and the angle of the installation position; This is the ordinate of the upper boundary of the current detection area.

[0044] like Figure 5 As shown, the farthest point of the current lane line point set can be determined ( ) y-axis x-axis Calculate the ordinate of the center point P1 of the next detection area using the following formula. and x-axis : ; ; Once the next detection region is determined, the lane line detection strategy can be executed based on the current binary image corresponding to the next detection region. The obtained lane line points are updated to the lane line point set corresponding to the middle lane line. Then, based on the updated lane line point set, the next detection region is determined again. The above steps are repeated until the next detection region reaches the preset maximum detection distance, and the complete point set of each middle lane line is obtained.

[0045] In this embodiment, when performing lane line detection for each subsequent detection area based on the lane line detection strategy, the specific process is similar to the process of performing lane line detection for the initial detection area described above, and will not be repeated here. However, it can be understood that in the specific detection process, the size of the square sliding frame (sliding window) is calculated according to the above formula. and sliding step size In this case, the specific values ​​of each parameter k0, k1 and b can be the same or different, which is acceptable.

[0046] After obtaining the complete lane line point set of the two middle lane lines, in this embodiment, lane lines of adjacent lanes can also be detected. Specifically, based on the two middle lane lines, the corresponding two center points of the two middle lane lines can be determined sequentially from near to far. According to the lateral distance between the two center points, the next detection area to which the two center points belong is extended outward in the lateral direction to obtain the detection area of ​​the two outer lane lines. Then, based on the binary image of the area corresponding to each detection area of ​​the two outer lane lines, a lane line detection strategy is executed to obtain the lane line point set of each outer lane line.

[0047] like Figure 6 As shown, after detecting the two middle lane lines, the lateral distance Y between corresponding points on the two middle lane lines can be calculated from near to far based on the information of the two middle lane lines. L Then, based on the lateral distance Y between the two corresponding points L The detection areas (yellow and blue boxes) corresponding to the two points are extended outward by a corresponding distance Y in the horizontal direction. L Determine the detection area of ​​the outer two lane lines (green and purple boxes) and proceed to the farthest point to obtain the entire detection area of ​​the outer two lane lines.

[0048] In this embodiment, two middle lane lines in a certain area in front of the vehicle, i.e., the near field, can be detected first. Then, based on the detected middle lane lines, the detection extends longitudinally forward and laterally to both sides to detect the complete middle lane lines and the outer lane lines. This method achieves continuous high-precision detection of lane lines from the near field to the far field, adapts to different lane scenarios such as curves and long straight roads, and greatly reduces the detection range, thereby improving the accuracy of lane line detection.

[0049] Figure 7 This illustration shows a schematic diagram of a lane line detection device based on trajectory extension, provided in an embodiment of this application. The device is applied to an autonomous vehicle and includes: The middle lane detection module 710 is used to determine the initial detection area in front of the vehicle, and execute a lane detection strategy based on the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point existing in the binary image based on the pixel distribution probability of the binary image. The next detection area determination module 720 is used to determine the next detection area corresponding to each of the middle lane lines in turn, based on the far-end trajectory direction of the middle lane line. The middle lane detection module 710 is further configured to execute the lane detection strategy based on the current binary image corresponding to the next detection area, update the obtained lane point to the lane point set corresponding to the middle lane, until the next detection area reaches the preset farthest detection distance, and obtain the complete point set of each middle lane. The outer lane line detection module 730 is used to determine the corresponding two center points of the two middle lane lines in order from near to far based on the two middle lane lines. According to the lateral distance between the two center points, the next detection area to which the two center points belong is extended outward in the lateral direction to obtain the outer two lane line detection area. According to the binary image of the area corresponding to each outer two lane line detection area, the lane line detection strategy is executed to obtain the lane line point set of each outer two lane line.

[0050] In one embodiment of this application, the middle lane line detection module 710 includes: The boundary determination submodule is used to determine the ordinate of the lower boundary of the initial detection area; the direction of the ordinate is the forward direction of the vehicle; the lower boundary of the initial detection area is the boundary of the initial detection area closest to the vehicle side. The parameter calculation submodule is used to determine the size of the square sliding frame and the sliding step size based on the ordinate of the lower boundary of the initial detection area; The lane line detection submodule is used to perform sliding window detection on the initial binary image starting from the upper left corner of the image and proceeding from left to right and from top to bottom, based on the size of the square sliding box and the sliding step size. In each sliding window, the distribution probability of white pixels is counted, and lane line point detection is performed based on the distribution probability to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located.

[0051] In one embodiment of this application, the parameter calculation submodule is specifically used for: Determine the size of the square slider using the following formula. and sliding step size : ; ; Where k0, k1, and b are all constants; y0 is the ordinate of the lower boundary of the initial detection region.

[0052] In one embodiment of this application, the lane line detection submodule is specifically used for: For each sliding window, count the number of white pixels within that window, and the total number of pixels within that window; The ratio of the number of white pixels to the total number of pixels is used as the distribution probability of white pixels within the sliding window.

[0053] In one embodiment of this application, the next detection region determination module 720 includes: The trajectory direction calculation submodule is used to calculate the far-end trajectory direction of each of the middle lane lines. The region parameter calculation submodule is used to determine the ordinate of the upper boundary of the current detection region, and calculate the size of the next detection region corresponding to the middle lane line based on the ordinate. The size of the next detection region includes the height and width of the rectangular detection region; the height is the dimension along the ordinate direction, and the width is the dimension along the lateral direction. The detection area determination submodule is used to determine the farthest point in the current lane line point set of the middle lane line, calculate the center point coordinates of the next detection area based on the farthest point, the far-end trajectory direction and the height of the rectangular detection area, and determine the next detection area corresponding to the middle lane line based on the center point coordinates and the size of the next detection area.

[0054] In one embodiment of this application, the trajectory direction calculation submodule is specifically used for: For each of the middle lane lines, determine the farthest point and the nearest point in the lane line point set corresponding to the middle lane line, and calculate the angle between the line connecting the farthest point and the nearest point and the vertical coordinate axis, which is used as the far-end trajectory direction of the middle lane line.

[0055] In one embodiment of this application, the region parameter calculation submodule is specifically used for: Calculate the height of the rectangular detection area using the following formula. and width : ; ; in, , , and All are constants; The ordinate of the upper boundary of the current detection area; The detection area determination submodule is specifically used for: Determine the ordinate of the farthest point x-axis The ordinate of the center point P1 of the next detection area is calculated according to the following formula. and x-axis : ; ; in, The direction of the far-end trajectory.

[0056] In this embodiment, two middle lane lines in a certain area in front of the vehicle, i.e., the near field, can be detected first. Then, based on the detected middle lane lines, the detection extends longitudinally forward and laterally to both sides to detect the complete middle lane lines and the outer lane lines. This method achieves continuous high-precision detection of lane lines from the near field to the far field, adapts to different lane scenarios such as curves and long straight roads, and greatly reduces the detection range, thereby improving the accuracy of lane line detection.

[0057] The following describes a computer device provided in an embodiment of this application. Please refer to [link / reference needed]. Figure 8 , Figure 8 A schematic diagram of a computer device provided in an embodiment of this application, the computer device comprising: One or more processors 40; The processor 40 is coupled to a storage device 41, which stores one or more programs. When the one or more programs are executed by the processor 40, the electronic device enables the electronic device to perform the following functions: Figures 1-6 The technical solution of the lane line detection method based on trajectory extension is described above.

[0058] This application also provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement... Figures 1-6 The technical solution of the lane line detection method based on trajectory extension is described above.

[0059] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the following: Figures 1-6 The technical solution of the lane line detection method based on trajectory extension is described above.

[0060] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.

[0061] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A lane line detection method based on trajectory extension, characterized in that, The method is applied to autonomous vehicles, and the method includes: S1: Determine the initial detection area in front of the vehicle, and execute the lane line detection strategy according to the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point in the binary image based on the pixel distribution probability of the binary image. S2: For each of the middle lane lines, determine the next detection area corresponding to the middle lane line in sequence according to the far-end trajectory direction of the middle lane line; S3: Based on the current binary image corresponding to the next detection region, execute the lane line detection strategy, update the obtained lane line points to the lane line point set corresponding to the middle lane line, until the next detection region reaches the preset farthest detection distance, and obtain the complete point set of each middle lane line; S4: Based on the two middle lane lines, determine the corresponding two center points of the two middle lane lines in order from near to far. According to the lateral distance between the two center points, expand the next detection area to which the two center points belong to the next detection area in the lateral direction to obtain the detection area of ​​the two outer lane lines. S5: Based on the binary image of the region corresponding to each of the outer two lane detection regions, execute the lane detection strategy to obtain the lane point set of each of the outer two lanes.

2. The method according to claim 1, characterized in that, The step of executing a lane line detection strategy based on the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located includes: Determine the ordinate of the lower boundary of the initial detection area; the direction of the ordinate is the forward direction of the vehicle; the lower boundary of the initial detection area is the boundary of the initial detection area closest to the vehicle side. Based on the ordinate of the lower boundary of the initial detection area, determine the size of the square sliding frame and the sliding step size; Based on the size of the square sliding frame and the sliding step size, the initial binary image is subjected to sliding window detection starting from the top left corner of the image and proceeding from left to right and from top to bottom. The distribution probability of white pixels in each sliding window is counted, and lane line point detection is performed based on the distribution probability to obtain the lane line point set of the two middle lanes of the lane where the vehicle is currently located.

3. The method according to claim 2, characterized in that, The step of determining the size of the square sliding frame and the sliding step size based on the ordinate of the lower boundary of the initial detection area includes: Determine the size of the square slider using the following formula. and sliding step size : ; ; Where k0, k1, and b are all constants; y0 is the ordinate of the lower boundary of the initial detection region.

4. The method according to claim 2, characterized in that, The step of calculating the distribution probability of white pixels in each sliding window includes: For each sliding window, count the number of white pixels within that window, and the total number of pixels within that window; The ratio of the number of white pixels to the total number of pixels is used as the distribution probability of white pixels within the sliding window.

5. The method according to claim 1, characterized in that, The step of determining the next detection area corresponding to each of the middle lane lines according to the far-end trajectory direction of the middle lane line includes: For each of the aforementioned middle lane lines, calculate the far-end trajectory direction of that middle lane line; Determine the ordinate of the upper boundary of the current detection area, and calculate the size of the next detection area corresponding to the middle lane line based on the ordinate. The size of the next detection area includes the height and width of the rectangular detection area; the height is the dimension along the ordinate direction, and the width is the dimension along the lateral direction. Determine the farthest point in the current lane line point set of the middle lane line. Calculate the center point coordinates of the next detection area based on the farthest point, the direction of the farthest trajectory, and the height of the rectangular detection area. Then, determine the next detection area corresponding to the middle lane line based on the center point coordinates and the size of the next detection area.

6. The method according to claim 5, characterized in that, The step of calculating the far-end trajectory direction of each of the middle lane lines includes: For each of the middle lane lines, determine the farthest point and the nearest point in the lane line point set corresponding to the middle lane line, and calculate the angle between the line connecting the farthest point and the nearest point and the vertical coordinate axis, which is used as the far-end trajectory direction of the middle lane line.

7. The method according to claim 5, characterized in that, The step of calculating the size of the next detection area corresponding to the middle lane line based on the vertical coordinate includes: Calculate the height of the rectangular detection area using the following formula. and width : ; ; in, , , and All are constants; The ordinate of the upper boundary of the current detection area; The step of calculating the coordinates of the center point of the next detection region based on the farthest point, the direction of the farthest trajectory, and the height of the rectangular detection region includes: Determine the ordinate of the farthest point x-axis The ordinate of the center point P1 of the next detection area is calculated according to the following formula. and x-axis : ; ; in, The direction of the far-end trajectory.

8. A lane line detection device based on trajectory extension, characterized in that, The device is used in autonomous vehicles, and the device includes: The middle lane detection module is used to determine the initial detection area in front of the vehicle, and execute the lane line detection strategy according to the initial binary image corresponding to the initial detection area to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located; the lane line detection strategy is to determine each lane line point existing in the binary image according to the pixel distribution probability of the binary image. The next detection area determination module is used to determine the next detection area corresponding to each of the middle lane lines in turn, based on the far-end trajectory direction of the middle lane line. The middle lane detection module is further configured to execute the lane detection strategy based on the current binary image corresponding to the next detection area, update the obtained lane line points to the lane line point set corresponding to the middle lane line, until the next detection area reaches the preset farthest detection distance, and obtain the complete point set of each middle lane line. The outer lane line detection module is used to determine the corresponding two center points of the two middle lane lines in order from near to far based on the two middle lane lines. According to the lateral distance between the two center points, the next detection area to which the two center points belong is extended outward in the lateral direction to obtain the outer two lane line detection area. According to the binary image of the region corresponding to each outer two lane line detection area, the lane line detection strategy is executed to obtain the lane line point set of each outer two lane line.

9. The apparatus according to claim 8, characterized in that, The middle lane line detection module includes: The boundary determination submodule is used to determine the ordinate of the lower boundary of the initial detection area; the direction of the ordinate is the forward direction of the vehicle; the lower boundary of the initial detection area is the boundary of the initial detection area closest to the vehicle side. The parameter calculation submodule is used to determine the size of the square sliding frame and the sliding step size based on the ordinate of the lower boundary of the initial detection area; The lane line detection submodule is used to perform sliding window detection on the initial binary image starting from the upper left corner of the image and proceeding from left to right and from top to bottom, based on the size of the square sliding box and the sliding step size. In each sliding window, the distribution probability of white pixels is counted, and lane line point detection is performed based on the distribution probability to obtain the lane line point set of the two middle lane lines of the lane where the vehicle is currently located.

10. The apparatus according to claim 9, characterized in that, The parameter calculation submodule is specifically used for: Determine the size of the square slider using the following formula. and sliding step size : ; ; Where k0, k1, and b are all constants; y0 is the ordinate of the lower boundary of the initial detection region.