Lane line detection method for iterative optimization from local to global and application
The lane detection method, which is optimized from local to global iteration, utilizes multi-scale feature extraction and global feature encoding to dynamically select query vectors, initialize learnable lane anchor boxes, and solves the adaptability and accuracy problems of lane detection in complex scenarios through multi-level decoder iterative optimization, thereby reducing training complexity.
Patent Information
- Application Number
- CN202511933316.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-20
AI Technical Summary
Existing lane line detection methods struggle to accurately detect lane boundaries in complex scenarios, especially on road sections with complex topologies. They lack adaptability and have high training complexity.
A lane detection method that iterates from local to global optimization is adopted. Through multi-scale feature extraction and global feature encoding, the query vector is dynamically selected to initialize learnable lane anchor boxes. Through multi-level decoder iterative optimization, and with the help of deformable attention mechanism and residual prediction, the lane lines are refined to model and fit.
It improves the adaptability and accuracy of lane line detection, reduces training complexity, and can stably detect lane lines in complex scenarios and adapt to complex topological structures.
Smart Images

Figure CN121708561A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and in particular to a lane detection method and its application that iteratively optimizes lane lines from local to global perspectives. Background Technology
[0002] In recent years, autonomous driving technology has developed rapidly. Robust lane detection is crucial for autonomous driving functions in various implementation schemes. Key modules such as lane keeping, lane departure warning, and trajectory planning all rely on stable and reliable lane detection capabilities. However, existing lane detection methods still face significant challenges in complex scenarios. Although some systems have achieved good results using LiDAR or multi-sensor fusion solutions, their high cost and computational consumption in lane marking detection have led to increasing attention on pure vision solutions. One of the main challenges is the difficulty in accurately detecting lane boundaries in road sections with complex topologies, such as dense, branching, and curved sections. Accurate lane detection in such scenarios is crucial for safe navigation and provides key information for path planning and vehicle control.
[0003] Currently, 2D lane detection methods mainly include anchor point-based, parameterized, segmentation, and key point-based schemes. However, each has its limitations in complex scenarios: anchor point-based methods rely on fixed priors and have poor adaptability to broken lanes and morphological changes; parameterized methods have fitting capabilities limited by preset function forms and are prone to failure when perspective changes, breaks, or occlusions occur; segmentation methods, although robust, rely on complex post-processing and often suffer from inaccurate boundaries and slow processing speeds; key point methods, while flexible, are prone to errors in key point selection and connection, and structural reconstruction highly depends on meticulous design.
[0004] For example, patent application CN120220094A discloses a 2D lane detection method based on anchor frame optimization. This method constructs an anchor frame optimization network (AONet) offline and trains it using a perspective-based accuracy criterion to calculate the loss function. In the online phase, the trained AONet is used for real-time 2D lane detection. This invention adaptively optimizes anchor frames by combining scene information with the anchor frame optimization network, detecting the actual position of lane lines with arbitrary starting points, significantly improving recognition accuracy and effectiveness. However, this scheme still relies on pre-defined anchor frame priors, making it difficult to handle complex road topologies and lacking adaptability to complex scenarios.
[0005] Therefore, a more advanced lane detection method is needed to address the above problems to some extent. Summary of the Invention
[0006] In view of the shortcomings of the prior art, the present invention provides a lane line detection method and application that iteratively optimizes from local to global perspectives. It is highly adaptable to complex scenarios, and the lane line representation paradigm can reduce training complexity while possessing fine-grained fitting capabilities.
[0007] To achieve the above and related objectives, the present invention adopts the following technical solution:
[0008] The first aspect of this invention provides a lane detection method that iteratively optimizes from local to global perspectives, comprising the following steps:
[0009] Step S100: Obtain the input road image and extract the multi-scale feature map of the road image;
[0010] Step S200: Global feature encoding is performed on the multi-scale feature map to output confidence. Based on the confidence, the top K query vectors are dynamically selected from a set of learnable query vectors. The query vectors correspond to potential lane line instances.
[0011] Step S300: Initialize the selected query vector into a learnable lane line anchor box, wherein the parameterized vector of the lane line anchor box satisfies the following expression 1:
[0012] ,
[0013] In Expression 1, (x,y) are the key coordinates of the center of the lane line anchor box in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles in the upper and lower directions, respectively, starting from the key point;
[0014] Step S400: Input the initialized lane line anchor boxes and the encoded multi-scale feature maps into the multi-level decoder for iterative optimization;
[0015] Step S500: Calculate the lane line detection result using the lane line parameters output by the last-stage decoder.
[0016] Furthermore, in step S400, each decoder stage performs the following operations:
[0017] Based on the lane line anchor box parameters of the current input, features are sampled around the baseline polyline determined by the dominant angle using a deformable attention mechanism;
[0018] The residuals of the current lane line parameters are predicted. The residuals include the adjustment of the parameterized vector of the lane line anchor frame and the lateral offset at N sampling points uniformly distributed along the longitudinal direction of the lane line. The lateral offset satisfies the following expression 2:
[0019] ;
[0020] The residuals are added to the lane line anchor frame parameters to obtain the optimized lane line parameters, which are then output to the next level decoder as input.
[0021] Further, in step S400, the reference lateral coordinates at each sampling point are calculated based on the current lane line anchor frame. The final lateral coordinates of the sampling point are the sum of the reference lateral coordinates and the predicted lateral offset. The final lateral coordinates of the sampling point satisfy the following expression 3:
[0022] .
[0023] Furthermore, the reference lateral coordinate satisfies the following expression 4:
[0024] ;
[0025] In expression 4, y i y is the ordinate of the sampling point; y is the ordinate of the key point; y is the ordinate of the sampling point. i It is obtained by sampling at N equal intervals within the lane line height h range.
[0026] Furthermore, in step S100, multi-scale feature maps are extracted through the backbone network and the feature pyramid network.
[0027] Furthermore, step S200 also includes: inputting the multi-scale feature map and position code into the encoder for global feature encoding, and outputting the confidence score.
[0028] Furthermore, in step S200, dynamically selecting the top K query vectors from a set of learnable query vectors based on confidence scores includes: selecting the K query vectors with the highest confidence scores output by the encoder to represent the K lane lines most likely to exist in the road image.
[0029] A second aspect of the present invention provides a lane detection system that iteratively optimizes from local to global perspectives, comprising:
[0030] The extraction module is used to acquire the input road image and extract multi-scale feature maps from the road image;
[0031] The encoding module is used to perform global feature encoding on the multi-scale feature map and output confidence. Based on the confidence, it dynamically selects the top K query vectors from a set of learnable query vectors. The query vectors correspond to potential lane line instances.
[0032] The initialization module initializes the selected query vector into learnable lane anchor boxes, whose parameterized vectors satisfy the following expression 1:
[0033] ,
[0034] In Expression 1, (x,y) are the key coordinates of the center of the lane line anchor box in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles in the upper and lower directions, respectively, starting from the key point;
[0035] The decoding module is used to input the initialized lane line anchor boxes and the encoded multi-scale feature maps into the multi-level decoder for iterative optimization.
[0036] The calculation module is used to calculate the lane detection results using the lane line parameters output by the last-stage decoder.
[0037] A third aspect of the present invention provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a computer's processor, cause the computer to perform the aforementioned lane detection method with iterative optimization from local to global.
[0038] A fourth aspect of the present invention provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the lane detection method described above for iterative optimization from local to global.
[0039] The beneficial technical effects of this invention are as follows:
[0040] This invention decomposes lane lines into an expression paradigm of overall direction and local deformation based on the parameterized vector of lane line anchor frames and lateral offsets, thereby achieving refined modeling of lane line geometry. Here, key points (x,y) and height h define the position and longitudinal range, the dominant angle describes the overall direction of the lane line, and N offsets achieve fine-grained fitting. This expression paradigm can accurately capture the complex curve features of lane lines, enabling it to reduce training complexity while possessing fine-grained fitting capabilities.
[0041] The novel lane line representation paradigm of this invention can predict each lane segment separately on lane lines that are disconnected in the same direction. Furthermore, through progressive iterative optimization and multi-scale feature fusion, it can improve its adaptability in complex scenarios and achieve accurate detection from local to global.
[0042] This invention utilizes the DETR framework based on Transformer, dynamically selecting the top-K query vectors based on the confidence level output by the encoder, and assigning them actual physical meaning (corresponding to potential lane line instances), thus solving the problem of difficult anchor design in traditional methods. This query selection mechanism enables the model to stably learn the representation of lane line instances, avoiding instability during training.
[0043] This invention uses learnable lane line anchor boxes to represent the overall trend of lane lines and iteratively optimizes them in each decoder, which reduces training complexity and stabilizes the model training process.
[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0045] The accompanying drawings, incorporated in and forming part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without inventive effort. In the drawings:
[0046] Figure 1 This is a flowchart of the lane detection method of this application, which iteratively optimizes from local to global perspectives.
[0047] Figure 2 This is a diagram of the training model framework for this application;
[0048] Figure 3 This is a framework diagram of the lane detection system for iterative optimization from local to global in this application;
[0049] Figure 4 A schematic diagram of the structure of a computer system suitable for an embodiment of this application is shown. Detailed Implementation
[0050] Unless otherwise defined, all technical and / or scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should be understood that certain features of the invention (described in the context of separate embodiments for clarity) may also be provided in a single embodiment. Conversely, multiple features of the invention (described in the context of a single embodiment for brevity) may also be provided separately or in any suitable combination or, where appropriate, in any other described embodiment of the invention. Certain features described in the context of various embodiments will not be considered essential features of those embodiments unless the embodiment is inoperable without those elements. The invention is further illustrated below by specific examples; however, it should be noted that the specific process conditions and results described in the embodiments of the invention are merely illustrative and should not be construed as limiting the scope of protection of the invention. All equivalent changes or modifications made in accordance with the spirit and essence of the invention should be covered within the scope of protection of the invention.
[0051] First, it should be noted that this application's DETR (Detection Transformer) is an end-to-end object detection model based on the Transformer architecture. It eliminates the need for manually designed components such as anchor boxes and non-maximum suppression (NMS) in traditional methods, and directly outputs detection results through ensemble prediction.
[0052] Transformer: A neural network architecture based on self-attention mechanism, originally used in natural language processing and later introduced into the field of computer vision. It establishes global dependencies between elements in the input sequence through attention mechanism.
[0053] Encoder-Decoder Structure: The encoder encodes the input data into a fixed-length context vector, and the decoder generates the output sequence from this vector. In DETR, the encoder extracts image features, and the decoder generates the object detection results.
[0054] Backbone: The backbone network, usually a pre-trained CNN (such as ResNet), is responsible for extracting multi-scale features from the input image.
[0055] FPN (Feature Pyramid Network): This network constructs a multi-scale feature pyramid by fusing feature maps of different scales, which is used to detect targets of different sizes.
[0056] Position Embedding: Position encoding is a key mechanism in the Transformer model used to add positional information to each element in the input sequence.
[0057] Encoder: The encoder encodes the input data into a fixed-length feature representation. It is responsible for extracting image features in the DETR.
[0058] Decoder: The decoder generates the final prediction result from the features output by the encoder. In DETR, detection boxes are generated through an object query mechanism.
[0059] Deformable Attention: An improved attention mechanism that combines the sparse sampling capability of deformable convolution with the relational modeling capability of Transformer. It focuses only on a small number of key sampling points around the reference point, significantly reducing computational complexity.
[0060] Query: The query vector is used to calculate attention weights in Transformer. In DETR, each Query corresponds to a possible target instance.
[0061] Anchor: Anchor boxes are predefined bounding boxes of various sizes and aspect ratios that serve as reference points for object detection. Instead of predicting boxes from scratch, the model adjusts these anchor boxes to better fit the actual objects.
[0062] Offset: The amount of adjustment made by the model's predictions to correct the position and size of the anchor box so that it matches the target more accurately.
[0063] Residual: The difference between the actual observed value and the model's predicted value. During training, the model gradually improves its predictive ability by fitting the residuals.
[0064] Top-K: Selects the top K most likely candidates, used in lane line detection to select the most promising lane line query.
[0065] Please see Figure 1 The flowchart of the lane detection method of this application, which iteratively optimizes from local to global, is described in detail below:
[0066] Step S100: Obtain the input road image and extract the multi-scale feature map of the road image.
[0067] Specifically, the training model for the lane line detection method in this application is as follows: Figure 2 As shown, combined with Figure 2 This application first extracts basic features from road images through a backbone network, outputting multiple feature maps at different scales. Then, it uses a feature pyramid network (FPN) to fuse these feature maps at different scales, generating a series of multi-scale feature maps. These feature maps simultaneously possess high-resolution detail information and rich semantic information. For example, high-level features have a wide field of view and can understand the layout of the entire road scene and the direction of long-distance lane lines; low-level features have high resolution and can accurately locate the edges and endpoints of lane lines.
[0068] Step S200: Global feature encoding is performed on the multi-scale feature map to output confidence. Based on the confidence, the top K query vectors are dynamically selected from a set of learnable query vectors. The query vectors correspond to potential lane line instances.
[0069] Specifically, in combination Figure 2This application utilizes multi-scale feature maps from Backbone and FPN, encompassing road features from local edges to global semantics. Position embedding provides spatial location information to the Transformer encoder. The combination of these two features as input to the encoder enables global contextual understanding of the road scene, identifying all possible lane line instances and their likelihood of existence in the image. More specifically, the model in this application is based on the DETR architecture, inputting both the multi-scale feature maps and position embeddings into the encoder. The encoder, through a self-attention mechanism, allows each location in the multi-scale feature maps to interact with all other locations. This process enables the model to understand the structural relationships between lane lines, such as determining which lines belong to the same lane or handling topological structures like bifurcations and merging. It also integrates global context, such as utilizing road edges, vehicle positions, and distant vanishing points, to assist in determining whether local features belong to lane lines, enhancing robustness in complex scenarios such as occlusion and lighting changes. After completing global feature encoding, the encoder of this application outputs a confidence score for a set of initially set learnable query vectors Query. This application selects the K query vectors with the highest confidence scores output by the encoder to represent the K most likely lane lines in the road image.
[0070] Specifically, this application automatically selects query vectors from the encoder based on confidence and assigns practical meaning to the query vectors, which can avoid interference from a large number of negative samples in the early stage of training, accelerate convergence, and thus stabilize the training process.
[0071] Step S300: Initialize the selected query vector into a learnable lane line anchor box, wherein the parameterized vector of the lane line anchor box satisfies the following expression 1:
[0072] ,
[0073] In Expression 1, (x,y) are the key coordinates of the center of the lane line anchor box in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles (in radians) in the upper and lower directions, respectively, starting from the key point. In this application, the upper and lower directions are based on the image coordinate system, with the y-axis pointing downwards as positive. Therefore, the upper direction corresponds to a smaller y-coordinate (closer to the top of the image).
[0074] Specifically, in combination Figure 2This application initializes the learnable query vectors in traditional DETR, which have no physical meaning, into lane anchor boxes with clear geometric meaning, thereby giving the query physical meaning so that each query vector corresponds to the overall geometric state of a possible lane line; and provides an optimization starting point, providing a reasonable initial geometric state for the subsequent iterative optimization of the decoder, reducing the optimization difficulty.
[0075] Specifically, step S300 of this application is implemented in the training model as follows: The model presets a set of learnable query vectors, usually more numerous than the actual lane line data in the image. After extracting global features of the image through the encoder, the confidence of each query vector is calculated based on the features, and the top-K high-confidence query vectors are selected to enter the decoding stage. For each selected query vector, it is mapped to a parameterized vector of a lane line anchor box, which is achieved through a learnable linear transformation. These parameters are randomly initialized in the early stage of training and are learned end-to-end with the entire model during training. In addition, the lane line anchor box of this application defines a piecewise straight line approximation. Above the key point, the lane line follows the dominant angle θ. t Extend; below the critical point, the lane line extends along the dominant angle θ b extend.
[0076] Step S400: Input the initialized lane line anchor boxes and the encoded multi-scale feature maps into the multi-level decoder for iterative optimization.
[0077] Specifically, each decoder level in this application performs the following operations:
[0078] Based on the lane line anchor box parameters of the current input, features are sampled around the baseline polyline determined by the dominant angle using a deformable attention mechanism;
[0079] The residuals of the current lane line parameters are predicted. The residuals include the adjustment of the parameterized vector of the lane line anchor frame and the lateral offset at N sampling points uniformly distributed along the longitudinal direction of the lane line. The lateral offset satisfies the following expression 2:
[0080] ;
[0081] The residuals are added to the lane line anchor frame parameters to obtain the optimized lane line parameters, which are then output to the next level decoder as input.
[0082] Specifically, this application calculates the reference lateral coordinates at each sampling point based on the current lane line anchor frame. The final lateral coordinates of the sampling point are the sum of the reference lateral coordinates and the predicted lateral offset. The final lateral coordinates of the sampling point satisfy the following expression 3:
[0083] .
[0084] Specifically, the lateral coordinate of the reference in this application satisfies the following expression 4:
[0085] ;
[0086] In expression 4, y i y is the ordinate of the sampling point; y is the ordinate of the key point; y is the ordinate of the sampling point. i It is obtained by sampling at N equal intervals within the lane line height h range.
[0087] Wherein, the ordinate of the sampling point in this application is y i Satisfy the following expression 5:
[0088] .
[0089] More specifically, this application parameterizes the vector based on the currently input lane line anchor box. Calculate the baseline polyline, and use the formula in Expression 4 to calculate the base position of each sampling point, thus obtaining a set of sampling points. Then, this application uses a deformable attention mechanism to sample features only in a local region around the baseline polyline. Features are upsampled at K preset offset positions around the point to avoid the large computational load caused by calculating global attention and reduce computational complexity. Next, the decoder predicts two types of residuals, optimizing parameters at different levels, including: anchor box parameter residuals, i.e., the adjustment amount of the parameterized vector of the lane line anchor boxes mentioned above. It is used to adjust the overall geometric properties, correct the overall direction and positioning of the lane, and the lateral offset. It is used to adjust local detail deformation to fit the micro-bending and twisting of lane lines.
[0090] Therefore, the optimized lane line parameter expression of this application satisfies the following expression 6:
[0091] .
[0092] More specifically, this application employs a multi-level decoder for hierarchical optimization. The shallow decoder corrects lane line anchor frame parameters, quickly adjusting the overall position and direction of the lane lines. The deep decoder corrects lateral offsets, finely adjusting local shapes and fitting complex curves and bifurcations within the already accurate lane line framework. In this way, this application reduces computational load, simplifies the learning task, and improves the model's detection capabilities.
[0093] More specifically, based on the expressions for the parameterized vector and lateral offset of the lane line anchor frame mentioned above, this application defines the lane line representation paradigm as the following expression 7:
[0094] .
[0095] More specifically, the new lane line representation paradigm of this application can predict each lane segment separately on lane lines that are disconnected in the same direction. Furthermore, through progressive iterative optimization and multi-scale feature fusion, it can improve its adaptability in complex scenarios and achieve accurate detection from local to global.
[0096] Step S500: Calculate the lane line detection result using the lane line parameters output by the last-stage decoder.
[0097] Specifically, the next layer of the Decoder in this application continues to optimize based on the parameters corrected in the previous layer, thereby achieving iterative optimization from local (basic direction) to global (refined curve) until the final lane line parameters are output. Through progressive optimization, this application can handle complex scenes such as occlusion and changes in lighting.
[0098] Please see Figure 3 This is a framework diagram of the lane detection system 300 of this application, which is iteratively optimized from local to global, including:
[0099] The extraction module 310 is used to acquire the input road image and extract multi-scale feature maps from the road image;
[0100] The encoding module 320 is used to perform global feature encoding on the multi-scale feature map and output confidence. Based on the confidence, it dynamically selects the top K query vectors from a set of learnable query vectors. The query vectors correspond to potential lane line instances.
[0101] Initialization module 330 is used to initialize the selected query vector into learnable lane line anchor boxes, the parameterized vectors of which satisfy the following expression 1:
[0102] ,
[0103] In Expression 1, (x,y) are the key coordinates of the center of the lane line anchor box in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles in the upper and lower directions, respectively, starting from the key point;
[0104] Decoding module 340 is used to input the initialized lane line anchor boxes and the encoded multi-scale feature maps into the multi-level decoder for iterative optimization.
[0105] The calculation module 350 is used to calculate the lane line detection result using the lane line parameters output by the last stage decoder.
[0106] It should be noted that the lane detection system with iterative optimization from local to global provided in the above embodiments and the lane detection method with iterative optimization from local to global provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the lane detection system with iterative optimization from local to global provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above, and this is not a limitation here.
[0107] Embodiments of this application also provide a computer device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the computer device to implement the lane detection method of iterative optimization from local to global provided in the various embodiments above.
[0108] Figure 4 A schematic diagram of the structure of a computer system suitable for an embodiment of this application is shown. It should be noted that... Figure 4 The computer system 400 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0109] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage section 408 into a random access memory (RAM) 403, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in the RAM 403. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404. The following components are connected to the I / O interface 405: an input section 406 including a keyboard, mouse, etc.; an output section 407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (local area network) card, modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A driver 410 is also connected to the I / O interface 405 as needed. Removable media 411, such as disks, optical discs, magneto-optical discs, semiconductor memories, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.
[0110] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer tool programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs various functions defined in the system of this application.
[0111] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, flash memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. Computer programs contained on computer-readable media can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0113] The units described in the embodiments of this application can be implemented by tools or by hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.
[0114] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a computer's processor, causes the computer to perform the lane detection method described above, which iteratively optimizes from local to global perspectives. This computer-readable storage medium may be included in the computer device described in the above embodiments, or it may exist independently and not incorporated into the computer device.
[0115] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the lane detection method with local-to-global iterative optimization provided in the various embodiments described above.
[0116] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A lane detection method that iteratively optimizes from local to global perspectives, characterized in that, Includes the following steps: Step S100: Obtain the input road image and extract the multi-scale feature map of the road image; Step S200: Global feature encoding is performed on the multi-scale feature map to output confidence. Based on the confidence, the top K query vectors are dynamically selected from a set of learnable query vectors, and the query vectors correspond to potential lane line instances. Step S300: Initialize the selected query vector into a learnable lane anchor box, wherein the parameterized vector of the lane anchor box satisfies the following expression 1: , In Expression 1, (x, y) are the key point coordinates of the center of the lane line anchor frame in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles in the upper and lower directions, respectively, starting from the aforementioned key point; Step S400: Input the initialized lane line anchor boxes and the encoded multi-scale feature maps into a multi-level decoder for iterative optimization; Step S500: Calculate the lane line detection result using the lane line parameters output by the last-stage decoder.
2. The lane line detection method according to claim 1, characterized in that, In step S400, each level of the decoder performs the following operations: Based on the lane line anchor frame parameters currently input, features are sampled around the baseline polyline determined by the dominant angle using a deformable attention mechanism; The residuals of the current lane line parameters are predicted, and the residuals include the adjustment of the parameterized vector of the lane line anchor frame and the lateral offset at N sampling points uniformly distributed along the longitudinal direction of the lane line. The lateral offset satisfies the following expression 2: ; The residual is added to the lane line anchor frame parameters to obtain the optimized lane line parameters, which are then output to the next level decoder as input.
3. The lane line detection method according to claim 2, characterized in that, In step S400, the reference lateral coordinates at each sampling point are calculated based on the current lane line anchor frame. The lateral coordinates of the final sampling point are the sum of the reference lateral coordinates and the predicted lateral offset. The lateral coordinates of the final sampling point satisfy the following expression 3: 。 4. The lane line detection method according to claim 3, characterized in that, The reference lateral coordinate satisfies the following expression 4: ; In expression 4, y i y is the ordinate of the sampling point; y is the ordinate of the key point; the ordinate of the sampling point y i It is obtained by sampling at N equal intervals within the lane line height h range.
5. The lane line detection method according to claim 1, characterized in that, In step S100, the multi-scale feature map is extracted through the backbone network and the feature pyramid network.
6. The lane line detection method according to claim 1, characterized in that, Step S200 further includes: inputting the multi-scale feature map and position code into the encoder for global feature encoding, and outputting the confidence score.
7. The lane line detection method according to claim 6, characterized in that, In step S200, dynamically selecting the top K query vectors from a set of learnable query vectors based on the confidence score includes: selecting the K query vectors with the highest confidence scores output by the encoder to represent the K lane lines most likely to exist in the road image.
8. A lane detection system that iteratively optimizes from local to global perspectives, characterized in that, include: An extraction module is used to acquire the input road image and extract multi-scale feature maps from the road image; The encoding module is used to perform global feature encoding on the multi-scale feature map and output a confidence score. Based on the confidence score, the module dynamically selects the top K query vectors from a set of learnable query vectors, wherein the query vectors correspond to potential lane line instances. An initialization module is used to initialize the selected query vector into learnable lane line anchor boxes, wherein the parameterized vectors of the lane line anchor boxes satisfy the following expression 1: , In Expression 1, (x, y) are the key point coordinates of the center of the lane line anchor frame in the y-direction of the road image; h is the extension height of the lane line in the y-direction of the road image. and These are the dominant angles in the upper and lower directions, respectively, starting from the aforementioned key point; The decoding module is used to input the initialized lane line anchor boxes and the encoded multi-scale feature maps into a multi-level decoder for iterative optimization; The calculation module is used to calculate the lane line detection result using the lane line parameters output by the last stage decoder.
9. A computer-readable storage medium, characterized in that, It stores computer-readable instructions, which, when executed by the computer's processor, cause the computer to perform the lane detection method of local-to-global iterative optimization as described in any one of claims 1 to 7.
10. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the steps of the lane detection method of any one of claims 1 to 7, which is iteratively optimized from local to global.
Citation Information
Patent Citations
Anchor frame optimization-based 2D lane line detection method
CN120220094A
