Lane line detection method, training method, related equipment and storage medium
Patent Information
- Application Number
- CN202310798716.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-06-30
AI Technical Summary
[0003]在实际应用中,车道线存在有多种类型,如直线、弯曲程度不同的各曲线等,相关技术中的车道线检测方法在部分类型下的检测结果较高,在部分类型下的检测结果不尽人意
Smart Images

Figure CN118230268B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of lane line detection technology, and in particular to a lane line detection method, training method, related equipment and storage medium. Background Technology
[0002] In autonomous driving and assisted driving scenarios, lane detection methods can be used to detect lane lines during vehicle movement. Accurate lane line detection can help vehicles better perform functions such as lane departure warning, lane keeping assist, and vehicle centering assist.
[0003] In practical applications, lane markings come in various types, such as straight lines and curves with varying degrees of curvature. While existing lane marking detection methods yield high results for some types, their performance is unsatisfactory for others. Therefore, improving the detection accuracy for various lane marking types has become a pressing technical challenge. Summary of the Invention
[0004] This application provides a lane line detection method, training method, related equipment, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0005] According to a first aspect of this application, a lane line detection method is provided, comprising:
[0006] Obtain an image to be detected, the image to be detected having a corresponding preset grid, and the first anchor point is located on the grid of the image to be detected;
[0007] Based on the first anchor point, predict the reference lane line of the image to be detected;
[0008] Based on the reference lane line, a second anchor point is determined in the image to be detected. The second anchor point is located in a sub-grid, which is a grid in which the reference lane line exists.
[0009] Based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line, predict the offset information of the reference lane line;
[0010] The target lane line of the image to be detected is obtained based on the reference lane line and its offset information.
[0011] According to a second aspect of this application, a method for training a detection model is provided, comprising:
[0012] Obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid;
[0013] Determine the first anchor point for each sample image, which is located within the grid of each sample image;
[0014] Based on the actual lane lines in each sample image, the first marked lane line information of each sample image is obtained. The first marked lane line information of each sample image is the lane line position mark represented by the first anchor point of each sample image.
[0015] The detection model is trained based on each sample image and the first labeled lane line information of each sample image;
[0016] Based on the target sample image and the detection model, a first predicted lane line is obtained from the target sample image, wherein the target sample image is at least a portion of the sample images;
[0017] Based on the first predicted lane line of the target sample image and the grid of the target sample image, a sub-grid of the target sample image is obtained. The sub-grid of the target sample image is a grid in the target sample image that contains the first predicted lane line, and the sub-grid has a preset second anchor point.
[0018] Based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, the second marked lane line information of the target sample image is obtained. The second marked lane line information is the positional offset between the actual lane line and the first predicted lane line based on the second anchor point.
[0019] The detection model is trained based on the second marked lane line information of the target sample image and the target sample image itself.
[0020] According to a third aspect of this application, a lane line detection device is provided, comprising:
[0021] The first acquisition unit is used to acquire the image to be detected, the image to be detected corresponds to a preset grid, and the first anchor point is located at the grid of the image to be detected;
[0022] The first prediction unit is used to predict the reference lane line of the image to be detected based on the first anchor point;
[0023] The first determining unit is used to determine a second anchor point of the image to be detected based on a reference lane line. The second anchor point is located in a sub-grid, and the sub-grid is a grid in which the reference lane line exists.
[0024] The second prediction unit is used to predict the offset information of the reference lane line based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line.
[0025] The second acquisition unit is used to obtain the target lane line of the image to be detected based on the reference lane line and the offset information of the reference lane line.
[0026] According to a fourth aspect of this application, a training apparatus for a detection model is provided, comprising:
[0027] The first obtaining unit is used to obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid.
[0028] The first determining unit is used to determine the first anchor point of each sample image, and the first anchor point of each sample image is located in the grid of each sample image;
[0029] The second obtaining unit is used to obtain the first marked lane line information of each sample image based on the actual lane lines in each sample image. The first marked lane line information of each sample image is a lane line position mark represented by the first anchor point of each sample image.
[0030] The first training unit is used to train the detection model based on each sample image and the first labeled lane line information of each sample image;
[0031] The third obtaining unit is used to obtain a first predicted lane line of the target sample image based on the target sample image and the detection model, wherein the target sample image is at least a portion of the sample images;
[0032] The fourth obtaining unit is used to obtain a sub-grid of the target sample image based on the first predicted lane line of the target sample image and the grid of the target sample image. The sub-grid of the target sample image is a grid in the target sample image in which the first predicted lane line exists, and the sub-grid has a preset second anchor point.
[0033] The fifth obtaining unit is used to obtain second marked lane information of the target sample image based on the first predicted lane line of the target sample image and the actual lane line in the target sample image. The second marked lane information is the position offset of the actual lane line and the first predicted lane line represented by the second anchor point.
[0034] The second training unit is used to train the detection model based on the second marked lane line information of the target sample image and the target sample image.
[0035] According to a fifth aspect of this application, an electronic device is provided, comprising:
[0036] At least one processor; and
[0037] A memory communicatively connected to the at least one processor; wherein,
[0038] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in this application.
[0039] According to a sixth aspect of this application, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this application.
[0040] The lane line method, detection model training method, and related equipment of this application achieve accurate detection of various types of lane lines by utilizing two anchor points (a first anchor point and a second anchor point).
[0041] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0042] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which:
[0043] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0044] Figure 1 This document illustrates the implementation flow of the training method for the detection model in an embodiment of this application. Figure 1 ;
[0045] Figure 2 This document illustrates the implementation flow of the training method for the detection model in an embodiment of this application. Figure 2 ;
[0046] Figure 3 The diagram illustrates the implementation block diagram of the training method for the detection model in an embodiment of this application;
[0047] Figure 4 A schematic diagram illustrating the implementation flow of the lane line detection method in an embodiment of this application is shown;
[0048] Figure 5 An application diagram illustrating the embodiments of this application is shown;
[0049] Figure 6 A schematic diagram of the composition structure of the lane line detection device in an embodiment of this application is shown;
[0050] Figure 7 This paper shows a schematic diagram of the composition structure of the training device for the detection model in an embodiment of this application;
[0051] Figure 8 A schematic diagram of the composition structure of the electronic device in an embodiment of this application is shown. Detailed Implementation
[0052] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0055] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit the scope of this application.
[0057] It should be understood that in the various embodiments of this application, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0058] In this application, the lane detection method can be applied to driving devices. Driving devices include at least one of private transportation vehicles and public transportation vehicles. Private transportation vehicles include, but are not limited to, self-balancing scooters, electric motorcycles, private cars, and private airplanes. Public transportation vehicles include, but are not limited to, buses, trains, subways, high-speed trains, and airplanes. The training method for the detection model in this application can be applied to driving devices, and also to other devices that can communicate with the driving device, such as servers. Once the detection model has been trained on other devices, the trained detection model is synchronized to the driving device, enabling the driving device to predict or detect lane lines.
[0059] This application first describes the training scheme, and then uses the trained detection model to illustrate the detection scheme. See the following description for details.
[0060] Figure 1 This document illustrates the implementation flow of the training method for the detection model in an embodiment of this application. Figure 1 This method can be applied to driving devices, as well as other devices that communicate with the driving device, such as servers. Preferably, it is applied to driving devices.
[0061] like Figure 1 As shown, the training methods for the detection model (hereinafter referred to as training methods) include:
[0062] S101: Obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid.
[0063] In practical applications, images of the driving device during its movement are captured. These images may contain lane lines in the direction of travel. The captured images containing lane lines in the direction of travel are used as sample images, and the lane lines in these sample images are labeled as the actual lane lines in the sample images. The lane lines in the sample images can be labeled manually or using any other reasonable automatic method.
[0064] It's understandable that the sample images are obtained through the same driving device's image acquisition mechanism, such as a camera, and the size of each sample image is usually consistent. However, if the sample images are obtained through different driving devices' image acquisition mechanisms, then the size of each sample image may differ. Regardless of whether the sample images are the same or different sizes, they can be divided into a grid according to a pre-set grid size, such as 8×8. The grid division effect is as follows. Figure 5 As shown.
[0065] In this application, preferably, the moving images of different sizes can be preprocessed, such as by cropping or transforming, to ensure that the size of each sample image is consistent. The sample images of the same size are then divided into grids according to a pre-set grid. When the size of each sample image and the grid size are consistent, the number of grids divided among the sample images is also consistent.
[0066] S102: Determine the first anchor point of each sample image, where the first anchor point of each sample image is located in the grid of each sample image.
[0067] This application provides two types of anchor points for marking locations: a first anchor point and a second anchor point. The first anchor point is a point within a grid of the sample image, and its position within the grid can be determined based on the specific circumstances. The first anchor point can be one of the four corners of the grid (top left, bottom left, top right, or bottom right). For example, the top left corner of the grid in the sample image is used as the first anchor point.
[0068] S103: Based on the actual lane lines in each sample image, obtain the first marked lane line information of each sample image, wherein the first marked lane line information of each sample image is a lane line position mark represented by the first anchor point of each sample image.
[0069] In this step, the lane line positions in the sample image are marked using a first anchor point. The lane line position marked by the first anchor point may be the position of the actual lane line in the sample image, or it may be the position of a line in the sample image that is adjacent to or close to the actual lane line. That is, the first marked lane line information can be the position of the actual lane line in the sample image represented by the first anchor point, or it can be the position of a line in the sample image that is adjacent to or close to the actual lane line, represented by the first anchor point.
[0070] Marking lane line positions in sample images based on a (first) anchor point is a novel technical solution. Furthermore, considering the stability of the (first) anchor point itself, using it to mark lane line positions ensures the accuracy of the marking.
[0071] S104: Train the detection model based on each sample image and the first labeled lane line information of each sample image.
[0072] The detection model in this application comprises two parts: a first sub-model and a second sub-model. In this step, the first sub-model in the detection model is trained based on each sample image and the first marked lane line information of each sample image.
[0073] If we abstract the mathematical expression of the first sub-model as the formula y1 = f1(x1), then training the first sub-model means treating each sample image as x1 in the formula and the first lane line information of each sample image as y1 in the formula. Given the input x1 and output y1 in the formula, the first sub-model is trained to obtain a better f1. Specifically, given the input sample images, f1 is continuously adjusted so that the output y1' obtained under the given f1 and input sample images is as close as possible to the known y1.
[0074] It is understood that the above is just an example, and the mathematical expression of the first sub-model can be any reasonable formula, not limited to the one shown above.
[0075] The technical solutions in S101 to S104 lie in the first sub-model in the training detection model. The solutions in S105 to S108 lie in the second sub-model in the training detection model.
[0076] S105: Based on the target sample image and the detection model, obtain the first predicted lane line of the target sample image, wherein the target sample image is at least a portion of the sample images.
[0077] This step allows you to read all or part of the sample images as the target sample images. In practice, the target sample images can be input into the trained detection model, specifically the first sub-model. The trained first sub-model predicts the lane lines in the target sample images and outputs them as the first predicted lane lines.
[0078] In this application, the schemes S105 to S108 are schemes for training the second sub-model. During the training process, the first predicted lane line output by the trained first sub-model is used to train the second sub-model. That is, the training of the second sub-model uses the output of the first sub-model, providing a new technical support for the training of the detection model.
[0079] S106: Based on the first predicted lane line of the target sample image and the grid of the target sample image, a sub-grid of the target sample image is obtained. The sub-grid of the target sample image is a grid in the target sample image that contains the first predicted lane line. The sub-grid has a preset second anchor point.
[0080] In this step, when all or part of the sample image is used as the target sample image, the target sample image is divided into multiple grids according to the set grid size. From each grid of the target sample image, the grids containing the first predicted lane line are selected as sub-grids of the target sample image. Within each sub-grid, another anchor point—a second anchor point—is set, in addition to the first anchor point. The second anchor point can be set at any reasonable location within the sub-grid, such as on the diagonal of the sub-grid. In implementation, one or more points can be selected from the diagonal of the sub-grid as the second anchor point.
[0081] S107: Based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, obtain the second marked lane line information of the target sample image. The second marked lane line information is the position offset between the actual lane line and the first predicted lane line represented by the second anchor point.
[0082] In this step, based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, the positional offset of the first predicted lane line relative to the actual lane line is obtained. A second anchor point is then used to characterize this positional offset.
[0083] In this application, the marking of offset information based on the (second) anchor point is a novel technical solution. Furthermore, considering the stability of the anchor point itself, using the anchor point to mark the offset information ensures the accuracy of the marking.
[0084] S108: Train the detection model based on the second marked lane line information of the target sample image and the target sample image.
[0085] In this step, the second sub-model in the detection model is trained based on the positional offset of the first predicted lane line relative to the actual lane line in the target sample image and the target sample image.
[0086] If we abstract the mathematical expression of the second sub-model as the formula y2 = f2(x2, y1), then training the second sub-model means treating each target sample image as x2 in the formula, the first predicted lane line of each target sample image as y1 in the formula, and the second marked lane line information of each target sample image as y2 in the formula. Given the input x2 and output y2 in the formula, the second sub-model is trained to obtain a better f2. Specifically, given the input target sample image, f2 is continuously adjusted so that the output y2' obtained under the given f2 and input target sample image is as close as possible to the known y2.
[0087] It is understood that the above is just an example, and the mathematical expression of the second sub-model can be any reasonable formula, not limited to the one shown above.
[0088] The detection model in this application includes a first model and a second model. If the first model and the second model have been trained, the detection model can be considered to have been trained.
[0089] In the schemes shown in S101 to S108, schemes S101 to S104 utilize a first anchor point to train the first sub-model. Using the first anchor point, the position of the lane lines in the sample image is represented, accurately indicating the lane lines' location within the image, thus enabling accurate training of the first sub-model. Schemes S105 to S108 utilize a second anchor point to train the second sub-model. Using the second anchor point, the positional offset between the actual lane lines and the first predicted lane lines is represented, providing accurate offset information, thus enabling accurate training of the second sub-model. The combination of two anchor points (the first anchor point and the second anchor point) achieves precise training of the detection model, providing technical support for accurate detection of different types of lane lines.
[0090] In some embodiments, the actual lane lines of each sample image include multiple actual lane points in each sample image. The technical solution in this application for obtaining the first marked lane line information of each sample image based on the actual lane lines in each sample image can be implemented through the following methods:
[0091] From the grid of each sample image, determine the target grid into which each actual lane point of each sample image falls; based on the position of each first anchor point located in each target grid and the offset of each actual lane point in each target grid relative to each first anchor point, obtain the first marked lane line information of the sample image.
[0092] In practical applications, the actual lane lines in the sample image are composed of multiple actual lane points. Let's take an example where the actual lane points include the two endpoints and the midpoint of the actual lane line.
[0093] Given the location of the actual lane lines in the sample image, it is easy to determine the locations of the two endpoints constituting the actual lane lines in the sample image. Assume that... Figure 5 The image shown is a sample image. The two endpoints in this scene are... Figure 5The starting point A1 and the ending point C1 are defined in the actual lane line. Among the remaining points forming the actual lane line (excluding the starting and ending points), a point is selected where the sum of its distance to the starting point A1 and its distance to the ending point C1 minimizes the error compared to the actual lane line length. This selected point is used as the intermediate point. In this scenario, point B1 is assumed to be the selected intermediate point.
[0094] Understandable. Figure 5 To make this scheme clearer, the starting and ending points (A1 and C1) and the middle point B1 found among the actual lane points constituting the actual lane line are shown as deviating from the actual lane line. In reality, the starting and ending points and the middle point found among the actual lane points constituting the actual lane line should be located on the actual lane line. Connecting adjacent points among the starting point A1, the middle point B1, and the ending point C1, specifically using straight lines, yields the following... Figure 5 The lines A1B1 and B1C1 are shown.
[0095] In each grid of the sample image, determine which grids contain actual lane points and consider them as target grids. Assume grid 1 contains the starting point A1 of an actual lane line, grid 2 contains the midpoint B1 of an actual lane line, and grid 3 contains the ending point C1 of an actual lane line; grids 1-3 are the target grids. Select the top-left corner of grids 1-3 as the (first) anchor point. Knowing the position of starting point A1 in grid 1, the position of midpoint B1 in grid 2, and the position of ending point C1 in grid 3, it is easy to determine the offset of starting point A1 relative to the (first) anchor point in grid 1, the offset of midpoint B1 relative to the (first) anchor point in grid 2, and the offset of ending point C1 relative to the (first) anchor point in grid 3. Knowing the offset of each point in the actual lane line relative to the (first) anchor point in the grid it falls into, the first anchor point can be used to represent the position of each point.
[0096] Specifically, assuming that after the aforementioned processing, the offset coordinates of the first endpoint A1 are (a1, b1), the offset coordinates of the middle point B1 are (a2, b2), and the offset coordinates of the last endpoint C1 are (a3, b3), then the coordinates (a1, b1) represent the offset of the first endpoint 1 relative to the position of the (first) anchor point of grid 1; the coordinates (a2, b2) of the middle point B1 represent the offset of the middle point 2 relative to the position of the (first) anchor point of grid 2; and the coordinates (a3, b3) of the last endpoint C1 represent the offset of the last endpoint 3 relative to the position of the (first) anchor point of grid 3. For the first, last, and middle endpoints, the above offsets are added to the positions of their respective (first) anchor points in the sample image to obtain the position information of these three points in the sample image. The set of position information for each point can be considered as a marker of the lane line position in the sample image using the first anchor point. That is, the set of position information for each point can be used as the first marker of lane line information.
[0097] The aforementioned scheme uses a (first) anchor point to mark the lane line positions in the sample image. Considering the stability of the (first) anchor point itself, using it to mark the lane line positions ensures the accuracy of the lane line marking. The accuracy of the lane line marking guarantees the accuracy of the training of the first sub-model.
[0098] In some embodiments, such as Figure 2 As shown, the technical solution for obtaining the second marked lane line information of the target sample image based on the first predicted lane line and the actual lane line in the target sample image can be implemented through the following scheme:
[0099] S201: Based on the position of the second anchor point in the target sample image and the first predicted lane line, determine the target perpendicular line; wherein, the target perpendicular line is a perpendicular line passing through the second anchor point and perpendicular to the first predicted lane line.
[0100] assumed Figure 5 The image shown is the target sample image. Inputting the target sample image into the trained first sub-model yields the first predicted lane line formed by lines A1B1 and B1C1. Among the grids divided in the target sample image, grids containing the first predicted lane line are selected. These selected grids are called sub-grids of the target sample image. That is, a sub-grid is the grid through which the first predicted lane line passes in the target sample image. One or more points are selected on the diagonal of each sub-grid as the (second anchor point) of that sub-grid.
[0101] For example, assuming subgrid 1 is a grid through which the first predicted lane line passes, point o is selected on the diagonal of subgrid 1 as a (second) anchor point. A perpendicular line oE is drawn from point o to the line A1B1. Perpendicular line oE is the target perpendicular line. The above example demonstrates drawing a perpendicular line using a (second) anchor point selected on the diagonal of subgrid 1. In practical applications, if multiple (second) anchor points are selected on the diagonal of subgrid 1, a similar scheme is needed to draw a perpendicular line to the first predicted lane line through each (second anchor point), thus obtaining multiple target perpendicular lines for the same subgrid. Each subgrid in the target sample image containing the first predicted lane line can be processed according to this scheme to obtain target perpendicular lines for the entire target sample image.
[0102] S202: Based on the target vertical line and the actual lane lines in the target sample image, obtain the second marked lane line information of the target sample image.
[0103] During implementation, the intersection of the target perpendicular line and the first predicted lane line of the target sample image can be obtained; the intersection of the target perpendicular line and the actual lane line of the target sample image can be obtained; based on the intersection of the target perpendicular line and the first predicted lane line of the target sample image, and the intersection of the target perpendicular line and the actual lane line of the target sample image, the second marked lane line information of the target sample image can be obtained.
[0104] Combination Figure 5 As shown, taking the target perpendicular line oE as an example, the intersection of perpendicular line oE and the connecting line A1B1 is point D, and the intersection of perpendicular line oE and the actual lane line is point E. Points E and D form line segment DE. Line segment DE can be regarded as the offset of the first predicted lane line from the actual lane line at point D. Performing the above processing on all target perpendicular lines of the entire target sample image yields the offset of each point on the first predicted lane line relative to the actual lane line. Collecting the offset information of each point on the first predicted lane line relative to the actual lane line yields the offset of the first predicted lane line relative to the actual lane line. That is, the second marked lane line information of the target sample image is obtained.
[0105] In this application, offset information is labeled based on the (second) anchor point. This is a novel technical solution. Considering the stability of the anchor point itself, using the anchor point to label the offset information ensures the accuracy of the offset information labeling, thereby ensuring accurate training of the second sub-model.
[0106] In summary, the training scheme for the detection model can be considered as follows: the first anchor point is used to mark the lane line position, and the second anchor point is used to mark the offset information. The marked information is then used to train both the first and second sub-models. This scheme can be viewed as a training method using information marked by two types of anchor points. The first anchor point, placed on the grid, easily captures complete lane line information and is less prone to lane line interruptions. The second anchor point, placed at a specific location within the grid, marks the offset information. The detection model trained using these two anchor points ensures training accuracy.
[0107] Figure 3 A block diagram illustrating the implementation of the training method for the detection model in an embodiment of this application is shown. Figure 3 As shown, the first and second sub-models in the detection model are trained respectively.
[0108] In the training scheme for the first sub-model, the training samples are the sample images, and the sample labels are the first lane marking information of each sample image. The first lane marking information is obtained through the aforementioned related scheme. Given the input sample images, the model parameters of the first sub-model f1 are continuously adjusted so that the output of the first sub-model continuously fits to the sample labels of the first sub-model.
[0109] After the first sub-model is trained, some or all of the target sample images selected from each sample image are input into the trained first sub-model to obtain the first predicted lane line data that can be used as the target sample image for the training of the second sub-model.
[0110] In the training scheme for the second sub-model, the training samples required are the target sample images, and the sample labels are the second-marked lane line information of each target sample image. The second-marked lane line information is obtained through the aforementioned related scheme. Given the target sample images as input, the model parameters of the second sub-model f2 are continuously adjusted so that the output of the second sub-model continuously fits to the sample labels of the second sub-model.
[0111] This application proposes a detection model capable of predicting or detecting different types of lane lines. Through a training scheme, an accurate detection model can be obtained. By utilizing this accurate detection model to predict different types of lane lines, the accuracy of lane line prediction is improved.
[0112] The above describes the training scheme of this application. After the first and second sub-models of this application are trained, the detection model is trained. The detection model is tested using a test set (including images of lane lines in motion). When the precision and / or recall of the model obtained after testing both meet expectations, the detection model can be put into use. That is, the detection model is used to detect lane lines in the image to be tested. The testing process is not the focus of this application and will not be described in detail here.
[0113] Figure 4 A schematic diagram illustrating the implementation flow of the lane line detection method in an embodiment of this application is shown. The lane line detection method is applied in a driving device. Figure 4 As shown, the method includes:
[0114] S401: Obtain the image to be detected, the image to be detected corresponds to a preset grid, and the first anchor point is located in the grid of the image to be detected.
[0115] In this step, the image to be detected can be an image obtained by the image acquisition device of the driving equipment from the driving environment. That is, the image to be detected is obtained by acquiring images of the driving environment through the image acquisition device. The number of images to be detected can be one or multiple. For the acquired image to be detected, the image to be detected is divided into grids according to a pre-set grid size.
[0116] Here, it is preferable that the size of the image to be detected, the size of the grid in which it is divided, and the size of the sample image used during training, as well as the size of the grid in which the sample image is divided, are consistent. Within each grid of the image to be detected, a position within that grid, such as the top-left, top-right, bottom-left, or bottom-right corner, is selected as the first anchor point of the image to be detected. For example, consistent with the practice of selecting the top-left corner of the grid as the (first) anchor point during training, when detecting lane lines in the image to be detected, the top-left corner of each grid is also selected as the (first) anchor point. It can be understood that since the size of the image to be detected and the grid size are known, and the positions of each anchor point within each grid are also known, it is easy to determine the position of each grid within the image to be detected, which is then used to predict the reference lane lines in the image to be detected.
[0117] S402: Based on the first anchor point, predict the reference lane line of the image to be detected.
[0118] In this step, the image to be detected and its first anchor point are input into the first sub-model of the detection model to obtain the target relative position output by the first sub-model. The target relative position represents the position of the reference lane line in the image to be detected relative to the first anchor point.
[0119] If the image to be detected is as follows Figure 5 The image shown is input to the detection model, specifically the first sub-model, with the image to be detected and the position information of the first anchor point. Under this input, the first sub-model outputs the position of each reference (lane) point that constitutes the reference lane line relative to the first anchor point in the grid into which each reference point falls.
[0120] For example, if the reference points constituting the reference lane lines include Figure 5 The information output by the first sub-model for points A1, B1, and C1 includes the position information of point A1 relative to the first anchor point in the grid where point A1 falls, the position information of point B1 relative to the first anchor point in the grid where point B1 falls, and the position information of point C1 relative to the first anchor point in the grid where point C1 falls. The information output by the first sub-model is the relative position information of the reference points represented by the first anchor point.
[0121] The position information of a reference point relative to the first anchor point in the grid it falls into is actually the offset of the reference point relative to that first anchor point. Next, based on the offset of each reference point relative to its first anchor point in the grid, and the position of each first anchor point—that is, based on the relative position of the target and the position of the first anchor points—the reference lane lines of the image to be detected are obtained. For example, the relative position information of each reference point represented by the first anchor points and the position information of each first anchor point can be added together to obtain the reference lane lines of the image to be detected.
[0122] Taking three reference points constituting the reference lane line—A1, B1, and C1—as an example, for point A1, the first sub-model outputs the coordinates of point A1 relative to the anchor point (e.g., anchor point 1) in grid 1 where point A1 falls. For point B1, the first sub-model outputs the coordinates of point B1 relative to the anchor point (e.g., anchor point 2) in grid 2 where point B1 falls. For point C1, the first sub-model outputs the coordinates of point C1 relative to the anchor point (e.g., anchor point 3) in grid 3 where point C1 falls. The coordinates of point A1 relative to anchor point 1 are added to the coordinates of anchor point 1 to obtain the position of point A1 in the image to be detected. The coordinates of point B1 relative to anchor point 2 are added to the coordinates of anchor point 2 to obtain the position of point B1 in the image to be detected. The coordinates of point C1 relative to anchor point 3 are added to the coordinates of anchor point 3 to obtain the position of point C1 in the image to be detected. At points A1, B1, and C1, draw a line connecting any two adjacent points. This line can be considered as the reference lane line for the image to be detected.
[0123] The above explanation uses points A1, B1, and C1 as an example. In practical applications, there are many reference points that constitute the reference lane line. Therefore, by connecting adjacent points based on the positions of a large number of reference points in the image to be detected, the obtained reference lane line will be more accurate.
[0124] In the aforementioned scheme, the prediction or detection of the target's relative position is performed by the first sub-model that has been trained accurately, which ensures the accuracy of the target's relative position and thus obtains a precise reference lane line.
[0125] S403: Based on the reference lane line, determine the second anchor point of the image to be detected. The second anchor point is located in a sub-grid, which is a grid in which the reference lane line exists.
[0126] In this step, the grids through which the reference lane line passes are selected from the grids of the image to be detected. These selected grids are then used as sub-grids. One or more points are selected on the diagonal of each sub-grid as the second anchor points in this application, thereby determining the second anchor points of the image to be detected.
[0127] S404: Based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line, predict the offset information of the reference lane line.
[0128] During implementation, the image to be detected, the second anchor point of the image to be detected, and the reference lane line are input into the second sub-model of the detection model to obtain the offset information of the reference lane line output by the second sub-model.
[0129] Considering that the reference lane line is composed of various reference (lane) points, the information output by the second sub-model can be the offset information of each reference point that constitutes the reference lane line. For example, if... Figure 5 The image shown is the image to be detected. The offset information of a reference point, such as point D, that constitutes the reference lane line can be the length of line segment DE.
[0130] S405: Based on the reference lane line and the offset information of the reference lane line, obtain the target lane line of the image to be detected.
[0131] During implementation, each target lane point is obtained based on each reference lane point and its offset information; based on each target lane point, the target lane line of the image to be detected is obtained.
[0132] For example, taking three reference (lane) points constituting the reference lane line as points A1, B1, and C1, the coordinates of point A1 are added to its offset information (offset length) to obtain the coordinates of a point, such as point 1. The coordinates of point B1 are added to its offset information (offset length) to obtain the coordinates of a point, such as point 2. The coordinates of point C1 are added to its offset information (offset length) to obtain the coordinates of a point, such as point 3. Points 1, 2, and 3 can be considered as target lane points. Based on the coordinates of points 1, 2, and 3 in the image to be detected, a line is drawn connecting adjacent points. This line can be considered as the target lane line of the image to be detected.
[0133] As you can understand, the above example uses three reference (lane) points. In practical applications, there are multiple reference points. Based on the coordinates and offsets of all reference points, multiple target lane points can be obtained. The target lane line formed by all target lane points is more accurate.
[0134] In S401 to S405, the first anchor point is used to predict the reference lane line, and the second anchor point is used to predict the reference lane line offset information. Due to the stability of the anchor points, the accuracy of the prediction of the reference lane line and offset information can be guaranteed.
[0135] Furthermore, in this application, if the first anchor point is referred to as the large anchor point and the second anchor point as the small anchor point, then the large anchor point is used for coarse prediction of lane lines, and the small anchor point is used for correction of the lane lines coarsely predicted by the large anchor point. By combining the large and small anchor points, accurate prediction of lane lines is achieved. Because the large anchor point is a point in the grid, it has a large area of interest in the image. Therefore, using the large anchor point, it is easy to capture complete lane line information, and it is less likely to produce lane line interruptions. The small anchor point is a point on the diagonal of the grid. Compared to the large anchor point, it has a smaller area of interest in the image, but its prediction accuracy is high, enabling the correction of lane lines.
[0136] The lane line prediction scheme proposed in this application, which combines large and small anchor points, can accurately predict lane lines regardless of their number, direction, curvature, or location. Specifically, this application utilizes two types of anchor points (a first anchor point and a second anchor point) to predict various types of lane lines while ensuring the accuracy of the prediction.
[0137] In this application, the sample image, target sample image, and test image are all preferably two-dimensional images. Two-dimensional images are used to train the detection model, specifically the first and second sub-models, to ensure accurate detection of lane lines in the two-dimensional image under test. That is, training and lane line detection are performed in the image coordinate system. In practical applications, during driving, such as when a car is in motion, the lane line detection scheme of this application can be used to detect lane lines in two-dimensional images. Based on the conversion relationship between the image coordinate system and the vehicle coordinate system, the lane lines in the two-dimensional image are converted to lane lines on the actual driving road. Accurate detection of lane lines in two-dimensional images ensures the accuracy of lane lines on the actual driving road, thereby enabling vehicles to better perform functions such as lane departure warning, lane keeping assist, and vehicle centering assist.
[0138] It is understandable that the aforementioned plan addresses the issue of... Figure 5 When providing an explanation, it is referred to Figure 5The illustration shows one of the two lane lines (the left lane line). In practical applications, both lane lines need to be processed as shown above. This allows for accurate training of the detection model and accurate detection of different types of lane lines.
[0139] This application also provides a lane line detection device, such as Figure 6 As shown, it includes:
[0140] The first acquisition unit 601 is used to acquire an image to be detected, the image to be detected having a preset grid, and the first anchor point being located on the grid of the image to be detected;
[0141] The first prediction unit 602 is used to predict the reference lane line of the image to be detected based on the first anchor point;
[0142] The first determining unit 603 is used to determine a second anchor point of the image to be detected based on a reference lane line. The second anchor point is located in a sub-grid, and the sub-grid is a grid in which the reference lane line exists.
[0143] The second prediction unit 604 is used to predict the offset information of the reference lane line based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line.
[0144] The second acquisition unit 605 is used to obtain the target lane line of the image to be detected based on the reference lane line and the offset information of the reference lane line.
[0145] In some embodiments, the first prediction unit 602 is configured to:
[0146] The image to be detected and its first anchor point are input into the first sub-model of the detection model to obtain the target relative position output by the first sub-model. The target relative position represents the position of the reference lane line of the image to be detected relative to the first anchor point.
[0147] Based on the relative position of the target and the position of the first anchor point, the reference lane line of the image to be detected is obtained.
[0148] In some embodiments, the second prediction unit 604 is configured to:
[0149] The image to be detected, the second anchor point of the image to be detected, and the reference lane line are input into the second sub-model of the detection model to obtain the offset information of the reference lane line.
[0150] In some embodiments, the reference lane line includes a plurality of reference lane points; the second acquisition unit 605 is configured to:
[0151] Based on each reference lane point and its offset information, each target lane point is obtained;
[0152] Based on each target lane point, the target lane line of the image to be detected is obtained.
[0153] In some embodiments, the device further includes a first training unit for:
[0154] Obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid;
[0155] Determine the first anchor point for each sample image, which is located within the grid of each sample image;
[0156] Based on the actual lane lines in each sample image, the first marked lane line information of each sample image is obtained. The first marked lane line information of each sample image is the lane line position mark represented by the first anchor point of each sample image.
[0157] Based on each sample image and the first marked lane line information of each sample image, the first sub-model of the detection model is trained so that the trained first sub-model can output the relative position of the target.
[0158] In some embodiments, the device further includes a second training unit for:
[0159] Based on the target sample image and the first sub-model of the detection model, a first predicted lane line of the target sample image is obtained, wherein the target sample image is at least a portion of the sample images used when training the first sub-model;
[0160] Based on the first predicted lane line of the target sample image and the grid of the target sample image, a sub-grid of the target sample image is obtained. The sub-grid of the target sample image is a grid in the target sample image that contains the first predicted lane line, and the sub-grid has a preset second anchor point.
[0161] Based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, the second marked lane line information of the target sample image is obtained. The second marked lane line information is the positional offset between the actual lane line and the first predicted lane line based on the second anchor point.
[0162] Based on the second lane line information marked in the target sample image and the target sample image, a second sub-model of the detection model is trained so that the trained second sub-model can output offset information.
[0163] This application provides a training device for a detection model, such as... Figure 7 As shown, the device includes:
[0164] The first obtaining unit 701 is used to obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid.
[0165] The first determining unit 702 is used to determine the first anchor point of each sample image, wherein the first anchor point of each sample image is located in the grid of each sample image;
[0166] The second obtaining unit 703 is used to obtain the first marked lane line information of each sample image based on the actual lane lines in each sample image. The first marked lane line information of each sample image is a lane line position mark represented by the first anchor point of each sample image.
[0167] The first training unit 704 is used to train the detection model based on each sample image and the first marked lane line information of each sample image;
[0168] The third obtaining unit 705 is used to obtain a first predicted lane line of the target sample image based on the target sample image and the detection model, wherein the target sample image is at least a portion of the sample images;
[0169] The fourth obtaining unit 706 is used to obtain a sub-grid of the target sample image based on the first predicted lane line of the target sample image and the grid of the target sample image. The sub-grid of the target sample image is a grid in the target sample image in which the first predicted lane line exists. The sub-grid has a second anchor point preset.
[0170] The fifth obtaining unit 707 is used to obtain second marked lane information of the target sample image based on the first predicted lane line of the target sample image and the actual lane line in the target sample image. The second marked lane information is the position offset of the actual lane line and the first predicted lane line represented by the second anchor point.
[0171] The second training unit 708 is used to train the detection model based on the second marked lane line information of the target sample image and the target sample image.
[0172] In some embodiments, the actual lane lines of each sample image include multiple actual lane points of each sample image; the second obtaining unit 703 is configured to:
[0173] From the grid of each sample image, determine the target grid into which each actual lane point of each sample image falls;
[0174] Based on the position of each first anchor point located in each target grid and the offset of each actual lane point in each target grid relative to each first anchor point, the first marked lane line information of the sample image is obtained.
[0175] In some embodiments, the fifth obtaining unit 707 is configured to:
[0176] Based on the position of the second anchor point in the target sample image and the first predicted lane line, a target perpendicular line is determined; wherein, the target perpendicular line is a perpendicular line passing through the second anchor point and perpendicular to the first predicted lane line;
[0177] Based on the target vertical line and the actual lane lines in the target sample image, the second marked lane line information of the target sample image is obtained.
[0178] In some embodiments, the fifth obtaining unit 707 is further configured to: obtain the intersection point of the target vertical line and the first predicted lane line of the target sample image;
[0179] Obtain the intersection point of the target perpendicular line and the actual lane line in the target sample image;
[0180] The second marked lane line information of the target sample image is obtained based on the intersection of the target perpendicular line and the first predicted lane line of the target sample image, and the intersection of the target perpendicular line and the actual lane line of the target sample image.
[0181] It should be noted that the lane line detection device and the detection model training device in this application embodiment are similar in principle to the lane line detection method and the detection model training method described above. Therefore, the implementation process and implementation principle of the lane line detection device and the detection model training device can be referred to the implementation process and implementation principle description of the aforementioned method, and the repeated parts will not be repeated.
[0182] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.
[0183] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned lane detection method and / or detection model training method.
[0184] For a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the aforementioned lane detection method and / or detection model training method.
[0185] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0186] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0187] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0188] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as lane line detection methods and detection model training methods. For example, in some embodiments, the lane line detection method and the detection model training method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the lane line detection method and detection model training method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured in any other suitable manner (e.g., by means of firmware) to perform a lane detection method or a method for training a detection model.
[0189] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0190] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0191] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0192] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0193] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0194] A computer system may include clients and servers. Clients and servers are generally geographically separated and typically interact via a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server incorporating blockchain technology. The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A lane line detection method, characterized in that, include: Obtain an image to be detected, the image to be detected having a corresponding preset grid, and the first anchor point is located on the grid of the image to be detected; Based on the first anchor point, predict the reference lane line of the image to be detected; Based on the reference lane line, a second anchor point is determined in the image to be detected. The second anchor point is located in a sub-grid, which is a grid in which the reference lane line exists. Based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line, predict the offset information of the reference lane line; The target lane line of the image to be detected is obtained based on the reference lane line and its offset information.
2. The method according to claim 1, characterized in that, The step of predicting the reference lane line of the image to be detected based on the first anchor point includes: The image to be detected and its first anchor point are input into the first sub-model of the detection model to obtain the target relative position output by the first sub-model. The target relative position represents the position of the reference lane line of the image to be detected relative to the first anchor point. Based on the relative position of the target and the position of the first anchor point, the reference lane line of the image to be detected is obtained.
3. The method according to claim 1, characterized in that, The prediction of the offset information of the reference lane line based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line includes: The image to be detected, the second anchor point of the image to be detected, and the reference lane line are input into the second sub-model of the detection model to obtain the offset information of the reference lane line.
4. The method according to any one of claims 1 to 3, characterized in that, The reference lane line includes multiple reference lane points; The process of obtaining the target lane line of the image to be detected based on the reference lane line and its offset information includes: Based on each reference lane point and its offset information, each target lane point is obtained; Based on each target lane point, the target lane line of the image to be detected is obtained.
5. The method according to claim 2, characterized in that, Also includes: Obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid; Determine the first anchor point for each sample image, which is located within the grid of each sample image; Based on the actual lane lines in each sample image, the first marked lane line information of each sample image is obtained. The first marked lane line information of each sample image is the lane line position mark represented by the first anchor point of each sample image. Based on each sample image and the first marked lane line information of each sample image, the first sub-model of the detection model is trained so that the trained first sub-model can output the relative position of the target.
6. The method according to claim 3, characterized in that, Also includes: Based on the target sample image and the first sub-model of the detection model, a first predicted lane line of the target sample image is obtained, wherein the target sample image is at least a portion of the sample images used when training the first sub-model; Based on the first predicted lane line of the target sample image and the grid of the target sample image, a sub-grid of the target sample image is obtained. The sub-grid of the target sample image is a grid in the target sample image that contains the first predicted lane line, and the sub-grid has a preset second anchor point. Based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, the second marked lane line information of the target sample image is obtained. The second marked lane line information is the positional offset between the actual lane line and the first predicted lane line based on the second anchor point. Based on the second lane line information marked in the target sample image and the target sample image, a second sub-model of the detection model is trained so that the trained second sub-model can output offset information.
7. A method for training a detection model, characterized in that, include: Obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid; Determine the first anchor point for each sample image, which is located within the grid of each sample image; Based on the actual lane lines in each sample image, the first marked lane line information of each sample image is obtained. The first marked lane line information of each sample image is the lane line position mark represented by the first anchor point of each sample image. The detection model is trained based on each sample image and the first labeled lane line information of each sample image; Based on the target sample image and the detection model, a first predicted lane line is obtained from the target sample image, wherein the target sample image is at least a portion of the sample images; Based on the first predicted lane line of the target sample image and the grid of the target sample image, a sub-grid of the target sample image is obtained. The sub-grid of the target sample image is a grid in the target sample image that contains the first predicted lane line, and the sub-grid has a preset second anchor point. Based on the first predicted lane line in the target sample image and the actual lane line in the target sample image, the second marked lane line information of the target sample image is obtained. The second marked lane line information is the positional offset between the actual lane line and the first predicted lane line based on the second anchor point. The detection model is trained based on the second marked lane line information of the target sample image and the target sample image itself.
8. The method according to claim 7, characterized in that, The actual lane lines in each sample image include multiple actual lane points in each sample image; The process of obtaining the first marked lane line information for each sample image based on the actual lane lines in each sample image includes: From the grid of each sample image, determine the target grid into which each actual lane point of each sample image falls; Based on the position of each first anchor point located in each target grid and the offset of each actual lane point in each target grid relative to each first anchor point, the first marked lane line information of the sample image is obtained.
9. The method according to claim 7, characterized in that, The process of obtaining second marked lane line information for the target sample image based on the first predicted lane lines and the actual lane lines in the target sample image includes: Based on the position of the second anchor point in the target sample image and the first predicted lane line, a target perpendicular line is determined; wherein, the target perpendicular line is a perpendicular line passing through the second anchor point and perpendicular to the first predicted lane line; Based on the target vertical line and the actual lane lines in the target sample image, the second marked lane line information of the target sample image is obtained.
10. The method according to claim 9, characterized in that, The process of obtaining the second marked lane line information of the target sample image based on the target vertical line and the actual lane lines in the target sample image includes: Obtain the intersection point of the target perpendicular line and the first predicted lane line in the target sample image; Obtain the intersection point of the target perpendicular line and the actual lane line in the target sample image; The second marked lane line information of the target sample image is obtained based on the intersection of the target perpendicular line and the first predicted lane line of the target sample image, and the intersection of the target perpendicular line and the actual lane line of the target sample image.
11. A lane line detection device, characterized in that, include: The first acquisition unit is used to acquire the image to be detected, the image to be detected corresponds to a preset grid, and the first anchor point is located at the grid of the image to be detected; The first prediction unit is used to predict the reference lane line of the image to be detected based on the first anchor point; The first determining unit is used to determine a second anchor point of the image to be detected based on a reference lane line. The second anchor point is located in a sub-grid, and the sub-grid is a grid in which the reference lane line exists. The second prediction unit is used to predict the offset information of the reference lane line based on the image to be detected, the second anchor point of the image to be detected, and the reference lane line. The second acquisition unit is used to obtain the target lane line of the image to be detected based on the reference lane line and the offset information of the reference lane line.
12. A training device for a detection model, comprising: The first obtaining unit is used to obtain each sample image and the actual lane lines in each sample image, wherein each sample image corresponds to a preset grid. The first determining unit is used to determine the first anchor point of each sample image, wherein the first anchor point of each sample image is located in the grid of each sample image; The second obtaining unit is used to obtain the first marked lane line information of each sample image based on the actual lane lines in each sample image. The first marked lane line information of each sample image is a lane line position mark represented by the first anchor point of each sample image. The first training unit is used to train the detection model based on each sample image and the first labeled lane line information of each sample image; The third obtaining unit is used to obtain a first predicted lane line of the target sample image based on the target sample image and the detection model, wherein the target sample image is at least a portion of the sample images; The fourth obtaining unit is used to obtain a sub-grid of the target sample image based on the first predicted lane line of the target sample image and the grid of the target sample image. The sub-grid of the target sample image is a grid in the target sample image in which the first predicted lane line exists, and the sub-grid has a preset second anchor point. The fifth obtaining unit is used to obtain second marked lane line information of the target sample image based on the first predicted lane line of the target sample image and the actual lane line in the target sample image. The second marked lane line information is the position offset between the actual lane line and the first predicted lane line represented by the second anchor point. The second training unit is used to train the detection model based on the second marked lane line information of the target sample image and the target sample image.
13. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-6 and / or the method of any one of claims 7-10.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6, and / or the method according to any one of claims 7-10.
Citation Information
Patent Citations
Lane line detection method and device, computer equipment and storage medium
CN109740469A
Lane line detection method and device, computer equipment and storage medium
CN115019268A