Lane line detection method, detection device, electronic device and storage medium
By pre-training lane line detection models and encoding and decoding technology, combined with regression parabola and camera parameters, the accuracy problem of existing lane line detection methods in curve scenes is solved, and accurate position prediction and rash prediction of lane lines are achieved. Improved stickiness.
Patent Information
- Application Number
- CN202210049836.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-01-17
AI Technical Summary
Existing lane line detection methods have low detection accuracy in curved scenes, image processing-based methods have poor generalization capabilities and robustness, and convolutional neural network-based methods have poor detection results in complex scenes.
A lane line detection method is used to process the image to be detected through a pre-trained lane line detection model to obtain lane line description parameters, including coefficients and camera parameters fused with regression parabolas, and the encoder and decoder are used to perform feature sequence Encoding and decoding, predicting lane line parameters, determining lane line positions, and integrating camera parameters into image processing to reduce dependence on camera parameters.
It achieves accurate detection of curved and straight lane lines, reduces dependence on camera parameters, and improves the robustness and generalization ability of lane line detection, especially the detection accuracy in complex scenes.
Smart Images

Figure CN114399747B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of machine vision and deep learning technology, and in particular to a lane line detection method, a detection device, an electronic device, and a storage medium. Background Art
[0002] Lane detection plays an important role in autonomous driving. In recent years, with the continuous development of autonomous driving technology, the requirements for lane detection accuracy have become increasingly higher.
[0003] At present, lane line detection is mainly divided into two types of methods: image processing-based and convolutional neural network-based. The image processing-based method relies on feature extractors, which makes it difficult to capture high-level semantic features and complex content, and its generalization ability and robustness are poor. The convolutional neural network-based method can improve the generalization ability and robustness of the detection model through data-driven, but the detection accuracy is low in scenes such as curves.
[0004] How to accurately detect lane lines is a problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present disclosure provide a lane line detection method, a detection device, an electronic device and a storage medium, which can accurately detect lane lines.
[0006] According to a first aspect of an embodiment of the present disclosure, a lane line detection method is provided, comprising:
[0007] Acquire an image to be detected including lane lines;
[0008] Processing the image to be detected based on a pre-trained lane line detection model to obtain lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters fused with coefficients of a regression parabola and camera parameters;
[0009] Based on the lane line description parameters, a lane line position in the image to be detected is determined.
[0010] In one embodiment of the present disclosure, the processing of the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected includes:
[0011] Performing feature extraction processing on the image to be detected to obtain a first feature sequence;
[0012] Performing position encoding on the first feature sequence to obtain a second feature sequence;
[0013] Using an encoder to encode the first feature sequence and the second feature sequence to obtain a coded sequence;
[0014] Position decoding is performed on the coding sequence to obtain a third characteristic sequence;
[0015] Decoding the encoded sequence and the third characteristic sequence using a decoder to obtain a decoded sequence;
[0016] Lane line parameter prediction is performed based on the decoded sequence to determine the lane line description parameters.
[0017] In one embodiment of the present disclosure, the decoding process of the encoding sequence and the third characteristic sequence to obtain a decoded sequence includes:
[0018] Position encoding is performed on the query sequence to obtain a storage position difference information sequence;
[0019] The encoding sequence, the third characteristic sequence, the sequence to be queried and the position difference sequence are decoded by using a decoder to obtain the decoded sequence.
[0020] In one embodiment of the present disclosure, the modeling formula of the lane line detection model is:
[0021]
[0022] Among them, a′, b′, C′ and d′ are parameters that integrate the coefficients of the regression parabola and the camera parameters, and a′, b′, C′ and d′ are all real numbers, δ is the lens distortion parameter, and u and v are the horizontal and vertical coordinates of the pixel point of the sample image in the pixel coordinate system, respectively.
[0023] In one embodiment of the present disclosure, the training of the lane line detection model includes:
[0024] Performing feature extraction processing on the sample image to obtain a fourth feature sequence;
[0025] Performing position encoding on the fourth characteristic sequence to obtain a fifth characteristic sequence;
[0026] Using an encoder to encode the fourth characteristic sequence and the fifth characteristic sequence to obtain a sample encoding sequence;
[0027] Position decoding is performed on the sample coding sequence to obtain a sixth characteristic sequence;
[0028] Decoding the sample coding sequence and the sixth characteristic sequence using a decoder to obtain a sample decoding sequence;
[0029] Predicting lane line parameters based on the decoded sequence to obtain lane line description parameters of the sample image;
[0030] A prediction error is determined based on the lane line description parameters of the sample image and the lane line description label of the sample image, and parameters of the lane line detection model are updated based on the prediction error.
[0031] In one embodiment of the present disclosure, the position encoding is performed by a position encoding function, wherein the position encoding function adopts a function for position encoding of word information in natural language processing, and the position encoding function is:
[0032]
[0033]
[0034] Among them, PE (pos,2i) represents the positional encoding of the word position pos and dimension 2i, PE (pos,2i+1) The position encoding represents the word position pos and the dimension 2i+1. pos represents the position of the word in the sentence, d represents the dimension of the word vector, 2i represents an even dimension, 2i+1 represents an odd dimension, and N is a natural number greater than 0.
[0035] In one embodiment of the present disclosure, the determining the prediction error based on the lane line description parameter and the lane line description label of the sample image includes:
[0036] The error value between the lane line description parameter and the lane line description label is calculated based on an error loss function, wherein the error loss function is:
[0037]
[0038] Among them, k1, k2 and k3 are loss weights, p i is the probability of lane line existence, is the predicted point sequence of the lane line, The actual point sequence of the lane line, l1 and l2 are the predicted starting point and predicted end point of the lane line respectively, l 1gt and l 2gt are the actual starting point and end point of the lane line, respectively. It is the position error between the predicted point sequence and the actual calibration position of the lane line.
[0039] According to a second aspect of the embodiments of the present disclosure, a lane line detection device is provided, comprising:
[0040] An image acquisition module, used to acquire an image to be detected including lane lines;
[0041] A model processing module, used to process the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters fused with coefficients of a regression parabola and camera parameters;
[0042] A lane line position determination module is used to determine the lane line position in the image to be detected based on the lane line description parameters.
[0043] In one embodiment of the present disclosure, the model processing module includes:
[0044] A feature extraction unit, used for performing feature extraction processing on the image to be detected to obtain a first feature sequence;
[0045] A position encoding unit, used to perform position encoding on the first feature sequence to obtain a second feature sequence
[0046] An encoding processing unit, configured to use an encoder to perform encoding processing on the first feature sequence and the second feature sequence to obtain a coded sequence;
[0047] A position decoding unit, used for performing position decoding on the coding sequence to obtain a third feature sequence;
[0048] A decoding processing unit, configured to use a decoder to decode the coded sequence and the third characteristic sequence to obtain a decoded sequence;
[0049] A lane line parameter prediction unit is used to predict lane line parameters based on the decoded sequence and determine the lane line description parameters.
[0050] In one embodiment of the present disclosure, the decoding processing unit is used to position encode the sequence to be queried to obtain a position difference sequence; the decoding processing unit is also used to use a decoder to decode the encoded sequence, the third feature sequence, the sequence to be queried and the stored position difference information sequence to obtain the decoded sequence.
[0051] In one embodiment of the present disclosure, the modeling formula of the lane line detection model is:
[0052]
[0053] Among them, a′, b′, C′ and d′ are parameters that integrate the coefficients of the regression parabola and the camera parameters, and a′, b′, C′ and d′ are all real numbers, δ is the lens distortion parameter, and u and v are the horizontal and vertical coordinates of the pixel point of the sample image in the pixel coordinate system, respectively.
[0054] In one embodiment of the present disclosure, the model processing module further includes a model parameter updating unit;
[0055] Wherein, the feature extraction unit is further used to perform feature extraction processing on the sample image to obtain a fourth feature sequence;
[0056] The position encoding unit is further used to perform position encoding on the fourth characteristic sequence to obtain a fifth characteristic sequence
[0057] The encoding processing unit is further used to use an encoder to perform encoding processing on the fourth characteristic sequence and the fifth characteristic sequence to obtain a sample encoding sequence;
[0058] The position decoding unit is further used to perform position decoding on the sample coding sequence to obtain a sixth feature sequence;
[0059] The decoding processing unit is further used to use a decoder to decode the sample encoding sequence and the sixth characteristic sequence to obtain a sample decoding sequence;
[0060] The lane line parameter prediction unit is also used to predict the lane line parameters based on the sample decoding sequence to obtain the lane line description parameters of the sample image;
[0061] The model parameter updating unit is used to determine a prediction error based on the lane line description parameters of the sample image and the lane line description label of the sample image, and to update the parameters of the lane line detection model based on the prediction error.
[0062] In one embodiment of the present disclosure, the position encoding unit is used to perform the position encoding through a position encoding function, wherein the position encoding function adopts a function for position encoding of word information in natural language processing, and the position encoding function is:
[0063]
[0064]
[0065] Among them, PE (pos,2i) represents the positional encoding of the word position pos and dimension 2i, PE (pos,2i+1) The position encoding represents the word position pos and the dimension 2i+1. pos represents the position of the word in the sentence, d represents the dimension of the word vector, 2i represents an even dimension, 2i+1 represents an odd dimension, and N is a natural number greater than 0.
[0066] In one embodiment of the present disclosure, the model parameter updating unit is used to calculate the error value between the lane description parameter and the lane description label based on an error loss function, wherein the error loss function is:
[0067]
[0068] Among them, k1, k2 and k3 are loss weights, p i is the probability of the lane line existing, is the predicted point sequence of the lane line, The actual point sequence of the lane line, l1 and l2 are the predicted starting point and predicted end point of the lane line respectively, l 1gt and l 2g are the actual starting point and end point of the lane line, respectively. is the shape error between the predicted point sequence and the real point sequence of the lane line, L1(l1, l2, l 1g , l 2g ) is the position error between the predicted position and the actual position of the lane line.
[0069] According to a third aspect of the present disclosure, an electronic device is provided, including:
[0070] Memory for storing computer programs;
[0071] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the lane line detection method described in the first aspect above is implemented.
[0072] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the lane line detection method described in the first aspect is implemented.
[0073] The lane line detection method, detection device, electronic device and storage medium of the embodiment of the present disclosure, after acquiring the image to be detected including the lane lines, uses the lane line detection model to process the image to be detected to obtain the lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters that are fused with the coefficients of the regression parabola and the camera parameters, and the parameters can characterize the positions of the pixels contained in the lane lines in the image to be detected. Based on the lane line description parameters, the positions of the lane lines in the image to be detected can be accurately determined. In the embodiment of the present disclosure, since the lane line description parameters include parameters that are fused with the coefficients of the regression parabola and the camera parameters, it is not necessary to obtain the current camera parameters when performing lane line detection, which eliminates the dependence on the camera parameters, and the lane lines on the curves and the lane lines on the straights can be accurately predicted.
[0074] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0076] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0077] Figure 1 A schematic diagram of a process flow of a lane line detection method in an embodiment of the present disclosure;
[0078] Figure 2 is a working principle diagram between an encoder and a decoder in an example of the present disclosure;
[0079] Figure 3 is a schematic diagram of an image coordinate system in an example of the present disclosure;
[0080] Figure 4 is a schematic diagram of predicting lane lines through a lane line detection model in an example of the present disclosure;
[0081] Figure 5 is a training flow chart of a lane detection model in an example of the present disclosure;
[0082] Figure 6 This is a structural block diagram of a lane line detection device in one embodiment of the present disclosure;
[0083] Figure 7 The figure is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. DETAILED DESCRIPTION
[0084] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0085] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0086] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0087] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0088] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0089] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0090] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0091] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0092] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0093] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0094] The disclosed embodiments can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0095] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0096] Figure 1 FIG. 1 is a flow chart of a lane line detection method in one embodiment of the present disclosure. Figure 1 As shown, the lane line detection method includes:
[0097] S1: Acquire an image to be detected including lane lines.
[0098] In an optional manner, an image in front of the vehicle is captured by a vehicle-mounted camera as the image to be detected. The image to be detected includes lane lines. The lane lines in the image to be detected may be lane lines on a curved road, in which case the lane lines are curved. The lane lines in the image to be detected may also be lane lines on a straight road, in which case the lane lines are not curved.
[0099] S2: Process the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters fused with coefficients of the regression parabola and camera parameters.
[0100] The lane detection model is trained based on sample images. When training the lane detection model, feature extraction, position encoding, encoder encoding, position decoding, decoder decoding, lane parameter prediction, and model parameter adjustment are performed in sequence. Among them, the lane description parameters obtained by lane parameter prediction include coefficients fused with regression parabolas and parameters determined by camera parameters, which can characterize the position of the pixels contained in the lane in the sample image.
[0101] Since the camera parameters are integrated into image processing and parameter prediction, the trained lane line detection model can accurately predict the lane lines in the image without relying on the camera parameters.
[0102] Since the regression parabola is used as the mathematical model of the lane line, the trained lane line detection model can detect the lane line on the curve more accurately. When the coefficients of the cubic term and the quadratic term in the regression parabola are both zero, the lane line on the straight road can be accurately detected.
[0103] The image to be detected is used as the input of the lane line detection model, and the lane line description parameters of the image to be detected can be output. The lane line description parameters can describe the position and curvature of the lane line in the image to be detected.
[0104] S3: Determine the position of the lane line in the image to be detected based on the lane line description parameters.
[0105] Based on the lane line description parameters, the coordinates of the lane line point sequence in the image to be detected can be obtained, and then the position of the lane line in the image to be detected can be determined.
[0106] In this embodiment, the lane line description parameters obtained by the lane line detection model include parameters that integrate the coefficients of the regression parabola and the camera parameters. The parameters can characterize the positions of the pixels contained in the lane lines in the image to be detected. Therefore, there is no need to obtain the current camera parameters when performing lane line detection, which eliminates the dependence on the camera parameters, and can accurately predict the lane lines on curved roads and the lane lines on straight roads.
[0107] In one embodiment of the present disclosure, step S2 includes:
[0108] S2-1: Perform feature extraction processing on the image to be detected to obtain a first feature sequence.
[0109] By extracting features from the sample image through the feature extraction network, a feature map of H×W×C dimensions can be obtained. Then, in order to adapt to the input of the encoder, the feature map is flattened in the spatial dimension to obtain a first feature sequence of length HW×C, denoted as S. Among them, HW represents the length of the sequence and C is the number of channels.
[0110] S2-2: Position encoding is performed on the first feature sequence to obtain a second feature sequence. The first feature sequence is position encoded by a position encoding function to obtain a second feature sequence containing position information, which is recorded as S'.
[0111] S2-3: Use an encoder to encode the first feature sequence and the second feature sequence to obtain a coded sequence.
[0112] As an optional method, S and S' are input into the attention layer together. The attention function can be expressed as follows:
[0113]
[0114] Where Q, K, V represent the query, key value and value sequence for linear transformation of each input row; C is the number of channels of the feature sequence S; A is the attention map, which preserves the spatial and shape information of the lane line; O is the final output of the attention function.
[0115] The specific inputs of Q, K, and V are: Q and K of the first layer of the encoder standard layer are the position embedding sequence S', and Q and K of the remaining layers are the output of the previous layer; V of the first layer of the encoder standard layer is the feature sequence S, and V of the remaining layers are the output of the previous layer.
[0116] The output of the function is input into the forward feedback network for feature fusion after the residual structure and normalization operation to obtain the encoding sequence, which is recorded as T. Among them, the forward feedback network layer is composed of multi-layer perceptrons.
[0117] S2-4: Positionally decode the encoded sequence to obtain a third characteristic sequence. Here, positionally decode T using a decoding function corresponding to the position encoding function in step S2-2 to obtain a third characteristic sequence, which is recorded as T'.
[0118] S2-5: Use a decoder to decode the encoded sequence and the third characteristic sequence to obtain a decoded sequence.
[0119] The decoder module consists of four standard decoding layers. The standard decoding layer consists of two parts. The first part is the self-decoding part, and the second part is the decoding output part. The last standard decoding layer outputs the decoding sequence, denoted as D. Among them, the first part of the standard decoding layer is the self-decoding part, which consists of the attention layer and the normalization layer. Its main function is to fix the number of lane lines detected and learn the differences between lane lines. The second part of the standard decoding layer is the decoding output part, which consists of the attention layer, the normalization layer, and the forward feedback layer. Its main function is to decode the representation sequence T into a fixed output form.
[0120] S2-6: Predict lane line parameters based on the decoded sequence to determine lane line description parameters of the image to be detected.
[0121] The prediction module receives the decoded sequence D output by the decoder and predicts the final lane line description parameter H.
[0122] The first part of the prediction module is the existence prediction module, which consists of a fully connected network and outputs C i ∈{0,1}i=1,…N, 0 represents non-lane and 1 represents lane.
[0123] The second part of the prediction module is the parameter prediction module, which predicts the lane line description parameters, denoted as H. H includes the predicted a′, b′, C′ and d′. The prediction module is mainly composed of a multi-layer perceptron with an activation function.
[0124] In this embodiment, the encoder is used to encode the first feature sequence and the second feature sequence to obtain a coding sequence, thereby obtaining the structural features of the lane line in the image to be detected. The coding sequence is positionally decoded to obtain a third feature sequence, and the decoder can decode the coding sequence and the third feature sequence to further obtain the structural features of the lane line in the image to be detected, and then based on the structural features of the lane line in the image to be detected, the lane line of the image to be detected can be accurately located.
[0125] Figure 2 : is a working principle diagram between an encoder and a decoder in an example of the present disclosure. Figure 2 As shown, step S2-5 specifically includes:
[0126] S2-5-1: Positionally encode the query sequence to obtain a position difference sequence.
[0127] An initial sequence to be queried is introduced, denoted as Q. Q is encoded using the same position encoding function as in step S3 to obtain a position difference sequence, denoted as P. The initial values of the sequence to be queried and the sequence storing the position difference information are both empty matrices of N×C, where N is the number of lane lines to be predicted, C is the number of channels of the image, and C is the same as the number of channels of the first feature sequence.
[0128] S2-5-2: Use a decoder to decode the encoded sequence, the third feature sequence, the sequence to be queried and the position difference sequence to obtain a decoded sequence.
[0129] The input of the attention function is: Q and K of the first standard decoding layer are the initial sequence Q to be queried, and the remaining layers are the output of the previous decoding standard layer; V of all standard decoding layers is the storage position difference information sequence P.
[0130] The input of the attention layer is: Q of all standard decoding layers is the storage position difference information sequence P, K of the first decoding standard layer, V is the output representation sequence T of the encoder, and the remaining layers are the output of the first part. The output of the attention layer is input to the forward feedback layer after the residual structure and normalization function to further learn the nonlinear representation of the lane line.
[0131] In this embodiment, by introducing an initial sequence to be queried, the number of lane lines to be detected can be determined according to the encoding features of the encoder. By introducing the storage position difference information sequence, the spatial difference information between different lane lines can be obtained. The sequence to be queried, the storage position difference information sequence, the third feature sequence and the encoding sequence are used as the input of the decoder, and a nonlinear representation of the lane lines in the detection image can be obtained.
[0132] In one embodiment of the present disclosure, the modeling formula of the lane line detection model is:
[0133]
[0134] Among them, the parameters a′, b′, C′ and d′ are parameters that integrate the coefficients of the regression parabola and the camera parameters, and a′, b′, C′ and d′ are all real numbers, δ is the lens distortion parameter, and u and v are the horizontal and vertical coordinates of the pixel point of the sample image in the pixel coordinate system, respectively.
[0135] Specifically, since the line will produce irregular refraction when passing through the lens in the camera lens, it will cause lens distortion. Therefore, lens distortion is introduced based on the above (1):
[0136]
[0137] Among them, δ xr is the radial distortion, δ xd is the tangential distortion. By further integrating the distortion parameters and the camera parameters, we can get the above formula (2).
[0138] In this embodiment, when setting the modeling formula of the lane line detection model, not only the coefficients of the regression parabola and the camera parameters are combined, but also the lens distortion parameters are introduced, so that the trained lane line detection model can accurately detect the lane lines of curves and lanes while adapting to the lens distortion.
[0139] In one embodiment of the present disclosure, the training of the lane detection model includes:
[0140] A: Build a lane detection model that uses a regression parabola to describe lane lines.
[0141] The camera coordinate system is a coordinate system with the camera light point as the center, the X-axis and Y-axis parallel to the two sides of the image, and the optical axis as the z-axis. c ,y c , z c ) represents point P c The position in the camera coordinate system. The image coordinate system takes the center of the image as the origin, and the X-axis and Y-axis are parallel to the sides of the image. The coordinate value of object P can be expressed as (x, y). Point P in the camera coordinate system c =(x c ,y c , z c ) to the image coordinate system point P = (x, y) belongs to the perspective projection relationship, that is, from 3D to 2D, the conversion relationship is expressed as follows:
[0142]
[0143] Where f is the focal length of the camera.
[0144] The image coordinate system is a coordinate system with the lower left corner of the image as the origin, and the X-axis and Z-axis are parallel to the two sides of the image. The coordinate value is represented by (u, v). The length and width of the pixel in the pixel coordinate system are d x d y Point P ix =(u, v) is:
[0145]
[0146] Among them, (u0, v0) is the plane center of the image.
[0147] Point P in the camera coordinate system c =(x c ,y c , z c ) to the midpoint P of the pixel coordinate system ix =(u, v) is:
[0148]
[0149] remember f·f u =f u ′、f·f v =f v ′, then the above formula can be converted to:
[0150]
[0151] Figure 3 is a schematic diagram of an image coordinate system in an example of the present disclosure. Figure 3 As shown in the figure, assuming that the road surface is flat and the height is constant, the image coordinate system is established with the lower left corner of the vehicle condition image as the origin, the Y axis is perpendicular to the road surface, the Z axis is the vertical axis, the direction is along the road surface, and the X axis is the horizontal axis, the direction is from left to right. Then the coordinates of any point on the road surface are (X, 0, Z). Considering the calculation efficiency and simplicity, the lane line model is only constructed on the XZ plane.
[0152] In the case of a curve, the shape of the lane line is a curve with different curvatures, so a simple linear relationship cannot reflect the shape of the lane line. Therefore, the present invention selects a regression parabola to describe the shape of the lane line, and the formula is as follows:
[0153] X=aZ 3 +bZ 2 +cZ+d (8)
[0154] Where a≠0, (X, Z) is a point on the lane line, a, b, c and d are coefficients of the regression parabola, and a, b, c and d are all real numbers.
[0155] Assume that the optical axis of the camera is parallel to the ground plane and the height from the ground is h. Project the point (X, Z) onto the image plane according to the conversion formula between coordinate systems:
[0156]
[0157] Where (u, v) is a point on the image plane.
[0158] By fusing the parameters a, b, c and d with the camera parameters, we can obtain the parameters a′, b′, c′ and d′ used to describe the lane line.
[0159] B: Perform feature extraction processing on the sample image including the lane lines to obtain a fourth feature sequence.
[0160] By extracting features from the sample image through the feature extraction network, a feature map of H×W×C dimensions can be obtained. Then, in order to adapt to the input of the encoder, the feature map is flattened in the spatial dimension to obtain a first feature sequence of length HW×C, denoted as S. Among them, HW represents the length of the sequence and C is the number of channels.
[0161] C: Position encoding the fourth feature sequence to obtain a fifth feature sequence. The fourth feature sequence is position encoded by a position encoding function to obtain a second feature sequence containing position information, which is recorded as S'.
[0162] D: Use the encoder to encode the fourth feature sequence and the fifth feature sequence to obtain a sample encoding sequence.
[0163] E: Positionally decode the sample coding sequence to obtain a third characteristic sequence. Here, positionally decode T using the decoding function corresponding to the position coding function that is the same as that in step C and step S2-2 to obtain a sixth characteristic sequence, denoted as T'.
[0164] F: Use a decoder to decode the encoded sequence and the third characteristic sequence to obtain a sample decoding sequence.
[0165] The decoder module consists of four standard decoding layers. The standard decoding layer consists of two parts. The first part is the self-decoding part, and the second part is the decoding output part. The last standard decoding layer outputs the decoding sequence, denoted as D. Among them, the first part of the standard decoding layer is the self-decoding part, which consists of the attention layer and the normalization layer. Its main function is to fix the number of lane lines detected and learn the differences between lane lines. The second part of the standard decoding layer is the decoding output part, which consists of the attention layer, the normalization layer, and the forward feedback layer. Its main function is to decode the representation sequence T into a fixed output form.
[0166] G: Predict lane line parameters based on the decoded sequence and determine the lane line description parameters of the sample image.
[0167] The prediction module receives the decoded sequence D output by the decoder and predicts the final lane line description parameter H.
[0168] The first part of the prediction module is the existence prediction module, which consists of a fully connected network and outputs C i ∈{0,1}i=1,…N, 0 represents non-lane and 1 represents lane.
[0169] The second part of the prediction module is the parameter prediction module, which predicts the lane line description parameters, denoted as H. H includes the predicted a′, b′, C′ and d′. The prediction module is mainly composed of a multi-layer perceptron with an activation function.
[0170] H: Determine the prediction error based on the lane description parameters and the lane description label of the sample image, and update the parameters of the lane detection model based on the prediction error. The parameters of the lane detection model can be updated and optimized using the gradient descent method during back propagation. The lane description label can include whether there is a lane in the sample image, and can also mark the lane (position / curvature) in the sample image.
[0171] In this embodiment, feature extraction is performed on a sample image including lane lines to obtain a first feature sequence, and the first feature sequence is fused with position coding to obtain a second feature sequence, and then the first feature sequence and the second feature sequence can be encoded by an encoder to obtain a coding sequence, so that the structural features of the lane lines can be learned. The coding sequence is positionally decoded to obtain a third feature sequence, and the coding sequence and the third feature sequence can be decoded by a decoder to further learn the features of the lane lines, so that the selected lane line detection model can accurately locate the lane lines on the curves and the lane lines on the straights based on the image.
[0172] In one embodiment of the present disclosure, step F specifically includes:
[0173] F-1: Positionally encode the query sequence to obtain a position difference sequence.
[0174] An initial sequence to be queried is introduced, denoted as Q. Q is encoded using a position encoding function to obtain a position difference sequence, denoted as P. The initial values of the sequence to be queried and the sequence storing the position difference information are both N×C empty matrices. Among them, N is the number of lane lines to be predicted, C is the number of channels of the image, and C is the same as the number of channels of the first feature sequence. The introduction of the sequence to be queried allows the decoder to fix the number of lane lines to be detected based on the encoding features of the encoder. The stored position difference information sequence is used to implicitly learn the spatial difference information between different lane lines.
[0175] F-2: Use a decoder to decode the encoded sequence, the third feature sequence, the sequence to be queried and the position difference sequence to obtain a decoded sequence.
[0176] The input of the attention function is: Q and K of the first standard decoding layer are the initial sequence Q to be queried, and the remaining layers are the output of the previous decoding standard layer; V of all standard decoding layers is the storage position difference information sequence P.
[0177] The input of the attention layer is: Q of all standard decoding layers is the storage position difference information sequence P, K of the first decoding standard layer, V is the output representation sequence T of the encoder, and the remaining layers are the output of the first part. The output of the attention layer is input to the forward feedback layer after the residual structure and normalization function to further learn the nonlinear representation of the lane line.
[0178] In this embodiment, by introducing an initial sequence to be queried, the number of lane lines to be detected can be determined according to the encoding features of the encoder. By introducing a stored position difference information sequence, the spatial difference information between different lane lines can be learned. The sequence to be queried, the stored position difference information sequence, the third feature sequence and the encoding sequence are used as inputs of the decoder, and the nonlinear representation of the lane lines can be further learned.
[0179] In one embodiment of the present disclosure, in step H, the error value between the lane description parameter and the lane description label is calculated based on the error loss function. Since the lane detection model needs to predict the position information of the lane in addition to the points on the lane, the lane description parameter may also include the starting position (denoted as l1) and the end position (denoted as l2) of the lane. At this time, the lane description parameter may include: [a', b', c', d', δ, l1, l2].
[0180] The error loss function is:
[0181]
[0182] Among them, k1, k2 and k3 are loss weights, p i is the probability of the lane line existing, is the predicted point sequence of the lane line, The actual point sequence of the lane line, l1 and l2 are the predicted starting point and predicted end point of the lane line respectively, l 1gt and l 2gt are the actual starting point and end point of the lane line, respectively. is the shape error between the predicted point sequence and the real point sequence of the lane line, L1(l1, l2, l 1gt , l 2gt ) is the position error between the predicted position and the actual position of the lane line.
[0183] After the lane line detection model training is completed, the starting point and end point of the lane line in the image to be detected can be determined based on l1 and l2 in [a′, b′, c′, d′, δ, l1, l2], and the pixel coordinates on the lane line in the image to be detected can be determined based on the above formula (2).
[0184] Figure 4 4 shows a schematic diagram of predicting lane lines using a lane line detection model in an example of the present disclosure. As shown in FIG4 , the lane line detection model trained using the error loss function can accurately predict the number of lane lines, the curvature of the lane lines, and the starting and ending positions of the lane lines.
[0185] In this embodiment, through the error loss function, not only can it be accurately calculated whether there is an error on the lane line, but also the errors in the starting and ending positions of the lane line can be calculated, and the error term of the lane line shape can be calculated, so as to adjust the lane line detection model based on the calculated prediction error, so that the lane line detection model finally obtained can predict whether there is a lane line in the input detection image, and can detect the starting and ending positions of the lane line when there is a lane line, as well as the shape of the lane line.
[0186] In one embodiment of the present disclosure, position encoding is performed by a position encoding function. The position encoding function adopts a function for encoding the position of word information in natural language processing, and the position encoding function is:
[0187]
[0188]
[0189] Among them, PE (pos,2i) represents the positional encoding of the word position pos and dimension 2i, PE (pos,2i+1)The position encoding represents the word position pos and the dimension 2i+1. pos represents the position of the word in the sentence, d represents the dimension of the word vector, 2i represents an even dimension, 2i+1 represents an odd dimension, and N is a natural number greater than 0.
[0190] In this embodiment, the encoding function used can make each dimension correspond to a sine curve, so that each position has a separate code. The principle is: since each dimension i corresponds to a sine-cosine curve of different periods, for two different positions pos1 and pos2, if their encoding values in the i-dimensional are the same, it means that the difference between the two positions is an integer multiple of the period of the i-dimensional curve, that is, |pos1-pos2|=T i At this time, for another dimension j (j≠i), due to T i ≠T j , so the two positions will not be equal in dimension j, and they are also not equal for other dimensions k∈{0, 1, …d-1} and k≠i, so the encoding of each position is unique.
[0191] Figure 5 is a training flow chart of a lane detection model in an example of the present disclosure. Figure 5 As shown in the figure, the training process of the lane detection model includes:
[0192] Get a sample image;
[0193] Extract features from the sample image based on the feature extraction network to obtain a first feature sequence S;
[0194] Use the position encoding function to position encode the first feature sequence S to obtain the second feature sequence S';
[0195] The first feature sequence S and the second feature sequence S' are encoded by using an encoder to obtain an encoded sequence T;
[0196] The coding sequence T is position-coded using the same position coding function to obtain a third feature sequence T';
[0197] Use the same position encoding function to position encode the query sequence Q to obtain the position difference sequence P;
[0198] Using a decoder to decode the coded sequence T, the third characteristic sequence T', the sequence to be queried Q and the position difference sequence P, to obtain a decoded sequence D;
[0199] The decoded sequence D is respectively subjected to lane line existence prediction and parameter prediction, and the two prediction results are combined to obtain the lane line description parameters;
[0200] Post-processing is performed based on the lane line description parameters, that is, the prediction error is determined based on the lane line description parameters and the lane line description label of the sample image, and the parameters of the lane line detection model are updated based on the prediction error.
[0201] The training method of the lane line detection model in this example can not only enable the feature extraction network (such as a convolutional neural network) to effectively capture the spatial relationship between long-distance pixels, especially the curvature differences within and between lane lines in curved conditions, but also can realize accurate detection of lane lines in combination with camera parameters, and can also accurately learn the private features of each lane line in curved conditions, thereby being applicable to lane line detection in curved roads.
[0202] Figure 6 : is a structural block diagram of a lane line detection device in one embodiment of the present disclosure. Figure 6 As shown, the lane line detection device includes:
[0203] An image acquisition module 100 is used to acquire an image to be detected including lane lines;
[0204] A model processing module 200 is used to process the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected, where the lane line description parameters include parameters that integrate coefficients of a regression parabola and camera parameters;
[0205] The lane line position determination module 300 is used to determine the lane line position in the image to be detected based on the lane line description parameters.
[0206] In one embodiment of the present disclosure, the model processing module 200 includes:
[0207] A feature extraction unit, used for performing feature extraction processing on the image to be detected to obtain a first feature sequence;
[0208] A position encoding unit is used to perform position encoding on the first feature sequence to obtain a second feature sequence
[0209] An encoding processing unit, used for encoding the first feature sequence and the second feature sequence using an encoder to obtain an encoding sequence;
[0210] A position decoding unit, used for performing position decoding on the coded sequence to obtain a third feature sequence;
[0211] A decoding processing unit, used for decoding the coded sequence and the third characteristic sequence to obtain a decoded sequence;
[0212] The lane line parameter prediction unit is used to predict the lane line parameters based on the decoded sequence and determine the lane line description parameters.
[0213] In one embodiment of the present disclosure, the decoding processing unit is used to position encode the sequence to be queried to obtain a position difference sequence; the decoding processing unit is also used to use a decoder to decode the encoded sequence, the third feature sequence, the sequence to be queried and the stored position difference information sequence to obtain a decoded sequence.
[0214] In one embodiment of the present disclosure, the modeling formula of the lane line detection model is:
[0215]
[0216] Among them, the parameters a′, b′, C′ and d′ are parameters that integrate the coefficients of the regression parabola and the camera parameters, and a′, b′, C′ and d′ are all real numbers, δ is the lens distortion parameter, and u and v are the horizontal and vertical coordinates of the pixel point of the sample image in the pixel coordinate system, respectively.
[0217] In one embodiment of the present disclosure, the model processing module 200 further includes a model parameter updating unit;
[0218] The feature extraction unit is further used to perform feature extraction processing on the sample image to obtain a fourth feature sequence;
[0219] The position encoding unit is also used to perform position encoding on the fourth feature sequence to obtain a fifth feature sequence
[0220] The encoding processing unit is further used to use the encoder to perform encoding processing on the fourth feature sequence and the fifth feature sequence to obtain a sample encoding sequence;
[0221] The position decoding unit is also used to perform position decoding on the sample coding sequence to obtain a sixth feature sequence;
[0222] The decoding processing unit is further used to use a decoder to decode the sample coding sequence and the sixth characteristic sequence to obtain a sample decoding sequence;
[0223] The lane line parameter prediction unit is also used to predict the lane line parameters based on the sample decoding sequence to obtain the lane line description parameters of the sample image;
[0224] The model parameter updating unit is used to determine the prediction error based on the lane line description parameters of the sample image and the lane line description label of the sample image, and update the parameters of the lane line detection model based on the prediction error.
[0225] In one embodiment of the present disclosure, the position encoding unit is used to perform position encoding through a position encoding function, wherein the position encoding function adopts a function for position encoding of word information in natural language processing, and the position encoding function is:
[0226]
[0227]
[0228] Among them, PE (pos,2i) represents the positional encoding of the word position pos and dimension 2i, PE (pos,2i+1) The position encoding represents the word position pos and the dimension 2i+1. pos represents the position of the word in the sentence, d represents the dimension of the word vector, 2i represents an even dimension, 2i+1 represents an odd dimension, and N is a natural number greater than 0.
[0229] In one embodiment of the present disclosure, the model parameter updating unit is used to calculate the error value between the lane description parameter and the lane description label based on the error loss function, wherein the error loss function is:
[0230]
[0231] Among them, k1, k2 and k3 are loss weights, p i is the probability of the lane line existing, is the predicted point sequence of the lane line, The actual point sequence of the lane line, l1 and l2 are the predicted starting point and predicted end point of the lane line respectively, l 1gt and l 2gt are the actual starting point and end point of the lane line, respectively. is the shape error between the predicted point sequence and the real point sequence of the lane line, L1(l1, l2, l 1gt , l 2gt ) is the position error between the predicted position and the actual position of the lane line.
[0232] It should be noted that the specific implementation of the lane line detection device of the embodiment of the present disclosure is similar to the specific implementation of the lane line detection method of the embodiment of the present disclosure. Please refer to the description of the lane line detection method part for details. In order to reduce redundancy, it will not be repeated.
[0233] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0234] Memory for storing computer programs;
[0235] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the lane line detection method described in any of the above embodiments of the present disclosure is implemented.
[0236] Figure 7 FIG. 1 is a schematic diagram of a structure of an application embodiment of the electronic device disclosed in the present invention. Figure 7 As shown, the electronic device includes one or more processors and memory.
[0237] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0238] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the lane line detection method of each embodiment of the present disclosure described above and / or other desired functions.
[0239] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0240] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0241] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0242] Of course, to simplify, Figure 7 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0243] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the lane line detection method according to various embodiments of the present disclosure described in the above part of this specification.
[0244] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0245] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the training method of the lane line detection model according to various embodiments of the present disclosure described in the above part of this specification.
[0246] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0247] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0248] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limiting. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0249] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0250] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0251] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0252] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0253] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0254] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A lane line detection method, characterized in that: include: Acquire an image to be detected including lane lines; Processing the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters fused with coefficients of a regression parabola and camera parameters; Based on the lane line description parameters, determining the lane line position in the image to be detected; The processing of the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected includes: Performing feature extraction processing on the image to be detected to obtain a first feature sequence; Performing position encoding on the first feature sequence to obtain a second feature sequence; Using an encoder to encode the first feature sequence and the second feature sequence to obtain a coded sequence; Position decoding is performed on the coding sequence to obtain a third characteristic sequence; Decoding the encoded sequence and the third characteristic sequence using a decoder to obtain a decoded sequence; Lane line parameter prediction is performed based on the decoded sequence to determine the lane line description parameters.
2. The lane line detection method according to claim 1, characterized in that: The decoding process of the encoding sequence and the third characteristic sequence to obtain a decoding sequence includes: Position encoding is performed on the query sequence to obtain a storage position difference information sequence; The encoding sequence, the third characteristic sequence, the sequence to be queried and the position difference sequence are decoded by using a decoder to obtain the decoded sequence.
3. The lane line detection method according to any one of claims 1-2, characterized in that: The modeling formula of the lane line detection model is: Among them, a ′ ,b ′ ,c ′ and d ′ The parameters are determined based on the coefficients of the regression parabola and the camera parameters, and a ′ ,b ′ ,c ′ and d ′ are all real numbers, δ is the lens distortion parameter, u and v are respectively the horizontal coordinate and the vertical coordinate of the pixel point of the sample image in the pixel coordinate system.
4. The lane line detection method according to claim 1, characterized in that: The training of the lane detection model includes: Performing feature extraction processing on the sample image to obtain a fourth feature sequence; Performing position encoding on the fourth characteristic sequence to obtain a fifth characteristic sequence; Using an encoder to encode the fourth characteristic sequence and the fifth characteristic sequence to obtain a sample encoding sequence; Position decoding is performed on the sample coding sequence to obtain a sixth characteristic sequence; Decoding the sample coding sequence and the sixth characteristic sequence using a decoder to obtain a sample decoding sequence; Predicting lane line parameters based on the decoded sequence to obtain lane line description parameters of the sample image; A prediction error is determined based on the lane line description parameters of the sample image and the lane line description label of the sample image, and parameters of the lane line detection model are updated based on the prediction error.
5. The lane line detection method according to any one of claims 1-2 and 4, characterized in that: The position encoding is performed by a position encoding function, wherein the position encoding function adopts a function for position encoding of word information in natural language processing, and the position encoding function is: Among them, PE (pos,2i) represents the position encoding of the word position pos and dimension 2i, PE (pos,2i+1) The position encoding represents the word position pos and the dimension 2i+1. pos represents the position of the word in the sentence, d represents the dimension of the word vector, 2i represents an even dimension, 2i+1 represents an odd dimension, and N is a natural number greater than 0.
6. The lane line detection method according to claim 4, characterized in that: The determining of the prediction error based on the lane line description parameter and the lane line description label of the sample image includes: The error value between the lane line description parameter and the lane line description label is calculated based on an error loss function, wherein the error loss function is: Among them, k1, k2 and k3 are loss weights, p i is the probability of the lane line existing, is the predicted point sequence of the lane line, The actual point sequence of the lane line, l1 and l2 are the predicted starting point and predicted end point of the lane line respectively, l 1g and l 2gt are the actual starting point and end point of the lane line, respectively. is the shape error between the predicted point sequence and the real point sequence of the lane line, L1(l1,l2,l 1gt ,l 2gt ) is the position error between the predicted position and the actual position of the lane line.
7. A lane line detection device, characterized in that: include: An image acquisition module, used to acquire an image to be detected including lane lines; A model processing module, used to process the image to be detected based on the lane line detection model to obtain lane line description parameters of the image to be detected, wherein the lane line description parameters include parameters fused with coefficients of a regression parabola and camera parameters; A lane line position determination module, used to determine the lane line position in the image to be detected based on the lane line description parameters; Wherein, the model processing module includes: A feature extraction unit, used for performing feature extraction processing on the image to be detected to obtain a first feature sequence; A position encoding unit, used to perform position encoding on the first feature sequence to obtain a second feature sequence; an encoding processing unit, used to perform encoding processing on the first feature sequence and the second feature sequence using an encoder to obtain an encoding sequence; A position decoding unit, used for performing position decoding on the coding sequence to obtain a third feature sequence; A decoding processing unit, configured to use a decoder to decode the coded sequence and the third characteristic sequence to obtain a decoded sequence; A lane line parameter prediction unit is used to predict lane line parameters based on the decoded sequence and determine the lane line description parameters.
8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the lane line detection method described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the lane line detection method described in any one of claims 1 to 6 is implemented.
