Method, device and terminal for labeling incomplete point cloud data in autonomous driving scenarios
By using point cloud filtering, clustering and automatic reasoning modules to generate and adjust three-dimensional rectangular frames in autonomous driving scenarios, the accuracy and efficiency issues of incomplete point cloud data annotation are solved, and efficient annotation in autonomous driving scenarios is achieved.
Patent Information
- Application Number
- CN202410213038.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-02-27
AI Technical Summary
In autonomous driving scenarios, incomplete manual annotation of point cloud data suffers from low accuracy and low efficiency. Existing technical completion algorithms are inaccurate and highly complex, resulting in reduced annotation efficiency.
The startup annotation module is used for range frame selection, and the point cloud filtering, clustering and target positioning modules are combined to generate an external three-dimensional rectangular frame. The direction and angle of the rectangular frame are adjusted by calculating the convex hull and the automatic fitting module, and the automatic inference module is used to determine the growth direction. Complete the rectangular frame to form a complete target rectangular frame to be labeled.
It improves the accuracy and efficiency of labeling incomplete target point cloud data, automatically corrects the direction and angle of the rectangular frame, adapts to a variety of target types, and achieves fast and accurate labeling.
Smart Images

Figure CN118071994B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of point cloud data annotation, and in particular to a method, device and terminal for annotating incomplete point cloud data in an autonomous driving scenario. Background Art
[0002] In the scenario of autonomous driving, the on-board LiDAR will continuously collect objects in the scene outside the car to form point cloud data. The 3D point cloud generated by the LiDAR can be used for autonomous driving system training after annotation. As the performance improves, the amount of training data required for autonomous driving technology is almost exponentially growing. During the acquisition process, due to factors such as distance or occlusion, some targets are not fully collected. For example, for vehicles, only the front or rear part may be collected. However, during the annotation process, the incomplete target must be annotated with a complete three-dimensional rectangular frame that fits the actual target.
[0003] There are generally two ways to mark the complete three-dimensional rectangular frame of an incomplete target:
[0004] 1. Artificial imagination: Artificial perception and imagination of the overall picture of the incomplete target, inferring the overall shape from the local part, and manually delineating the rectangular frame. This method requires constant adjustment and enlargement of the local part before delineation. It is likely that there will always be errors with the boundary of the target point cloud. At the same time, for non-positive targets, the direction and angle of the rectangular frame are difficult to estimate, resulting in low annotation accuracy and low efficiency.
[0005] 2. Use technical means to complete the point cloud target and then annotate the completed target. This method has two defects: first, the accuracy of the point cloud completion algorithm cannot be fully guaranteed. If the generated target is distorted or deformed, it may lead to inaccurate annotation results; second, generating a complete 3D point cloud based on the observed incomplete point cloud is a relatively complex project, which will increase the complexity and reduce the efficiency of annotation work. Summary of the invention
[0006] In response to the problems existing in the above-mentioned prior art, the present invention provides a method, device and terminal, method and terminal for labeling incomplete point cloud data in an autonomous driving scenario. The technical problem to be solved by the present invention is to realize automatic labeling of incomplete target point cloud data and improve the accuracy and efficiency of labeling.
[0007] In order to solve the above technical problems, the present invention provides a method, device and terminal for labeling incomplete point cloud data in an autonomous driving scenario, including:
[0008] Start the annotation module, which is used to select the range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start three-dimensional rectangular frame;
[0009] The target positioning module includes a point cloud filtering submodule, a clustering calculation submodule and a target positioning submodule. The point cloud filtering submodule is used to filter all point clouds that start the three-dimensional rectangular frame; the clustering calculation submodule is used to cluster the filtered point clouds to form multiple clusters; the target positioning submodule is used to select the target cluster to be marked and generate an external three-dimensional rectangular frame using preset rules;
[0010] The automatic correction module includes a convex hull calculation submodule and an automatic fitting submodule; the convex hull calculation submodule is used to process all point clouds inside the external three-dimensional rectangular frame and calculate the boundary of the convex hull; the automatic fitting submodule is used to automatically correct the external three-dimensional rectangular frame to keep it consistent with the target orientation to form a minimum rectangular frame;
[0011] The automatic reasoning module includes a reasoning calculation submodule and a complete labeling submodule; the reasoning calculation submodule is used to infer the growth direction of the minimum rectangular box; the complete labeling submodule is used to filter the growth direction, select the optimal candidate box, and calculate the growth distance, so as to automatically complete the minimum rectangular box and form a complete target rectangular box to be labeled.
[0012] The present invention provides a method for labeling incomplete point cloud data in an autonomous driving scenario, which is characterized by using the above-mentioned device for labeling incomplete point cloud data in an autonomous driving scenario, comprising the following steps:
[0013] Step S1: Use the start-up annotation module to select a range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start-up three-dimensional rectangular frame;
[0014] Step S2: Filter all point clouds that start the three-dimensional rectangular frame using the point cloud filtering submodule; then cluster the filtered point clouds using the clustering calculation submodule to form multiple clusters; then select the target cluster to be labeled using the target positioning submodule, and then generate an external three-dimensional rectangular frame using the preset rules;
[0015] Step S3: Use the convex hull calculation submodule to process all point clouds inside the circumscribed three-dimensional rectangular frame and calculate the convex hull boundary; then use the automatic fitting submodule to rotate the circumscribed three-dimensional rectangular frame to keep it consistent with the target orientation and construct a minimum rectangular frame;
[0016] Step S4: Use the inference calculation submodule to infer the growth direction of the minimum rectangular box; use the complete annotation submodule to filter the growth direction, select the optimal candidate box, and calculate the growth distance to automatically complete the minimum rectangular box to form a complete target rectangular box to be annotated, thereby completing the annotation of the incomplete target point cloud.
[0017] Furthermore, in step S1, the startup annotation module is used to perform range selection in the point cloud data, and a two-dimensional rectangular frame in the x-axis and y-axis planes is formed according to the coordinates of the upper left corner and the lower right corner. All points in the two-dimensional rectangular frame are traversed, and the minimum value min_z and the maximum value max_z of all points in the range in the z-axis direction are determined. The difference between the two is taken as the height of the three-dimensional rectangular frame, and a startup three-dimensional rectangular frame is generated.
[0018] Furthermore, in the step S2, firstly, a target size threshold is preset according to the type of the target to be labeled, the boundary coordinate value of the target to be labeled is calculated, and all point clouds in the starting three-dimensional rectangular frame are filtered using the boundary coordinate value; the clustering algorithm input parameters in the clustering calculation submodule include the filtered points, the neighborhood radius and the minimum number of points in the neighborhood, and after calculation by the clustering algorithm, multiple clusters are formed; the target positioning submodule calculates the number of point clouds of each cluster respectively, selects the cluster with the largest number as the target cluster, traverses all point clouds in the target cluster, finds the maximum and minimum values on the x-axis and the maximum and minimum values on the y-axis respectively, forms a positive rectangular frame located on the xy-axis plane, and then finds the lowest point min_z and the highest point max_z in the z-axis direction in the target cluster, takes the difference between the two as the height of the three-dimensional rectangular frame, and generates an external three-dimensional rectangular frame.
[0019] Furthermore, in step S3, all point clouds within the circumscribed three-dimensional rectangular frame are taken as a point set, and the point with the smallest ordinate is found from the point set. If there are multiple points with the same ordinate, the point with the smallest abscissa is selected as the reference point P0; the other points are sorted according to their polar angles relative to the reference point P0, where the polar angle is the angle between the line segment from the reference point to the other points and the horizontal direction, and is calculated using an inverse tangent function or polar coordinate conversion; after sorting, the points in the point set are arranged from small to large according to their polar angles with the reference point, and each point is added to the convex hull in turn by scanning the sorted point set; then an algorithm is used to maintain a stack, where the stack is empty at the beginning, and the points are scanned. After the scan, the stack contains all the vertices of the convex hull, and these vertices are arranged in counterclockwise order to form the boundary of the convex hull;
[0020] The algorithm comprises the following steps:
[0021] Step H1: Push the reference point P0 and the first point P1 after sorting into the stack;
[0022] Step H2: Starting from the second point P2 after sorting, consider each point in turn; if the current point P2, the top point T and the second top point S form a right turn, pop T from the stack and continue to check the new top and second top of the stack until no right turn is formed; if no right turn is formed, push the current point P2 into the stack;
[0023] Step H3: Repeat the above steps until all points are considered.
[0024] Furthermore, in step S3, the automatic fitting submodule obtains the rotation angle by calculating the main direction of the convex hull and the parameters of the circumscribed three-dimensional rectangular box, rotates the circumscribed three-dimensional rectangular box according to the rotation angle, and then adjusts the size of the circumscribed three-dimensional rectangular box to obtain the minimum rectangular box of the target to be labeled. The constructed minimum rectangular box is the minimum area rectangle surrounding the convex hull, the convex hull contains all points in the target point set to be labeled, and its boundary is convex.
[0025] Furthermore, the steps to calculate the minimum rectangular frame are as follows:
[0026] Step M1: Determine the main direction. First, calculate the main axis of the convex hull. The main axis is a line segment parallel to the edge of the convex hull bounding box. It corresponds to the long side and short side of the bounding box respectively. Find the direction of the longest side and the shortest side of the convex hull, so as to determine the main direction of the convex hull.
[0027] Step M2: Calculate the parameters of the circumscribed three-dimensional rectangular frame, including the calculation of the center point coordinates, width and height; the center point coordinates of the circumscribed three-dimensional rectangular frame are the same as the center point coordinates of the convex hull; the width and height are the lengths of the longest side and the shortest side of the projection of the convex hull in the main direction, respectively;
[0028] Step M3: Calculate the rotation angle by calculating the angle between the positive direction of the circumscribed three-dimensional rectangular frame and the main axis direction of the convex hull to obtain the rotation angle;
[0029] Step M4: According to the calculated center point coordinates, height, width and rotation angle, rotate the circumscribed three-dimensional rectangular frame so that the orientation of the circumscribed three-dimensional rectangular frame is aligned with the main axis, and then adjust the size of the circumscribed three-dimensional rectangular frame to reconstruct a rectangle so that it surrounds the entire convex hull, that is, the minimum rectangular frame.
[0030] Furthermore, in step S4, the radar device on the collection vehicle is used as the origin, and the quadrant where the minimum rectangular frame is located is determined according to the relative position of the target cluster to be labeled and the collection vehicle, and the growth direction of the minimum rectangular frame is determined according to the quadrant position;
[0031] Determining the growth direction of the minimum rectangular frame includes the following steps:
[0032] Determine the quadrant: Calculate the distances between the four vertices of the smallest rectangular box and the origin, find the point with the smallest distance, and the two adjacent points of the closest point;
[0033] Determine the growth direction: The growth direction is the alignment direction of the straight line connecting the minimum point and the two adjacent points.
[0034] Further, in step S4, set the default length and width (l, w) in the target positioning module, and filter the growth direction and calculate the growth distance by comparing the default length and width with the length and width (l1, w1) of the minimum bounding rectangle. The specific logic is as follows:
[0035] When min(l1, w1) > max(l, w), there is no growth;
[0036] When max(l1, w1) < max(l, w) & min(l1, w1) < min(l, w), the growth distance of l1 is l - l1, and the growth distance of w1 is w - w1;
[0037] When max(l1, w1) < min(l, w), there will be two growth directions. The first growth direction is that l1 grows to l and w1 grows to w, and the second growth direction is that l1 grows to w and w1 grows to l;
[0038] Wherein, l is the length set in the target positioning module; w is the width set in the target positioning module; l1 is the length of the minimum rectangle frame generated by the algorithm; w1 is the width of the minimum rectangle frame generated by the algorithm;
[0039] After automatically completing the filling in the xy plane, find the minimum and maximum values in the z-axis direction to form a complete target rectangle frame to be labeled, and complete the automatic full labeling of the incomplete target.
[0040] The present invention provides a terminal for labeling incomplete point cloud data in an autonomous driving scenario, including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned method for labeling incomplete point cloud data in an autonomous driving scenario are implemented.
[0041] The present invention proposes a method, device, and terminal for labeling incomplete point cloud data in an autonomous driving scenario. By using the start labeling module to perform range selection within the point cloud data to form a start three-dimensional rectangle frame; filtering the point cloud of the start three-dimensional rectangle frame, and then performing clustering to form multiple clusters, selecting the target cluster to be labeled, and then generating an external three-dimensional rectangle frame using a preset rule; constructing a convex hull boundary, rotating the external three-dimensional rectangle frame to make it consistent with the target orientation, and constructing a minimum rectangle frame; determining the growth direction of the minimum rectangle frame, using the complete labeling sub-module to filter the growth direction and determine the growth distance, so as to automatically complete the minimum rectangle frame to form a complete target rectangle frame to be labeled. The present invention can help the labeling personnel quickly and accurately complete the automatic labeling of the complete target frame of the incomplete target, improving work efficiency. The present invention can adapt to various different types of targets.
[0042] The beneficial effects of the present invention are as follows:
[0043] 1. It can realize automatic correction of the direction and angle of the external three-dimensional rectangular frame. Initially, the frame selection is performed on a large range of point cloud data without the need to specifically define the target boundary frame. After locating the target using the clustering algorithm, the convex hull and rotation angle are calculated to complete the automatic adjustment of the direction and angle of the external three-dimensional rectangular frame, automatically fit the target boundary, and form a minimum rectangular frame, solving the problem of difficult estimation of the direction and angle of the minimum rectangular frame in manual annotation, and improving the annotation accuracy.
[0044] 2. Automatic reasoning of the rectangular frame of the target to be labeled including the uncollected part can be realized. Through the relative position of the target and the collection vehicle, the direction and size of the uncollected part, that is, the growth direction and growth distance of the minimum rectangular frame, are inferred by logical operation, so as to complete the labeling of the incomplete target and form a complete rectangular frame of the target to be labeled. The present invention realizes the automatic labeling of incomplete target point cloud data and improves the labeling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The present invention is a structural diagram of an incomplete point cloud data labeling method, device and terminal in an autonomous driving scenario.
[0046] Figure 2 The present invention is a flowchart of an automatic annotation method for an incomplete target point cloud.
[0047] Figure 3 It is a schematic diagram of an external three-dimensional rectangular frame of an incomplete target point cloud automatic annotation method.
[0048] Figure 4 It is a rotational schematic diagram of a circumscribed three-dimensional rectangular box of an incomplete target point cloud automatic annotation method.
[0049] Figure 5 It is a schematic diagram of the growth direction of an incomplete target point cloud automatic annotation method; the dotted box in the figure is a candidate box, including the growth direction and growth distance. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0054] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of an incomplete point cloud data labeling method, device and terminal, method and terminal in an autonomous driving scenario of the present invention in conjunction with the accompanying drawings.
[0055] Embodiment 1:
[0056] like Figure 1 As shown, the present invention provides a method, device and terminal for labeling incomplete point cloud data in an autonomous driving scenario, including:
[0057] Start the annotation module, which is used to select the range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start three-dimensional rectangular frame;
[0058] The target positioning module includes a point cloud filtering submodule, a clustering calculation submodule and a target positioning submodule. The point cloud filtering submodule is used to filter all point clouds that start the three-dimensional rectangular frame; the clustering calculation submodule is used to cluster the filtered point clouds to form multiple clusters; the target positioning submodule is used to select the target cluster to be marked and generate an external three-dimensional rectangular frame using preset rules;
[0059] The automatic correction module includes a convex hull calculation submodule and an automatic fitting submodule; the convex hull calculation submodule is used to process all point clouds inside the external three-dimensional rectangular box to construct a convex hull boundary; the automatic fitting submodule is used to rotate the external three-dimensional rectangular box to keep it consistent with the target orientation and construct a minimum rectangular box;
[0060] The automatic reasoning module includes a reasoning calculation submodule and a complete labeling submodule; the reasoning calculation submodule is used to determine the growth direction of the minimum rectangular box; the complete labeling submodule is used to filter the growth direction, select the optimal candidate box, and determine the growth distance, so as to automatically complete the minimum rectangular box to form a complete target rectangular box to be labeled, thereby realizing the labeling of incomplete target point clouds.
[0061] Embodiment 2:
[0062] like Figure 2 As shown, the present invention provides an automatic annotation method for an incomplete target point cloud, comprising the following steps:
[0063] Step S1: Use the start-up annotation module to select a range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start-up three-dimensional rectangular frame;
[0064] Step S2: Filter all point clouds that start the three-dimensional rectangular frame using the point cloud filtering submodule; then cluster the filtered point clouds using the clustering calculation submodule to form multiple clusters; then select the target cluster to be labeled using the target positioning submodule, and then generate an external three-dimensional rectangular frame using the preset rules;
[0065] Step S3: Use the convex hull calculation submodule to process all point clouds inside the circumscribed three-dimensional rectangular frame to construct a convex hull boundary; then use the automatic fitting submodule to rotate the circumscribed three-dimensional rectangular frame to keep it consistent with the target orientation, and construct a minimum rectangular frame;
[0066] Step S4: Use the inference calculation submodule to determine the growth direction of the minimum rectangular box; use the complete annotation submodule to filter the growth direction, select the optimal candidate box, and determine the growth distance, so as to automatically complete the minimum rectangular box and form a complete target rectangular box to be annotated, thereby realizing the annotation of the incomplete target point cloud.
[0067] Embodiment 3:
[0068] like Figure 2 As shown, the present invention provides an automatic annotation method for an incomplete target point cloud, comprising the following steps:
[0069] Step S1: Use the start-up annotation module to select a range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start-up three-dimensional rectangular frame;
[0070] Step S2: Filter all point clouds that start the three-dimensional rectangular frame using the point cloud filtering submodule; then cluster the filtered point clouds using the clustering calculation submodule to form multiple clusters; then select the target cluster to be labeled using the target positioning submodule, and then generate an external three-dimensional rectangular frame using the preset rules;
[0071] Step S3: Use the convex hull calculation submodule to process all point clouds inside the circumscribed three-dimensional rectangular frame to construct a convex hull boundary; then use the automatic fitting submodule to rotate the circumscribed three-dimensional rectangular frame to keep it consistent with the target orientation, and construct a minimum rectangular frame;
[0072] Step S4: Use the inference calculation submodule to determine the growth direction of the minimum rectangular box; use the complete annotation submodule to filter the growth direction, select the optimal candidate box, and determine the growth distance, so as to automatically complete the minimum rectangular box and form a complete target rectangular box to be labeled.
[0073] The difference between this embodiment and the second embodiment is that:
[0074] In the step S1, a range selection is performed in the point cloud data using the startup annotation module, a two-dimensional rectangular frame in the x-axis and y-axis planes is formed according to the coordinates of the upper left corner and the lower right corner, all points in the two-dimensional rectangular frame are traversed, and the minimum value min_z and the maximum value max_z of all points in the range in the z-axis direction are determined, and the difference between the two is taken as the height of the three-dimensional rectangular frame to generate a startup three-dimensional rectangular frame;
[0075] In the step S2, firstly, a target size threshold is preset according to the type of the target to be labeled, the boundary coordinate value of the target to be labeled is calculated, and all point clouds in the starting three-dimensional rectangular frame are filtered using the boundary coordinate value;
[0076] For example, taking a small passenger car as an example, assuming that the length is 4 meters, the width is 1.8 meters, and the height is 1.5 meters, the lowest point height is selected as 0.2 meters, and all point clouds in the starting three-dimensional rectangular box are filtered to filter out points with height values below 0.2 meters and above 1.7 meters (0.2+1.5) in the box.
[0077] In step S2, the clustering algorithm input parameters in the clustering calculation submodule include the filtered points (points), the neighborhood radius (epsilon) and the minimum number of points in the neighborhood (minPts), and after calculation by the clustering algorithm, multiple clusters are formed;
[0078] like Figure 3 As shown, in step S2, the target positioning submodule calculates the number of point clouds of each cluster respectively, selects the cluster with the largest number as the target cluster, traverses all point clouds in the target cluster, finds the maximum and minimum values on the x-axis and the maximum and minimum values on the y-axis respectively, forms a positive rectangular frame located on the xy-axis plane, and then finds the lowest point min_z and the highest point max_z in the z-axis direction in the target cluster, takes the difference between the two as the height of the three-dimensional rectangular frame, and generates an external three-dimensional rectangular frame.
[0079] Embodiment 4:
[0080] like Figure 2 As shown, the present invention provides an automatic annotation method for an incomplete target point cloud, comprising the following steps:
[0081] Step S1: Use the start-up annotation module to select a range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start-up three-dimensional rectangular frame;
[0082] Step S2: Filter all point clouds that start the three-dimensional rectangular frame using the point cloud filtering submodule; then cluster the filtered point clouds using the clustering calculation submodule to form multiple clusters; then select the target cluster to be labeled using the target positioning submodule, and then generate an external three-dimensional rectangular frame using the preset rules;
[0083] Step S3: Use the convex hull calculation submodule to process all point clouds inside the circumscribed three-dimensional rectangular frame to construct a convex hull boundary; then use the automatic fitting submodule to rotate the circumscribed three-dimensional rectangular frame to keep it consistent with the target orientation, and construct a minimum rectangular frame;
[0084] Step S4: Use the inference calculation submodule to determine the growth direction of the minimum rectangular box; use the complete annotation submodule to filter the growth direction, select the optimal candidate box, and determine the growth distance, so as to automatically complete the minimum rectangular box and form a complete target rectangular box to be labeled.
[0085] The difference between this embodiment and the second and third embodiments is that:
[0086] In step S3, all point clouds within the circumscribed three-dimensional rectangular frame are taken as point sets, and the point with the smallest ordinate is found from the point set. If there are multiple points with the same ordinate, the point with the smallest abscissa is selected as the reference point (P0); all other points are sorted according to their polar angles relative to the reference point. The polar angle is the angle between the line segment from the reference point to other points and a fixed direction (usually the horizontal direction), which is calculated using the inverse tangent function or polar coordinate conversion; after sorting, the points in the point set are arranged from small to large according to their polar angles with the reference point, and each point is added to the convex hull in turn by scanning the sorted point set. A stack is maintained using an algorithm. The stack is empty at the beginning, and the points are scanned. After the scanning is completed, the stack contains all the vertices of the convex hull. These vertices are arranged in counterclockwise order to form the boundary of the convex hull.
[0087] The algorithm comprises the following steps:
[0088] Step H1: Push the reference point P0 and the first point P1 after sorting into the stack;
[0089] Step H2: Starting from the second point P2 after sorting, consider each point in turn; if the current point P2, the top point T and the second top point S form a right turn (i.e., TS-P2 forms a right turn), pop T from the stack and continue to check the new top and second top of the stack until no right turn is formed; if no right turn is formed, push the current point P2 into the stack;
[0090] Step H3: Repeat the above steps until all points are considered.
[0091] like Figure 4 As shown, in step S3, the automatic fitting submodule obtains the rotation angle by calculating the main direction of the convex hull and the parameters of the circumscribed three-dimensional rectangular box, and rotates the circumscribed three-dimensional rectangular box to obtain the minimum rectangular box of the target to be labeled. Constructing the minimum rectangular box is to determine the minimum area rectangle surrounding the convex hull. The convex hull already contains all the points in the target point set to be labeled, and its boundary is convex.
[0092] The steps to calculate the minimum rectangular box are as follows:
[0093] Step M1: Determine the main direction. First, calculate the main axis of the convex hull. The main axis is a line segment parallel to the edge of the convex hull bounding box. It corresponds to the long side and short side of the bounding box respectively. Find the direction of the longest side and the shortest side of the convex hull, and you can determine the main direction of the convex hull.
[0094] Step M2: Calculate the parameters of the circumscribed three-dimensional rectangular frame, including the center point coordinates, width and height.
[0095] Center point coordinates: The center point coordinates of the circumscribed three-dimensional rectangular box are the same as the center point coordinates of the convex hull.
[0096] Width and height: The projection of the convex hull in the principal directions, i.e. the length of the longest and shortest sides.
[0097] Step M3: Calculate the rotation angle by calculating the angle between the positive direction of the circumscribed three-dimensional rectangle and the main axis direction of the convex hull to obtain the rotation angle so that the direction of the circumscribed three-dimensional rectangular frame is aligned with the main axis;
[0098] Step M4: According to the calculated center point coordinates, height, width and rotation angle, the circumscribed three-dimensional rectangular frame is rotated to construct a rectangle that surrounds the entire convex hull, that is, the minimum rectangular frame.
[0099] like Figure 5 As shown, in step S4, the radar device on the collection vehicle is taken as the origin, and the quadrant where the minimum rectangular frame is located is determined according to the relative position of the target cluster to be labeled and the collection vehicle, and the candidate direction for the growth of the minimum rectangular frame is determined according to the quadrant position.
[0100] The specific steps are as follows:
[0101] Determine the quadrant: Calculate the distances from the four vertices of the minimum rectangular box to the origin respectively, find the point with the minimum distance, and the two adjacent points of the nearest point.
[0102] Determine the growth direction: The growth direction is the alignment direction of the straight lines connected by the minimum point to the two adjacent points respectively. As shown in the following figure, assuming that the minimum rectangular box is in the first quadrant, the growth directions are the upper left and upper right directions.
[0103] In step S4, after determining the growth direction, the complete annotation sub-module filters the growth direction and determines the growth distance to automatically complete the minimum rectangular box and form a complete target rectangular box to be annotated.
[0104] In step S4, set the default length and width (l, w) in the target positioning module, and filter the growth direction and calculate the growth distance by comparing the default length and width with the length and width (l1, w1) of the minimum rectangular box. The specific logic is as follows:
[0105] When min(l1, w1)>max(l, w), there is no growth;
[0106] When max(l1, w1)<max(l, w) & min(l1, w1)<min(l, w), the growth distance of l1 is l - l1, and the growth distance of w1 is w - w1;
[0107] When max(l1, w1)<min(l, w), there will be two growth directions. The first growth direction is that l1 grows to l and w1 grows to w, and the second growth direction is that l1 grows to w and w1 grows to l; the first growth direction is preferred;
[0108] Among them, l is the length set in the target positioning module; w is the width set in the target positioning module; l1 is the length of the minimum rectangular box generated by the algorithm; w1 is the width of the minimum rectangular box generated by the algorithm;
[0109] After automatically completing in the xy plane, find the minimum and maximum values in the z-axis direction to form a three-dimensional rectangular box and complete the automatic complete annotation of the incomplete target.
[0110] Embodiment 5:
[0111] An automatic annotation terminal for incomplete target point clouds, characterized by including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned automatic annotation method for incomplete target point clouds are implemented.
[0112] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A device for labeling incomplete point cloud data in an autonomous driving scenario, characterized in that: include; Start the annotation module, which is used to select the range in the point cloud data, determine the coordinate values in the x-axis, y-axis and z-axis directions respectively, and form a start three-dimensional rectangular frame; The target positioning module includes a point cloud filtering submodule, a clustering calculation submodule and a target positioning submodule. The point cloud filtering submodule is used to filter all point clouds of the starting three-dimensional rectangular box; The clustering calculation submodule is used to cluster the filtered point cloud to form multiple clusters; The target positioning submodule is used to select the target cluster to be labeled and generate an external three-dimensional rectangular frame using preset rules; The automatic correction module includes a convex hull calculation submodule and an automatic fitting submodule; the convex hull calculation submodule is used to process all point clouds inside the external three-dimensional rectangular frame and calculate the boundary of the convex hull; the automatic fitting submodule is used to automatically correct the external three-dimensional rectangular frame to keep it consistent with the target orientation to form a minimum rectangular frame; Automatic reasoning module, including reasoning calculation submodule and complete annotation submodule; The inference calculation submodule is used to infer the growth direction of the minimum rectangular box; the complete annotation submodule is used to filter the growth direction, select the optimal candidate box, calculate the growth distance, and automatically complete the minimum rectangular box to form a complete target rectangular box to be annotated; The automatic correction module is specifically used to: take all point clouds within the circumscribed three-dimensional rectangular frame as a point set, find the point with the smallest ordinate from the point set, if there are multiple points with the same ordinate, select the point with the smallest abscissa as the reference point P0; sort the other points according to their polar angles relative to the reference point P0, the polar angle is the angle between the line segment from the reference point to the other points and the horizontal direction, and is calculated using an inverse tangent function or polar coordinate conversion; after sorting, the points in the point set are arranged from small to large according to their polar angles with the reference point, and each point is added to the convex hull in turn by scanning the sorted point set; then use an algorithm to maintain a stack, the stack is empty at the beginning, and the points are scanned. After the scanning is completed, the stack contains all the vertices of the convex hull, and these vertices are arranged in counterclockwise order to form the convex hull boundary; The algorithm comprises the following steps: Step H1: Push the reference point P0 and the first point P1 after sorting into the stack; Step H2: Starting from the second point P2 after sorting, consider each point in turn; if the current point P2, the top point T and the second top point S form a right turn, pop T from the stack and continue to check the new top and second top of the stack until no right turn is formed; if no right turn is formed, push the current point P2 into the stack; Step H3: Repeat the above steps until all points are considered; In the automatic correction module, the automatic fitting submodule obtains a rotation angle by calculating the main direction of the convex hull and the parameters of the circumscribed three-dimensional rectangular box, rotates the circumscribed three-dimensional rectangular box according to the rotation angle, and then adjusts the size of the circumscribed three-dimensional rectangular box to obtain a minimum rectangular box of the target to be labeled. The constructed minimum rectangular box is a rectangle with the minimum area surrounding the convex hull. The convex hull contains all points in the target point set to be labeled, and its boundary is convex. The automatic reasoning module is specifically used for: taking the radar device on the acquisition vehicle as the origin, determining the quadrant where the minimum rectangular box is located according to the relative position between the target cluster to be labeled and the acquisition vehicle, and determining the growth direction of the minimum rectangular box according to the quadrant position; Set the default length and width (l, w) in the target positioning module, and filter the growth direction and calculate the growth distance by comparing the default length and width with the length and width (l1, w1) of the minimum rectangular box. The specific logic is as follows: When min(l1, w1) > max(l, w), there is no growth; When max(l1, w1) < max(l, w) & min(l1, w1) < min(l, w), the growth distance of l1 is l - l1, and the growth distance of w1 is w - w1; When max(l1, w1) < min(l, w), there will be two growth directions. The first growth direction is that l1 grows to l and w1 grows to w, and the second growth direction is that l1 grows to w and w1 grows to l; Where, l is the length set in the target positioning module; w is the width set in the target positioning module; l1 is the length of the minimum rectangular box generated by the algorithm; w1 is the width of the minimum rectangular box generated by the algorithm; After the automatic completion in the xy plane, find the minimum and maximum values in the z-axis direction to form a complete target rectangular box to be labeled, and complete the automatic full annotation of the incomplete target point cloud.
2. A method for labeling incomplete point cloud data in an autonomous driving scenario, characterized in that: Using the incomplete point cloud data annotation device in the autonomous driving scenario described in claim 1, includes the following steps: Step S1: Use the start annotation module to perform range selection in the point cloud data, and respectively determine the coordinate values in the x-axis, y-axis, and z-axis directions to form a start three-dimensional rectangular box; Step S2: Use the point cloud filtering sub-module to filter all the point clouds of the start three-dimensional rectangular box; then use the clustering calculation sub-module to cluster the filtered point clouds to form multiple clusters; then use the target positioning sub-module to select the target cluster to be labeled, and then use the preset rules to generate an external three-dimensional rectangular box; Step S3: Use the convex hull calculation sub-module to process all the point clouds inside the external three-dimensional rectangular box and calculate the convex hull boundary; then use the automatic fitting sub-module to rotate the external three-dimensional rectangular box to make it consistent with the target orientation and construct a minimum rectangular box; Step S4: Use the reasoning calculation sub-module to infer the growth direction of the minimum rectangular box; use the complete annotation sub-module to filter the growth direction, select the optimal candidate box, calculate the growth distance, and automatically complete the minimum rectangular box to form a complete target rectangular box to be labeled, and complete the annotation of the incomplete target point cloud; In step S3, all the point clouds within the circumscribed three-dimensional rectangular box are taken as a point set. From the point set, find the point with the minimum ordinate. If there are multiple points with the same ordinate, select the point with the minimum abscissa as the reference point P0. Sort the other points according to their polar angles relative to the reference point P0. The polar angle is the angle between the line segment from the reference point to other points and the horizontal direction, which is calculated using the arctangent function or polar coordinate transformation. After sorting, the points in the point set will be arranged in ascending order of their polar angles with respect to the reference point. By scanning the sorted point set, each point is added to the convex hull in turn. Then, use an algorithm to maintain a stack. At the beginning, the stack is empty. Scan the points. After the scan is completed, the stack contains all the vertices of the convex hull. Arrange these vertices in counterclockwise order to form the convex hull boundary. The algorithm includes the following steps: Step H1: Push the reference point P0 and the first sorted point P1 onto the stack. Step H2: Starting from the second sorted point P2, consider each point in turn. If the current point P2, the top point T, and the second top point S form a right turn, pop T from the stack and continue to check the new top and second top until no right turn is formed. If no right turn is formed, push the current point P2 onto the stack. Step H3: Repeat the above steps until all points have been considered. In step S3, the automatic fitting sub-module obtains the rotation angle by calculating the main direction of the convex hull and the parameters of the circumscribed three-dimensional rectangular box. Rotate the circumscribed three-dimensional rectangular box according to the rotation angle, and then adjust the size of the circumscribed three-dimensional rectangular box to obtain the minimum rectangular box of the target to be labeled. The constructed minimum rectangular box is the rectangle with the minimum area that encloses the convex hull. The convex hull contains all the points in the point set of the target to be labeled, and its boundary is convex. In step S4, taking the radar device on the acquisition vehicle as the origin, determine the quadrant where the minimum rectangular box is located according to the relative position between the target cluster to be labeled and the acquisition vehicle, and determine the growth direction of the minimum rectangular box according to the quadrant position. In step S4, set the default length and width (l, w) in the target positioning module. Filter the growth direction and calculate the growth distance by comparing the default length and width with the length and width (l1, w1) of the minimum rectangular box. The specific logic is as follows: When min(l1, w1) > max(l, w), there is no growth. When max(l1, w1) < max(l, w) & min(l1, w1) < min(l, w), the growth distance of l1 is l - l1, and the growth distance of w1 is w - w1. When max(l1, w1) < min(l, w), there will be two growth directions. The first growth direction is that l1 grows to l and w1 grows to w. The second growth direction is that l1 grows to w and w1 grows to l. Where, l is the length set in the target positioning module; w is the width set in the target positioning module; l1 is the length of the minimum rectangular box generated by the algorithm; w1 is the width of the minimum rectangular box generated by the algorithm. After the automatic completion in the xy plane, find the minimum and maximum values in the z-axis direction to form a complete rectangular box of the target to be labeled, and complete the automatic full annotation of the incomplete target point cloud.
3. The method for labeling incomplete point cloud data in an autonomous driving scenario according to claim 2, characterized in that: In step S1, a range selection is performed in the point cloud data using the startup annotation module, and a two-dimensional rectangular frame in the x-axis and y-axis planes is formed according to the coordinates of the upper left corner and the lower right corner. All points in the two-dimensional rectangular frame are traversed, and the minimum value min_z and the maximum value max_z of all points in the range in the z-axis direction are determined. The difference between the two is taken as the height of the three-dimensional rectangular frame to generate a startup three-dimensional rectangular frame.
4. The method for labeling incomplete point cloud data in an autonomous driving scenario according to claim 2, characterized in that: In the step S2, firstly, a target size threshold is preset according to the type of the target to be marked, the boundary coordinate value of the target to be marked is calculated, and all point clouds in the starting three-dimensional rectangular frame are filtered using the boundary coordinate value; the clustering algorithm input parameters in the clustering calculation submodule include the filtered points, the neighborhood radius and the minimum number of points in the neighborhood, and after calculation by the clustering algorithm, multiple clusters are formed; the target positioning submodule calculates the number of point clouds of each cluster respectively, selects the cluster with the largest number as the target cluster, traverses all point clouds in the target cluster, finds the maximum and minimum values on the x-axis and the maximum and minimum values on the y-axis respectively, forms a positive rectangular frame located on the xy-axis plane, and then finds the lowest point min_z and the highest point max_z in the target cluster in the z-axis direction, takes the difference between the two as the height of the three-dimensional rectangular frame, and generates an external three-dimensional rectangular frame.
5. The method for labeling incomplete point cloud data in an autonomous driving scenario according to claim 2, characterized in that: The steps to calculate the minimum rectangular box are as follows: Step M1: Determine the main direction. First, calculate the main axis of the convex hull. The main axis is a line segment parallel to the edge of the convex hull bounding box. It corresponds to the long side and short side of the bounding box respectively. Find the direction of the longest side and the shortest side of the convex hull, so as to determine the main direction of the convex hull. Step M2: Calculate the parameters of the circumscribed three-dimensional rectangular frame, including the calculation of the center point coordinates, width and height; the center point coordinates of the circumscribed three-dimensional rectangular frame are the same as the center point coordinates of the convex hull; the width and height are the lengths of the longest side and the shortest side of the projection of the convex hull in the main direction, respectively; Step M3: Calculate the rotation angle by calculating the angle between the positive direction of the circumscribed three-dimensional rectangular frame and the main axis direction of the convex hull to obtain the rotation angle; Step M4: According to the calculated center point coordinates, height, width and rotation angle, rotate the circumscribed three-dimensional rectangular frame so that the orientation of the circumscribed three-dimensional rectangular frame is aligned with the main axis, and then adjust the size of the circumscribed three-dimensional rectangular frame to reconstruct a rectangle so that it surrounds the entire convex hull, that is, the minimum rectangular frame.
6. The method for labeling incomplete point cloud data in an autonomous driving scenario according to claim 5, characterized in that: In step S4, determining the growth direction of the minimum rectangular frame includes the following steps: Determine the quadrant: Calculate the distances between the four vertices of the smallest rectangular box and the origin, find the point with the smallest distance, and the two adjacent points of the closest point; Determine the growth direction: The growth direction is the alignment direction of the straight line connecting the minimum point and the two adjacent points.
7. A terminal for labeling incomplete point cloud data in an autonomous driving scenario, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the incomplete point cloud data labeling method in the autonomous driving scenario as described in any one of claims 2 to 6 are implemented.
