Lane Line Fitting Method, Device and Computer Readable Storage Medium
By dividing the lane line feature point sequence into subcurves and smoothing it multiple times, the problem of fitting complex lane lines in the prior art is solved, and accurate fit and comfortable driving effects are achieved.
Patent Information
- Application Number
- CN202210616214.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-06-01
AI Technical Summary
The prior art is difficult to accurately fit multi-map and closed lane lines, especially smooth curves with complex shapes, resulting in insufficient accuracy and comfort of driverless electronic maps.
The lane line feature point sequence is divided into several segments, fitted into sub-curves respectively, and then connected and smoothed multiple times, including the initial and re-smoothing to form the final lane line.
Accurate fitting of multi-map and closed curves is achieved, improving riding comfort during unmanned driving and the accuracy of electronic maps.
Smart Images

Figure CN114882145B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving, and in particular, to a lane line fitting method, device, and computer-readable storage medium. Background Art
[0002] With the development of technology, the reduction of costs, and the implementation of relevant regulations and policies, driverless driving has gradually entered the practical stage, and driverless vehicles are becoming increasingly popular in people's travel activities. The driving of driverless vehicles requires cooperation with high-precision electronic maps. In the production process of electronic maps, generally, lane videos are first collected through visual devices such as on-vehicle cameras, and then the actual coordinate position information is calculated by combining the position information of the vehicle to which the on-vehicle camera belongs and the lane pixel information in the lane video. Finally, the lane lines are fitted based on the calculated actual position information. It can be seen that in the production process of electronic maps, the fitting of lane lines is the last link. The related technologies mainly fit lane lines based on polynomials or based on Bezier curves with control points. However, based on polynomials, only single-mapping curves can be fitted, and multi-mapping and closed curves such as circles cannot be fitted. And for the Bezier curve fitting method based on control points, since it is difficult to find appropriate control points, the success rate of this method is questionable. Summary of the Invention
[0003] To solve or partially solve the problems existing in the related technologies, this application provides a lane line fitting method, device, and computer-readable storage medium, which can more accurately fit smooth curves of various shapes, especially those with complex shapes.
[0004] The first aspect of this application provides a lane line fitting method, including:
[0005] Dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted;
[0006] Fitting the points to be fitted in each segment of points to be fitted in the several segments of points to be fitted into a sub-curve respectively to obtain several corresponding sub-curves;
[0007] Connecting the several sub-curves to obtain an initial overall curve;
[0008] Performing primary smoothing on the initial overall curve to obtain a smoothed initial target lane line;
[0009] Performing secondary smoothing on the smoothed initial target lane line to obtain the final lane line.
[0010] The second aspect of this application provides a lane line fitting device, including:
[0011] A segmentation module, configured to divide a sequence of lane line feature points to be fitted into several segments according to a preset rule, so as to obtain several segments of points to be fitted;
[0012] A fitting module, configured to fit the points to be fitted in each segment of points to be fitted among the several segments of points to be fitted into a sub-curve respectively, so as to obtain several corresponding sub-curves;
[0013] A connection module, configured to connect the several sub-curves to obtain an initial overall curve;
[0014] A first smoothing module, configured to perform primary smoothing on the initial overall curve to obtain a smoothed initial target lane line;
[0015] A second smoothing module, configured to perform secondary smoothing on the smoothed initial target lane line to obtain a final lane line.
[0016] A third aspect of the present application provides an electronic device, including:
[0017] A processor; and
[0018] A memory, storing executable code thereon, which when executed by the processor, causes the processor to execute the method as described above.
[0019] A fourth aspect of the present application provides a computer-readable storage medium, storing executable code thereon, which when executed by a processor of an electronic device, causes the processor to execute the method as described above.
[0020] The technical solution provided by the present application may include the following beneficial effects: For a sequence of lane line feature points to be fitted, it is first divided into several segments of points to be fitted, and after these segments of points to be fitted are respectively fitted into sub-curves, they are connected and smoothed in sequence. Different from the related technology that performs overall fitting on all the lane line feature points to be fitted, since the technical solution of the present application divides the sequence of lane line feature points to be fitted into several segments of points to be fitted and then performs fitting, which is equivalent to first dividing the complex sequence of lane line feature points into simple segments of points to be fitted for local fitting and then overall smoothing, thereby enabling accurate fitting of multi-mapped and closed curves or complex curves. And the initial overall curve obtained after fitting is smoothed multiple times, so that the finally obtained lane line is relatively smooth, which can improve the comfort of riding during autonomous driving.
[0021] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Description of the Drawings
[0022] The above and other objects, features, and advantages of the present application will become more apparent by describing the exemplary embodiments of the present application in more detail with reference to the accompanying drawings, wherein, in the exemplary embodiments of the present application, the same reference numerals generally represent the same components.
[0023] Figure 1 is a schematic flowchart of the lane line fitting method shown in an embodiment of the present application;
[0024] Figure 2 is a schematic structural diagram of the lane line fitting device shown in an embodiment of the present application;
[0025] Figure 3 is a schematic structural diagram of the electronic device shown in an embodiment of the present application. Detailed Embodiments
[0026] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0027] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0028] It should be understood that although the terms "first", "second", "third", etc. may be used in the present 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 the present 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 the present application, "a plurality" means two or more unless otherwise specifically defined.
[0029] With the development of technology, the reduction of costs, and the implementation of relevant regulations and policies, driverless technology has gradually entered the practical stage, and driverless vehicles are becoming increasingly popular in people's travel activities. The driving of driverless vehicles requires the cooperation of high-precision electronic maps. In the production process of electronic maps, generally, lane videos are first collected through visual devices such as in-vehicle cameras, and then the actual coordinate position information is calculated by combining the position information of the vehicle to which the in-vehicle camera belongs and the lane pixel information in the lane video. Finally, the lane lines are fitted based on the calculated actual position information. It can be seen that in the production process of electronic maps, the fitting of lane lines is the last link. The related technologies mainly fit lane lines based on polynomials or based on Bezier curves with control points. However, based on polynomials, only curves in a single mapping form can be fitted, and multi-mapping and closed curves such as circles cannot be fitted. And for the Bezier curve fitting method based on control points, since it is difficult to find suitable control points, the success rate of this method is in doubt.
[0030] In view of the above problems, an embodiment of the present application provides a lane line fitting method, which can accurately fit smooth curves of various shapes.
[0031] The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0032] See Figure 1 , which is a schematic flowchart of the lane line fitting method shown in the embodiment of the present application, mainly includes steps S101 to S105, which are described as follows:
[0033] Step S101: Divide the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted.
[0034] In the embodiments of the present application, the sequence of lane line feature points to be fitted is a series of feature points extracted through an image processing algorithm after a sampling vehicle responsible for sampling the lane line detects and photographs the target lane line through devices such as an induction radar and a camera carried thereon. Since the lane line forms vary in the actual scenario, for example, some roundabouts on the road may have circular lane lines. Different from some curves in a single mapping form, such circular lane lines belong to multi-mapping and closed curves geometrically. If the target curve belongs to the above multi-mapping and closed curve or other more complex curves, according to related technologies, such as polynomial fitting, it is actually impossible to directly fit the sequence of lane line feature points to be fitted into a multi-mapping and closed curve or other more complex curves. Therefore, the technical solution of the present application is to first divide the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted. As a basic principle, when dividing the sequence of lane line feature points to be fitted into several segments, it is mainly considered whether each finally obtained segment of points to be fitted can be fitted into a curve in a single mapping. Therefore, when dividing the sequence of lane line feature points to be fitted into several segments, if some of the finally obtained segments of points to be fitted still cannot be fitted into a curve in a single mapping, these individual segments of points to be fitted should be further divided.
[0035] Since the running trajectory of the sampling vehicle is mostly fitted to the target lane line, that is, the lane line to be finally fitted, when collecting the lane line feature points, this fitting is manifested as similarity in geometric attributes such as length and curvature. Therefore, in an embodiment of the present application, dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted can be: dividing the reference line into several single-mapping sub-curve segments; using the several single-mapping sub-curve segments as a reference, dividing the sequence of lane line feature points to be fitted into several segments of points to be fitted with geometric attributes corresponding to and similar to each single-mapping sub-curve segment among the several single-mapping sub-curve segments, where the reference line is the curve corresponding to the running trajectory of the vehicle when collecting the lane line feature points, and the vehicle collecting the lane line feature points here is the sampling vehicle mentioned in the foregoing embodiments. When dividing the reference line into several single-mapping sub-curve segments, using the several single-mapping sub-curve segments as a reference can divide the sequence of lane line feature points to be fitted into several segments of points to be fitted with geometric attributes corresponding to and similar to each single-mapping sub-curve segment among the several single-mapping sub-curve segments. It should be noted that the segment of points to be fitted in the embodiments of the present application is a sequence composed of points to be fitted, and the points to be fitted are the lane line feature points to be fitted.
[0036] To prevent significantly non - compliant lane line feature points, i.e., abnormal points, from participating in subsequent curve fitting and reduce unnecessary consumption of computing resources, in the above - mentioned embodiments, after obtaining a number of point segments to be fitted, a line segment Li can be formed by connecting the first point to be fitted and the last point to be fitted of any one of the point segments to be fitted Di among the number of point segments to be fitted; calculate the distance from each other point to be fitted in the point segment to be fitted Di to the line segment Li; if the distance is greater than the first preset distance threshold, delete the points to be fitted whose distance to the line segment Li is greater than the first preset distance threshold; if the distance is not greater than the first preset distance threshold, retain the points to be fitted whose distance to the line segment Li is not greater than the first preset distance threshold. In the above - mentioned embodiments, as long as an appropriate first preset distance threshold is set, when it is calculated that the distance from a certain point to be fitted to the line segment Li is greater than the first preset distance threshold, it indicates that the certain point to be fitted is a significantly non - compliant lane line feature point, i.e., an abnormal point, so the certain point to be fitted should be deleted. On the contrary, if it is calculated that the distance from a certain point to be fitted to the line segment Li is not greater than the first preset distance threshold, it indicates that the certain point to be fitted meets the requirements and should be retained.
[0037] As another embodiment of the present application, dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several point segments to be fitted can also be achieved through steps S1011 to S1015, which are described as follows:
[0038] Step S1011: Connect the first point to be fitted and the last point to be fitted of the sequence of lane line feature points to be fitted to form a line segment L.
[0039] Here, the first point to be fitted and the last point to be fitted should be two points to be fitted in the sequence of lane line feature points to be fitted that can make the line segment L the longest when connected.
[0040] Step S1012: Calculate the distance from each other point to be fitted to the line segment L and determine the maximum distance among them, where the other points to be fitted are the points to be fitted in the sequence of lane line feature points to be fitted except the first point to be fitted and the last point to be fitted.
[0041] Step S1013: If the maximum distance is less than the second preset distance threshold, delete the points to be fitted in the sequence of lane line feature points to be fitted corresponding to the maximum distance less than the second preset distance threshold to the line segment L, and use the points to be fitted included in the line segment L as the point segments to be fitted obtained after dividing the sequence of lane line feature points to be fitted.
[0042] If the maximum distance from the other points to be fitted to the line segment L is less than the second preset distance threshold, it indicates that the segmentation is reasonable, and the points to be fitted included in the line segment L can be used as the point segments to be fitted obtained after dividing the sequence of lane line feature points to be fitted.
[0043] Step S1014: If the maximum distance is not less than the second preset distance threshold, retain the to-be-fitted points corresponding to the maximum distance not less than the second preset distance threshold to the line segment L, and take the to-be-fitted points corresponding to the maximum distance not less than the second preset distance threshold to the line segment L as the demarcation points, and divide the sequence of to-be-fitted lane line feature points into two target to-be-fitted point segments.
[0044] If the maximum distance from other to-be-fitted points to the line segment L is not less than the second preset distance threshold, it indicates that the segmentation span is relatively large and not very reasonable, which is likely to result in the inability to fit a multi-mapped and closed curve or a complex curve. Therefore, it is necessary to take the to-be-fitted points corresponding to the maximum distance not less than the second preset distance threshold to the line segment L as the demarcation points, and divide the sequence of to-be-fitted lane line feature points into two target to-be-fitted point segments.
[0045] Step S1015: For each of the two target to-be-fitted point segments, repeat the segmentation in the manner of the above steps S1011 to S1014 until a number of to-be-fitted point segments are obtained.
[0046] For each of the two target to-be-fitted point segments, repeat the segmentation in the manner of the above steps S1011 to S1014 until a number of to-be-fitted point segments are obtained. In other words, for each of the two target to-be-fitted point segments, first perform the operations of steps S1011 and S1012 of the above embodiment, and then through the judgment of step S1013, examine whether the re-segmentation of each of the two target to-be-fitted point segments is reasonable. If it is reasonable, there is no need for re-segmentation. Otherwise, perform the operations of steps S1014 and S1015.
[0047] Step S102: Fit the to-be-fitted points of each to-be-fitted point segment among the number of to-be-fitted point segments into a sub-curve respectively, and obtain the corresponding number of sub-curves.
[0048] For the to-be-fitted point segments divided by step S101, since the target curves fitted by these to-be-fitted point segments are all single-mapped curves or simple curves, in principle, any existing fitting algorithm (for example, polynomial fitting) can be used to fit the to-be-fitted points of each to-be-fitted point segment among the number of to-be-fitted point segments respectively. To further improve the smoothness of the curve obtained after fitting, as an embodiment of the present application, fitting the to-be-fitted points of each to-be-fitted point segment among the number of to-be-fitted point segments into a sub-curve respectively, and obtaining the corresponding number of sub-curves can be achieved through steps S1021 to S1024, and the details are as follows:
[0049] Step S1021: For any one of a plurality of point segments to be fitted, select the points to be fitted that meet the preset spacing from the any one of the point segments to be fitted, so as to obtain the target point segment to be fitted.
[0050] In the embodiment of the present application, the preset spacing can be set according to actual needs, or set after weighing between calculation accuracy and calculation resource consumption, that is, while maintaining the calculation accuracy, minimizing the consumption of calculation resources as much as possible, or maintaining the calculation accuracy on the premise of consuming as little calculation resources as possible.
[0051] Step S1022: Select key fitting points from the target point segment to be fitted, and linearly interpolate and fit to obtain an initial sub-curve segment.
[0052] For a curve with different curvatures, the points entering the curve and the points leaving the curve have certain particularities. Therefore, in the embodiment of the present application, the points entering the curve and the points leaving the curve in the target point segment to be fitted can be selected as key fitting points, and a control point is determined at a preset distance from two adjacent key fitting points. Through this control point, the points to be fitted in the target point segment to be fitted are linearly interpolated and fitted to obtain an initial sub-curve segment.
[0053] Step S1023: By calculating the curvature change rate of the initial sub-curve segment corresponding to all target points to be fitted, determine the sudden change fitting points among all the points to be fitted corresponding to the initial sub-curve segment, where the sudden change fitting points are the points to be fitted on the target point segment to be fitted whose curvature change rates do not exceed the preset curvature change rate range respectively.
[0054] The reason for setting a sudden change fitting point is that considering that the lane line is a kind of curve, the continuity of its curvature needs to meet certain requirements. A lane line with too poor curvature continuity will bring poor comfort to the occupants in the driverless vehicle. Therefore, the sudden change fitting points among all the points to be fitted corresponding to the initial sub-curve segment can be determined by calculating the curvature change rate of the initial sub-curve segment corresponding to all target points to be fitted. Among them, the curvature change rate of the target point to be fitted can be defined as the derivative of the curvature of the target point to be fitted, and the curvature of the target point to be fitted can be calculated by any method. As for determining the sudden change fitting points among all the points to be fitted corresponding to the initial sub-curve segment by calculating the curvature change rate of the initial sub-curve segment corresponding to all target points to be fitted, in an embodiment of the present application, specifically, it can be: perform gradient descent processing on the initial sub-curve segment corresponding to all target points to be fitted to obtain each target point to be fitted; calculate the curvature change rate of each target point to be fitted on the initial sub-curve; and select the sudden change fitting points from each target point to be fitted based on the curvature change rate of each target point to be fitted.
[0055] Step S1024: Use a polynomial to fit the abrupt change fitting points within the interval formed by the abrupt change fitting points to obtain a sub-curve.
[0056] Step S103: Connect several sub-curves to obtain an initial overall curve.
[0057] It can be understood that fitting the fitting points of each segment to be fitted to obtain the corresponding sub-curve is not the ultimate goal. The ultimate goal is to connect these sub-curves into a single curve. When connecting the sub-curves obtained through Steps S101 to S102, some special situations need to be considered. For example, when the sub-curves obtained after fitting are connected together, there may be intersections, or there may be a large gap between two sub-curves, resulting in the initial overall curve after connection being discontinuous, etc. These intersections or discontinuities should be processed in advance. Otherwise, it may bring a large amount of work and poor smoothness to the final curve smoothing. In view of the above situations, in the embodiments of the present application, connecting several sub-curves to obtain an initial overall curve may specifically be: if several sub-curves intersect and extend from the intersection point, then cut off the part extending from the intersection point; if there is a gap exceeding a preset threshold after connecting several sub-curves, then fill the gap and smooth it through linear interpolation.
[0058] Step S104: Perform primary smoothing on the initial overall curve to obtain a smoothed initial target lane line.
[0059] Considering that different smoothing algorithms have requirements for parameters such as the curvature of the target curve, or for different curvatures, using the corresponding smoothing algorithm can maximize its advantages. Therefore, for the initial overall curve obtained through Step S103, different smoothing methods can be adopted for different curvatures of the points thereon. Specifically, the curvature of each point on the initial overall curve can be calculated first; the B-spline smoothing method is used to smooth the neighborhood of the points on the initial overall curve whose curvature does not exceed the preset curvature threshold to obtain a smoothed initial target lane line. For the neighborhood of the points on the initial overall curve whose curvature exceeds the preset curvature threshold, a linear interpolation algorithm can be used to smooth the curve. Further, in the above embodiments, using the B-spline smoothing method to smooth the neighborhood of the points on the initial overall curve whose curvature does not exceed the preset curvature threshold to obtain a smoothed initial target lane line may be: according to the sampling frequency corresponding to the original fitting points on the initial overall curve, select the control points corresponding to the Nth B-spline curve for smoothing the initial overall curve in the initial overall curve; generate the Nth B-spline curve according to the control points, where N is an integer not greater than 3; perform equally spaced sampling on the Nth B-spline curve; and determine the equally spaced sampled Nth B-spline curve as the smoothed initial target lane line.
[0060] Step S105: Smooth the initially smoothed target lane line again to obtain the final lane line.
[0061] In order to further improve the smoothness of the curve, in the embodiment of the present application, the initially smoothed target lane line obtained through the above step S104 can be smoothed again. Specifically, the curvature of each point on the initially smoothed target lane line can be calculated. For some points on the initially smoothed target lane line with a curvature less than a preset threshold, a multiple (e.g., three times) linear interpolation method can be used for smoothing. When using the multiple linear interpolation method for smoothing, the interpolation distance can be fine-tuned each time to maintain the smoothing accuracy.
[0062] From the above Figure 1 Example lane line fitting method, for the sequence of lane line feature points to be fitted, first divide it into several segments to be fitted, and then fit these segments to be fitted into sub-curves and connect and smooth them in sequence. Different from the related art that fits the entire sequence of lane line feature points to be fitted as a whole, since the technical solution of the present application divides the sequence of lane line feature points to be fitted into several segments to be fitted and then fits them, it is equivalent to first dividing the complex sequence of lane line feature points into simple segments to be fitted for local fitting and then global smoothing, so as to achieve accurate fitting of multi-mapping and closed curves or complex curves. And the initially obtained overall curve after fitting is smoothed multiple times, so that the finally obtained lane line is relatively smooth, which can improve the comfort of riding during autonomous driving.
[0063] Corresponding to the foregoing application function implementation method embodiment, the present application also provides a lane line fitting device, an electronic device, and corresponding embodiments.
[0064] See Figure 2 , which is a schematic structural diagram of the lane line fitting device shown in the embodiment of the present application. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown. Figure 2 The exemplary lane line fitting device mainly includes a segmentation module 201, a fitting module 202, a connection module 203, a first smoothing module 204, and a second smoothing module 205, where:
[0065] The segmentation module 201 is configured to divide the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments to be fitted;
[0066] The fitting module 202 is configured to fit the points to be fitted of each segment to be fitted in the several segments to be fitted into a sub-curve respectively to obtain corresponding sub-curves;
[0067] The connection module 203 is configured to connect the several sub-curves to obtain an initial overall curve;
[0068] The first smoothing module 204 is configured to perform primary smoothing on the initial overall curve to obtain the smoothed initial target lane line;
[0069] The second smoothing module 205 is configured to perform secondary smoothing on the smoothed initial target lane line to obtain the final lane line.
[0070] 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.
[0071] From the above Figure 2 It can be seen from the lane line fitting device in the example that for the sequence of lane line feature points to be fitted, it is first divided into several segments of points to be fitted. After fitting these segments of points to be fitted into sub-curves respectively, they are connected and smoothed in sequence. Different from the related art where the entire sequence of lane line feature points to be fitted is fitted as a whole, since the technical solution of this application divides the sequence of lane line feature points to be fitted into several segments of points to be fitted and then fits them, which is equivalent to first dividing the complex sequence of lane line feature points into simple segments of points to be fitted for local fitting and then global smoothing. Thus, it can achieve accurate fitting of multi-mapped and closed curves or complex curves. And the initial overall curve obtained after fitting is smoothed multiple times, so that the finally obtained lane line is relatively smooth, which can improve the comfort of riding during autonomous driving.
[0072] Figure 3 It is a schematic structural diagram of an electronic device shown in an embodiment of this application.
[0073] Referring to Figure 3 , the electronic device 300 includes a memory 310 and a processor 320.
[0074] The processor 320 may be a central processing unit (CPU), or may 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 may be a microprocessor or the processor may also be any conventional processor, etc.
[0075] The memory 310 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM may store static data or instructions required by the processor 320 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may 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 may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all of the instructions and data required by the processor during operation. In addition, the memory 310 may 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 may also be used. In some embodiments, the memory 310 may 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. Computer-readable storage media do not include carrier waves and instantaneous electronic signals transmitted wirelessly or by wire.
[0076] Executable code is stored on the memory 310, and when the executable code is processed by the processor 320, it may cause the processor 320 to execute some or all of the methods described above.
[0077] In addition, the method according to the present application may also be implemented as a computer program or computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0078] Alternatively, the present application may also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium), on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), it causes the processor to execute some or all of the steps of the above method according to the present application.
[0079] The embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of 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 to understand the embodiments disclosed herein.
Claims
1. A lane line fitting method, characterized in that, The method includes: Dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted; For any one of the several segments of points to be fitted, selecting the points to be fitted that meet the preset spacing from the any one segment of points to be fitted to obtain a target segment of points to be fitted; selecting the points entering the curve and the points leaving the curve from the target segment of points to be fitted as key fitting points, and determining a control point with two adjacent key fitting points separated by a preset distance, and linearly interpolating and fitting through the control point to obtain an initial sub-curve segment; calculating the curvature change rate of the initial sub-curve segment corresponding to all target points to be fitted to determine the sudden change fitting points among all points to be fitted corresponding to the initial sub-curve segment, where the sudden change fitting points are the points to be fitted on the target segment of points to be fitted whose curvature change rates do not exceed the preset curvature change rate range respectively; fitting the sudden change fitting points with a polynomial in the interval formed by the sudden change fitting points to obtain a sub-curve; Connecting the several sub-curves to obtain an initial overall curve; Performing primary smoothing on the initial overall curve to obtain a smoothed initial target lane line; Performing secondary smoothing on the smoothed initial target lane line to obtain the final lane line; The step of dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted includes: dividing the reference line into several single-mapped sub-curve segments, where the reference line is the curve corresponding to the running trajectory of the vehicle when collecting the lane line feature points; using the several single-mapped sub-curve segments as a reference to divide the multi-mapped sequence of lane line feature points to be fitted into several single-mapped segments of points to be fitted.
2. The lane line fitting method according to claim 1, wherein The method further includes: Connecting the starting point to be fitted and the ending point to be fitted of any one segment of points to be fitted Di among the several segments of points to be fitted to form a line segment Li; Calculating the distance from each other point to be fitted in the segment of points to be fitted Di to the line segment Li; If the distance is greater than the first preset distance threshold, deleting the points to be fitted whose distances to the line segment Li are greater than the first preset distance threshold; If the distance is not greater than the first preset distance threshold, retaining the points to be fitted whose distances to the line segment Li are not greater than the first preset distance threshold.
3. The lane line fitting method according to claim 1, wherein The step of dividing the sequence of lane line feature points to be fitted into several segments according to a preset rule to obtain several segments of points to be fitted includes: S1: Connecting the starting point to be fitted and the ending point to be fitted of the sequence of lane line feature points to be fitted to form a line segment L; S2: Calculating the distance from each other point to be fitted to the line segment L and determining the maximum distance among them, where the other points to be fitted are the points to be fitted in the sequence of lane line feature points to be fitted except the starting point to be fitted and the ending point to be fitted; S3: If the maximum distance is less than the second preset distance threshold, deleting the points to be fitted corresponding to the maximum distance less than the second preset distance threshold to the line segment L, and using the points to be fitted included in the line segment L as the segments of points to be fitted obtained after dividing the sequence of lane line feature points to be fitted; S4: If the maximum distance is not less than the second preset distance threshold, retain the to-be-fitted points corresponding to the maximum distance not less than the second preset distance threshold to the line segment L, and use the to-be-fitted points corresponding to the maximum distance not less than the second preset distance threshold to the line segment L as the demarcation points to divide the to-be-fitted lane line feature point sequence into two target to-be-fitted point segments; S5: For each of the two target to-be-fitted point segments above, perform segmentation in the manner of S1 to S4 above until the several to-be-fitted point segments are obtained.
4. The lane line fitting method according to claim 1, wherein The determination of the sudden change fitting points corresponding to all the to-be-fitted points of the initial sub-curve by calculating the curvature change rate of the initial sub-curve corresponding to all the target to-be-fitted points includes: Perform gradient descent processing on the initial sub-curve segment corresponding to all the target to-be-fitted points to obtain each target to-be-fitted point; Calculate the curvature change rate of each of the target to-be-fitted points on the initial sub-curve; Based on the curvature change rate of each of the target to-be-fitted points, select the sudden change fitting points from each of the target to-be-fitted points.
5. The lane line fitting method according to claim 1, wherein The initial smoothing of the initial overall curve to obtain the smoothed initial target lane line includes: Calculate the curvature of each point on the initial overall curve; Use the B-spline smoothing method to smooth the neighborhood of the points on the initial overall curve whose curvature does not exceed the preset curvature threshold to obtain the smoothed initial target lane line.
6. The lane line fitting method according to claim 5, characterized in that The use of the B-spline smoothing method to smooth the neighborhood of the points on the initial overall curve whose curvature does not exceed the preset curvature threshold to obtain the smoothed initial target lane line includes: According to the sampling frequency corresponding to each original to-be-fitted point on the initial overall curve, select the control points corresponding to the Nth B-spline curve for smoothing the initial overall curve in the initial overall curve; Generate the Nth B-spline curve according to the control points, where N is an integer not greater than 3; Perform equally spaced sampling on the Nth B-spline curve; Determine the Nth B-spline curve after equally spaced sampling as the smoothed initial target lane line.
7. The lane line fitting method according to claim 1, wherein The connection of the several sub-curves to obtain the initial overall curve includes: If the several sub-curves intersect and extend after connection, cut the extended part; If there is a gap exceeding the preset threshold after the connection of the several sub-curves, fill the gap and perform smoothing by linear interpolation.
8. A lane line fitting device, characterized in that, The device includes: A segmentation module, configured to divide the to-be-fitted lane line feature point sequence into several segments according to a preset rule to obtain several to-be-fitted point segments; A fitting module, configured to, for any one of the plurality of point segments to be fitted, select fitting points that satisfy a preset spacing from the any one of the point segments to be fitted to obtain a target point segment to be fitted; select the points entering the curve and the points exiting the curve from the target point segment to be fitted as key fitting points, and determine a control point with two adjacent key fitting points separated by a preset distance, and perform linear interpolation fitting through the control point to obtain an initial sub-curve segment; by calculating the curvature change rate of the initial sub-curve segment corresponding to all target points to be fitted, determine the sudden change fitting points among all the points to be fitted corresponding to the initial sub-curve segment, where the sudden change fitting points are the fitting points on the target point segment to be fitted whose curvature change rates do not exceed the preset curvature change rate range respectively; use a polynomial to fit the sudden change fitting points in the interval formed by the sudden change fitting points to obtain a sub-curve; A connection module, configured to connect the plurality of sub-curves to obtain an initial overall curve; A first smoothing module, configured to perform primary smoothing on the initial overall curve to obtain a smoothed initial target lane line; A second smoothing module, configured to perform secondary smoothing on the smoothed initial target lane line to obtain a final lane line; The step of dividing the sequence of lane line feature points to be fitted into a plurality of segments according to a preset rule to obtain a plurality of point segments to be fitted includes: dividing a reference line into a plurality of single-mapped sub-curve segments, where the reference line is a curve corresponding to the running trajectory of the vehicle when collecting the lane line feature points; using the plurality of single-mapped sub-curve segments as a reference, dividing the sequence of multi-mapped lane line feature points to be fitted into a plurality of single-mapped point segments to be fitted.
9. An electronic device, characterized in that, Comprising: A processor; And A memory, storing executable code thereon, which when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, storing executable code thereon, which when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Lane line segmentation fitting method and system, electronic equipment and storage medium
CN114092906A