Method for optimizing marking box of laser point cloud and electronic equipment
By expanding or shrinking the labeling box and comparing the distribution histogram, the laser point cloud labeling box is automatically adjusted, which solves the problem that the labeling box and the moving target are not fit, and fully automatic labeling is achieved, which improves the labeling efficiency.
Patent Information
- Application Number
- CN202410668820.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-05-27
AI Technical Summary
In the prior art, the labeling frame of the laser point cloud does not fit the moving target, and requires manual participation in modification, and fully automatic labeling cannot be achieved, resulting in low labeling efficiency.
By obtaining the initial annotation box, expanding or shrinking based on the preset proportion, and combining with the distribution histogram comparison, the annotation box is automatically adjusted until there is no difference in the point cloud distribution or the difference is within an acceptable range, achieving full automatic annotation.
The process of manually refining the annotation frame is eliminated, which greatly improves the labeling efficiency and realizes fully automatic labeling of laser point clouds.
Smart Images

Figure CN120340028A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of annotation of perception system data, and in particular to an optimization method for annotation frames of lidar point clouds and an electronic device. Background Art
[0002] With the continuous development of autonomous driving technology, 3D dynamic target recognition technology based on lidar point clouds has been widely applied. The 3D dynamic target recognition technology based on lidar point clouds refers to collecting lidar point cloud data centered on the vehicle itself (which can also be called lidar point clouds, point clouds, or point cloud data) through lidar scanning, and using the point cloud data for target recognition.
[0003] In order to make the recognition results more accurate, it is usually necessary to pre-train the recognition model, and the process of model training requires the use of annotated frame data that has been labeled. The current industry approach is to invest a large amount of manpower and material resources to solve the annotation problem of point cloud data. Even though some existing solutions can perform automatic annotation, there will still be situations where the annotation frame does not fit the moving target (such as pedestrians, vehicles), and manual intervention is required to modify the annotation content, and full-automatic annotation cannot be achieved. Summary of the Invention
[0004] This application provides an optimization method for annotation frames of lidar point clouds and an electronic device, which are used to obtain a second annotation frame based on a pre-acquired first annotation frame (the initially acquired one is the initial first annotation frame, and the one acquired after the first time is the first annotation frame whose position has been adjusted), and then finely adjust the first annotation frame according to the difference in point cloud distribution between the first annotation frame and the second annotation frame until there is no difference or the difference is within an acceptable error range in the point cloud distribution of the two frames, thereby achieving full-automatic point cloud annotation, eliminating the need for manual fine-tuning of the annotation frame, and greatly improving the annotation efficiency.
[0005] Based on this, the embodiments of this application provide the following technical solutions:
[0006] First aspect, the present application first provides an optimization method for annotation frames of laser point clouds. The method specifically includes: First, an electronic device obtains one or more annotation frames, and each obtained annotation frame is called a first annotation frame. After that, based on the obtained first annotation frame, a second annotation frame is obtained, and the laser point clouds included in the first annotation frame and the second annotation frame are respectively preprocessed to obtain a preprocessed first point cloud set and a preprocessed second point cloud set. After obtaining the first point cloud set and the second point cloud set, the first point cloud set and the second point cloud set are compared to obtain a first comparison result. And further determine whether the first comparison result meets a preset requirement (i.e., the first preset requirement), and in the case where the first comparison result does not meet the first preset requirement, adjust the position of the first annotation frame. Finally, the first annotation frame after position adjustment is used as the new first annotation frame, and the above steps are repeatedly executed until the termination condition for repeated execution is reached. It should be noted that in the embodiments of the present application, when the electronic device obtains the first annotation frame for the first time, the obtained first annotation frame is the initial annotation frame, and the initial annotation frame can be roughly marked manually or output by a trained annotation model, and the present application does not limit this; if the above steps need to be repeatedly executed subsequently, the first annotation frame obtained subsequently is the first annotation frame after position adjustment in the previous round. That is to say, when obtaining the first annotation frame for the kth (k≥2) time, the obtained first annotation frame is the first annotation frame obtained after position adjustment in the (k - 1)th time.
[0007] In the above implementation manner of the present application, based on the pre-obtained first annotation frame (the initial first annotation frame is obtained for the first time, and the first annotation frame obtained after the first time is the first annotation frame of the previous round after position adjustment), a second annotation frame is obtained, and then the first annotation frame is finely adjusted according to the difference in the point cloud distribution within the first annotation frame and the second annotation frame until there is no difference or the difference is within an acceptable error range in the point cloud distribution of the two frames, so as to achieve fully automatic point cloud annotation, which can eliminate the link of manual fine-tuning of the annotation frame and greatly improve the annotation efficiency.
[0008] In a possible implementation manner of the first aspect, one implementation manner of obtaining the second annotation frame based on the obtained first annotation frame can be: expanding the obtained first annotation frame according to a preset ratio to obtain the second annotation frame.
[0009] In the above implementation manner of the present application, the second annotation frame is expanded based on the first annotation frame, which is feasible.
[0010] In a possible implementation of the first aspect, if the adjusted first annotation box is used as the new first annotation box and the number of rounds of repeatedly executing the above steps is n, where n ≥ 1, then an implementation of expanding the obtained first annotation box by a preset ratio to obtain a second annotation box can be as follows: Determine the current preset ratio p according to the current round i (1 ≤ i ≤ n) of repeated execution. For example, taking the top view angle as an example, when expanding by the preset ratio p1 in the long side direction of the first annotation box, the preset ratio p can be p1; when expanding by the preset ratio p2 in the short side direction of the first annotation box, the preset ratio can also be p2, specifically determined by which dimension of position adjustment is being performed currently. The current preset ratio p has an inverse correlation with the value of the current round i. Then, expand the first annotation box obtained in the current round i by the current preset ratio p to obtain the second annotation box.
[0011] In the above implementation manner of the present application, when it is necessary to repeatedly execute the above steps in multiple rounds (assuming the number of rounds is n, n ≥ 1), the value of the preset ratio p (such as p1, p2) for expansion can be correspondingly reduced in each round of iteration, that is, the preset ratio p for expansion in each round is smaller than the previous round, so as to achieve progressive position adjustment and improve the accuracy of adaptive position adjustment.
[0012] In a possible implementation of the first aspect, an implementation of comparing the first point cloud set and the second point cloud set to obtain a first comparison result can be as follows: Calculate the first distribution histogram of the first point cloud set and the second distribution histogram of the second point cloud set respectively. Among them, the horizontal axis of each distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of each distribution histogram is used to represent the number of laser point clouds. Then, compare the two calculated distribution histograms to obtain a comparison result, and this comparison result can be called the first comparison result. It should be noted that in the embodiments of the present application, if the second annotation box is obtained by expanding the first annotation box in the long side direction, then the horizontal axis of the distribution histogram is the x-axis for the long side direction; if the second annotation box is obtained by expanding the first annotation box in the short side direction, then the horizontal axis of the distribution histogram is the y-axis for the short side direction.
[0013] In the above implementation manner of the present application, it is specifically described that the comparison of the two annotation boxes is achieved by comparing the respective distribution histograms of the first annotation box and the second annotation box. Through the distribution histogram method, the differences in the laser point clouds contained in the two annotation boxes can be directly observed, which is simple and easy to operate and has high comparison efficiency.
[0014] In a possible implementation of the first aspect, when the first comparison result does not meet the first preset requirement, one implementation of adjusting the position of the first annotation box may be: when the first comparison result is that the horizontal axis coordinate values of the first distribution histogram and the second distribution histogram are the same, and the first vertical axis value of the first distribution histogram is different from the second vertical axis value of the second distribution histogram, move the first annotation box by a preset distance.
[0015] In the above implementation manner of the present application, if the number of point clouds at some horizontal axis coordinates of the first distribution histogram and the second distribution histogram is different, it indicates that the first annotation box does not fit the corresponding laser point cloud, and the position of the first annotation box needs to be adjusted. This comparison method of directly comparing the horizontal and vertical coordinate values of the two distribution histograms is easy to implement and can improve the comparison efficiency.
[0016] In a possible implementation of the first aspect, the termination conditions for repeated execution include but are not limited to the following: 1) Until the first comparison result meets the first preset requirement. This implementation is to adjust the position of the first annotation box in multiple rounds until the laser point cloud included in the first annotation box has the same distribution as the laser point cloud included in the second annotation box. 2) Until the number of repeated executions reaches the first preset value. This implementation is to preset an upper limit on the number of repeated executions (i.e., the first preset value) in advance. When the number of repeated executions reaches this upper limit, regardless of whether the first comparison result meets the first preset requirement, it will directly end after the last repeated execution. This implementation is more applicable to scenarios with multiple complex moving targets. Because in the case of a large number of moving targets in a complex scene, there may be an overlapping situation among multiple first annotation boxes, and it may be impossible to make the first comparison result meet the first preset requirement by continuously repeating the execution. At this time, it is necessary to force a stop. 3) Until the distance between the center point position of the first annotation box obtained in the last adjustment and the center point position of the first annotation box obtained in the first acquisition reaches the second preset value. This implementation requires that the moving distance of the first annotation box obtained in the last round does not exceed a preset distance upper limit (i.e., the second preset value). For example, the second preset value can be set to the long side or the short side of the first annotation box, aiming to ensure that the adjustment range of the first annotation box is not too large, otherwise it may cause the adjusted first annotation box to include the laser point cloud of other annotation boxes and reduce the annotation accuracy.
[0017] In the above implementation manner of the present application, there can be various types of termination conditions for repeated execution, aiming to improve the annotation accuracy, improve the annotation efficiency, and have flexibility.
[0018] In a possible implementation of the first aspect, after taking the adjusted first annotation box as the new first annotation box and repeatedly executing the above steps until the termination condition for repeated execution is reached, the method may further include: taking the first annotation box obtained in the last adjustment as the final annotation box.
[0019] In the above embodiments of the present application, after the last round of position adjustment, it shows that the first annotation box has been adjusted to the optimal position. Therefore, the first annotation box obtained in the last adjustment can be taken as the final annotation box for subsequent direct application, meeting the actual application requirements.
[0020] In a possible implementation of the first aspect, the method may further include: when the first comparison result meets the first preset requirement, taking the first annotation box as the final annotation box.
[0021] In the above embodiments of the present application, if the first annotation box and the second annotation box fit during the first round of comparison, there is no need to adjust the first annotation box, meeting the actual application requirements.
[0022] In a possible implementation of the first aspect, after repeatedly executing the above steps until the termination condition for repeated execution is reached, the method may further include: obtaining a fourth annotation box based on a third annotation box, where the initial third annotation box is the first annotation box obtained in the last time; then, respectively preprocessing the laser point clouds included in the third annotation box and the fourth annotation box to obtain a preprocessed third point cloud set and a fourth point cloud set. After obtaining the second comparison result of the third point cloud set and the fourth point cloud set, it will be further determined whether the second comparison result meets the preset requirement (i.e., the second preset requirement), and when the second comparison result does not meet the second preset requirement, the position of the third annotation box is adjusted. Finally, taking the third annotation box after the position adjustment as the new third annotation box, and repeatedly executing the above steps until the termination condition for repeated execution is reached. It should be noted that in the embodiments of the application, due to the difference in the first comparison result, the situation of the first annotation box obtained in the last time is also different. In the case where the first comparison result meets the first preset requirement, the third annotation box is the initial first annotation box; in the case where the first comparison result does not meet the first preset requirement, the third annotation box is the first annotation box obtained after the last position adjustment.
[0023] In the above embodiments of the present application, the automatic position adjustment of the conservative progressive annotation box is specifically described, that is, based on the first annotation box obtained in the last time (i.e., the third annotation box), shrinking to obtain the fourth annotation box, and then adjusting the position of the third annotation box in a similar way until the termination condition is reached. The advantage of this method is that it can perform multiple aspects of automatic adjustment on the same annotation box, which can improve the annotation accuracy.
[0024] In a possible implementation of the first aspect, one way to obtain the fourth annotation box based on the third annotation box can be: shrinking the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0025] In the above implementation of the present application, the fourth annotation box is obtained by shrinking based on the third annotation box, which is feasible.
[0026] In a possible implementation of the first aspect, if the adjusted third annotation box is used as the new third annotation box and the number of rounds of repeating the above steps is m, where m ≥ 1, then one way to shrink the third annotation box according to a preset ratio to obtain the fourth annotation box can be: determining the current preset ratio q according to the current round j (1 ≤ j ≤ m) of repeated execution. For example, taking the top view angle as an example, when shrinking the preset ratio q1 in the long side direction of the third annotation box, the preset ratio can be q1; when shrinking the preset ratio q2 in the short side direction of the third annotation box, the preset ratio can also be q2, specifically determined by which dimension of position adjustment is being performed currently. The current preset ratio q has an inverse correlation with the value of the current round j. After that, shrink the third annotation box in the current round j according to the current preset ratio q to obtain the fourth annotation box.
[0027] In the above implementation of the present application, when it is necessary to repeat the above steps multiple times (assuming the number of rounds is m, m ≥ 1), the value of the preset ratio q (such as q1, q2) for shrinking can be reduced correspondingly in each round of iteration, that is, the preset ratio q for shrinking in each round is smaller than the previous round, so as to achieve progressive position adjustment and improve the accuracy of adaptive position adjustment.
[0028] In a possible implementation of the first aspect, one way to compare the third point cloud cluster and the fourth point cloud cluster to obtain the second comparison result can be: calculating the third distribution histogram of the third point cloud cluster and the fourth distribution histogram of the fourth point cloud cluster respectively, where the horizontal axis of each distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of each distribution histogram is used to represent the number of laser point clouds. Then compare the two calculated distribution histograms to obtain the comparison result, and this comparison result can be called the second comparison result. It should be noted that in the embodiments of the present application, if the fourth annotation box is obtained by shrinking the third annotation box based on the long side direction, then the horizontal axis of the distribution histogram is the x-axis for the long side direction; if the fourth annotation box is obtained by shrinking the third annotation box based on the short side direction, then the horizontal axis of the distribution histogram is the y-axis for the short side direction.
[0029] In the above embodiments of the present application, it is specifically described that the comparison of the third annotation box and the fourth annotation box is achieved by comparing their respective distribution histograms. Through the distribution histogram, the differences in the laser point clouds contained in the two annotation boxes can be directly observed, which is simple and easy to operate, and has high comparison efficiency.
[0030] In a possible implementation manner of the first aspect, when the second comparison result does not meet the second preset requirement, one implementation manner of adjusting the position of the third annotation box can be: when the second comparison result is that the horizontal axis coordinate values of the third distribution histogram and the fourth distribution histogram are the same, and the third vertical axis value of the third distribution histogram is different from the fourth vertical axis value of the fourth distribution histogram, move the third annotation box by a preset distance.
[0031] In the above embodiments of the present application, if the number of point clouds at some horizontal axis coordinates of the third distribution histogram and the fourth distribution histogram is different, it indicates that the third annotation box does not fit the corresponding laser point cloud, and the position of the third annotation box needs to be adjusted. This comparison method that directly compares the horizontal and vertical coordinate values of the two distribution histograms is easy to implement and can improve the comparison efficiency.
[0032] In a possible implementation manner of the first aspect, after taking the adjusted third annotation box as the new third annotation box and repeating the above steps until the termination condition for repeated execution is reached, the method may further include: taking the third annotation box obtained in the last adjustment as the final annotation box.
[0033] In the above embodiments of the present application, after the last round of position adjustment, it indicates that the third annotation box has been adjusted to the optimal position. Therefore, the third annotation box obtained in the last adjustment can be used as the final annotation box for subsequent direct application, which meets the actual application requirements.
[0034] In a possible implementation manner of the first aspect, the method may further include: when the second comparison result meets the second preset requirement, taking the third annotation box as the final annotation box.
[0035] In the above embodiments of the present application, if the third annotation box and the fourth annotation box fit during the first round of comparison, there is no need to adjust the third annotation box, which meets the actual application requirements.
[0036] In a possible implementation manner of the first aspect, the preprocessing method may be: ground point cloud filtering processing.
[0037] In the above embodiments of the present application, a specific implementation manner of the preprocessing is described, which has feasibility.
[0038] The second aspect of the present application provides an electronic device, which has the function of implementing the method of the first aspect or any possible implementation manner of the first aspect. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0039] The third aspect of the present application provides an electronic device, which may include a memory, a processor, and a bus system. Among them, the memory is used to store a computer program (which can also be referred to as a program or computer-readable instruction), and the processor is used to call the program stored in the memory to execute the method of the first aspect or any possible implementation manner of the first aspect of the embodiments of the present application.
[0040] The fourth aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are run on a computer, the computer can execute the method of the first aspect or any possible implementation manner of the first aspect.
[0041] The fifth aspect of the present application provides a computer program or a computer program product containing instructions. When the computer program or computer program product runs on a computer, the computer is enabled to execute the method of the first aspect or any possible implementation manner of the first aspect.
[0042] The sixth aspect of the present application provides a chip, which includes at least one processor and at least one interface circuit. The interface circuit is coupled to the processor. The at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. The at least one processor is used to run a computer program or instructions, and it has the function of implementing the method of the first aspect or any possible implementation manner of the first aspect. This function can be implemented by hardware, or by software, or by a combination of hardware and software. The hardware or software includes one or more modules corresponding to the above functions. In addition, the interface circuit is used to communicate with other modules outside the chip.
[0043] In some implementation manners of the present application, some of the one or more processors may also implement some steps of the above method in a dedicated hardware manner. For example, the processing involving a neural network model can be implemented by a dedicated neural network processor or a graphics processor.
[0044] The method provided by the embodiments of the present application can be implemented by one chip or by multiple chips cooperating with each other. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic flowchart of an optimization method for the annotation box of the laser point cloud provided by the embodiments of the present application;
[0046] Figure 2 Schematic diagram of an implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0047] Figure 3 Schematic diagram of another implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0048] Figure 4 Schematic diagram of another implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0049] Figure 5 Schematic diagram of another implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0050] Figure 6 Schematic diagram of another implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0051] Figure 7 Schematic diagram of another implementation manner for expanding the first annotation box provided by an embodiment of the present application;
[0052] Figure 8 Schematic diagram of another process for the optimization method of the annotation box of the laser point cloud provided by an embodiment of the present application;
[0053] Figure 9 Schematic diagram of a structure of an electronic device provided by an embodiment of the present application;
[0054] Figure 10 Schematic diagram of another structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0055] The embodiment of the present application provides an optimization method for the annotation box of the laser point cloud and an electronic device, which are used to obtain a second annotation box based on a pre-acquired first annotation box, and then finely adjust the first annotation box according to the difference in the point cloud distribution between the first annotation box and the second annotation box until there is no difference or the difference is within an acceptable error range in the point cloud distribution of the two boxes, so as to realize fully automatic point cloud annotation, which can save the link of manual fine-tuning the annotation box and greatly improve the annotation efficiency.
[0056] In the description and claims of this application and the above-mentioned drawings, terms such as "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is merely a way of distinguishing objects with the same attributes when describing embodiments of this application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products, or devices.
[0057] The embodiments of this application will be described below in conjunction with the drawings. Those of ordinary skill in the art will know that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems.
[0058] First, an optimization method for the annotation box of the laser point cloud provided by the embodiments of this application will be introduced. For details, please refer to Figure 1 , Figure 1 is a schematic flowchart of an optimization method for the annotation box of the laser point cloud provided by the embodiments of this application. This method may specifically include the following steps:
[0059] 101. Obtain a second annotation box based on the acquired first annotation box.
[0060] First, the electronic device will acquire one or more annotation boxes, referred to as the first annotation box. For example, when the laser point cloud data collected by lidar scanning with the vehicle itself as the center only includes one moving target (such as a pedestrian in front of the vehicle itself), then the first annotation box can be one, and this first annotation box corresponds to that passerby; another example is that when the laser point cloud data collected by lidar scanning with the vehicle itself as the center includes multiple moving targets (such as cars, trucks, tricycles, and pedestrians on the road where the vehicle is traveling), then the first annotation box can be multiple, and one first annotation box corresponds to one moving target. Whether the first annotation box is one or multiple is determined by the specific application scenario, and this application does not make any limitations in this regard.
[0061] After that, the electronic device will obtain a second annotation box based on the acquired first annotation box. In the embodiments of this application, one implementation method may be: expand the acquired first annotation box according to a preset ratio to obtain the second annotation box.
[0062] Specifically, in the embodiments of this application, since the first annotation box annotates the laser point cloud data, because this first annotation box is three-dimensional, for the convenience of description, this application will illustrate how to expand the acquired first annotation box according to a preset ratio from a top-down perspective. The following will be described separately:
[0063] (1) Expand outward along the long side direction of the first annotation box.
[0064] One implementation of expanding the obtained first annotation box according to a preset ratio can be: along the long side direction of the first annotation box, expand it according to the preset ratio p1 of the long side of the first annotation box to obtain a second annotation box.
[0065] As an example, for specific reference, see Figure 2 , Figure 2 shows 3 first annotation boxes. Taking one of the first annotation boxes as an example, assuming the length of the long side direction of this first annotation box is x1, expand this long side according to the preset ratio p1 to obtain a new length of the long side direction as x2, x2 = (1 + p1) * x1, and the length of the long side direction of the second annotation box is x2.
[0066] It should be noted that in the embodiment of the present application, if the electronic device executes step 101 for the first time, expanding outward along the long side direction of the first annotation box can be expanding outward on both sides of the long side direction simultaneously. As Figure 2 shown, it can be expanding the same size on both sides of the long side direction, that is, the size expanded on both sides is p1 * x1 * 1 / 2; or as Figure 3 shown, it can be expanding different sizes on both sides of the long side direction. For example, the size expanded on one side is p1 * x1 * a1, and the size expanded on the other side is p1 * x1 * a2, where 0 ≤ a2 < a1 ≤ 1. Specifically, the present application does not limit the specific implementation manner of the first expansion.
[0067] It should be noted here that if the electronic device needs to repeat executing step 101 subsequently, the obtained first annotation box is the first annotation box whose position has been adjusted for the first annotation box through step 103 in the previous round. And based on the first annotation box that has been adjusted once, it can be known which side of the laser point cloud along the long side direction does not fit. Correspondingly, when expanding, it can be expanded along the long side direction of the side where the laser point cloud does not fit. For specific reference, see Figure 4 , at this time, the expansion of the long side direction of the first annotation box is to expand to the non - fitting side along the long side direction, that is, expand p1 * x1 to the non - fitting side, and the other side remains unchanged.
[0068] (2) Expand outward along the short side direction of the first annotation box.
[0069] Another implementation of expanding the obtained first annotation box according to a preset ratio can be: along the short side direction of the first annotation box, expand it according to the preset ratio p2 of the short side of the first annotation box to obtain a second annotation box.
[0070] As an example, please refer to specifically Figure 5 , Figure 5 which shows three first annotation frames. Taking one of the first annotation frames as an example, assuming the length of the short side direction of the first annotation frame is y1, the short side is expanded outward according to a preset ratio p2, and the new length of the short side direction obtained is y2, where y2 = (1 + p2) * y1, and the length of the short side direction of the second annotation frame is y2.
[0071] Similarly, in the embodiment of the present application, if the electronic device executes step 101 for the first time, the expansion along the short side direction of the first annotation frame can be an expansion on both sides of the short side direction simultaneously. As Figure 5 shown, it can be an expansion of the same size on both sides of the short side direction, that is, the size of the expansion on both sides is p2 * y1 * 1 / 2; or it can be as Figure 6 shown, it can be an expansion of different sizes on both sides of the short side direction. For example, the size of the expansion on one side is p2 * y1 * b1, and the size of the expansion on the other side is p2 * y1 * b2, where 0 ≤ b2 < b1 ≤ 1. Specifically, the present application does not limit the specific implementation manner of the first expansion.
[0072] It should also be noted that if the electronic device needs to repeat the execution of step 101 subsequently, the obtained first annotation frame is the first annotation frame after the position adjustment of the first annotation frame in the previous round through step 103. Based on the first annotation frame that has been adjusted once, it can be known which side of the short side direction the laser point cloud does not fit, and accordingly, when expanding, it can be expanded along the short side direction of the side where the laser point cloud does not fit. Please refer to specifically Figure 7 , at this time, the expansion of the short side direction of the first annotation frame is an expansion on the non - fitting side of the short side direction, that is, an expansion of p2 * y1 on the non - fitting side, and the other side remains unchanged.
[0073] 102. Compare the first point cloud set and the second point cloud set to obtain a first comparison result. Among them, the first point cloud set is a point cloud set obtained by pre - processing the laser point cloud included in the first annotation frame, and the second point cloud set is a point cloud set obtained by pre - processing the laser point cloud included in the second annotation frame.
[0074] After that, pre - process the laser point clouds included in the first annotation frame and the second annotation frame respectively to obtain a pre - processed first point cloud set and a second point cloud set. Among them, the pre - processing method can be to filter the ground point cloud through the height of the laser point cloud, so as to obtain the first point cloud set and the second point cloud set.
[0075] After obtaining the first point cloud set and the second point cloud set, the first point cloud set and the second point cloud set can be compared to obtain a first comparison result.
[0076] It should be noted that, in the embodiments of the present application, one implementation manner may be: calculate the distribution histograms of the above two point clouds respectively, that is, calculate the first distribution histogram of the first point cloud and the second distribution histogram of the second point cloud. Wherein, the horizontal axis of each distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of each distribution histogram is used to represent the number of laser point clouds. Then, compare the two calculated distribution histograms to obtain a comparison result, and this comparison result can be referred to as the first comparison result. It should be noted that, in the embodiments of the present application, if the second annotation box is obtained by expanding the first annotation box based on the long side direction, then the horizontal axis of the distribution histogram is the x-axis with respect to the long side direction; if the second annotation box is obtained by expanding the first annotation box based on the short side direction, then the horizontal axis of the distribution histogram is the y-axis with respect to the short side direction.
[0077] Specifically, in some embodiments of the present application, taking the first annotation box as an example, the method for calculating the first distribution histogram of the first point cloud may be: taking the lower left corner of the first annotation box as the origin, taking the bottom line of the first annotation box as the x-axis (corresponding to the long side direction), and the left line as the y-axis (corresponding to the short side direction), construct the first annotation box coordinate system, and calculate the point cloud distribution to obtain the first distribution histogram. Wherein, the horizontal axis coordinate of the first distribution histogram is the x-axis coordinate (when corresponding to the long side direction) or the y-axis coordinate (when corresponding to the short side direction) of the laser point cloud in the annotation box coordinate system, and the vertical axis coordinate of the first distribution histogram is the number of laser point clouds at the corresponding horizontal axis coordinate.
[0078] Similarly, when calculating the second distribution histogram of the second point cloud, take the lower left corner of the second annotation box as the origin, take the bottom line of the second annotation box as the x-axis (corresponding to the long side direction), and the left line as the y-axis (corresponding to the short side direction), construct the second annotation box coordinate system, and calculate the point cloud distribution to obtain the second distribution histogram. Wherein, the horizontal axis coordinate of the second distribution histogram is the x-axis coordinate (when corresponding to the long side direction) or the y-axis coordinate (when corresponding to the short side direction) of the laser point cloud in the annotation box coordinate system, and the vertical axis coordinate of the second distribution histogram is the number of laser point clouds at the corresponding horizontal axis coordinate.
[0079] It should also be noted that, in some other embodiments of the present application, it is also possible to directly compare the number of point clouds included in the first point cloud and the second point cloud respectively to obtain the first comparison result. Specifically, the present application does not limit the comparison method of the two point clouds.
[0080] 103. In the case where the first comparison result does not meet the first preset requirement, adjust the position of the first annotation box.
[0081] After obtaining the first comparison result between the first point cloud cluster and the second point cloud cluster, it will be further determined whether the first comparison result meets the preset requirements (i.e., the first preset requirement). And in the case where the first comparison result does not meet the first preset requirement, the position of the first annotation box is adjusted.
[0082] Specifically, if the first comparison result is obtained based on the two distribution histograms calculated in step 102 above, then the specific implementation of this step is as follows: when the horizontal axis coordinate values of the first distribution histogram and the second distribution histogram in the first comparison result are the same, and the first vertical axis value of the first distribution histogram is different from the second vertical axis value of the second distribution histogram, move the first annotation box by a preset distance. That is to say, if the number of point clouds under one or more horizontal axis coordinates of the above two distribution histograms is not equal, it means that the first annotation box does not fit the laser point cloud, and the position of the first annotation box needs to be adjusted. Specifically, it can be determined on which side of the horizontal axis the first distribution histogram is unequal, and then move the center point coordinate of the first annotation box towards the unequal side (essentially moving the first annotation box, and the position movement of the first annotation box is achieved by moving the center point coordinate of the first annotation box), and the moving distance can be the expansion length.
[0083] It should also be noted that in some other embodiments of the present application, if the comparison is directly made by comparing the number of point clouds included in the first point cloud cluster and the second point cloud cluster respectively, then in this implementation manner, directly compare whether the number of laser point clouds included in the two point cloud clusters is the same. If they are not the same, it indicates that the first comparison result does not meet the first preset requirement. In this case, the position of the first annotation box needs to be adjusted, and the adjustment method is similar to the method based on the distribution histogram above, which will not be elaborated here.
[0084] 104. Take the adjusted first annotation box as the new first annotation box, and repeat the above steps 101 - 103 until the termination condition for repeated execution is reached.
[0085] Finally, take the first annotation box after position adjustment as the new first annotation box, and repeat the above steps 101 - 103 until the termination condition for repeated execution is reached.
[0086] It should be noted that in some embodiments of the present application, until the termination condition for repeated execution is reached includes but is not limited to the following several types:
[0087] (1) Until the first comparison result meets the first preset requirement.
[0088] Repeat steps 101 - 103 until the first comparison result meets the first preset requirement. This implementation method adjusts the position of the first annotation box in multiple rounds until the laser point cloud included in the first annotation box has the same distribution as the laser point cloud included in the second annotation box.
[0089] (2) Until the number of repeated executions reaches the first preset value.
[0090] Repeat steps 101 - 103 until the number of repeated executions reaches the first preset value. This implementation method presets an upper limit on the number of repeated executions (i.e., the first preset value) in advance. When the number of repeated executions reaches this upper limit, regardless of whether the first comparison result meets the first preset requirement, it will directly end after the last repeated execution. This implementation method is more applicable to scenarios with multiple complex moving targets. Because in the case of a large number of moving targets in a complex scene, there may be an overlapping situation among multiple first annotation boxes, and it may be impossible to make the first comparison result meet the first preset requirement by continuously repeating the execution. At this time, it is necessary to force a stop.
[0091] (3) Until the distance between the center point position of the first annotation box obtained from the last adjustment and the center point position of the first annotation box obtained for the first time reaches the second preset value.
[0092] Repeat steps 101 - 103 until the distance between the center point position of the first annotation box obtained from the last adjustment and the center point position of the first annotation box obtained for the first time reaches the second preset value. This implementation method requires that the moving distance of the first annotation box obtained in the last round does not exceed a preset distance upper limit (i.e., the second preset value). For example, the second preset value can be set to the long side or the short side of the first annotation box. The purpose is to ensure that the adjustment range of the first annotation box is not too large, otherwise it may cause the adjusted first annotation box to include the laser point cloud of other annotation boxes and reduce the annotation accuracy.
[0093] It should be noted that in the embodiments of the present application, when the electronic device executes step 101 for the first time, the obtained first annotation box is an initial annotation box, and the initial annotation box can be obtained by, but not limited to, the following methods: 1) First, a rough annotation (i.e., manual-assisted annotation) is performed manually on the annotation tool to obtain the initial annotation box. The existing method is to directly perform manual annotation, and then the position of the initial annotation box needs to be continuously adjusted to adjust the initial annotation box to the optimal position; after adopting the method of the embodiments of the present application, the user only needs to roughly annotate the initial annotation box, and then through the method of the embodiments of the present application, the initial annotation box can be automatically iteratively adjusted to the optimal position, achieving a significant improvement in annotation efficiency. 2) The initial annotation box can be an annotation box output by a trained annotation model, that is, unannotated data is input to the trained annotation model, and the annotation model can directly output each initial annotation box. This method of obtaining the initial annotation box has low accuracy, so it also belongs to rough annotation.
[0094] In addition, it should also be noted that if the electronic device needs to repeat the execution of step 101 subsequently, the obtained first annotation box is the first annotation box whose position has been adjusted for the first annotation box in the previous round through step 103. That is to say, when the electronic device executes step 101 for the kth (k≥2) time, the obtained first annotation box is the first annotation box obtained by executing step 103 for the (k - 1)th time.
[0095] It should also be noted that in step 101 of the embodiments of the present application, it has been described that the implementation manner of obtaining the second annotation box based on the obtained first annotation box can be to expand the obtained first annotation box according to a preset ratio. It can be to first expand in the long side direction to obtain the second annotation box, and then execute the subsequent steps 102 - 104 until the termination condition for repeated execution is reached in the long side direction; then, expand in the short side direction to obtain the second annotation box, and then execute the subsequent steps 102 - 104 until the termination condition for repeated execution is reached in the short side direction. This implementation manner is to adjust the position in the dimension of the long side direction first, and then adjust the position in the dimension of the short side direction until the first annotation box is adjusted to the optimal position. In another implementation manner, it can also be to first expand in the short side direction to obtain the second annotation box, and then execute the subsequent steps 102 - 104 until the termination condition for repeated execution is reached in the short side direction; then, expand in the long side direction to obtain the second annotation box, and then execute the subsequent steps 102 - 104 until the termination condition for repeated execution is reached in the long side direction. This implementation manner is to adjust the position in the dimension of the short side direction first, and then adjust the position in the dimension of the long side direction until the first annotation box is adjusted to the optimal position. The embodiments of the present application do not limit which dimension's position is adjusted first specifically.
[0096] When the adjustments in both the long side direction and the short side direction are completed, it indicates that the first annotation box has been adjusted to the optimal position. Therefore, the first annotation box obtained from the last adjustment can be used as the final annotation box for subsequent direct applications.
[0097] It should be noted that in some embodiments of the present application, if the first comparison result meets the first preset requirement, for example, the number of point clouds at each horizontal axis coordinate of the first distribution histogram and the second distribution histogram are equal, indicating that the initial first annotation box fits the included laser point cloud, then the initial first annotation box is already in the optimal position without adjustment. At this time, the initial first annotation box can be directly used as the final annotation box for subsequent direct applications.
[0098] It should also be noted that in some embodiments of the present application, when it is necessary to repeatedly execute steps 101 - 103 in multiple rounds (assuming the round is n, n≥1), the value of the preset expansion ratio p (such as p1, p2) can be correspondingly reduced in each round of iteration, that is, the preset expansion ratio p in each round is smaller than the previous round to achieve a progressive position adjustment. Specifically, the implementation method of obtaining the second annotation box based on the first annotation box in each round can be: determine the current preset ratio p according to the current round i (1≤i≤n) of repeated execution. The preset ratio p can be p1 or p2, specifically determined by which dimension's position adjustment is being performed currently. The current preset ratio p has an inverse correlation with the value of the current round i. Then, expand the first annotation box obtained in the current round i according to the current preset ratio p to obtain the second annotation box.
[0099] It should also be noted that in some other embodiments of the present application, a conservative progressive position adjustment can also be achieved. For details, please refer to Figure 8 , Figure 8 which is another flowchart of the method for optimizing the annotation box of the laser point cloud provided by the embodiments of the present application. The method can specifically include the following steps:
[0100] 801. Obtain a second annotation box based on the acquired first annotation box.
[0101] 802. Compare the first point cloud set and the second point cloud set to obtain a first comparison result, where the first point cloud set is the point cloud set obtained by preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is the point cloud set obtained by preprocessing the laser point cloud included in the second annotation box.
[0102] 803. When the first comparison result does not meet the first preset requirement, adjust the position of the first annotation box.
[0103] 804. Use the adjusted first annotation box as the new first annotation box, and repeat the above steps 801-803 until the termination condition for repeated execution is reached.
[0104] Steps 801-804 are similar to the above steps 101-104. For the specific implementation method, refer to the above steps 101-104, which will not be elaborated here.
[0105] 805. Obtain a fourth annotation box based on the third annotation box, where the initial third annotation box is the first annotation box obtained last time.
[0106] After that, to obtain a fourth annotation box based on the third annotation box, it should be noted that the initial third annotation box is the first annotation box obtained last in the above steps 801-804. Due to different first comparison results, the situations of the first annotation box obtained last time are also different, which will be elaborated separately below:
[0107] (1) The situation where the first comparison result meets the first preset requirement
[0108] In the above steps 801-804, if when the electronic device executes step 801 for the first time, the first annotation box obtained is the initial annotation box (i.e., the initial first annotation box), and if the first comparison result between the first point cloud set of the initial first annotation box and the second point cloud set of the second annotation box obtained based on the initial box meets the first preset requirement, it indicates that the initial first annotation box fits the included laser point cloud, and then the initial first annotation box is already in the best position without adjustment. At this time, the third annotation box is the initial first annotation box.
[0109] (2) The situation where the first comparison result does not meet the first preset requirement
[0110] In the above steps 801-804, if the first comparison result does not meet the first preset requirement, the electronic device needs to repeatedly execute steps 801-803 for multiple rounds until the termination condition for repeated execution is reached. At this time, the third annotation box is the first annotation box obtained after the last position adjustment.
[0111] It should be noted that in some embodiments of the present application, one implementation method for the electronic device to obtain the fourth annotation box based on the third annotation box can be: shrink the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0112] Similarly, in the embodiments of the present application, since the third annotation box annotates the laser point cloud data, and because the third annotation box is three-dimensional, for the convenience of description, the present application uses a top-down perspective to illustrate how to shrink the obtained third annotation box according to a preset ratio. The following will be described separately:
[0113] (1)Shrink along the long side direction of the third annotation box.
[0114] One implementation of shrinking the obtained third annotation box according to a preset ratio can be: along the long side direction of the third annotation box, shrink according to the preset ratio q1 of the long side of the third annotation box to obtain a fourth annotation box. The shrinking method is similar to the above-mentioned expanding method and will not be elaborated here.
[0115] (2)Shrink along the short side direction of the third annotation box.
[0116] One implementation of shrinking the obtained third annotation box according to a preset ratio can be: along the short side direction of the third annotation box, shrink according to the preset ratio q2 of the short side of the third annotation box to obtain a fourth annotation box. The shrinking method is similar to the above-mentioned expanding method and will not be elaborated here.
[0117] 806. Compare the third point cloud cluster and the fourth point cloud cluster to obtain a second comparison result, where the third point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the third annotation box, and the fourth point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the fourth annotation box.
[0118] After that, preprocess the laser point clouds included in the third annotation box and the fourth annotation box respectively to obtain the preprocessed third point cloud cluster and fourth point cloud cluster. Among them, the preprocessing method can be to filter the ground point cloud through the height of the laser point cloud, so as to obtain the above-mentioned third point cloud cluster and fourth point cloud cluster.
[0119] After obtaining the third point cloud cluster and the fourth point cloud cluster, the third point cloud cluster and the fourth point cloud cluster can be compared to obtain a second comparison result.
[0120] It should be noted that in an embodiment of the present application, one implementation can be: calculate the distribution histograms of the above two point cloud clusters respectively, that is, calculate the third distribution histogram of the third point cloud cluster and the fourth distribution histogram of the fourth point cloud cluster respectively. Among them, the horizontal axis of each distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of each distribution histogram is used to represent the number of laser point clouds. Then, compare the two calculated distribution histograms to obtain a comparison result, and this comparison result can be called the second comparison result. It should be noted that in an embodiment of the present application, if the fourth annotation box is obtained by shrinking the third annotation box along the long side direction, then the horizontal axis of the distribution histogram is the x-axis for the long side direction; if the fourth annotation box is obtained by shrinking the third annotation box along the short side direction, then the horizontal axis of the distribution histogram is the y-axis for the short side direction.
[0121] Specifically, in some embodiments of the present application, taking the third annotation box as an example, the method for calculating the third distribution histogram of the third point cloud set may be as follows: taking the lower left corner of the third annotation box as the origin, the bottom line of the third annotation box as the x-axis (corresponding to the long side direction), and the left side line as the y-axis (corresponding to the short side direction), a coordinate system of the third annotation box is constructed, and the point cloud distribution is calculated to obtain the third distribution histogram. Among them, the horizontal axis coordinate of the third distribution histogram is the x-axis coordinate (when corresponding to the long side direction) or the y-axis coordinate (when corresponding to the short side direction) of the laser point cloud in the annotation box coordinate system, and the vertical axis coordinate of the third distribution histogram is the number of laser point clouds at the corresponding horizontal axis coordinate.
[0122] Similarly, when calculating the fourth distribution histogram of the fourth point cloud set, taking the lower left corner of the fourth annotation box as the origin, the bottom line of the fourth annotation box as the x-axis (corresponding to the long side direction), and the left side line as the y-axis (corresponding to the short side direction), a coordinate system of the fourth annotation box is constructed, and the point cloud distribution is calculated to obtain the fourth distribution histogram. Among them, the horizontal axis coordinate of the fourth distribution histogram is the x-axis coordinate (when corresponding to the long side direction) or the y-axis coordinate (when corresponding to the short side direction) of the laser point cloud in the annotation box coordinate system, and the vertical axis coordinate of the fourth distribution histogram is the number of laser point clouds at the corresponding horizontal axis coordinate.
[0123] It should also be noted that in some other embodiments of the present application, the comparison can also be directly made by comparing the number of point clouds included in the third point cloud set and the fourth point cloud set respectively to obtain the second comparison result. Specifically, the present application does not limit the comparison method of the two point cloud sets.
[0124] 807. In the case where the second comparison result does not meet the second preset requirement, the position of the third annotation box is adjusted.
[0125] After obtaining the second comparison result of the third point cloud set and the fourth point cloud set, it will be further determined whether the second comparison result meets the preset requirement (i.e., the second preset requirement), and in the case where the second comparison result does not meet the second preset requirement, the position of the third annotation box is adjusted.
[0126] Specifically, if the second comparison result is obtained based on the two distribution histograms calculated in step 806 above, the specific implementation of this step is as follows: when the horizontal axis coordinate values of the third distribution histogram and the fourth distribution histogram are the same in the second comparison result, and the third vertical axis value of the third distribution histogram is different from the fourth vertical axis value of the fourth distribution histogram, move the third annotation box by a preset distance. That is to say, if the number of point clouds under one or more horizontal axis coordinates of the above two distribution histograms is not equal, it means that the third annotation box does not fit the laser point cloud, and the position of the third annotation box needs to be adjusted. Specifically, it can be determined which side of the horizontal axis the third distribution histogram is unequal, and then move the center point coordinate of the third annotation box towards the unequal side (essentially moving the third annotation box, and the position movement of the third annotation box is achieved by moving the center point coordinate of the third annotation box), and the moving distance can be the contraction length.
[0127] It should also be noted that in some other embodiments of the present application, if the comparison is directly made by comparing the number of point clouds included in the third point cloud set and the fourth point cloud set respectively, then in this implementation manner, directly compare whether the number of laser point clouds included in the two point cloud sets is the same. If they are not the same, it indicates that the second comparison result does not meet the second preset requirement. In this case, the position of the third annotation box needs to be adjusted, and the adjustment method is similar to the method based on the distribution histogram above, which will not be elaborated here.
[0128] 808. Use the adjusted third annotation box as the new third annotation box, and repeat the above steps 805 - 807 until the termination condition for repeated execution is reached.
[0129] Finally, use the third annotation box after position adjustment as the new third annotation box, and repeat the above steps 805 - 807 until the termination condition for repeated execution is reached.
[0130] It should be noted that in some embodiments of the present application, until the termination condition for repeated execution is reached includes but is not limited to the following several cases:
[0131] (1) Until the second comparison result meets the second preset requirement.
[0132] Repeat steps 805 - 807 until the second comparison result meets the second preset requirement. This implementation manner is to adjust the position of the third annotation box in multiple rounds until the laser point cloud included in the third annotation box has the same distribution as the laser point cloud included in the fourth annotation box.
[0133] (2) Until the number of repeated executions reaches the third preset value.
[0134] Repeat steps 805 - 807 until the number of repeated executions reaches the third preset value. This implementation method presets an upper limit for the number of repeated executions (i.e., the third preset value) in advance. When the number of repeated executions reaches this upper limit, regardless of whether the second comparison result meets the second preset requirement, it will directly end after the last repeated execution. This implementation method is more applicable to scenarios with multiple complex moving targets. Because in the case of a large number of moving targets in a complex scene, there may be an overlapping situation among multiple third annotation frames. Continuing to repeat the execution may not be able to make the second comparison result meet the second preset requirement. In this case, it is necessary to force a stop.
[0135] (3) Until the distance between the center point positions of the third annotation frame obtained in the last adjustment and the third annotation frame obtained in the first acquisition reaches the fourth preset value.
[0136] Repeat steps 805 - 807 until the distance between the center point positions of the third annotation frame obtained in the last adjustment and the third annotation frame obtained in the first acquisition reaches the fourth preset value. This implementation method requires that the moving distance of the third annotation frame obtained in the last round does not exceed a preset distance upper limit (i.e., the fourth preset value). For example, the fourth preset value can be set to the long side or the short side of the third annotation frame. The purpose is to ensure that the adjustment range of the third annotation frame is not too large, otherwise it may include the laser point clouds of other annotation frames in the adjusted third annotation frame, reducing the annotation accuracy.
[0137] It should also be noted that in step 805 of the embodiment of the present application, it has been described that the implementation method of obtaining the fourth annotation frame based on the third annotation frame can be to shrink the third annotation frame according to a preset ratio. It can be to first shrink the third annotation frame in the long side direction to obtain the fourth annotation frame, and then execute the subsequent steps 806 - 808 until the termination condition for repeated execution is reached in the long side direction; afterwards, shrink the fourth annotation frame in the short side direction to obtain the fourth annotation frame, and then execute the subsequent steps 806 - 808 until the termination condition for repeated execution is reached in the short side direction. This implementation method first adjusts the position in the dimension of the long side direction and then in the dimension of the short side direction until the third annotation frame is adjusted to the best position. In another implementation method, it can also be to first shrink the third annotation frame in the short side direction to obtain the fourth annotation frame, and then execute the subsequent steps 806 - 808 until the termination condition for repeated execution is reached in the short side direction; afterwards, shrink the fourth annotation frame in the long side direction to obtain the fourth annotation frame, and then execute the subsequent steps 806 - 808 until the termination condition for repeated execution is reached in the long side direction. This implementation method first adjusts the position in the dimension of the short side direction and then in the dimension of the long side direction until the third annotation frame is adjusted to the best position. The embodiment of the present application does not limit which dimension of the position is adjusted first specifically.
[0138] When the adjustments in both the long side direction and the short side direction are completed, it indicates that the third annotation box has been adjusted to the optimal position. Therefore, the third annotation box obtained from the last adjustment can be used as the final annotation box for subsequent direct applications.
[0139] It should be noted that in some embodiments of the present application, if the second comparison result meets the second preset requirement. For example, the number of point clouds at each horizontal axis coordinate of the third distribution histogram and the fourth distribution histogram are equal, indicating that the initial third annotation box fits the included laser point cloud, then the initial third annotation box is already in the optimal position without adjustment. At this time, the initial third annotation box can be directly used as the final annotation box for subsequent direct applications.
[0140] It should also be noted that in some embodiments of the present application, when it is necessary to repeatedly execute steps 805 - 807 in multiple rounds (assuming the number of rounds is m, m ≥ 1), the value of the preset shrinkage ratio q (such as q1, q2) can be decreased correspondingly in each round of iteration. That is, the preset shrinkage ratio q in each round is smaller than the previous round to achieve a progressive position adjustment. Specifically, the implementation manner of obtaining the fourth annotation box based on the third annotation box in each round can be: determining the current preset ratio q according to the current round j (1 ≤ j ≤ m) of repeated execution. This preset ratio q can be q1 or q2, specifically determined by which dimension's position adjustment is being performed currently. The current preset ratio q has an inverse correlation with the value of the current round j. Then, the third annotation box in the current round j is shrunk according to the current preset ratio q to obtain the fourth annotation box.
[0141] Based on the above embodiments, to better implement the above solutions of the embodiments of the present application, relevant devices for implementing the above solutions are also provided below. Specifically, refer to Figure 9 , Figure 9A schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 900 may specifically include: a first acquisition module 901, a first comparison module 902, a first adjustment module 903, and a first loop trigger module 904. Among them, the first acquisition module 901 is configured to obtain a second annotation box according to the acquired first annotation box; the first comparison module 902 is configured to compare a first point cloud set and a second point cloud set to obtain a first comparison result, where the first point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the second annotation box; the first adjustment module 903 is configured to adjust the position of the first annotation box when the first comparison result does not meet a first preset requirement; the first loop trigger module 904 is configured to use the adjusted first annotation box as the new first annotation box, and trigger the first acquisition module 901, the first comparison module 902, and the first adjustment module 903 to repeatedly execute their respective functions until the termination condition for repeated execution is reached.
[0142] In a possible design, the first acquisition module 901 is specifically configured to: expand the acquired first annotation box according to a preset ratio to obtain a second annotation box.
[0143] In a possible design, the number of rounds for the first loop trigger module 904 to trigger the first acquisition module 901, the first comparison module 902, and the first adjustment module 903 to repeatedly execute their respective functions is n, n≥1. The first acquisition module 901 is further specifically configured to: determine a current preset ratio p according to the current round i of repeated execution, and the current preset ratio p has an inverse correlation with the value of the current round i, 1≤i≤n; expand the first annotation box acquired in the current round i according to the current preset ratio p to obtain a second annotation box.
[0144] In a possible design, the first comparison module 902 is specifically configured to: respectively calculate a first distribution histogram of the first point cloud set and a second distribution histogram of the second point cloud set, where the horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; compare the first distribution histogram with the second distribution histogram to obtain a first comparison result.
[0145] In a possible design, the first adjustment module 903 is specifically configured to: move the first annotation box a preset distance when the first comparison result is that the horizontal axis coordinate values of the first distribution histogram and the second distribution histogram are the same, and the first vertical axis value of the first distribution histogram is different from the second vertical axis value of the second distribution histogram.
[0146] In a possible design, the condition for terminating the repeated execution includes: until the first comparison result meets the first preset requirement; or, until the number of rounds of repeated execution reaches a first preset value; or, until the distance between the center point position of the first annotation box obtained in the last adjustment and the center point position of the first annotation box obtained in the first acquisition reaches a second preset value.
[0147] In a possible design, the first loop trigger module 904 is further configured to: use the first annotation box obtained in the last adjustment as the final annotation box.
[0148] In a possible design, the first adjustment module 903 is further configured to: use the first annotation box as the final annotation box when the first comparison result meets the first preset requirement.
[0149] In a possible design, the electronic device 900 further includes: a second acquisition module 905, a second comparison module 906, a second adjustment module 907, and a second loop trigger module 908. Among them, the second acquisition module 905 is configured to obtain a fourth annotation box according to a third annotation box, where the third annotation box is the first annotation box obtained in the last acquisition; the second comparison module 906 is configured to compare a third point cloud set and a fourth point cloud set to obtain a second comparison result, where the third point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the third annotation box, and the fourth point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the fourth annotation box; the second adjustment module 907 is configured to adjust the position of the third annotation box when the second comparison result does not meet a second preset requirement; the second loop trigger module 908 is configured to use the adjusted third annotation box as the new third annotation box, and trigger the second acquisition module, the second comparison module, and the second adjustment module to repeatedly execute their respective functions until the termination condition for repeated execution is reached.
[0150] In a possible design, the second acquisition module 905 is specifically configured to: shrink the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0151] In a possible design, the number of rounds for the second loop trigger module 908 to trigger the second acquisition module 905, the second comparison module 906, and the second adjustment module 907 to repeatedly execute their respective functions is m, m≥1. The second acquisition module 905 is further specifically configured to: determine a current preset ratio q according to the current round j of repeated execution, where the current preset ratio q has an inverse correlation with the value of the current round j, 1≤j≤m; shrink the third annotation box in the current round j according to the current preset ratio q to obtain the fourth annotation box.
[0152] In a possible design, the second comparison module 906 is specifically configured to: calculate the third distribution histogram of the third point cloud set and the fourth distribution histogram of the fourth point cloud set respectively, where the horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; compare the third distribution histogram with the fourth distribution histogram to obtain a second comparison result.
[0153] In a possible design, the second adjustment module 907 is specifically configured to: when the second comparison result is that the horizontal axis coordinate values of the third distribution histogram and the fourth distribution histogram are the same, and the third vertical axis value of the third distribution histogram is different from the fourth vertical axis value of the fourth distribution histogram, move the third annotation box by a preset distance.
[0154] In a possible design, the second loop trigger module 908 is further configured to: use the third annotation box obtained by the last adjustment as the final annotation box.
[0155] In a possible design, the second adjustment module 907 is further configured to: when the second comparison result meets the second preset requirement, use the third annotation box as the final annotation box.
[0156] In a possible design, the preprocessing method includes: ground point cloud filtering processing.
[0157] It should be noted that the information interaction, execution process, etc. between the modules / units in the electronic device 900 are based on the same concept as the above method embodiments in this application. For specific content, reference can be made to the description in the method embodiments shown above in this application, which will not be elaborated here.
[0158] Next, another electronic device provided in the embodiments of the present application will be introduced. Please refer to Figure 10 , Figure 10 which is a schematic structural diagram of the electronic device provided in the embodiments of the present application. Each module of the electronic device 900 described in the corresponding embodiments can be deployed on the electronic device 1000 to implement Figure 9 the functions corresponding to the various modules of the electronic device 900 described in the corresponding embodiments, and are used to implement Figure 9Corresponding to the functions of the electronic device 900 in the embodiments, specifically, the electronic device 1000 is implemented by one or more servers. The electronic device 1000 may vary significantly due to configuration or performance differences. It may include one or more central processing units (CPUs) 1022 and a memory 1032, and one or more storage media 1030 (such as one or more mass storage devices) for storing application programs 1042 or data 1044. Among them, the memory 1032 and the storage media 1030 may be transient storage or persistent storage. The programs stored in the storage media 1030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations for the electronic device 1000. Further, the central processing unit 1022 may be configured to communicate with the storage media 1030 and execute a series of instruction operations in the storage media 1030 on the electronic device 1000.
[0159] The electronic device 1000 may further include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input / output interfaces 1058, and / or one or more operating systems 1041, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0160] In the embodiments of the present application, the central processing unit 1022 is used to execute Figure 1 or Figure 8 the steps executed by the electronic device in the corresponding embodiments. For example, the central processing unit 1022 may be used to: First, obtain a second annotation box according to the acquired first annotation box. Then, preprocess the laser point clouds included in the first annotation box and the second annotation box respectively to obtain a preprocessed first point cloud set and a second point cloud set. Among them, the preprocessing method may be to filter the ground point cloud through the height of the laser point cloud to obtain the first point cloud set and the second point cloud set. After obtaining the first point cloud set and the second point cloud set, the first point cloud set and the second point cloud set can be compared to obtain a first comparison result. After obtaining the first comparison result of the first point cloud set and the second point cloud set, it will be further determined whether the first comparison result meets a preset requirement (i.e., the first preset requirement), and in the case where the first comparison result does not meet the first preset requirement, the position of the first annotation box is adjusted. Finally, the first annotation box after the position adjustment is used as the new first annotation box, and the above steps are repeatedly executed until the termination condition for repeated execution is reached.
[0161] It should be noted that the specific manner in which the central processing unit 1022 executes the above steps is the same as that in the present application Figure 1 orFigure 8 The corresponding method embodiments are based on the same concept, and the technical effects brought by them are also the same as those of the above embodiments of the present application. For specific content, reference can be made to the descriptions in the method embodiments shown above in the present application, and details will not be repeated here.
[0162] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided in the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be various, such as analog circuits, digital circuits or dedicated circuits. However, for the present application, software program implementation is a better implementation method in more cases. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disc of a computer, etc., and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0164] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0165] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions may be transmitted from a website, a computer, a training device, or a data center to another website, a computer, a training device, or a data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
Claims
1. An optimization method for the annotation box of laser point cloud, characterized in that, Including: Obtaining a second annotation box based on the acquired first annotation box; Comparing a first point cloud set and a second point cloud set to obtain a first comparison result, where the first point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the second annotation box; Adjusting the position of the first annotation box when the first comparison result does not meet the first preset requirement; Taking the adjusted first annotation box as the new first annotation box, and repeating the above steps until the termination condition for repeated execution is reached.
2. The method according to claim 1, characterized in that, The obtaining the second annotation box according to the acquired first annotation box includes: Expanding the acquired first annotation box by a preset ratio to obtain a second annotation box.
3. The method according to claim 2, wherein The number of rounds of taking the adjusted first annotation box as the new first annotation box and repeating the above steps is n, n≥1, and the expanding the acquired first annotation box by a preset ratio to obtain a second annotation box includes: Determining a current preset ratio p according to the current round i of repeated execution, where the current preset ratio p has an inverse correlation with the value of the current round i, 1≤i≤n; Expanding the first annotation box acquired in the current round i by the current preset ratio p to obtain a second annotation box.
4. The method according to any one of claims 1-3, characterized in that The comparing the first point cloud set and the second point cloud set to obtain a first comparison result includes: Calculating a first distribution histogram of the first point cloud set and a second distribution histogram of the second point cloud set respectively, where the horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; Comparing the first distribution histogram with the second distribution histogram to obtain a first comparison result.
5. The method according to claim 4, wherein The adjusting the position of the first annotation box when the first comparison result does not meet the first preset requirement includes: When the first comparison result is that the horizontal axis coordinate values of the first distribution histogram and the second distribution histogram are the same, and the first vertical axis value of the first distribution histogram is different from the second vertical axis value of the second distribution histogram, moving the first annotation box by a preset distance.
6. The method according to any one of claims 1-5, characterized in that The until the termination condition for repeated execution is reached includes: Until the first comparison result meets the first preset requirement; Or, Until the number of rounds of repeated execution reaches a first preset value; Or, Until the distance between the center point position of the first annotation box obtained by the last adjustment and the center point position of the first annotation box obtained for the first time reaches a second preset value.
7. The method according to any one of claims 1-6, characterized in that, After taking the adjusted first annotation box as the new first annotation box and repeating the above steps until the termination condition for repeated execution is reached, the method further includes: Taking the first annotation box obtained by the last adjustment as the final annotation box.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: When the first comparison result meets the first preset requirement, taking the first annotation box as the final annotation box.
9. The method according to any one of claims 1 to 6, characterized in that After repeating the above steps until the termination condition for repeated execution is reached, the method further includes: According to the third annotation box, a fourth annotation box is obtained, where the third annotation box is the last obtained first annotation box; The third point cloud cluster and the fourth point cloud cluster are compared to obtain a second comparison result, where the third point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the third annotation box, and the fourth point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the fourth annotation box; In the case where the second comparison result does not meet the second preset requirement, the position of the third annotation box is adjusted; The adjusted third annotation box is used as the new third annotation box, and the above steps are repeatedly executed until the termination condition for repeated execution is reached.
10. The method according to claim 9, wherein The obtaining of the fourth annotation box according to the third annotation box includes: The third annotation box is shrunk according to a preset ratio to obtain the fourth annotation box.
11. The method according to claim 10, characterized in that, The number of rounds of repeatedly executing the above steps with the adjusted third annotation box as the new third annotation box is m, m≥1. The shrinking of the third annotation box according to a preset ratio to obtain the fourth annotation box includes: Determine the current preset ratio q according to the current round j of repeated execution. The current preset ratio q has an inverse correlation with the value of the current round j, 1≤j≤m; The third annotation box in the current round j is shrunk according to the current preset ratio q to obtain the fourth annotation box.
12. The method according to any one of claims 9-11, characterized in that, The comparison of the third point cloud cluster and the fourth point cloud cluster to obtain the second comparison result includes: Calculate the third distribution histogram of the third point cloud cluster and the fourth distribution histogram of the fourth point cloud cluster respectively. The horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; The third distribution histogram is compared with the fourth distribution histogram to obtain the second comparison result.
13. The method according to claim 12, wherein The adjusting the position of the third annotation box in the case where the second comparison result does not meet the second preset requirement includes: In the case where the second comparison result is that the horizontal axis coordinate values of the third distribution histogram and the fourth distribution histogram are the same, and the third vertical axis value of the third distribution histogram is different from the fourth vertical axis value of the fourth distribution histogram, move the third annotation box a preset distance.
14. The method according to any one of claims 9 - 13, characterized in that After repeatedly executing the above steps with the adjusted third annotation box as the new third annotation box until the termination condition for repeated execution is reached, the method further includes: The last adjusted third annotation box is used as the final annotation box.
15. The method according to any one of claims 9-14, characterized in that, The method further includes: In the case where the second comparison result meets the second preset requirement, the third annotation box is used as the final annotation box.
16. The method according to any one of claims 1-15, characterized in that, The preprocessing method includes: Ground point cloud filtering processing.
17. An electronic device, characterized in that, It includes: A first acquisition module for obtaining a second annotation box according to the acquired first annotation box; The first comparison module is used to compare the first point cloud set and the second point cloud set to obtain a first comparison result, where the first point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the second annotation box; The first adjustment module is used to adjust the position of the first annotation box when the first comparison result does not meet the first preset requirement; The first loop trigger module is used to use the adjusted first annotation box as the new first annotation box, and trigger the first acquisition module, the first comparison module, and the first adjustment module to repeat their respective functions until the termination condition of the repeated execution is reached.
18. The device according to claim 17, characterized in that, The first acquisition module specifically is used for: Expand the acquired first annotation box according to a preset ratio to obtain a second annotation box.
19. The device according to claim 18, characterized in that, The number of rounds in which the first loop trigger module triggers the first acquisition module, the first comparison module, and the first adjustment module to repeat their respective functions is n, n≥1. The first acquisition module is specifically further used for: Determine the current preset ratio p according to the current round i of the repeated execution, and the current preset ratio p has an inverse correlation with the value of the current round i, 1≤i≤n; Expand the first annotation box acquired in the current round i according to the current preset ratio p to obtain a second annotation box.
20. The device according to any one of claims 17-19, characterized in that, The first comparison module specifically is used for: Calculate the first distribution histogram of the first point cloud set and the second distribution histogram of the second point cloud set respectively, where the horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; Compare the first distribution histogram with the second distribution histogram to obtain a first comparison result.
21. The device according to claim 20, characterized in that, The first adjustment module specifically is used for: When the first comparison result is that the horizontal axis coordinate values of the first distribution histogram and the second distribution histogram are the same, and the first vertical axis value of the first distribution histogram is different from the second vertical axis value of the second distribution histogram, move the first annotation box a preset distance.
22. The device according to any one of claims 17-21, characterized in that The "until the termination condition of the repeated execution is reached" includes: Until the first comparison result meets the first preset requirement; Or, Until the number of rounds of repeated execution reaches the first preset value; Or, Until the distance between the center point position of the first annotation box obtained by the last adjustment and the center point position of the first annotation box obtained for the first time reaches the second preset value.
23. The device according to any one of claims 17 - 22, characterized in that, The first loop trigger module is further used for: Use the first annotation box obtained by the last adjustment as the final annotation box.
24. The device according to any one of claims 17-23, characterized in that, The first adjustment module is further used for: When the first comparison result meets the first preset requirement, use the first annotation box as the final annotation box.
25. The device according to any one of claims 17-22, characterized in that, The electronic device further includes: The second acquisition module is used to obtain a fourth annotation box according to the third annotation box, where the third annotation box is the first annotation box obtained for the last time; A second comparison module, configured to compare the third point cloud cluster and the fourth point cloud cluster to obtain a second comparison result, where the third point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the third annotation box, and the fourth point cloud cluster is a point cloud set obtained by preprocessing the laser point cloud included in the fourth annotation box; A second adjustment module, configured to adjust the position of the third annotation box when the second comparison result does not meet the second preset requirement; A second loop trigger module, configured to use the adjusted third annotation box as the new third annotation box, and trigger the second acquisition module, the second comparison module, and the second adjustment module to repeatedly execute their respective functions until the termination condition for repeated execution is reached.
26. The device according to claim 25, characterized in that, The second acquisition module specifically is configured to: Shrink the third annotation box according to a preset ratio to obtain a fourth annotation box.
27. The device according to claim 26, characterized in that, The number of rounds for which the second loop trigger module triggers the second acquisition module, the second comparison module, and the second adjustment module to repeatedly execute their respective functions is m, m≥1. The second acquisition module is further specifically configured to: Determine a current preset ratio q according to the current round j of repeated execution, where the current preset ratio q has an inverse correlation with the value of the current round j, 1≤j≤m; Shrink the third annotation box in the current round j according to the current preset ratio q to obtain a fourth annotation box.
28. The device according to any one of claims 25 - 27, characterized in that The second comparison module specifically is configured to: Calculate a third distribution histogram of the third point cloud cluster and a fourth distribution histogram of the fourth point cloud cluster respectively, where the horizontal axis of the distribution histogram is used to represent the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to represent the number of laser point clouds; Compare the third distribution histogram with the fourth distribution histogram to obtain a second comparison result.
29. The device according to claim 28, characterized in that, The second adjustment module specifically is configured to: When the second comparison result is that the horizontal axis coordinate values of the third distribution histogram and the fourth distribution histogram are the same, and the third vertical axis value of the third distribution histogram is different from the fourth vertical axis value of the fourth distribution histogram, move the third annotation box a preset distance.
30. The device according to any one of claims 25 - 29, characterized in that, The second loop trigger module is further configured to: Use the third annotation box obtained by the last adjustment as the final annotation box.
31. The device according to any one of claims 25-30, characterized in that, The second adjustment module is further configured to: When the second comparison result meets the second preset requirement, use the third annotation box as the final annotation box.
32. The device according to any one of claims 17-31, characterized in that, The preprocessing method includes: Ground point cloud filtering processing.
33. An electronic device, including a processor and a memory, the processor is coupled to the memory, and is characterized in that The memory is used to store programs; The processor is configured to execute the programs in the memory, so that the electronic device executes the method according to any one of claims 1-16.
34. A computer storage medium, characterized in that, Stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method according to any one of claims 1-16 is implemented.
35. A computer program product, characterized in that, The computer program product contains computer-readable instructions, which implement the method according to any one of claims 1-16 when the computer-readable instructions are executed by a processor.
36. A chip, the chip comprising a processor and a data interface, characterized in that, The processor reads the instructions stored on the memory through the data interface and executes the method according to any one of claims 1-16.
Citation Information
Patent Citations
Point cloud labeling method and device thereof and electronic equipment
CN112990293A
Point cloud labeling method and device, storage medium and electronic equipment
CN113689508A
Point cloud data processing method and system
WO2023072055A1