Method, System, Device and Medium for Calculating Point Cloud Bounding Box Based on Vehicle Targets
Through the point cloud bounding box calculation method based on vehicle targets, the point cloud density is reduced and the yaw angle is calculated using the x and y coordinates of point cloud data, the problem of inefficient computing in the prior art is solved, and stable vehicle target recognition and tracking is achieved.
Patent Information
- Application Number
- CN202210968273.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-12
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-08-12
AI Technical Summary
In the prior art, the method for determining the point cloud bounding box is not specific in the field of intelligent automobile driving, and the impact of the number of point clouds on the time-consuming algorithm is not considered, resulting in low computing efficiency.
The point cloud bounding box calculation method based on vehicle targets is adopted, including point cloud data acquisition, downsampling, point cloud direction calculation and bounding box calculation. The point cloud density is reduced by downsampling, the yaw angle is calculated using the x and y coordinates of the point cloud data, and the bounding box is determined by the loss value calculation.
It improves the processing efficiency of the algorithm and the stability of the calculation results, and is suitable for the vehicle target identification and tracking requirements in the field of intelligent automobile driving.
Smart Images

Figure CN115423833B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automotive intelligent driving, and particularly relates to a method, system, device and medium for calculating a point cloud bounding box based on a vehicle target. Background Art
[0002] A lidar can measure a target object to obtain the point cloud of the target object, and then obtain the envelope of the target object based on the point cloud of the target object. The bounding box of the target object can be determined according to the envelope of the target object, and thus the subsequent processes of identifying or tracking the target object can be completed.
[0003] In the prior art, for related methods of determining a point cloud bounding box, for example, Chinese Patent CN201911358284.0 provides a method and device for determining a bounding box of a point cloud. The first plane where the first graph is located is divided into N regions according to the first position information; taking each of the M edges as a reference edge, a bounding box is determined, and a total of M bounding boxes are obtained; determining N sub-loss values corresponding to each of the M bounding boxes for the N regions; determining the loss value corresponding to each bounding box according to the N sub-loss values corresponding to each bounding box; and determining the bounding box corresponding to the minimum loss value as the bounding box of the point cloud. The relative position between the processing device and the object is considered when calculating the sub-loss value, and such a bounding box can reduce the influence of the self-occlusion phenomenon on the observation result and improve the accuracy of the observation result of the target object. However, the method for determining the point cloud bounding box given in this patent is too broad for the field of automotive intelligent driving, does not describe the operation process, does not consider the influence of the point cloud quantity on the algorithm time consumption, and is not practically operable. Summary of the Invention
[0004] The main object of the present invention is to overcome the deficiencies of the prior art and propose a method, system, device and medium for calculating a point cloud bounding box based on a vehicle target.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for calculating a point cloud bounding box based on a vehicle target includes the following steps:
[0007] S1. Point cloud data acquisition: acquiring the point cloud data of the clustered or segmented vehicle target;
[0008] S2. Point cloud downsampling: performing downsampling on the acquired point cloud data;
[0009] S3. Point cloud direction calculation: using the coordinate information of the point cloud data in the horizontal plane to calculate the point cloud direction, that is, the yaw angle of the vehicle in the horizontal plane;
[0010] S4. Point cloud bounding box calculation.
[0011] Further, in step S1, for the acquired point cloud data, the points included in the data should be from the same target, and each individual point should at least have three-dimensional coordinate information of x, y, and z.
[0012] Further, the point cloud downsampling is specifically as follows:
[0013] Project the point cloud onto the horizontal plane, then divide the horizontal area where the point cloud is located into grid cells of equal size, divide the point cloud into the corresponding grid cells according to its projection on the horizontal plane, remove the corresponding points from each grid cell according to a custom ratio or rule, and at least one point should be retained in each grid cell with points. Finally, all the points retained in the grid cells are the downsampled point cloud.
[0014] Further, in step S3, since what needs to be calculated is the yaw angle of the vehicle on the horizontal plane, therefore, the use of the coordinate information of the point cloud on the horizontal plane specifically refers to using the x and y coordinate information of the point cloud.
[0015] Further, the point cloud direction calculation specifically includes:
[0016] Assume that the angle between the direction of the target point cloud and the positive x-axis is angle, and angle is positive when it is counterclockwise from the positive x-axis to the target direction, and vice versa.
[0017] S31. On the premise of the given point cloud direction, calculate the smallest rectangular frame including all the point clouds, and denote the four sides of the obtained rectangular frame as a, b, c, and e.
[0018] S32. For any point P in the point cloud, calculate the distance d between this point and the boundary closest to it:
[0019] d = min(d a , d b , d c , d e )
[0020] S33. Calculate the distance d for all points in the point cloud, and divide the calculated distance data into two groups, namely the group closest to the long side of the rectangular boundary box and the group closest to the short side:
[0021] S1 = {d|min(d a , d b , d c , d e ) = d a or d c}}
[0022] S2 = {d|min(d a , d b , dc , d e ) = d b or d e}
[0023] S34. When S1 and S2 are not empty, calculate the variances of the two sets of data respectively, and use the weighted sum of the variances as the loss value:
[0024] loss = -(k1 * var(S1) + k2 * var(S2))
[0025] where loss represents the loss value, var represents calculating the variance of the data in the set, and k1 and k2 are preset weight values;
[0026] S35. Take different values for angle and repeat the above steps to calculate the loss values when the target point cloud is at different angles. The angle with the maximum loss value is the direction of the target point cloud.
[0027] Further, the calculation of the point cloud bounding box is specifically as follows:
[0028] First, in the point cloud, search for the two point clouds with the farthest distance along the direction of the point cloud calculated in the previous step;
[0029] Second, along the direction perpendicular to the point cloud, search for the two point clouds with the farthest distance along this direction;
[0030] On the premise of determining the direction of the rectangular bounding box, determine the final rectangular bounding box according to the above four point clouds.
[0031] The present invention also includes a point cloud bounding box calculation system based on vehicle targets. The system applies the point cloud bounding box calculation method provided by the present invention. The system includes:
[0032] A data acquisition module for acquiring the point cloud data of the vehicle target after clustering or segmentation;
[0033] A downsampling module for downsampling the acquired point cloud data;
[0034] A point cloud direction calculation module for calculating the target point cloud direction using the coordinate information of the point cloud data in the horizontal plane;
[0035] A point cloud bounding box calculation module for calculating the point cloud bounding box according to the point cloud direction calculated by the point cloud direction calculation module.
[0036] The present invention also includes a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the point cloud bounding box calculation method provided by the present invention.
[0037] The present invention also includes a computer-readable storage medium storing a computer program, which when executed by a processor, implements the point cloud bounding box calculation method provided by the present invention.
[0038] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0039] 1. This method uses downsampling to reduce the density of the point cloud and improve the processing efficiency of the algorithm; by calculating and comparing the loss values for multiple hypothesized target directions, this method has stability in terms of direction and is suitable for the requirements of the point cloud bounding box of vehicle targets in the field of intelligent vehicle driving. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flowchart of the method of the present invention;
[0041] Figure 2 is a schematic diagram of point cloud downsampling;
[0042] Figure 3 is a schematic diagram of a vehicle coordinate system;
[0043] Figure 4 is a schematic diagram of a point cloud direction calculation method;
[0044] Figure 5 is a schematic diagram of bounding box calculation when the point cloud direction is known in the embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] The present invention will be further described in detail below with reference to the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0046] Embodiment
[0047] As Figure 1 shown, the point cloud bounding box calculation method of the present invention based on vehicle targets includes the following steps:
[0048] S1. Point cloud data acquisition, acquiring the point cloud data of the vehicle target after clustering or segmentation; for the acquired point cloud data, the points included in the data should originate from the same target, and each individual point should at least have three-dimensional coordinate information of x, y, and z.
[0049] S2. Point cloud downsampling, performing downsampling on the acquired point cloud data;
[0050] As Figure 2 shown, the point cloud downsampling is specifically as follows:
[0051] Project the point cloud onto the horizontal plane, then divide the horizontal area where the point cloud is located into grid cells of equal size. Divide the point cloud into the corresponding grid cells according to its projection on the horizontal plane. Remove the corresponding points from each grid cell according to a custom ratio or rule, and at least one point should be retained in each grid cell with points. Finally, all the points retained in the grid cells are the downsampled point cloud.
[0052] The shape and size of the grid cells can be set by oneself. However, for the purpose of downsampling, the size of the grid cells here should be small enough to ensure that there are enough points after downsampling to retain the overall characteristics of the actual target corresponding to the point cloud.
[0053] The purpose of downsampling is to reduce the redundant information in the point cloud. Since the point cloud obtained by new sensors such as lidar has a very high density, which often exceeds the actual needs of calculating the bounding box, and the disordered distribution of the point cloud makes its quantity have an impact on the execution time of the algorithm with at least a linear complexity or above. In the field of intelligent vehicle driving, such time consumption needs to be avoided.
[0054] S3. Calculate the point cloud direction. Use the coordinate information of the point cloud on the horizontal plane to calculate the point cloud direction, that is, the yaw angle of the vehicle on the horizontal plane. Since what needs to be calculated is the yaw angle of the vehicle on the horizontal plane, therefore, the use of the coordinate information of the point cloud on the horizontal plane specifically means using the x and y coordinate information of the point cloud. As Figure 3 shown, it is a schematic diagram of the vehicle coordinate system.
[0055] As Figure 4 shown, the point cloud direction calculation specifically includes:
[0056] Assume that the angle between the direction of the target point cloud and the positive x-axis is angle, and angle is positive when it is counterclockwise from the positive x-axis to the target direction, and vice versa.
[0057] S31. On the premise of a given point cloud direction, calculate the smallest rectangular box including all the point clouds, and record the four sides of the obtained rectangular box as a, b, c, and e;
[0058] S32. For any point P in the point cloud, calculate the distance d between this point and the boundary closest to it:
[0059] d = d a = min(d a , d b , d c , d e )
[0060] S33. Calculate the distance d for all points in the point cloud, and divide the calculated distance data into two groups, namely the group closest to the long side of the rectangular bounding box and the group closest to the short side:
[0061] S1 = {d|min(d a ,d b ,d c ,d e ) = da or d c}
[0062] S2 = {d|min(d a ,d b ,d c ,d e ) = d b or d e}
[0063] S34. When S1 and S2 are not empty, calculate the variances of the two sets of data respectively, and take the weighted sum of the variances as the loss value:
[0064] loss = -(k1 * var(S1) + k2 * var(S2))
[0065] where loss represents the loss value, var represents calculating the variance of the data in the set, and k1 and k2 are preset weight values;
[0066] S35. Take different values for angle and repeat the above steps to calculate the loss values when the target point cloud is at different angles. The angle with the maximum loss value is the direction of the target point cloud.
[0067] S4. Point cloud bounding box calculation. In this embodiment, specifically:
[0068] First, in the point cloud, search for the two point clouds that are farthest apart along the direction of the point cloud calculated in the previous step; as Figure 5 shown, Figure 5 points A and B in;
[0069] Secondly, search for the two point clouds that are farthest apart along the direction perpendicular to the point cloud; as Figure 5 shown, Figure 5 points C and D in;
[0070] On the premise of determining the rectangular bounding box direction, determine the final rectangular bounding box according to the above four point clouds (in special cases, there may be the same points among the above four points A, B, C, and D).
[0071] In another embodiment, a point cloud bounding box calculation system based on vehicle targets is also provided. The system applies the point cloud bounding box calculation method described in the above embodiment. The system includes:
[0072] A data acquisition module for acquiring the point cloud data of the vehicle target after clustering or segmentation;
[0073] A downsampling module for downsampling the acquired point cloud data;
[0074] A point cloud direction calculation module for calculating the target point cloud direction using the coordinate information of the point cloud data in the horizontal plane;
[0075] A point cloud bounding box calculation module for calculating the point cloud bounding box according to the point cloud direction calculated by the point cloud direction calculation module.
[0076] In another embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the point cloud bounding box calculation method described in the above embodiment is implemented.
[0077] In another embodiment, a computer-readable storage medium is further provided, storing a computer program, and when the computer program is executed by a processor, the point cloud bounding box calculation method described in the above embodiment is implemented.
[0078] It should also be noted that in this specification, terms such as "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0079] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for calculating a point cloud bounding box based on a vehicle target, characterized in that, It includes the following steps: S1. Point cloud data acquisition: acquiring the point cloud data of the vehicle target after clustering or segmentation; S2. Point cloud downsampling: downsampling the acquired point cloud data; S3. Point cloud direction calculation: using the coordinate information of the point cloud data in the horizontal plane to calculate the point cloud direction, that is, the yaw angle of the vehicle in the horizontal plane; specifically including: Suppose the angle between the direction of the target point cloud and the positive x-axis is angle , and when it is counterclockwise from the positive x-axis to the target direction angle it is positive, otherwise it is negative; S31. Given the direction of the point cloud, calculate the smallest rectangular box that includes all the point clouds, and denote the four sides of the obtained rectangular box as a , b , c , e ; S32. For any point P in the point cloud, calculate the distance between this point and its nearest boundary d : ; S33. Calculate the distance for all points in the point cloud d , and divide the calculated distance data into two groups, namely the group closest to the long side of the rectangular bounding box and the group closest to the short side: ; ; S34. When S 1 and S 2 are not empty, calculate the variances of the two sets of data respectively, and use the weighted sum of the variances as the loss value: ; Among them, loss represents the loss value, var represents the variance of the data in the calculation set, k 1 and k 2 are preset weights; S35. For angle taking different values and repeating the above steps, calculate the loss values when the target point cloud is at different angles, and the angle with the maximum loss value is the direction of the target point cloud; S4. Point cloud bounding box calculation: specifically: First, in the point cloud, search for the two point clouds with the farthest distance along the point cloud direction calculated in the previous step; Secondly, along the direction perpendicular to the point cloud, search for the two point clouds with the farthest distance along this direction; On the premise of determining the rectangular bounding box direction, determine the final rectangular bounding box according to the above four point clouds.
2. The method for calculating a point cloud bounding box based on a vehicle target according to claim 1, wherein In step S1, for the acquired point cloud data, the points included in the data should come from the same target, and each single point should at least have three-dimensional coordinate information of x, y, and z.
3. The method for calculating a point cloud bounding box based on a vehicle target according to claim 1, wherein, The point cloud downsampling is specifically as follows: Project the point cloud onto the horizontal plane, then divide the horizontal area where the point cloud is located into grid cells of equal size, divide the point cloud into the corresponding grid cells according to its projection on the horizontal plane, remove the corresponding points from each grid cell according to a custom ratio or rule, and at least retain one point in each grid cell with points. Finally, all the points retained in the grid cells are the downsampled point cloud.
4. The method for calculating a point cloud bounding box based on a vehicle target according to claim 1, wherein In step S3, since what needs to be calculated is the yaw angle of the vehicle in the horizontal plane, therefore, the use of the coordinate information of the point cloud data in the horizontal plane specifically refers to using the x and y coordinate information of the point cloud data.
5. A point cloud bounding box calculation system based on vehicle targets, characterized in that, The system applies the method described in any one of claims 1-4. The system includes: A data acquisition module for acquiring the point cloud data of the vehicle target after clustering or segmentation; A downsampling module for downsampling the acquired point cloud data; A point cloud direction calculation module for using the coordinate information of the point cloud data in the horizontal plane to calculate the target point cloud direction; A point cloud bounding box calculation module for calculating the point cloud bounding box according to the point cloud direction calculated by the point cloud direction calculation module.
6. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor implements the method described in any one of claims 1-4 when executing the computer program.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the method described in any one of claims 1-4 is implemented.
Citation Information
Patent Citations
Method and device for determining bounding box of point cloud
CN113034539A
Target shape and course estimation method and system
CN113807442A