Method, apparatus, electronic device, and storage medium for generating lane lines

By splitting and rectangular fitting of lane line contour points in a single frame image, combining intra-frame grouping, inter-frame merging and smoothing processing, the lane line accuracy deviation problem after curve fitting is solved, achieving more efficient and accurate lane line processing.

CN119741321BActive Publication Date: 2025-06-10ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510238074.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-10
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

During the high-precision map production process, the lane line after the curve fitting has an accuracy deviation from the actual lane line calculated, and the calculation amount is large, which may lead to the situation where the optimal solution cannot be found in multiple iterations, and it is impossible to provide more accurate lane line information for autonomous driving.

Method used

By obtaining the lane line contour points in a single frame image, split them into multiple convex polygons, and fitting them into rectangles, with the same long side direction as the driving direction. Then the fitted rectangles are grouped intra-frame and merged inter-frames, sorted and checked, and the center point of the lane line rectangle is obtained, and smoothed to obtain the smoothing point of the corresponding lane line.

Benefits of technology

It improves the processing efficiency of lane lines, reduces grouping errors, and the generated lane lines are more accurate, which can provide lane line information for autonomous driving more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741321B_ABST
    Figure CN119741321B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, electronic device, and storage medium for generating lane lines. The method includes: after obtaining the contour points of the lane lines in a single-frame image, splitting the contour of the lane lines in the frame into multiple convex polygons, and fitting the convex polygons into rectangles, wherein the long side direction of the rectangle is the same as the driving direction; performing in-frame grouping and inter-frame merging on each of the fitted rectangles to obtain grouped lane line rectangles; performing sorting and verification on the grouped lane line rectangles to obtain multiple sets of central points of the lane line rectangles; and performing smoothing processing on the central points of each set of the lane line rectangles to obtain a set of smoothed points corresponding to the lane lines. The solution provided by the present application can quickly process and improve the accuracy of lane lines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of high-precision map image processing, and particularly to a method, apparatus, electronic device, and storage medium for generating lane lines. Background Art

[0002] In the process of making a high-precision map, after calculating the contour points of the lane lines, the contour points of the lane lines can be curve-fitted to generate smooth lane lines. However, the lane lines after curve fitting need to conform to a curve equation within a certain section, while the actual lane lines may not conform to this curve equation. This phenomenon results in an accuracy deviation between the lane lines after curve fitting and the actually calculated lane lines. In curve fitting, the positions of the starting point and the ending point may also change. Moreover, the curve fitting algorithm performs curve fitting on all points. Although the global error can be minimized using the least squares principle, the computational complexity is high, and there may also be a situation where the optimal solution cannot be found after multiple iterations, thus unable to provide more accurate lane line information for autonomous driving. Summary of the Invention

[0003] To solve or partially solve the problems existing in the related art, this application provides a method, apparatus, electronic device, and storage medium for generating lane lines, which can quickly process and improve the accuracy of lane lines.

[0004] The first aspect of this application provides a method for generating lane lines, including:

[0005] After obtaining the contour points of the lane lines in a single-frame image, splitting the contour of the lane lines in this frame into multiple convex polygons, and fitting the convex polygons into rectangles, where the long side direction of the rectangle is the same as the driving direction;

[0006] Performing intra-frame grouping and inter-frame merging on each of the fitted rectangles to obtain grouped lane line rectangles;

[0007] Performing sorting and verification on the grouped lane line rectangles to obtain multiple sets of central points of the lane line rectangles;

[0008] Smoothing each set of the central points of the lane line rectangles to obtain a set of smoothed points corresponding to the lane line.

[0009] In an optional embodiment, it further includes:

[0010] After obtaining a set of the smoothed points, performing thinning processing on this set of the smoothed points.

[0011] In an optional embodiment, the performing thinning processing on this set of the smoothed points includes:

[0012] Determine the bending level of the current segment of the lane line according to the average curvature of multiple adjacent smooth points within a preset window;

[0013] Retain the corresponding number of smooth points according to different bending levels.

[0014] In an alternative embodiment, the splitting the contour of the lane line in the frame image into multiple convex polygons includes:

[0015] Split the concave polygon formed by the contour of the intersecting or curved lane line into multiple convex polygons, where each convex polygon represents a different part of the lane line.

[0016] In an alternative embodiment, the sorting and verification of the grouped lane line rectangles to obtain the central points of multiple groups of lane line rectangles includes:

[0017] After obtaining the grouped lane line rectangles, for each rectangle central point in a group of lane line rectangles, determine that the direction of the vector formed by any two adjacent rectangle central points is the same as the driving direction;

[0018] Filter the multiple rectangle central points, and use the filtered rectangle central points as the central points of the lane line rectangles corresponding to the group.

[0019] In an alternative embodiment, the smoothing process for each group of lane line rectangle central points to obtain a group of smooth points corresponding to the lane line includes:

[0020] For a group of lane line rectangle central points, set multiple insertion points between two adjacent lane line rectangle central points according to the curvature between the two adjacent lane line rectangle central points;

[0021] Dynamically adjust the insertion points according to a set of multiple curvature thresholds and corresponding windows, and use the adjusted insertion points and the two lane line rectangle central points as a group of smooth points.

[0022] In an alternative embodiment, the dynamically adjusting the insertion points according to a set of multiple curvature thresholds and corresponding windows includes:

[0023] Calculate the average curvature of each insertion point according to the curvature range corresponding to two adjacent lane line rectangle central points;

[0024] Determine the required window according to a set of multiple curvature thresholds and corresponding windows in combination with the average curvature of the insertion points;

[0025] According to the coordinates of the insertion points, take the average coordinates of all insertion points and lane line rectangle central points in its adjacent window as the adjusted coordinates of the insertion point.

[0026] The second aspect of the present application provides a device for generating lane lines, including:

[0027] A splitting and fitting module, which is configured to split the contour of the lane line in a single-frame image into multiple convex polygons after obtaining the contour points of the lane line in the frame image, and fit the convex polygons into rectangles, wherein the long side direction of the rectangle is the same as the driving direction;

[0028] A grouping and merging module, which is configured to perform intra-frame grouping and inter-frame merging on each of the fitted rectangles to obtain grouped lane line rectangles;

[0029] A sorting and verification module, which is configured to perform sorting and verification on the grouped lane line rectangles to obtain multiple sets of central points of the lane line rectangles;

[0030] A smoothing processing module, which is configured to smooth each set of the central points of the lane line rectangles to obtain a set of smoothed points corresponding to the lane line.

[0031] The third aspect of the present application provides an electronic device, including:

[0032] A processor; and

[0033] A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor is caused to execute the method as described above.

[0034] The fourth aspect of the present application provides a computer-readable storage medium, on which executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0035] The technical solution provided by the present application may include the following beneficial effects:

[0036] For the technical solution of this application, first group the lane line contour points, and then smooth the grouped lane lines to generate lane lines. Among them, in the process of grouping the lane line contour points, the contour of the lane line in a single-frame image obtained is split into multiple convex polygons, and the convex polygons are fitted into rectangles. Intra-frame grouping and inter-frame merging are performed on each of the fitted rectangles to obtain the grouped lane line rectangles. By means of rectangles for grouping and merging the lane lines, the processing efficiency of the lane lines can be improved, making the grouping efficiency higher, and the grouping error can also be reduced. In the process of smoothing the grouped lane lines, first perform sorting verification on the grouped lane line rectangles to obtain multiple groups of lane line rectangle center points, and then smooth the center points of each group of lane line rectangles to obtain a group of smoothed points corresponding to the corresponding lane lines. A group of lane line rectangle center points are obtained from the grouped lane line rectangle combination, and then the center points of this group of lane line rectangles are smoothed. The processing method is simple, and the connection of the smoothed points (which can be regarded as the lane line) also has a smaller error from the actually calculated lane line compared to the lane line error obtained by directly performing curve fitting on the lane line contour points, that is, the generated lane line has higher accuracy.

[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this application. Brief Description of the Drawings

[0038] By describing the exemplary embodiments of this application in more detail in combination with the drawings, the above and other objects, features, and advantages of this application will become more obvious. Among them, in the exemplary embodiments of this application, the same reference numerals generally represent the same components.

[0039] Figure 1 is a schematic flowchart of the method for generating lane lines shown in the embodiments of this application;

[0040] Figure 2 is a schematic structural diagram of the device for generating lane lines shown in the embodiments of this application;

[0041] Figure 3 is a schematic structural diagram of the electronic device shown in the embodiments of this application. Detailed Description of the Embodiments

[0042] The following will describe the embodiments of this application in more detail with reference to the drawings. Although the embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0043] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a", "the", and "said" used in this application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0044] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, "a plurality" means two or more unless otherwise specifically defined.

[0045] In the related art, after the contour points of the lane line are calculated, curve fitting is performed on the contour points of the lane line to generate a smooth lane line. However, the lane line after curve fitting needs to conform to a curve equation within a certain section, while the actual lane line may not conform to this curve equation. This phenomenon results in an accuracy deviation between the lane line after curve fitting and the actually calculated lane line, and the calculation amount is large. There may also be a situation where the optimal solution cannot be found after multiple iterations.

[0046] To address the above problems, an embodiment of this application provides a method for generating a lane line, which can process quickly and improve the accuracy of the lane line.

[0047] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0048] Figure 1 is a schematic flowchart of the method for generating a lane line shown in the embodiments of this application.

[0049] As Figure 1 shown, an embodiment of this application provides a method for generating a lane line, which mainly includes steps S101 to S104.

[0050] Step S101: After obtaining the contour points of the lane line in a single-frame image, split the contour of the lane line in this frame image into a plurality of convex polygons, and fit the convex polygons into a rectangle, where the long side direction of the rectangle is the same as the driving direction.

[0051] For cross or curved lane lines with irregular contours, splitting the cross or curved lane lines into multiple parts can make each part of the lane line clearer and more distinct, thereby avoiding the confusion and uncertainty caused by the cross or curved parts. Then, further splitting the concave polygon formed by the contour of the lane line in the frame image in step S101 into multiple convex polygons can be to split the concave polygon formed by the contour of the cross or curved lane line into multiple convex polygons, where each convex polygon represents a different part of the lane line. For actual lane lines, there will be concave parts in the lane line contour. That is, the contour of the lane line can be known from the lane line contour points in the same frame image obtained, and then the concave polygon formed by the contour of the lane line is split into multiple convex polygons, and each convex polygon can represent a different part of the lane line.

[0052] In this embodiment, since each convex polygon in step S101 can represent a different part of the lane line, fitting each convex polygon to obtain a rectangle corresponding to each convex polygon. The rectangle has a length and a width, has four vertices and one center point, and there is also a direction, which is roughly the same as the driving direction, and this direction is used as the long side direction of the rectangle. When each rectangle has a direction, an intuitive direction guidance can be provided for vehicle driving by means of the direction of the rectangle. Then, in autonomous driving, the vehicle can more easily adjust its driving direction according to the direction of the rectangle.

[0053] Step S102: Perform intra-frame grouping and inter-frame merging on the rectangles obtained by fitting to obtain the grouped lane line rectangles.

[0054] In step S102, performing intra-frame grouping on the rectangles obtained by fitting can further include determining whether the horizontal distance between two rectangles is below a set first distance threshold. If so, the two rectangles are in the same group; otherwise, the two rectangles are in separate groups. Considering that there is also inter-frame merging, in order to quickly identify the same group in different frames, in step S102, after intra-frame grouping, it can further include sorting the grouped rectangles.

[0055] In this embodiment, in step S102, it is determined whether the horizontal distance between two rectangles is below a set first distance threshold. The horizontal distance can be calculated from the projected distance between the centers of the two rectangles in the short side direction of the rectangle. The first distance threshold L1 is obtained based on the horizontal distance of the double-lane line and the horizontal distance between two adjacent lane lines in the multi-lane line. When the lane line is a double-lane line, when it is determined that the horizontal distance between two rectangles is below the first distance threshold L1, it can be determined that the lane lines corresponding to these two rectangles are double-lane lines; when it is determined that the horizontal distance between two rectangles exceeds the first distance threshold L1, it indicates that the horizontal distance is relatively large and belongs to different lane lines, and they cannot be processed in a group. For lane lines with three or more lanes, the horizontal distance between any two adjacent lane lines also satisfies that the horizontal distance between two rectangles is below the set first distance threshold, and thus multiple relevant rectangles can be divided into a group.

[0056] Considering that the present application ultimately groups the entire lane line rather than the lane line data in a single-frame image, in this embodiment, the sorting principle can be that assuming that several groups of lane lines in the same frame image are all in front of the vehicle, they are sorted from left to right. Among them, for two or more rectangles in the same group, they can also be further sorted from left to right on the basis of the current group according to the habit.

[0057] In step S102, the inter-frame merging of each fitted rectangle can further include comparing and merging the same groups of two consecutive frames according to the acquisition times of different frames using two nested loops.

[0058] In this embodiment, both the continuous first frame and the second frame include several groups. One group of data is taken out from all the lane line contour point data corresponding to the second frame, and all the groups in the second frame are traversed through the outer loop. For each group in the second frame, it is then compared with each group in the first frame through the inner loop. After the comparison, a merge operation is performed on the first frame and the second frame, that is, the data of the two groups to be merged are integrated.

[0059] For easy understanding, for example, if the first frame and the second frame are both two-dimensional arrays and each element can be regarded as a group, then each element in the second frame can be taken out in turn through two nested loops and compared with each element in the first frame, and if certain conditions are met, they are merged into a new element.

[0060] In at least one embodiment, performing inter-frame merging on each of the fitted rectangles may include, after determining that there is an overlapping region between the rectangle in the j-th group of the (i + 1)-th frame and the rectangle in the j-th group of the i-th frame, determining that the horizontal and vertical distances between the rectangle in the j-th group of the (i + 1)-th frame and the rectangle in the j-th group of the i-th frame satisfy a set condition; where i and j are both positive integers, the horizontal distance between the rectangle in the j-th group of the (i + 1)-th frame and the rectangle in the j-th group of the i-th frame is below a set second distance threshold, and the included angle in the long side direction is below a set angle threshold, and the vertical distance is below a set third distance threshold.

[0061] In this embodiment, the merging principle may be that two rectangles with an overlapping region can be merged into a group. Further, it is required that two rectangles with a relatively close horizontal distance and a relatively small included angle close to parallel can be merged into a group. Also, when the vertical distance between two rectangles is far beyond the third distance threshold, they cannot be merged into a group. Only after all the above requirements are met can the merging be carried out; otherwise, it cannot be merged. Suppose the rectangle A in the first group of the second frame is compared and merged with the rectangle B in the first group of the first frame. If there is an overlapping region between rectangle A and rectangle B, then continue to judge whether the horizontal distance between rectangle A and rectangle B is close and whether the included angle is small and close to parallel. On the premise that both are satisfied, then consider whether rectangle A and rectangle B are far apart in the vertical direction. Specifically, it can be quantified by the second distance threshold, the angle threshold, and the third distance threshold. The horizontal distance can be calculated by the projected distance of the centers of the two rectangles in the short side direction of the rectangle, or it can also be understood as the distance between the straight lines where the two rectangles are located. The vertical distance can be calculated by the projected distance of the centers of the two rectangles in the long side direction of the two rectangles.

[0062] Based on the above at least one embodiment, performing inter-frame merging on each of the fitted rectangles may further include: after obtaining the j-th merging group according to the matrix of the i-th frame, estimating the rectangle in the j-th group of the (i + 1)-th frame according to the curvature at the end of the j-th merging group, where i and j are both positive integers and i ≥ 2; and judging whether to merge the rectangle in the j-th group of the (i + 1)-th frame according to the estimated rectangle.

[0063] In this embodiment, suppose that after merging the first to fourth frames, 3 merging groups are obtained. Taking the first group among the three merging groups as an example, the curvature of the end curve of this merging group is within a certain range. It can be determined whether the new frame rectangle to be added to this merging group can be merged into this group. Specifically, the estimated rectangle of this merging group at the distance where the new frame rectangle is located is estimated according to the curvature of the end curve of this merging group, and then it can be judged whether the estimated rectangle and the new frame rectangle can be merged. This embodiment can be used as a limiting condition for further determining whether the new frame rectangle can be merged into the merging group, which can improve the quality of merging after grouping, and thus can make the final grouping effect of the lane lines better.

[0064] It should be noted that steps S101 and S102 mainly involve grouping the lane line contour points. Among them, by splitting the contour of the lane line corresponding to the lane line contour points in the same frame of image, multiple convex polygons are obtained, and then the convex polygons are fitted into rectangles. In this embodiment, splitting the lane line can clearly define each part of the lane line. Especially for intersecting or curved lane lines, it can improve the recognition and positioning accuracy of the lane line. Moreover, after splitting and fitting into rectangles, the long side direction of the rectangle is the same as the driving direction, which can also accurately determine the trend and boundary of the lane line. At the same time, using rectangles to fit the lane line contour can simplify the complex lane line shape into a rectangle with clear set features, which is also more convenient for storage and processing. Grouping all the fitted rectangles within a frame, first grouping the rectangles in the same frame. When the amount of data to be grouped is small, it is less likely to have grouping errors. Then, according to the time sequence of different frames, merging the same groups between frames to obtain the grouped lane line rectangles. By means of rectangles for grouping and merging of lane lines, the processing efficiency of lane lines can be improved, making the grouping efficiency higher, and it can also reduce grouping errors. Therefore, the embodiment of the present application can quickly and efficiently group lane lines, especially for intersecting and curved lane lines.

[0065] Step S103: Perform sorting verification on the grouped lane line rectangles to obtain multiple sets of lane line rectangle center points.

[0066] In some embodiments, step S103 may include:

[0067] After obtaining the grouped lane line rectangles, for the center points of each rectangle in a set of lane line rectangles, determine that the direction of the vector formed by any two adjacent rectangle center points is the same as the driving direction;

[0068] Filter the multiple rectangle center points, and use the filtered rectangle center points as the lane line rectangle center points of the corresponding group.

[0069] In this embodiment, perform sorting verification on a set of grouped lane line rectangles. The sorting principle is that the direction of the vector formed by two adjacent rectangle center points should be consistent with the vehicle's forward direction, and the longitudinal distance between two adjacent rectangle center points can be limited to about 1 meter. Assuming that the longitudinal distance is within 0.5 meters, it may be overly curved and can be removed.

[0070] Step S104: Smoothly process the center points of each group of lane line rectangles to obtain a set of smooth points corresponding to the corresponding lane line.

[0071] Further, step S104 may include: for a set of center points of lane line rectangles, multiple insertion points are set between two adjacent center points of lane line rectangles according to the curvature of the two adjacent center points of lane line rectangles; according to a set of multiple curvature thresholds and corresponding windows, the insertion points are dynamically adjusted, and the adjusted insertion points and the two center points of lane line rectangles are used as a set of smooth points.

[0072] Furthermore, dynamically adjusting the insertion points according to a set of multiple curvature thresholds and corresponding windows may include: calculating the average curvature of each insertion point according to the curvature range corresponding to two adjacent center points of lane line rectangles; determining the required window according to a set of multiple curvature thresholds and corresponding windows in combination with the average curvature of the insertion points; taking the average coordinates of all insertion points and the center points of lane line rectangles in its adjacent window as the adjusted coordinates of the insertion point according to the coordinates of the insertion point.

[0073] In this embodiment, for a set of center points of lane line rectangles, smoothing processing is performed. First, equidistant insertion points are inserted at a small fixed interval (such as 25 cm) between two adjacent center points of lane line rectangles. These insertion points are not linearly inserted straight points, and these insertion points need to meet the curvature requirements within the window where the two adjacent center points of lane line rectangles are located (a few more center points of lane line rectangles are taken before and after). Then, the average curvature within a certain window where each insertion point is located is calculated. Several curvature thresholds are set (each curvature threshold value corresponds to a window size respectively. The larger the curvature threshold, the smaller the corresponding window size, indicating a greater degree of bending, and vice versa. The specific values of the curvature thresholds can be determined according to the actual situation). According to these several curvature thresholds, the new position of each insertion point is adjusted. The specific adjustment method is to take the mean point of all insertion points and the center points of lane line rectangles within a certain window range adjacent to the insertion point, so that a set of dense smooth points can be obtained. Then, connecting a set of smooth points can obtain a center line of a lane line, and combining with the width of the rectangle, the lane line can be determined. It is well-known to those skilled in the art to determine the lane line from the center line of the lane line, and details will not be elaborated here.

[0074] For explanation, regarding several curvature thresholds, for example, there is a small curvature threshold C1, a medium curvature threshold C2 (C2 < C1), and a large curvature threshold C3 (C2 < C3). The corresponding window sizes are a larger window W1, a medium window W2, and a smaller window W3 respectively. If the average curvature of the insertion point is less than C1, then the window size W1 of the larger window is selected; if the average curvature is between C1 and C2, then the window size W2 is selected; if the average curvature is greater than C2, then the window size W3 is selected.

[0075] In the smoothing process, equidistant points are inserted to increase the density of the data, making subsequent processing more refined. By inserting points between the central points of adjacent two-lane line rectangles, the shape of the lane lines can be better simulated, improving the effect of the smoothing process. For example, the central points of two lane line rectangles that are far apart may not accurately reflect the curvature of the lane lines. After inserting equidistant points in combination with the curvature range, the changes of the lane lines between these two central points of the lane line rectangles can be described in more detail. Among them, these inserted points need to meet the curvature requirements within the window where the central points of two adjacent lane line rectangles are located, in order to ensure that the inserted points match the shape of the surrounding lane lines. The concept of the window is to consider the lane line features within a local range, so that the inserted points can better integrate into the overall shape of the lane lines. For example, if the lane lines within the window are curved, the inserted points should also have the corresponding degree of curvature to meet the curvature requirements of this area.

[0076] The embodiment of the present application considers the curvature change of the lane lines to dynamically adjust the window size of the inserted points, so as to complete the smoothing process of the central points of the lane line rectangles, making the processed lane lines more in line with the actual shape and smooth and natural.

[0077] Furthermore, a set of smoothed points obtained from step S104 is relatively dense. Dense points will result in a large amount of data, consuming a large amount of computing resources and time when performing various calculations and processes. Therefore, the method for generating lane lines may further include:

[0078] Step S105: After obtaining a set of smoothed points, thinning processing is performed on this set of smoothed points.

[0079] Among them, through thinning processing, the number of data points participating in the calculation can be reduced, thereby improving the calculation efficiency.

[0080] In some embodiments, in step S105, performing thinning processing on this set of smoothed points includes:

[0081] Determining the bending level of the current segment of the lane line according to the average curvature of multiple adjacent smoothed points within a preset window;

[0082] Retaining the corresponding number of smoothed points according to different bending levels.

[0083] In the embodiment of the present application, thinning processing is performed on the dense smooth points obtained in step S104. The thinning principle is to judge the degree of bending according to the curvature of adjacent three points (or more precisely, the average curvature within a preset window), and classify the degree of bending according to the curvature. At a certain degree of bending, one smooth point is retained at a certain interval. For example, one point is retained every 40 meters in the case close to a straight line, one point every 20 meters in the case of slight bending, and one point every 1 meter or half a meter in the case of special bending. In this way, the center points of the lane line rectangles that have been smoothed and thinned are obtained.

[0084] The method for generating lane lines provided by the embodiment of the present application, especially for complex lane lines with intersections or bends, has a simple, direct, fast, and efficient smoothing method. Moreover, the lane line center line formed by the thinned smooth points, combined with the method of splitting a concave polygon into multiple convex polygons and fitting the convex polygons into rectangles, has a relatively simple processing method, low computational complexity, and can also reduce the error from the actually calculated lane line center line.

[0085] Corresponding to the foregoing embodiment of the application function implementation method, the present application also provides a device for generating lane lines, an electronic device, and corresponding embodiments.

[0086] Figure 2 It is a schematic structural diagram of the device for generating lane lines shown in the embodiment of the present application.

[0087] See Figure 2 , the embodiment of the present application provides a device for generating lane lines, including:

[0088] A splitting and fitting module 201, which is configured to split the contour of the lane line in the frame image into multiple convex polygons and fit the convex polygons into rectangles after obtaining the contour points of the lane line in a single-frame image, wherein the long side direction of the rectangle is the same as the driving direction;

[0089] A grouping and merging module 202, which is configured to perform intra-frame grouping and inter-frame merging on each of the fitted rectangles to obtain grouped lane line rectangles;

[0090] A sorting and verification module 203, which is configured to perform sorting and verification on the grouped lane line rectangles to obtain multiple sets of lane line rectangle center points;

[0091] A smoothing processing module 204, which is configured to smooth each group of the lane line rectangle center points to obtain a set of smooth points corresponding to the corresponding lane line.

[0092] Preferably, it further includes a thinning module 205, and the thinning module 205 is configured to perform thinning processing on the set of smooth points after obtaining the set of smooth points.

[0093] Further, the thinning module 205 may be configured to determine the bending level of the current segment of the lane line according to the average curvature of a plurality of adjacent smoothing points within a preset window; and retain corresponding numbers of smoothing points according to different bending levels.

[0094] In the splitting and fitting module 201, the splitting of the contour of the lane line in the frame image into a plurality of convex polygons may include: splitting a concave polygon formed by the contour of an intersecting or curved lane line into a plurality of convex polygons, where each of the convex polygons represents a different part of the lane line.

[0095] Further, the sorting and verification module 203 may be configured to, after obtaining the grouped lane line rectangles, determine that the direction of a vector formed by any two adjacent rectangle center points in a group of the lane line rectangles is the same as the driving direction for each rectangle center point in the group of lane line rectangles; filter the plurality of rectangle center points, and use each of the filtered rectangle center points as the center point of the lane line rectangle corresponding to the group.

[0096] Further, the smoothing processing module 204 may be configured to, for a group of the lane line rectangle center points, set a plurality of insertion points between two adjacent lane line rectangle center points according to the curvature between the two adjacent lane line rectangle center points; dynamically adjust the insertion points according to a plurality of set curvature thresholds and corresponding windows, and use the adjusted insertion points and the two lane line rectangle center points as a group of smoothing points.

[0097] In the smoothing processing module 204, the dynamically adjusting the insertion points according to a plurality of set curvature thresholds and corresponding windows includes: calculating the average curvature of each of the insertion points according to the curvature range corresponding to two adjacent lane line rectangle center points; determining a required window according to the plurality of set curvature thresholds and corresponding windows in combination with the average curvature of the insertion points; and taking the average coordinates of all the insertion points and the lane line rectangle center points in its adjacent window as the adjusted coordinates of the insertion point according to the coordinates of the insertion point.

[0098] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0099] Figure 3 It is a schematic structural diagram of an electronic device shown in an embodiment of the present application.

[0100] See Figure 3 , the electronic device 300 includes a memory 301 and a processor 302.

[0101] The processor 302 can be a Central Processing Unit (CPU), or can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0102] The memory 301 can include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM can store static data or instructions required by the processor 302 or other modules of the computer. The permanent storage device can be a read-write storage device. The permanent storage device can be a non-volatile storage device that does not lose the stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In some other embodiments, the permanent storage device can be a removable storage device (such as a floppy disk, optical drive). The system memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. The system memory can store some or all of the instructions and data required by the processor during operation. In addition, the memory 301 can include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks can also be used. In some embodiments, the memory 301 can include a removable storage device that is readable and / or writable, such as a compact disc (CD), read-only digital versatile disc (such as DVD-ROM, dual-layer DVD-ROM), read-only Blu-ray disc, super density disc, flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and instantaneous electronic signals transmitted wirelessly or wired.

[0103] An executable code is stored on the memory 301, and when the executable code is processed by the processor 302, it can cause the processor 302 to execute some or all of the methods described above.

[0104] In addition, the method according to the present application can also be implemented as a computer program or a computer program product, which includes computer program code instructions for performing some or all of the steps in the above-mentioned method of the present application.

[0105] Alternatively, the present application can also be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium), on which executable code (or a computer program or computer instruction code) is stored. When the executable code (or the computer program or computer instruction code) is executed by a processor of an electronic device (or a server, etc.), the processor is caused to execute some or all of the steps of the above-mentioned method according to the present application.

[0106] The embodiments of the present application have been described above. The above description is exemplary and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application or the improvement of the technology in the market, or to enable other ordinary skill in the art in the technical field to understand the embodiments disclosed herein.

Claims

1. A method for generating lane lines, characterized in that: include: After obtaining the lane line contour points of a single frame image, split the concave polygon formed by the contour of the crossed or curved lane line into multiple convex polygons, and fit the convex polygons into rectangles, wherein each of the convex polygons represents a different part of the lane line, and the long side direction of the rectangle is the same as the driving direction; Performing intra-frame grouping and inter-frame merging on the fitted rectangles to obtain grouped lane line rectangles; Sorting and checking the grouped lane line rectangles to obtain the center points of multiple groups of lane line rectangles; Smoothing each group of lane line rectangle center points to obtain a group of smooth points corresponding to the corresponding lane line; After obtaining a group of the smooth points, the curvature level of the current segment of the lane line is determined according to the average curvature of a plurality of adjacent smooth points within a preset window, and a corresponding number of smooth points are retained according to different curvature levels.

2. The method for generating lane lines according to claim 1, characterized in that: The step of sorting and checking the grouped lane line rectangles to obtain a plurality of groups of lane line rectangle center points includes: After obtaining the grouped lane line rectangles, for each rectangle center point in a group of lane line rectangles, determine that the direction of a vector formed by any two adjacent rectangle center points is the same as the driving direction; The plurality of rectangular center points are filtered, and each of the filtered rectangular center points is used as a lane line rectangular center point of a corresponding group.

3. The method for generating lane lines according to claim 1, characterized in that: The smoothing process of each group of lane line rectangular center points to obtain a group of smooth points corresponding to the lane line includes: For a set of lane line rectangular center points, a plurality of insertion points are set between two adjacent lane line rectangular center points according to the curvature of two adjacent lane line rectangular center points; The insertion point is dynamically adjusted according to the set multiple curvature thresholds and the corresponding windows, and the adjusted insertion point and the two lane line rectangle center points are used as a group of smooth points.

4. The method for generating lane lines according to claim 3, characterized in that: The dynamically adjusting the insertion point according to the set multiple curvature thresholds and the corresponding windows includes: Calculating the average curvature of each insertion point according to the curvature range corresponding to the center points of two adjacent lane line rectangles; Determine the required window according to the set multiple curvature thresholds and corresponding windows and the average curvature of the insertion point; According to the coordinates of the insertion point, the average coordinates of all the insertion points in the adjacent windows and the center point of the lane line rectangle are taken as the adjusted coordinates of the insertion point.

5. A device for generating lane lines, characterized in that: include: A splitting and fitting module is configured to, after acquiring the lane line contour points of a single frame image, split the concave polygon formed by the contour of the crossing or curved lane line into a plurality of convex polygons, and fit the convex polygons into rectangles, wherein each of the convex polygons represents a different portion of the lane line, and the long side direction of the rectangle is the same as the driving direction; A grouping and merging module is configured to perform intra-frame grouping and inter-frame merging on the fitted rectangles to obtain grouped lane line rectangles; A sorting and verification module is configured to perform sorting and verification on the grouped lane line rectangles to obtain a plurality of groups of lane line rectangle center points; A smoothing processing module, configured to smooth each group of lane line rectangular center points to obtain a group of smooth points corresponding to the lane line; The thinning module is configured to determine the curvature level of the current segment of the lane line according to the average curvature of a plurality of adjacent smooth points within a preset window after obtaining a group of the smooth points; and retain a corresponding number of smooth points according to different curvature levels.

6. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method as claimed in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: An executable code is stored thereon, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as claimed in any one of claims 1 to 4.