Label processing method and device

By obtaining and optimizing the coordinate information and category information of lane lines, compatible tag json files are generated, which solves the resource waste and high cost problems caused by changes in lane line detection methods in the existing technology, and realizes the compatibility of multi-class models of tags and Improved data utilization.

CN118887634APending Publication Date: 2024-11-01BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410866578.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the prior art, changes in lane line detection methods require frequent replacement of tags, resulting in waste of resources and high manpower and financial costs, and lack of compatible tag processing methods.

Method used

By obtaining lane line coordinate information and category information in the initial label json file, generating mask diagrams, filtering and optimizing the level and short lane line points sets, generating compatible label json files, suitable for multi-class models.

Benefits of technology

It reduces the cost of manual labeling, improves the utilization rate of existing data, avoids repeated labeling and resource waste, and realizes compatibility of lane line labels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887634A_ABST
    Figure CN118887634A_ABST
Patent Text Reader

Abstract

The invention discloses a label processing method and device. Coordinate information and category information of lane lines in the initial label json file are obtained; and based on the coordinate information, assigning a lane line, generating a mask graph, and obtaining a lane line point set according to the mask graph. And based on the lane line point set, screening out a horizontal lane line and a short lane line, and carrying out optimization processing on the horizontal lane line and the short lane line. And finally, generating a label json file according to the optimized lane line point set and category information. Lane line labels suitable for one type of models are processed into lane line labels compatible with multiple types of models, and the processed labels can be used for segmentation type and detection type models. Existing labels do not need to be abandoned repeatedly, manual labeling is carried out again, and waste of manpower, financial resources and time is avoided. According to the compatible label processing method, the manual operation cost can be effectively reduced, and the utilization rate of existing data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for label processing. Background Art

[0002] Lane line perception is an important part of the intelligent driving system. The use of perception and positioning algorithms can obtain lane line ID, type (dashed line, white line, etc.), length and other related information. This information plays a vital role in vehicle driving path constraints, vehicle body position constraints, etc. The deep learning methods in lane line perception algorithms are divided into segmentation-based methods and detection-based methods due to the different types of labels used. When using segmentation methods for lane line detection, polygon labels are usually used to segment lane lines, while when using detection methods, point line labels are usually used to detect the coordinates and category information of lane lines.

[0003] In the prior art, depending on the selected method, the labeler needs to use different labeling methods to label the lane lines in the image to obtain different types of labels. When the lane detection method changes, the previous type of label needs to be discarded and the lane lines need to be re-labeled, which not only makes the existing resources idle, but also consumes a lot of human resources, financial resources and time costs. Therefore, it is very important to develop a compatible label processing method. Summary of the invention

[0004] Based on the above problems, the present application provides a label processing method and device to develop a compatible label processing method.

[0005] The present application discloses a method for label processing, the method comprising:

[0006] Get the coordinate information and category information of the lane line in the initial label json file;

[0007] Based on the coordinate information, assigning values ​​to the lane lines to generate a mask map;

[0008] According to the mask image, a lane line point set is obtained;

[0009] Based on the lane line point set, horizontal lane lines and short lane lines are screened out, and the horizontal lane lines and the short lane lines are optimized;

[0010] A label json file is generated based on the optimized lane line point set and the category information.

[0011] Optionally, assigning a value to the lane line based on the coordinate information to generate a mask map includes:

[0012] Generate a two-dimensional array with the same size as the mask image;

[0013] In the two-dimensional array, each lane line is assigned a different number based on the coordinate information of each lane line;

[0014] The assigned two-dimensional array is saved as the mask map.

[0015] Optionally, acquiring a lane line point set according to the mask image includes:

[0016] Obtaining a distribution range of lane lines in the mask image;

[0017] Acquire the ordinate and abscissa of the lane line in the mask image according to the distribution range;

[0018] The ordinate and the abscissa are combined to obtain the lane line point set; the lane line is composed of points in the lane line point set.

[0019] Optionally, obtaining the ordinate and abscissa of the lane line in the mask image according to the distribution range includes:

[0020] Acquire first ordinate anchor points equidistantly according to the distribution range;

[0021] Obtaining the first ordinate according to the first ordinate anchor point;

[0022] Obtain a first horizontal coordinate set corresponding to each of the first vertical coordinate anchor points;

[0023] The first horizontal coordinate set is averaged to obtain the first horizontal coordinate.

[0024] Optionally, the filtering out horizontal lane lines and short lane lines based on the lane line point set, and optimizing the horizontal lane lines and the short lane lines, includes:

[0025] When the number of points in the lane line point set is equal to 2, the lane line is screened as a round of short lane lines;

[0026] When the number of points is less than or equal to 1, the lane line is filtered as a horizontal lane line;

[0027] Optimizing the horizontal lane lines and selecting the two-wheel short lane lines;

[0028] Short-line optimization is performed on the first round of short lane lines and the second round of short lane lines.

[0029] Optionally, the performing horizontal line optimization on the horizontal lane line includes:

[0030] Acquire a first horizontal coordinate anchor point equidistantly according to the distribution range;

[0031] Obtaining a first optimized horizontal coordinate according to the first horizontal coordinate anchor point;

[0032] Obtain a first optimized vertical coordinate set corresponding to each of the first horizontal coordinate anchor points;

[0033] Performing an average process on the first optimized vertical coordinate set to obtain a first optimized vertical coordinate;

[0034] The first optimized horizontal coordinate and the first optimized vertical coordinate are combined to obtain an optimized horizontal lane line point set.

[0035] Optionally, the step of screening out the two-wheel short lane line includes:

[0036] When the number of points in the optimized horizontal lane line point set is less than or equal to 1, the optimized horizontal lane line is screened as the two-wheel short lane line.

[0037] Optionally, short-line optimization is performed on the round of short lane lines, including:

[0038] Acquire a round of vertical coordinate anchor points at a first spacing according to the distribution range;

[0039] Obtaining a round of optimized vertical coordinates according to the said round of vertical coordinate anchor points;

[0040] Obtain a round of optimized horizontal coordinate sets corresponding to each of the round of vertical coordinate anchor points;

[0041] The abscissa set of the optimization round is averaged to obtain the abscissa of the optimization round.

[0042] The abscissa of the first round of optimization and the ordinate of the first round of optimization are combined to obtain a set of short lane line points of the first round of optimization.

[0043] Optionally, short-line optimization is performed on the two-wheel short lane line, including:

[0044] Acquire the second wheel horizontal coordinate anchor points at a first spacing according to the distribution range;

[0045] Obtaining two rounds of optimized horizontal coordinates according to the two rounds of horizontal coordinate anchor points;

[0046] Obtain a two-round optimized vertical coordinate set corresponding to each of the two-round horizontal coordinate anchor points;

[0047] Performing an average processing on the two-round optimization vertical coordinate set to obtain the two-round optimization vertical coordinate;

[0048] The two-round optimized horizontal coordinates and the two-round optimized vertical coordinates are combined to obtain a two-round optimized short lane line point set.

[0049] Based on the above-mentioned label processing method, the present application also discloses a label processing device, including: an information acquisition unit, a mask map generation unit, a set acquisition unit, a screening unit, and a label generation unit;

[0050] An information acquisition unit, used to obtain the coordinate information and category information of the lane line in the initial label json file;

[0051] A mask map generating unit, configured to assign a value to the lane line based on the coordinate information to generate a mask map;

[0052] A set acquisition unit, used for acquiring a lane line point set according to the mask image;

[0053] A screening unit, configured to screen out horizontal lane lines and short lane lines based on the lane line point set, and perform optimization processing on the horizontal lane lines and the short lane lines;

[0054] The label generation unit is used to generate a label json file according to the optimized lane line point set and the category information.

[0055] Optionally, the mask image generating unit includes:

[0056] An array generation subunit, used to generate a two-dimensional array having the same size as the mask image;

[0057] an assignment subunit, configured to assign a different number to each lane line in the two-dimensional array based on the coordinate information of each lane line;

[0058] The mask map generating subunit is used to save the assigned two-dimensional array as the mask map.

[0059] Optionally, the set acquisition unit includes:

[0060] A range acquisition subunit, used to obtain the distribution range of lane lines in the mask image;

[0061] A coordinate acquisition subunit, used for acquiring the ordinate and abscissa of the lane line in the mask image according to the distribution range;

[0062] The set acquisition subunit is used to combine the longitudinal coordinate and the horizontal coordinate to obtain the lane line point set; the lane line is composed of points in the lane line point set.

[0063] Optionally, the coordinate acquisition subunit includes:

[0064] A first ordinate anchor point acquisition subunit is used to acquire first ordinate anchor points equidistantly according to the distribution range;

[0065] A first ordinate acquisition subunit, configured to obtain the first ordinate according to the first ordinate anchor point;

[0066] A first horizontal coordinate set acquisition subunit is used to acquire a first horizontal coordinate set corresponding to each of the first vertical coordinate anchor points;

[0067] The first horizontal coordinate acquisition subunit is used to perform average processing on the first horizontal coordinate set to obtain the first horizontal coordinate.

[0068] Optionally, the screening unit comprises:

[0069] A round screening subunit, used for screening the lane line as a round of short lane lines when the number of points in the lane line point set is equal to 2;

[0070] A horizontal screening subunit, configured to screen the lane line as a horizontal lane line when the number of points is less than or equal to 1;

[0071] A second round screening subunit, used for performing horizontal line optimization on the horizontal lane lines and screening out second round short lane lines;

[0072] The short line optimization subunit is used to perform short line optimization on the first round of short lane lines and the second round of short lane lines.

[0073] Optionally, the second round screening subunit comprises:

[0074] A first horizontal coordinate anchor point acquisition subunit is used to acquire first horizontal coordinate anchor points equidistantly according to the distribution range;

[0075] A first optimized horizontal coordinate obtaining subunit, configured to obtain a first optimized horizontal coordinate according to the first horizontal coordinate anchor point;

[0076] A first optimized vertical coordinate set acquisition subunit is used to acquire a first optimized vertical coordinate set corresponding to each of the first horizontal coordinate anchor points;

[0077] A first optimized ordinate acquisition subunit is used to average the first optimized ordinate set to obtain a first optimized ordinate;

[0078] The first optimized set acquisition subunit is used to combine the first optimized horizontal coordinate and the first optimized vertical coordinate to obtain an optimized horizontal lane line point set.

[0079] Optionally, the second round screening subunit comprises:

[0080] The two-round short line screening subunit is used to screen the optimized horizontal lane line as the two-round short lane line when the number of points in the optimized horizontal lane line point set is less than or equal to 1.

[0081] Optionally, the short-line optimization subunit includes:

[0082] A round of vertical coordinate anchor point acquisition subunit, used to acquire a round of vertical coordinate anchor points at a first spacing according to the distribution range;

[0083] A round of optimization vertical coordinate acquisition subunit, used to obtain a round of optimization vertical coordinate according to the round of vertical coordinate anchor point;

[0084] A one-round optimization horizontal coordinate set acquisition subunit is used to acquire a one-round optimization horizontal coordinate set corresponding to each one-round vertical coordinate anchor point;

[0085] The one-round optimization horizontal coordinate acquisition subunit is used to perform an average processing on the one-round optimization horizontal coordinate set to obtain the one-round optimization horizontal coordinate.

[0086] The one-round optimization set acquisition subunit is used to combine the one-round optimization horizontal coordinate and the one-round optimization vertical coordinate to obtain a one-round optimization short lane line point set.

[0087] Optionally, the short-line optimization subunit includes:

[0088] A second-round horizontal coordinate anchor point acquisition subunit is used to acquire the second-round horizontal coordinate anchor points at a first spacing according to the distribution range;

[0089] A second round optimization horizontal coordinate acquisition subunit, used for obtaining the second round optimization horizontal coordinate according to the second round horizontal coordinate anchor point;

[0090] A second-round optimization vertical coordinate set acquisition subunit is used to acquire a second-round optimization vertical coordinate set corresponding to each second-round horizontal coordinate anchor point;

[0091] A second round optimization vertical coordinate acquisition subunit is used to average the second round optimization vertical coordinate set to obtain the second round optimization vertical coordinate;

[0092] The two-round optimization set acquisition subunit is used to combine the two-round optimization horizontal coordinates and the two-round optimization vertical coordinates to obtain a two-round optimized short lane line point set.

[0093] The present application discloses a method and device for label processing. Obtain the coordinate information and category information of the lane line in the initial label json file. Based on the coordinate information, assign values ​​to the lane lines, generate a mask map, and then obtain a lane line point set based on this. Based on the lane line point set, screen out horizontal lane lines and short lane lines, and optimize them. Finally, generate a label json file based on the optimized lane line point set and category information. The lane line labels suitable for one type of model are processed into lane line labels that are compatible with multiple types of models, and the processed labels can be used for segmentation and detection models. There is no need to repeatedly abandon existing labels and re-annotate manually, avoiding waste of manpower, financial resources and time. This compatible label processing method can effectively reduce manual operation costs and improve the utilization rate of existing data. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0095] Figure 1a A flowchart of a label processing method disclosed in an embodiment of the present application;

[0096] Figure 1b A schematic diagram of a mask image generated for lane lines in a single image disclosed in an embodiment of the present application;

[0097] Figure 1c A schematic diagram of a mask image generated for lane lines in all images disclosed in the embodiments of this application;

[0098] Figure 2a A flowchart of another label processing method disclosed in an embodiment of the present application;

[0099] Figure 2b A schematic diagram of the lane line distribution range disclosed in the embodiment of this application;

[0100] Figure 2c A schematic diagram of horizontal lane lines disclosed in an embodiment of the present application;

[0101] Figure 3 A schematic diagram of the structure of a label processing device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0102] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0103] Embodiment 1: This application discloses a label processing method.

[0104] For details, please refer to Figure 1a A label processing method disclosed in this embodiment includes the following steps:

[0105] Step 101: Obtain the coordinate information and category information of the lane line in the initial label json file.

[0106] When using a deep learning model for lane line perception, depending on the selected method, the labeler usually uses polygon labels or point line labels in the labe lme software to label the lane lines in the image and form a json file, which contains parameter information of the lane lines on the image. In the method described in this embodiment, the coordinate information and category information of the lane lines can be obtained from the json file containing the initial labels.

[0107] Specifically, as an optional method, read the initial label json file and use two dictionaries to save the lane line coordinate information dict_pos and class information dict_class respectively. Among them, dict_pos is in the following form:

[0108]

[0109] In the formula, the key value "1 to z" of the dictionary represents the instance information of the lane line, that is, there are z lane lines in a certain picture, and "1 to n" represents the number of coordinate points of a lane line.

[0110] Step 102: Based on the coordinate information, assign values ​​to the lane lines to generate a mask map.

[0111] In the method described in this embodiment, when converting the json file into a mask map, it is necessary to assign values ​​to the positions corresponding to the lane lines. When there is only the category of the lane line but no instance information in the assignment, one or more lane lines will be included under the same vertical coordinate in the mask map, that is, the value of a mask corresponds to multiple lane lines in different positions. The instance information here can be understood as the unique identifier of the lane line. For example, there are 4 lane lines in a mask map, two of which are single white solid lines, that is, the solid line categories are the same, but they are distributed in different positions. In order to distinguish these two lines, they can be numbered as single white solid line 1 and single white solid line 2, and the information that distinguishes these two single white solid lines is the instance information.

[0112] In order to avoid that lane lines of the same category cannot be distinguished, the method described in this embodiment uses instance information to assign values ​​to the positions corresponding to lane lines on the mask map when generating a mask map, that is, to assign a unique identifier to each lane line so that a value in the generated mask map corresponds to only one lane line. The instance information can be a custom serial number. For example, if there are three lane lines in a picture, the first lane line is defined as 1, the second lane line is defined as 2, and the third lane line is defined as 3. It is sufficient to be able to distinguish different lane lines, without limiting the length, direction, or position order of the lane lines.

[0113] Specifically, in the method described in this embodiment, for the lane lines in a certain image, a two-dimensional array with the same size as the required mask image is generated. In the two-dimensional array, a different number (instance information) is assigned to each lane line based on the coordinate information of each lane line, and the assigned two-dimensional array is saved as a mask image. For example, in the coordinate information dictionary dict_pos, the coordinates of The position of is assigned a value of "1", which is the key value mentioned above. This is repeated to complete the assignment of all coordinates and save the two-dimensional array as a mask map. Figure 1b A schematic diagram of a mask image generated from lane lines in a single image disclosed in an embodiment of the present application, such as Figure 1b As shown in the figure, the plane where the white lines are located is regarded as the road surface, and the rest of the black part is the environment. The white lines are lane lines, and there are three non-intersecting lane lines in this single image.

[0114] As an optional method, obtain the labels of all the images to be processed or sample the labels of a part of the images to be processed, and visualize multiple labels on the same mask image using the above method to obtain Figure 1c . Figure 1c A schematic diagram of a mask image generated for lane lines in all images disclosed in the embodiments of this application, such as Figure 1c As shown, there are multiple intersecting or non-intersecting lane lines in multiple images to be processed.

[0115] Step 103: Obtain a lane line point set according to the mask image.

[0116] In the method described in this embodiment, the distribution range of the lane lines in the mask image is first obtained, and the ordinate and abscissa of the lane lines in the mask image are obtained according to the distribution range. As an optional method, the first ordinate anchor point is obtained equidistantly according to the distribution range, which serves to fix the ordinate of the lane line. For example, assuming that most of the lane lines are distributed in the range of a to b, then in the high dimension of the mask image, values ​​equidistantly (with a step size of step_y) in the range of a to b are taken as ordinate anchor points. Among them, a first ordinate anchor point can be taken every 20 pixels, and the first ordinate anchor point set is recorded as the following formula:

[0117] Yaxis=ly1y2…,yg](2)

[0118] Where g is the quotient of the absolute value of ab and step_y.

[0119] In the method described in this embodiment, since the lane line has a certain width, each lane line contains multiple horizontal coordinates under the same vertical coordinate. The first vertical coordinate can be obtained according to the first vertical coordinate anchor point, and then the first horizontal coordinate set corresponding to each first vertical coordinate anchor point is obtained. The first horizontal coordinate set is averaged to obtain the first horizontal coordinate. For example, assuming that when the coordinate y of the first vertical coordinate anchor point is c, the first horizontal coordinate set is X=[X1,X2,...,Xf] (f is the number of first horizontal coordinates in the first horizontal coordinate set at this time), then the horizontal coordinate of the first lane line on the image when the vertical coordinate y=c can be obtained by averaging, which can be specifically shown in the following formula:

[0120]

[0121] In the method described in this embodiment, the obtained ordinate and abscissa are combined to obtain a lane line point set, the label of which is a point line label, and the lane line can be composed of points in the lane line point set. As an optional method, the set of lane line point (a total of m) coordinates marked in the form of a point line label of a lane line in a certain image is as follows:

[0122] lane_points=[[x,yi],...,[Xm,ym]](4)

[0123] Among them, lane_po ints is a nested list, in which each sublist represents a coordinate point. Its Chinese description is the coordinates of the lane line marked in the form of dots and lines, and its physical meaning is the coordinates of a lane line marked in the form of dots and lines.

[0124] Step 104: Filter out horizontal lane lines and short lane lines based on the lane line point set, and optimize the horizontal lane lines and the short lane lines.

[0125] In the method described in this embodiment, when the number of points in the lane line point set is equal to 2, the lane line is screened as a short lane line. When the number of points is less than or equal to 1, the lane line is screened as a horizontal lane line. The remaining lane lines are normal lane lines and do not need to be processed.

[0126] In the method described in this embodiment, the horizontal lane line is optimized. As an optional method, the method described in step 103 can be used to obtain the first horizontal coordinate anchor point according to the distribution range equidistantly (step length is step_x), and then obtain the first optimized horizontal coordinate according to the first horizontal coordinate anchor point. The first optimized vertical coordinate set corresponding to each first horizontal coordinate anchor point is obtained, and the first optimized vertical coordinate is averaged to obtain the first optimized vertical coordinate. Finally, the first optimized horizontal coordinate and the first optimized vertical coordinate are combined to obtain the optimized horizontal lane line point set.

[0127] In the method described in this embodiment, the number of points of all optimized horizontal lane line points is determined, and if the number of points is still less than or equal to 1, these optimized horizontal lane lines are selected as the two-wheel short lane lines. Other sets of optimized horizontal lane line points are saved.

[0128] In the method described in this embodiment, a short lane line is optimized for a round. As an optional method, the method described in step 103 can be used to obtain a round of vertical coordinate anchor points according to the distribution range at a first spacing (for example, a step length of 1 pixel), and obtain a round of optimized vertical coordinates according to the round of vertical coordinate anchor points. Obtain a set of optimized horizontal coordinates corresponding to each round of vertical coordinate anchor point, and average them to obtain a round of optimized horizontal coordinates. Finally, combine the round of optimized horizontal coordinates and the round of optimized vertical coordinates to obtain a round of optimized short lane line point set.

[0129] In the method described in this embodiment, the short lane line of the second round is optimized. As an optional method, the method described in step 103 can be used to obtain the second round horizontal coordinate anchor point according to the distribution range with a first spacing (for example, a step length of 1 pixel), and obtain the second round optimized horizontal coordinate according to the second round horizontal coordinate anchor point. Obtain the second round optimized vertical coordinate set corresponding to each second round horizontal coordinate anchor point, and average it to obtain the second round optimized vertical coordinate. Finally, combine the second round optimized horizontal coordinate and the second round optimized vertical coordinate to obtain the second round optimized short lane line point set.

[0130] Step 105: Generate a label json file based on the optimized lane line point set and the category information.

[0131] In the method described in this embodiment, the normal lane lines obtained in the above steps, the saved optimized horizontal lane line point set, the first-round optimized short lane line point set and the second-round optimized short lane line point set and the category information dictionary d ict_class are used to generate a json label file annotated with point and line labels.

[0132] The method described in this embodiment provides a label processing method that makes polygon-annotated labels compatible with detection models when there are only a large number of lane line labels annotated with polygons and a detection model is needed, so as to avoid wasting a lot of manpower, financial resources and time by repeated labeling. The method described in this embodiment processes lane line labels annotated with polygons into labels annotated with points and lines, and the processed labels can be directly used in the detection model, so that the lane line segmentation model labels are compatible with the detection model labels. This method can effectively reduce the manpower labeling cost and time cost, and improve the utilization rate of existing resources.

[0133] Embodiment 2: This application discloses another method for label processing, please refer to Figure 2a , the method described in this embodiment is aimed at.

[0134] Step 201: Obtain the coordinate information and category information of the lane line in the initial label json file.

[0135] Step 202: Based on the coordinate information, assign a unique identifier to each lane line in the image to generate a mask map.

[0136] Step 203: Obtain the distribution range of lane lines in the mask image.

[0137] In the method described in this embodiment, Figure 2b This is a schematic diagram of the lane line distribution range disclosed in the embodiment of the present application.

[0138] Step 204: According to the distribution range, the first vertical coordinate anchor point is obtained at equal intervals with a step length of 20 pixels.

[0139] Step 205: Obtain a first horizontal coordinate set corresponding to each first vertical coordinate anchor point, and perform average processing on the first horizontal coordinate set to obtain a first horizontal coordinate.

[0140] Step 206: Combine the first ordinate and the first abscissa to obtain a lane line point set.

[0141] Step 207: Determine whether the number of points in the lane line point set is 2. If yes, proceed to step 208; if no, proceed to step 209.

[0142] Step 208: Filter the lane line as a short lane line. Go to step 213.

[0143] Step 209: Determine whether the number of points in the lane line point set is less than or equal to 1. If yes, proceed to step 210, if no, the lane line is a normal lane line and no processing is required.

[0144] Step 210: Filter the lane line as a horizontal lane line. Go to step 211.

[0145] In the method described in this embodiment, Figure 2c This is a schematic diagram of the horizontal lane lines disclosed in the embodiment of the present application. Assume that the black box represents an image with a length of 1920 and a width of 1080, and the upper left corner is the origin of the image coordinates. A, B, and C in the figure represent three lane lines, respectively, of which C is a horizontal lane line. When the step value of the vertical coordinate anchor point of the lane line is less than the width of the lane line, the lane line has only one vertical coordinate, namely "200", and the horizontal coordinates are n from x1 to xn. After subsequent processing, the lane line can only be represented by one point.

[0146] Step 211: Optimize the horizontal lane lines with a step size of 20 pixels.

[0147] Step 212: Determine whether the number of points of the optimized horizontal lane line is less than or equal to 1. If yes, proceed to step 214, if no, the lane line is a normal lane line and no processing is required.

[0148] Step 213: Optimize a round of short lane lines with a step size of 1 pixel.

[0149] Step 214: filter the lane line as a two-wheel short lane line, and optimize the two-wheel short lane line with a step size of 1 pixel.

[0150] Step 215: Combine the optimized first-round short lane lines, second-round short lane lines and normal lane lines with the category information to generate a label json file.

[0151] Based on the method for label processing disclosed in the above embodiment, this embodiment discloses a label processing device. Figure 3 The label processing device includes: an information acquisition unit 301, a mask map generation unit 302, a set acquisition unit 303, a screening unit 304, and a label generation unit 305;

[0152] An information acquisition unit 301 is used to acquire the coordinate information and category information of the lane line in the initial label json file;

[0153] A mask map generating unit 302, configured to assign values ​​to the lane lines based on the coordinate information to generate a mask map;

[0154] A set acquisition unit 303, configured to acquire a lane line point set according to the mask image;

[0155] A screening unit 304 is used to screen out horizontal lane lines and short lane lines based on the lane line point set, and optimize the horizontal lane lines and the short lane lines;

[0156] The label generation unit 305 is used to generate a label json file according to the optimized lane line point set and the category information.

[0157] Optionally, the mask image generating unit 302 includes:

[0158] An array generation subunit, used to generate a two-dimensional array having the same size as the mask image;

[0159] an assignment subunit, configured to assign a different number to each lane line in the two-dimensional array based on the coordinate information of each lane line;

[0160] The mask map generating subunit is used to save the assigned two-dimensional array as the mask map.

[0161] Optionally, the set acquisition unit 303 includes:

[0162] A range acquisition subunit, used to obtain the distribution range of lane lines in the mask image;

[0163] A coordinate acquisition subunit, used for acquiring the ordinate and abscissa of the lane line in the mask image according to the distribution range;

[0164] The set acquisition subunit is used to combine the longitudinal coordinate and the horizontal coordinate to obtain the lane line point set; the lane line is composed of points in the lane line point set.

[0165] Optionally, the coordinate acquisition subunit includes:

[0166] A first ordinate anchor point acquisition subunit is used to acquire first ordinate anchor points equidistantly according to the distribution range;

[0167] A first ordinate acquisition subunit, configured to obtain the first ordinate according to the first ordinate anchor point;

[0168] A first horizontal coordinate set acquisition subunit is used to acquire a first horizontal coordinate set corresponding to each of the first vertical coordinate anchor points;

[0169] The first horizontal coordinate acquisition subunit is used to perform average processing on the first horizontal coordinate set to obtain the first horizontal coordinate.

[0170] Optionally, the screening unit 304 includes:

[0171] A round screening subunit, used for screening the lane line as a round of short lane lines when the number of points in the lane line point set is equal to 2;

[0172] A horizontal screening subunit, configured to screen the lane line as a horizontal lane line when the number of points is less than or equal to 1;

[0173] A second round screening subunit, used for performing horizontal line optimization on the horizontal lane lines and screening out second round short lane lines;

[0174] The short line optimization subunit is used to perform short line optimization on the first round of short lane lines and the second round of short lane lines.

[0175] Optionally, the second round screening subunit comprises:

[0176] A first horizontal coordinate anchor point acquisition subunit is used to acquire first horizontal coordinate anchor points equidistantly according to the distribution range;

[0177] A first optimized horizontal coordinate obtaining subunit, configured to obtain a first optimized horizontal coordinate according to the first horizontal coordinate anchor point;

[0178] A first optimized vertical coordinate set acquisition subunit is used to acquire a first optimized vertical coordinate set corresponding to each of the first horizontal coordinate anchor points;

[0179] A first optimized ordinate acquisition subunit is used to average the first optimized ordinate set to obtain a first optimized ordinate;

[0180] The first optimized set acquisition subunit is used to combine the first optimized horizontal coordinate and the first optimized vertical coordinate to obtain an optimized horizontal lane line point set.

[0181] Optionally, the second round screening subunit comprises:

[0182] The two-round short line screening subunit is used to screen the optimized horizontal lane line as the two-round short lane line when the number of points in the optimized horizontal lane line point set is less than or equal to 1.

[0183] Optionally, the short-line optimization subunit includes:

[0184] A round of vertical coordinate anchor point acquisition subunit, used to acquire a round of vertical coordinate anchor points at a first spacing according to the distribution range;

[0185] A round of optimization vertical coordinate acquisition subunit, used to obtain a round of optimization vertical coordinate according to the round of vertical coordinate anchor point;

[0186] A one-round optimization horizontal coordinate set acquisition subunit is used to acquire a one-round optimization horizontal coordinate set corresponding to each one-round vertical coordinate anchor point;

[0187] The one-round optimization horizontal coordinate acquisition subunit is used to perform an average processing on the one-round optimization horizontal coordinate set to obtain the one-round optimization horizontal coordinate.

[0188] The one-round optimization set acquisition subunit is used to combine the one-round optimization horizontal coordinate and the one-round optimization vertical coordinate to obtain a one-round optimization short lane line point set.

[0189] Optionally, the short-line optimization subunit includes:

[0190] A second-round horizontal coordinate anchor point acquisition subunit is used to acquire the second-round horizontal coordinate anchor points at a first spacing according to the distribution range;

[0191] A second round optimization horizontal coordinate acquisition subunit, used for obtaining the second round optimization horizontal coordinate according to the second round horizontal coordinate anchor point;

[0192] A second-round optimization vertical coordinate set acquisition subunit is used to acquire a second-round optimization vertical coordinate set corresponding to each second-round horizontal coordinate anchor point;

[0193] A second round optimization vertical coordinate acquisition subunit is used to average the second round optimization vertical coordinate set to obtain the second round optimization vertical coordinate;

[0194] The two-round optimization set acquisition subunit is used to combine the two-round optimization horizontal coordinates and the two-round optimization vertical coordinates to obtain a two-round optimized short lane line point set.

[0195] The embodiments in this specification are described in a progressive manner. As for the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.

[0196] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0197] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0198] The features described in the embodiments of this specification can be replaced or combined with each other, so that professional and technical personnel in this field can implement or use the present application.

[0199] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A label processing method, characterized in that: include: Get the coordinate information and category information of the lane line in the initial label json file; Based on the coordinate information, assigning values ​​to the lane lines to generate a mask map; According to the mask image, a lane line point set is obtained; Based on the lane line point set, horizontal lane lines and short lane lines are screened out, and the horizontal lane lines and the short lane lines are optimized; A label json file is generated based on the optimized lane line point set and the category information.

2. The method according to claim 1, characterized in that The assigning of values ​​to the lane lines based on the coordinate information to generate a mask map includes: Generate a two-dimensional array with the same size as the mask image; In the two-dimensional array, each lane line is assigned a different number based on the coordinate information of each lane line; The assigned two-dimensional array is saved as the mask map.

3. The method according to claim 1, characterized in that The acquiring a lane line point set according to the mask image includes: Obtaining a distribution range of lane lines in the mask image; Acquire the ordinate and abscissa of the lane line in the mask image according to the distribution range; The ordinate and the abscissa are combined to obtain the lane line point set; the lane line is composed of points in the lane line point set.

4. The method according to claim 3, characterized in that The acquiring the ordinate and abscissa of the lane line in the mask image according to the distribution range includes: Acquire first ordinate anchor points equidistantly according to the distribution range; Obtaining the first ordinate according to the first ordinate anchor point; Obtain a first horizontal coordinate set corresponding to each of the first vertical coordinate anchor points; The first horizontal coordinate set is averaged to obtain the first horizontal coordinate.

5. The method according to claim 3, characterized in that: The filtering out horizontal lane lines and short lane lines based on the lane line point set, and optimizing the horizontal lane lines and the short lane lines, includes: When the number of points in the lane line point set is equal to 2, the lane line is screened as a round of short lane lines; When the number of points is less than or equal to 1, the lane line is filtered as a horizontal lane line; Optimizing the horizontal lane lines and selecting the two-wheel short lane lines; Short-line optimization is performed on the first round of short lane lines and the second round of short lane lines.

6. The method according to claim 5, characterized in that The step of optimizing the horizontal lane line includes: Acquire a first horizontal coordinate anchor point equidistantly according to the distribution range; Obtaining a first optimized horizontal coordinate according to the first horizontal coordinate anchor point; Obtain a first optimized vertical coordinate set corresponding to each of the first horizontal coordinate anchor points; Performing an average process on the first optimized vertical coordinate set to obtain a first optimized vertical coordinate; The first optimized horizontal coordinate and the first optimized vertical coordinate are combined to obtain an optimized horizontal lane line point set.

7. The method according to claim 6, characterized in that The screening of the two-wheel short lane line includes: When the number of points in the optimized horizontal lane line point set is less than or equal to 1, the optimized horizontal lane line is screened as the two-wheel short lane line.

8. The method according to claim 5, characterized in that The short lane line of the round is optimized, including: Acquire a round of vertical coordinate anchor points at a first spacing according to the distribution range; Obtaining a round of optimized vertical coordinates according to the said round of vertical coordinate anchor points; Obtain a round of optimized horizontal coordinate sets corresponding to each of the round of vertical coordinate anchor points; The abscissa set of the optimization round is averaged to obtain the abscissa of the optimization round. The abscissa of the first round of optimization and the ordinate of the first round of optimization are combined to obtain a set of short lane line points of the first round of optimization.

9. The method according to claim 5, characterized in that The short lane line of the two-wheel short lane is optimized, including: Acquire the second wheel horizontal coordinate anchor points at a first spacing according to the distribution range; Obtaining two rounds of optimized horizontal coordinates according to the two rounds of horizontal coordinate anchor points; Obtain a two-round optimized vertical coordinate set corresponding to each of the two-round horizontal coordinate anchor points; Performing an average processing on the two-round optimization vertical coordinate set to obtain the two-round optimization vertical coordinate; The two-round optimized horizontal coordinates and the two-round optimized vertical coordinates are combined to obtain a two-round optimized short lane line point set.

10. A label processing device, characterized in that: include: Information acquisition unit, mask map generation unit, set acquisition unit, screening unit, label generation unit; An information acquisition unit, used to obtain the coordinate information and category information of the lane line in the initial label json file; A mask map generating unit, configured to assign a value to the lane line based on the coordinate information to generate a mask map; A set acquisition unit, used for acquiring a lane line point set according to the mask image; A screening unit, configured to screen out horizontal lane lines and short lane lines based on the lane line point set, and perform optimization processing on the horizontal lane lines and the short lane lines; The label generation unit is used to generate a label json file according to the optimized lane line point set and the category information.

Citation Information

Patent Citations

  • A method and system for labeling pictures

    CN109035370A

  • A semantic segmentation and attention mechanism-combined lane line detection method and system

    CN112949493A

  • Lane line separation drawing method and device in confluence scene

    CN113780069A