A method for optimizing a bounding box of a laser point cloud and an electronic device
By expanding or shrinking the initial annotation box and adjusting its position using the distribution histogram, the problem of the laser point cloud data annotation box not fitting the moving target is solved, achieving fully automatic and efficient annotation.
Patent Information
- Application Number
- CN202410668820.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2044-05-27
AI Technical Summary
In existing technologies, the annotation boxes of laser point cloud data do not fit the moving targets, requiring manual intervention for modification, which makes fully automatic annotation impossible and results in low annotation efficiency.
By acquiring the initial annotation box, expanding or shrinking it based on a preset ratio, and comparing it with the distribution histogram, the position of the annotation box is gradually adjusted until there is no difference in the point cloud distribution or the difference is within an acceptable range, thus achieving fully automatic annotation.
It eliminates the need for manual refinement of annotation boxes, significantly improving annotation efficiency, accuracy, and automation.
Smart Images

Figure CN120340028B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of annotation of perception system data, and more particularly to an optimization method for annotation boxes of laser point clouds and an electronic device. Background Technology
[0002] With the continuous development of autonomous driving technology, 3D dynamic target recognition technology based on laser point clouds has been widely used. 3D dynamic target recognition technology based on laser point clouds refers to the use of LiDAR to scan and collect laser point cloud data (also called laser point cloud, point cloud, or point cloud data) centered on the vehicle, and then using this point cloud data for target recognition.
[0003] To improve the accuracy of recognition results, it is usually necessary to train the recognition model in advance, which requires the use of pre-annotated bounding box data. Currently, the industry approach is to invest a lot of manpower and resources to solve the annotation problem of point cloud data. Even though some existing solutions can perform automatic annotation, there are still cases where the bounding boxes do not fit the moving targets (such as pedestrians and vehicles), requiring manual intervention to modify the annotation content, and thus making fully automatic annotation impossible. Summary of the Invention
[0004] This application provides a method and electronic device for optimizing the annotation boxes of laser point clouds. The method is used to obtain a second annotation box based on a first annotation box obtained in advance (the first one obtained is the initial first annotation box, and the one obtained after the first one is the first annotation box with adjusted position). Then, the first annotation box is finely adjusted according to the difference in point cloud distribution between the first and second annotation boxes until there is no difference in the point cloud distribution between the two boxes or the difference is within an acceptable error range. This achieves fully automatic point cloud annotation, which can eliminate the step of manual fine-tuning of the annotation boxes and greatly improve the annotation efficiency.
[0005] Based on this, the embodiments of this application provide the following technical solutions:
[0006] Firstly, this application provides a method for optimizing the bounding boxes of laser point clouds. The method specifically includes: First, an electronic device acquires one or more bounding boxes, each acquired bounding box being called a first bounding box. Then, based on the acquired first bounding boxes, a second bounding box is obtained, and the laser point clouds included in the first and second bounding boxes are preprocessed respectively to obtain preprocessed first and second point cloud sets. After obtaining the first and second point cloud sets, they are compared to obtain a first comparison result. Further, it is determined whether the first comparison result meets a preset requirement (i.e., a first preset requirement). If the first comparison result does not meet the first preset requirement, the position of the first bounding box is adjusted. Finally, the first bounding box after position adjustment is used as a new first bounding box, and the above steps are repeated until a termination condition for repeated execution is met. It should be noted that in this embodiment, when the electronic device first acquires the first bounding box, the acquired first bounding box is an initial bounding box. This initial bounding box can be manually coarsely labeled or output by a trained annotation model; this application does not limit this. If the above steps need to be repeated subsequently, the first bounding box acquired later will be the first bounding box after position adjustment in the previous round. That is, when the first bounding box is acquired for the kth (k≥2)th time, the acquired first bounding box is the first bounding box obtained after position adjustment in the (k-1)th time.
[0007] In the above embodiments of this application, a second annotation box is obtained based on a first annotation box obtained in advance (the first annotation box obtained for the first time is the initial first annotation box, and the first annotation box obtained after the first time is the first annotation box that has undergone position adjustment in the previous round). Then, the first annotation box is finely adjusted according to the difference in point cloud distribution between the first and second annotation boxes until there is no difference in the point cloud distribution between the two boxes or the difference is within an acceptable error range. This achieves fully automatic point cloud annotation, which can eliminate the step of manually refining the annotation box and greatly improve annotation efficiency.
[0008] In one possible implementation of the first aspect, one way to obtain the second annotation box based on the obtained first annotation box is to expand the obtained first annotation box outward according to a preset ratio to obtain the second annotation box.
[0009] In the above embodiments of this application, the second annotation box is obtained by expanding the first annotation box, and is feasible.
[0010] In one possible implementation of the first aspect, if the adjusted first annotation box is used as the new first annotation box, and the above steps are repeated for n rounds (n≥1), then expanding the obtained first annotation box according to a preset ratio to obtain the second annotation box can be achieved by: determining the current preset ratio p based on the current round i (1≤i≤n). For example, taking the top view angle as an example, if the expansion is a preset ratio p1 in the long side direction of the first annotation box, then the preset ratio p can be p1; if the expansion is a preset ratio p2 in the short side direction of the first annotation box, then the preset ratio can also be p2, depending on which dimension of position adjustment is being performed. The current preset ratio p is inversely correlated with the value of the current round i. Then, the first annotation box obtained in the current round i is expanded according to the current preset ratio p to obtain the second annotation box.
[0011] In the above embodiments of this application, when the above steps need to be repeated multiple times (assuming the number of rounds is n, n≥1), the value of the preset expansion ratio p (e.g., p1, p2) can be reduced accordingly in each iteration. That is, the preset expansion ratio p in each round is reduced by a little compared to the previous round, so as to achieve gradual position adjustment and improve the accuracy of adaptive position adjustment.
[0012] In one possible implementation of the first aspect, comparing the first point cloud and the second point cloud to obtain the first comparison result can be achieved by: calculating a first distribution histogram of the first point cloud and a second distribution histogram of the second point cloud, respectively. The horizontal axis of each distribution histogram represents the positional information of the laser point cloud, and the vertical axis represents the number of laser point clouds. Then, the two calculated distribution histograms are compared to obtain the comparison result, which can be called the first comparison result. It should be noted that in this embodiment, if the second bounding box is obtained by expanding the first bounding box outwards along its longer side, then the horizontal axis of the distribution histogram is the x-axis relative to the longer side; if the second bounding box is obtained by expanding the first bounding box outwards along its shorter side, then the horizontal axis of the distribution histogram is the y-axis relative to the shorter side.
[0013] In the above embodiments of this application, it is specifically described that the comparison between the two boxes is achieved by comparing the distribution histograms of the first and second boxes. The difference in the laser point cloud contained in the two boxes can be directly observed by the distribution histogram method, which is simple to operate and has high comparison efficiency.
[0014] In one possible implementation of the first aspect, when the first comparison result does not meet the first preset requirement, one way to adjust the position of the first annotation box is: when the first comparison result is that the horizontal axis coordinates 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, the first annotation box is moved by a preset distance.
[0015] In the above embodiments of this application, if the number of point clouds in the first distribution histogram and the second distribution histogram are different under some horizontal axis coordinates, it indicates that the first annotation box and the corresponding laser point cloud do not fit, and the position of the first annotation box needs to be adjusted. This method of directly comparing the horizontal and vertical coordinate values of the two distribution histograms is easy to implement and can improve the efficiency of comparison.
[0016] In one 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 involves adjusting the position of the first bounding box multiple times until the laser point cloud included in the first bounding box has the same distribution as the laser point cloud included in the second bounding box. 2) Until the number of repeated executions reaches the first preset value. This implementation involves pre-setting an upper limit for the number of repeated executions (i.e., the first preset value). When the number of repeated executions reaches this upper limit, regardless of whether the first comparison result meets the first preset requirement, the process ends directly after the last repeated execution. This implementation is more suitable for scenarios with multiple complex moving targets, because in complex scenarios with too many moving targets, multiple first bounding boxes may overlap. Repeated execution may not be able to make the first comparison result meet the first preset requirement, in which case a forced stop is required. 3) Until the distance between the center point position of the first bounding box obtained in the last adjustment and the center point position of the first bounding box obtained in the first time reaches the second preset value. This implementation requires that the movement distance of the first annotation box obtained in the last round cannot exceed a pre-set upper limit of distance (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, the adjusted first annotation box may include the laser point cloud of other annotation boxes, reducing the annotation accuracy.
[0017] In the above embodiments of this application, there can be various types of situations where the termination condition for repeated execution is met, in order to improve annotation accuracy, increase annotation efficiency, and provide flexibility.
[0018] In one possible implementation of the first aspect, after repeatedly executing the above steps using the adjusted first annotation box as the new first annotation box until the termination condition for repeated execution is met, the method may further include: using the first annotation box obtained from the last adjustment as the final annotation box.
[0019] In the above embodiments of this application, after the last round of position adjustment, it is indicated 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 application, which meets the actual application requirements.
[0020] In one possible implementation of the first aspect, the method may further include: if the first comparison result meets the first preset requirement, the first annotation box is used as the final annotation box.
[0021] In the above embodiments of this application, if the first annotation box and the second annotation box fit together during the first round of comparison, there is no need to adjust the first annotation box, which meets the actual application requirements.
[0022] In one possible implementation of the first aspect, after repeatedly executing the above steps until the termination condition for repeated execution is met, the method may further include: obtaining a fourth annotation box based on the third annotation box, wherein the initial third annotation box is the last obtained first annotation box; then, preprocessing the laser point clouds included in the third and fourth annotation boxes respectively to obtain preprocessed third and fourth point cloud sets respectively. After obtaining the second comparison result of the third and fourth point cloud sets, it is further determined whether the second comparison result meets the preset requirements (i.e., the second preset requirements), and if the second comparison result does not meet the second preset requirements, the position of the third annotation box is adjusted. Finally, the third annotation box after position adjustment is used as the new third annotation box, and the above steps are repeated until the termination condition for repeated execution is met. It should be noted that in the application embodiments, due to the different first comparison results, the last obtained first annotation box is also different. If the first comparison result meets the first preset requirement, the third annotation box is the initial first annotation box; if 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 this application, a conservative and progressive automatic position adjustment of the annotation box is specifically described. That is, based on the first annotation box obtained last time (i.e. the third annotation box), the fourth annotation box is shrunk to obtain the fourth annotation box. The position of the third annotation box is then adjusted in a similar manner until the termination condition is met. The advantage of this method is that it can automatically adjust multiple aspects of the same annotation box, which can improve the annotation accuracy.
[0024] In one possible implementation of the first aspect, one way to obtain the fourth annotation box based on the third annotation box is to shrink the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0025] In the above embodiments of this application, the fourth annotation box is obtained by shrinking the third annotation box, and is feasible.
[0026] In one possible implementation of the first aspect, if the adjusted third annotation box is used as the new third annotation box, and the above steps are repeated for m rounds (m≥1), then the third annotation box is shrunk according to a preset ratio to obtain the fourth annotation box. One implementation is as follows: the current preset ratio q is determined based on the current round j (1≤j≤m). For example, taking the top view angle as an example, if the shrunk ratio is q1 along the long side of the third annotation box, then the preset ratio can be q1; if the shrunk ratio is q2 along the short side of the third annotation box, then the preset ratio can also be q2. The specific value depends on which dimension the position adjustment is currently performed. The current preset ratio q is inversely correlated 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.
[0027] In the above embodiments of this application, when it is necessary to repeat the above steps in multiple rounds (assuming the number of rounds is m, m≥1), the value of the preset shrinkage ratio q (e.g., q1, q2) can be reduced accordingly in each iteration. That is, the preset shrinkage ratio q in each round is reduced by a little compared to the previous round, so as to achieve gradual position adjustment and improve the accuracy of adaptive position adjustment.
[0028] In one possible implementation of the first aspect, comparing the third and fourth point clouds to obtain a second comparison result can be achieved by: calculating a third distribution histogram for the third point cloud and a fourth distribution histogram for the fourth point cloud, where the horizontal axis of each distribution histogram represents the positional information of the laser point cloud, and the vertical axis of each distribution histogram represents the number of laser point clouds. Then, the two calculated distribution histograms are compared to obtain a comparison result, which can be called the second comparison result. It should be noted that in this embodiment, if the fourth bounding box is obtained by shrinking the third bounding box along its long side, then the horizontal axis of the distribution histogram is the x-axis relative to the long side; if the fourth bounding box is obtained by shrinking the third bounding box along its short side, then the horizontal axis of the distribution histogram is the y-axis relative to the short side.
[0029] In the above embodiments of this application, it is specifically described that the comparison between the two boxes is achieved by comparing the distribution histograms of the third and fourth annotation boxes. The difference in the laser point cloud contained in the two annotation boxes can be directly observed by the distribution histogram method. It is simple to operate and has high comparison efficiency.
[0030] In one possible implementation of the first aspect, when the second comparison result does not meet the second preset requirement, one way to adjust the position of the third annotation box is: when the second comparison result is that the horizontal axis coordinates of the third distribution histogram and the fourth distribution histogram are the same, and the vertical axis value of the third distribution histogram is different from the vertical axis value of the fourth distribution histogram, the third annotation box is moved by a preset distance.
[0031] In the above embodiments of this application, if the number of point clouds in the third distribution histogram and the fourth distribution histogram are different under some horizontal axis coordinates, it indicates that the third annotation box and the corresponding laser point cloud do not fit together, and the position of the third annotation box needs to be adjusted. This method of directly comparing the horizontal and vertical coordinate values of the two distribution histograms is easy to implement and can improve the efficiency of comparison.
[0032] In one possible implementation of the first aspect, after repeatedly executing the above steps using the adjusted third annotation box as the new third annotation box until the termination condition for repeated execution is met, the method may further include: using the third annotation box obtained from the last adjustment as the final annotation box.
[0033] In the above embodiments of this application, after the last round of position adjustment, it is shown 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 application, which meets the actual application requirements.
[0034] In one possible implementation of the first aspect, the method may further include: if the second comparison result meets the second preset requirement, using the third annotation box as the final annotation box.
[0035] In the above embodiments of this application, if the third and fourth annotation boxes fit together during the first round of comparison, there is no need to adjust the third annotation box, which meets the actual application requirements.
[0036] In one possible implementation of the first aspect, the preprocessing method may be: ground point cloud filtering processing.
[0037] The above embodiments of this application describe a specific implementation method for preprocessing, which is feasible.
[0038] A second aspect of this application provides an electronic device that has the function of implementing the method described in the first aspect or any possible implementation 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 described function.
[0039] A third aspect of this application provides an electronic device that may include a memory, a processor, and a bus system, wherein the memory is used to store a computer program (also referred to as a program or computer-readable instructions), and the processor is used to invoke the program stored in the memory to execute the method of the first aspect of the embodiments of this application or any possible implementation thereof.
[0040] A fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0041] The fifth aspect of this application provides a computer program or a computer program product containing instructions that, when the computer program or computer program product is run on a computer, causes the computer to perform the method described in the first aspect or any possible implementation of the first aspect.
[0042] A sixth aspect of this application provides a chip including at least one processor and at least one interface circuit coupled to the processor. The interface circuit performs transceiver functions and sends instructions to the at least one processor. The at least one processor runs a computer program or instructions, having the functionality to implement the methods described in the first aspect or any possible implementation of the first aspect. This functionality can be implemented in hardware, software, or a combination of hardware and software, including one or more modules corresponding to the described functions. Furthermore, the interface circuit is used to communicate with other modules outside the chip.
[0043] In some implementations of this application, some of the one or more processors may implement some steps of the above method through dedicated hardware. For example, the processing involving neural network models may be implemented by a dedicated neural network processor or graphics processor.
[0044] The method provided in this application embodiment can be implemented by a single chip or by multiple chips working together. Attached Figure Description
[0045] Figure 1 A flowchart illustrating a method for optimizing the annotation bounding box of a laser point cloud provided in an embodiment of this application;
[0046] Figure 2 This is a schematic diagram illustrating one implementation method for expanding the first annotation box according to an embodiment of this application;
[0047] Figure 3 This is a schematic diagram illustrating another implementation of expanding the first annotation box according to an embodiment of this application;
[0048] Figure 4 This is a schematic diagram illustrating another implementation of expanding the first annotation box according to an embodiment of this application;
[0049] Figure 5 This is a schematic diagram illustrating another implementation of expanding the first annotation box according to an embodiment of this application;
[0050] Figure 6 This is a schematic diagram illustrating another implementation of expanding the first annotation box according to an embodiment of this application;
[0051] Figure 7 This is a schematic diagram illustrating another implementation of expanding the first annotation box according to an embodiment of this application;
[0052] Figure 8 Another flowchart illustrating the method for optimizing the annotation box of a laser point cloud provided in an embodiment of this application;
[0053] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0054] Figure 10 Another structural schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0055] This application provides an optimization method and electronic device for laser point cloud annotation boxes. The method is used to obtain a second annotation box based on a pre-acquired first annotation box, and then to finely adjust the first annotation box according to the difference in point cloud distribution within the first and second annotation boxes until there is no difference in the point cloud distribution between the two boxes or the difference is within an acceptable error range. This achieves fully automatic point cloud annotation, which can eliminate the step of manual fine-tuning of the annotation boxes and greatly improve annotation efficiency.
[0056] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0057] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0058] First, the optimization method for the annotation box of the laser point cloud provided in the embodiments of this application will be introduced. For details, please refer to [link to relevant documentation]. Figure 1 , Figure 1 A flowchart illustrating a method for optimizing the annotation bounding box of a laser point cloud provided in an embodiment of this application is shown. The method may specifically include the following steps:
[0059] 101. Based on the obtained first annotation box, obtain the second annotation box.
[0060] First, the electronic device acquires one or more bounding boxes, referred to as the first bounding box. For example, when the laser point cloud data centered on the vehicle acquired by LiDAR scanning includes only one moving target (such as a pedestrian in front of the vehicle), then there can be one first bounding box, corresponding to the pedestrian. Alternatively, when the laser point cloud data centered on the vehicle acquired by LiDAR scanning includes multiple moving targets (such as cars, trucks, tricycles, and pedestrians on the road), then there can be multiple first bounding boxes, with one first bounding box corresponding to one moving target. Whether there is one or multiple first bounding boxes depends on the specific application scenario, and this application does not limit this.
[0061] Subsequently, the electronic device will obtain a second annotation box based on the acquired first annotation box. In this embodiment, one implementation method is to expand the acquired first annotation box outward according to a preset ratio to obtain the second annotation box.
[0062] Specifically, in this embodiment, since the first annotation box annotates laser point cloud data, and because this first annotation box is three-dimensional, for ease of explanation, this application uses a top-down view to illustrate how the acquired first annotation box is expanded outward according to a preset ratio. The following sections will describe these methods in detail:
[0063] (1) Expand outward along the long side of the first annotation box.
[0064] One way to expand the first annotation box according to a preset ratio is to expand it along the long side of the first annotation box according to a preset ratio p1 of the long side of the first annotation box to obtain the second annotation box.
[0065] For an example, please refer to [link / reference]. Figure 2 , Figure 2 The diagram illustrates three first annotation boxes. Taking one of the first annotation boxes as an example, assuming the length of the long side of the first annotation box is x1, the long side is expanded outward according to a preset ratio p1 to obtain a new length of the long side, x2 = (1 + p1) * x1. The length of the long side of the second annotation box is then x2.
[0066] It should be noted that, in this embodiment of the application, if the electronic device is performing step 101 for the first time, the outward expansion along the long side of the first annotation box can be an simultaneous outward expansion to both sides of the long side, such as... Figure 2 As shown, it can be that both sides expand outward by the same size along the longer side, that is, the size of the expansion on both sides is p1*x1*1 / 2; or it can be as follows: Figure 3 As shown, the expansion can be of different sizes on both sides along the long side. For example, the expansion on one side is p1*x1*a1, and the expansion on the other side is p1*x1*a2, where 0≤a2<a1≤1. This application does not limit the specific implementation of the first expansion.
[0067] It is important to note that if the electronic device needs to repeat step 101 in subsequent iterations, the first bounding box obtained will be the first bounding box after the position adjustment in step 103 of the previous round. Based on the first bounding box that has already undergone one round of adjustment, it can be determined which side of the laser point cloud is not aligned along the long side. Correspondingly, during the outward expansion, the expansion can be performed along the long side of the side where the laser point cloud is not aligned. For details, please refer to [reference needed]. Figure 4 At this point, expanding the first annotation box outward along its long side means expanding outward towards the side that is not attached along the long side, i.e., expanding outward by p1*x1 towards the side that is not attached, while the other side remains unchanged.
[0068] (2) Expand outward along the short side of the first annotation box.
[0069] Another way to expand the first annotation box according to a preset ratio is to expand it along the short side of the first annotation box according to a preset ratio p2 of the short side of the first annotation box to obtain the second annotation box.
[0070] For an example, please refer to [link / reference]. Figure 5 , Figure 5 The diagram illustrates three first annotation boxes. Taking one of the first annotation boxes as an example, assuming the length of the short side of the first annotation box is y1, the short side is expanded outward according to a preset ratio p2 to obtain a new length of the short side, y2 = (1 + p2) * y1. The length of the short side of the second annotation box is then y2.
[0071] Similarly, in this embodiment, if the electronic device is performing step 101 for the first time, the outward expansion along the short side of the first annotation box can be an simultaneous outward expansion to both sides of the short side, such as... Figure 5 As shown, it can be that both sides expand outward by the same size along the shorter side, that is, the size of the expansion on both sides is p2*y1*1 / 2; or it can be as follows: Figure 6 As shown, the expansion can be of different sizes on both sides in the direction of the shorter side. For example, the expansion size on one side is p2*y1*b1, and the expansion size on the other side is p2*y1*b2, where 0≤b2<b1≤1. This application does not limit the specific implementation of the first expansion.
[0072] It is also important to note that if the electronic device needs to repeat step 101 in subsequent iterations, the first bounding box obtained will be the first bounding box after the position adjustment in step 103 of the previous round. Based on the first bounding box that has already undergone one round of adjustment, it can be determined which side of the laser point cloud is not aligned in the short side direction. Correspondingly, during the outward expansion, the expansion can be performed in the short side direction of the side where the laser point cloud is not aligned. For details, please refer to [reference needed]. Figure 7 At this point, the expansion of the first annotation box in the short side direction is to expand outward towards the side that does not fit in the short side direction, that is, to expand outward towards the side that does not fit in the short side by p2*y1, while the other side remains unchanged.
[0073] 102. Compare the first point cloud set and the second point cloud set to obtain the first comparison result. The first point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the second annotation box.
[0074] Subsequently, the laser point clouds included in the first and second annotation boxes are preprocessed to obtain the preprocessed first and second point cloud sets, respectively. The preprocessing method can be to filter the ground point cloud by the height of the laser point cloud to obtain the first and second point cloud sets.
[0075] After obtaining the first and second point clouds, the first and second point clouds can be compared to obtain the first comparison result.
[0076] It should be noted that, in one embodiment of this application, one implementation method is to calculate the distribution histograms of the two point cloud sets respectively, that is, to calculate the first distribution histogram of the first point cloud set and the second distribution histogram of the second point cloud set respectively. The horizontal axis of each distribution histogram is used to represent the positional 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, the two calculated distribution histograms are compared to obtain a comparison result, which can be called the first comparison result. It should be noted that, in this embodiment of the application, if the second bounding box is obtained by expanding the first bounding box outwards along the long side, then the horizontal axis of the distribution histogram is the x-axis relative to the long side; if the second bounding box is obtained by expanding the first bounding box outwards along the short side, then the horizontal axis of the distribution histogram is the y-axis relative to the short side.
[0077] Specifically, in some embodiments of this application, taking the first annotation box as an example, the method for calculating the first distribution histogram of the first point cloud can be as follows: taking the lower left corner of the first annotation box as the origin, the bottom line of the first 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 first annotation box coordinate system is constructed, and the point cloud distribution is calculated to obtain the first distribution histogram. The horizontal axis coordinate of the first distribution histogram is the x-axis coordinate (corresponding to the long side direction) or y-axis coordinate (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 under the corresponding horizontal axis coordinate.
[0078] Similarly, when calculating the second distribution histogram of the second point cloud, the second annotation box coordinate system is constructed with the lower left corner of the second annotation box as the origin, 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). The point cloud distribution is then calculated to obtain the second distribution histogram. The horizontal axis of the second distribution histogram is the x-axis coordinate (corresponding to the long side direction) or y-axis coordinate (corresponding to the short side direction) of the laser point cloud in the annotation box coordinate system, and the vertical axis of the second distribution histogram is the number of laser point clouds under the corresponding horizontal axis coordinate.
[0079] It should also be noted that in some other embodiments of this application, the comparison can also be performed directly by comparing the number of points included in the first point cloud set and the second point cloud set to obtain the first comparison result. Specifically, this application does not limit the comparison method for the two point cloud sets.
[0080] 103. If the first comparison result does not meet the first preset requirement, the position of the first annotation box shall be adjusted.
[0081] After obtaining the first comparison result of the first point cluster and the second point cluster, it will be further determined whether the first comparison result meets the preset requirements (i.e., the first preset requirements). If the first comparison result does not meet the first preset requirements, the position of the first annotation box will be 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: if the first comparison result shows that the horizontal axis coordinates of the first distribution histogram and the second distribution histogram are the same, but the first vertical axis value of the first distribution histogram and the second vertical axis value of the second distribution histogram are different, then the first annotation box is moved by a preset distance. That is to say, if the number of point clouds in one or more horizontal axis coordinates of the 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 which side of the horizontal axis of the first distribution histogram is unequal, and then the center point coordinate of the first annotation box is moved towards the side of inequality (essentially, the first annotation box is moved, and the position of the first annotation box is moved by moving the center point coordinate of the first annotation box), and the distance moved can be an outward expansion length.
[0083] It should also be noted that in some other embodiments of this application, if the comparison is made by directly comparing the number of point clouds included in the first point cloud set and the second point cloud set, then in this implementation, the number of laser point clouds included in the two point cloud sets is directly compared. 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. The position adjustment method is similar to the above-mentioned method based on the distribution histogram, and will not be described in detail here.
[0084] 104. Use the adjusted first annotation box as the new first annotation box, and repeat steps 101-103 above until the termination condition for repeated execution is met.
[0085] Finally, the first annotation box after the position adjustment is used as the new first annotation box, and the above steps 101-103 are repeated until the termination condition for repeated execution is met.
[0086] It should be noted that, in some embodiments of this application, the termination conditions for repeated execution include, but are not limited to, the following:
[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 involves adjusting 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 rounds reaches the first preset value.
[0090] Repeat steps 101-103 until the number of repetitions reaches the first preset value. This implementation pre-sets an upper limit for the number of repetitions (i.e., the first preset value). When the number of repetitions reaches this upper limit, the process terminates immediately after the last repetition, regardless of whether the first comparison result meets the first preset requirement. This implementation is more suitable for scenarios with multiple complex moving targets. Because in complex scenarios with a large number of moving targets, multiple first bounding boxes may overlap, and continuous repetition may not be enough to ensure the first comparison result meets the first preset requirement, necessitating a forced stop.
[0091] (3) Until the distance between the center point of the first annotation box obtained by the last adjustment and the center point of the first annotation box obtained in the first adjustment reaches the second preset value.
[0092] Repeat steps 101-103 until the distance between the center point of the first annotation box obtained in the last adjustment and the center point of the first annotation box obtained in the first adjustment reaches a second preset value. This implementation requires that the movement distance of the first annotation box obtained in the last round cannot exceed a preset distance 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 prevent the adjustment range of the first annotation box from being too large. Otherwise, the adjusted first annotation box may include the laser point cloud of other annotation boxes, reducing the annotation accuracy.
[0093] It should be noted that, in this embodiment, when the electronic device executes step 101 for the first time, the first annotation box obtained is an initial annotation box. This initial annotation box can be obtained in, but is not limited to, the following ways: 1) First, a rough annotation is performed manually on the annotation tool (i.e., manual assisted annotation) to obtain the initial annotation box. The existing method is to directly annotate manually, and then the position of the initial annotation box needs to be continuously adjusted to the optimal position; however, after adopting the method of this embodiment, the manual only needs to roughly annotate the initial annotation box, and then through the method of this embodiment, 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 the annotation box output by a trained annotation model, that is, inputting unlabeled data into a 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, and therefore also belongs to rough annotation.
[0094] Furthermore, it should be noted that if the electronic device needs to repeat step 101 in subsequent iterations, the first bounding box obtained will be the first bounding box after the position adjustment of the first bounding box in step 103 in the previous round. That is, when the electronic device executes step 101 for the kth time (k≥2), the first bounding box obtained will be the first bounding box obtained in the (k-1)th time step 103 is executed.
[0095] It should also be noted that in step 101 of this application embodiment, the implementation of obtaining the second annotation box based on the acquired first annotation box can be achieved by expanding the acquired first annotation box outward according to a preset ratio. This can be done by first expanding the second annotation box outward along the long side, then executing steps 102-104 until the termination condition for repeated execution is met in the long side direction; then, expanding the second annotation box outward along the short side direction, and then executing steps 102-104 again, until the termination condition for repeated execution is met in the short side direction. This implementation involves adjusting the position first along the long side direction and then along the short side direction until the first annotation box is adjusted to its optimal position. In another implementation, the second annotation box can also be obtained by first expanding it outward along the short side direction, then executing steps 102-104 until the termination condition for repeated execution is met in the short side direction; then, expanding it outward along the long side direction, and then executing steps 102-104 again, until the termination condition for repeated execution is met in the long side direction. This implementation method involves first adjusting the position along the shorter side, then adjusting it along the longer side, until the first annotation box is in the optimal position. This application does not specify which dimension to adjust first.
[0096] Once both the long and short sides have been adjusted, the first annotation box has been positioned optimally. Therefore, the first annotation box obtained from the last adjustment can be used as the final annotation box for subsequent direct application.
[0097] It should be noted that in some embodiments of this application, if the first comparison result meets the first preset requirement, for example, the number of point clouds in each horizontal axis coordinate of the first distribution histogram and the second distribution histogram is equal, it means that the initial first annotation box is in line with the included laser point cloud. In this case, 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 application.
[0098] It should also be noted that in some embodiments of this application, when steps 101-103 need to be repeated multiple times (assuming the number of rounds is n, n≥1), the value of the preset expansion ratio p (e.g., p1, p2) can be reduced accordingly in each iteration. That is, the preset expansion ratio p in each round is slightly smaller than the previous round to achieve gradual position adjustment. Specifically, the implementation of obtaining the second annotation box based on the first annotation box in each round can be as follows: determine the current preset ratio p according to the current round i (1≤i≤n) of repeated execution. This preset ratio p can be p1 or p2, depending on which dimension of position adjustment is being performed. The current preset ratio p is inversely correlated with the value of the current round i. Then, the first annotation box obtained in the current round i is expanded 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 this application, a conservative, gradual position adjustment can also be implemented; please refer to [link / reference] for details. Figure 8 , Figure 8 Another flowchart illustrating the method for optimizing the annotation box of a laser point cloud provided in this application embodiment is shown. The method may specifically include the following steps:
[0100] 801. Based on the obtained first annotation box, obtain the second annotation box.
[0101] 802. Compare the first point cloud set and the second point cloud set to obtain the first comparison result, wherein the first point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the first annotation box, and the second point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the second annotation box.
[0102] 803. If the first comparison result does not meet the first preset requirement, the position of the first annotation box shall be adjusted.
[0103] 804. Use the adjusted first annotation box as the new first annotation box, and repeat steps 801-803 above until the termination condition for repeated execution is met.
[0104] Steps 801-804 are similar to steps 101-104 above. For specific implementation methods, please refer to steps 101-104 above. They will not be repeated here.
[0105] 805. Based on the third annotation box, the fourth annotation box is obtained, where the initial third annotation box is the first annotation box obtained last time.
[0106] Next, based on the third annotation box, the fourth annotation box is obtained. It's important to note that the initial third annotation box is the first annotation box obtained last in steps 801-804 above. Due to the different results of the first comparison, the last obtained first annotation box will also differ, which will be explained below:
[0107] (1) The case where the first comparison result meets the first preset requirement
[0108] In steps 801-804 above, if the first annotation box obtained by the electronic device when executing step 801 for the first time is the initial annotation box (i.e. the initial first annotation box), and if the first comparison result of the first point cloud of the initial first annotation box and the second point cloud of the second annotation box obtained based on the initial box meets the first preset requirement, it means that the initial first annotation box is in line with the laser point cloud included. Then the initial first annotation box is already in the best position without adjustment, and the third annotation box is the initial first annotation box.
[0109] (2) The first comparison result does not meet the first preset requirement.
[0110] In steps 801-804 above, if the first comparison result does not meet the first preset requirement, the electronic device needs to repeat steps 801-803 multiple times 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 adjustment of position.
[0111] It should be noted that, in some embodiments of this application, one way in which the electronic device obtains the fourth annotation box based on the third annotation box is by shrinking the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0112] Similarly, in this embodiment, since the third annotation box annotates laser point cloud data, and because this third annotation box is three-dimensional, for ease of explanation, this application uses a top-down view to illustrate how the acquired third annotation box is shrunk according to a preset ratio. The following sections will describe this process:
[0113] (1) Shrink along the long side of the third annotation box.
[0114] One way to shrink the obtained third annotation box according to a preset ratio is to shrink it along the long side of the third annotation box by a preset ratio q1 of the long side, thus obtaining the fourth annotation box. The shrinking method is similar to the expansion method described above, and will not be elaborated here.
[0115] (2) Shrink along the short side of the third annotation box.
[0116] One way to shrink the obtained third annotation box according to a preset ratio is to shrink it along the short side of the third annotation box by a preset ratio q2 of the short side, thus obtaining the fourth annotation box. The shrinking method is similar to the expansion method described above, and will not be elaborated here.
[0117] 806. Compare the third point cloud set and the fourth point cloud set to obtain the second comparison result. The third point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the third annotation box, and the fourth point cloud set is the point cloud set obtained after preprocessing the laser point cloud included in the fourth annotation box.
[0118] Subsequently, the laser point clouds included in the third and fourth annotation boxes are preprocessed to obtain the preprocessed third and fourth point cloud sets, respectively. The preprocessing method can be to filter the ground point cloud by the height of the laser point cloud to obtain the third and fourth point cloud sets.
[0119] After obtaining the third and fourth point clouds, the third and fourth point clouds can be compared to obtain the second comparison result.
[0120] It should be noted that, in one embodiment of this application, one implementation method is to calculate the distribution histograms of the two point cloud sets respectively, that is, to calculate the third distribution histogram of the third point cloud set and the fourth distribution histogram of the fourth point cloud set respectively. The horizontal axis of each distribution histogram is used to represent the positional 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, the two calculated distribution histograms are compared to obtain a comparison result, which can be called the second comparison result. It should be noted that, in this embodiment of the application, if the fourth bounding box is obtained by shrinking the third bounding box based on the long side direction, then the horizontal axis of the distribution histogram is the x-axis relative to the long side direction; if the fourth bounding box is obtained by shrinking the third bounding box based on the short side direction, then the horizontal axis of the distribution histogram is the y-axis relative to the short side direction.
[0121] Specifically, in some embodiments of this application, taking the third annotation box as an example, the method for calculating the third distribution histogram of the third point cloud can 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 third annotation box coordinate system is constructed, and the point cloud distribution is calculated to obtain the third distribution histogram. The horizontal axis coordinate of the third distribution histogram is the x-axis coordinate (corresponding to the long side direction) or y-axis coordinate (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 under the corresponding horizontal axis coordinate.
[0122] Similarly, when calculating the fourth distribution histogram of the fourth point cloud, the fourth annotation box coordinate system is constructed with 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 line as the y-axis (corresponding to the short side direction). The point cloud distribution is then calculated to obtain the fourth distribution histogram. The horizontal axis coordinate of the fourth distribution histogram is the x-axis coordinate (corresponding to the long side direction) or y-axis coordinate (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 under the corresponding horizontal axis coordinate.
[0123] It should also be noted that in some other embodiments of this application, a second comparison result can be obtained by directly comparing the number of point clouds included in the third point cloud set and the fourth point cloud set. Specifically, this application does not limit the comparison method for the two point cloud sets.
[0124] 807. If the second comparison result does not meet the second preset requirements, the position of the third annotation box shall be adjusted.
[0125] After obtaining the second comparison results of the third and fourth point clusters, it will be further determined whether the second comparison results meet the preset requirements (i.e., the second preset requirements). If the second comparison results do not meet the second preset requirements, the position of the third annotation box will be adjusted.
[0126] Specifically, if the second comparison result is obtained based on the two distribution histograms calculated in step 806 above, then the specific implementation of this step is as follows: if the second comparison result shows that the horizontal axis coordinates of the third and fourth distribution histograms are the same, but the vertical axis values of the third and fourth distribution histograms are different, then the third annotation box is moved a preset distance. In other words, if the number of point clouds in one or more horizontal axis coordinates of the two distribution histograms is unequal, it indicates that the third annotation box does not fit the laser point cloud, and its position needs to be adjusted. Specifically, it can be determined which side of the horizontal axis of the third distribution histogram is unequal, and then the center point coordinates of the third annotation box are moved towards that unequal side (essentially, the third annotation box is moved; the position of the third annotation box is moved by moving its center point coordinates). The distance moved can be the shrinkage length.
[0127] It should also be noted that in some other embodiments of this application, if the comparison is made by directly comparing the number of point clouds included in the third point cloud set and the fourth point cloud set, then in this implementation, the number of laser point clouds included in the two point cloud sets is directly compared. 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. The position adjustment method is similar to the above-mentioned method based on the distribution histogram, and will not be described in detail here.
[0128] 808. Use the adjusted third annotation box as the new third annotation box, and repeat steps 805-807 above until the termination condition for repeated execution is met.
[0129] Finally, the third annotation box after its position adjustment is used as the new third annotation box, and steps 805-807 above are repeated until the termination condition for repeated execution is met.
[0130] It should be noted that, in some embodiments of this application, the termination conditions for repeated execution include, but are not limited to, the following:
[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 method involves adjusting 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 rounds reaches the third preset value.
[0134] Repeat steps 805-807 until the number of repetitions reaches the third preset value. This implementation pre-sets an upper limit for the number of repetitions (i.e., the third preset value). When the number of repetitions reaches this upper limit, the process terminates immediately after the last repetition, regardless of whether the second comparison result meets the second preset requirement. This implementation is more suitable for scenarios with multiple complex moving targets. Because in complex scenarios with a large number of moving targets, multiple third-level bounding boxes may overlap, and continuous repetition may not be enough to ensure the second comparison result meets the second preset requirement, necessitating a forced stop.
[0135] (3) Until the distance between the center point of the third annotation box obtained in the last adjustment and the center point of the third annotation box obtained in the first adjustment reaches the fourth preset value.
[0136] Repeat steps 805-807 until the distance between the center point of the third annotation box obtained in the last adjustment and the center point of the third annotation box obtained in the first adjustment reaches a fourth preset value. This implementation requires that the movement distance of the third annotation box obtained in the last round cannot exceed a preset distance 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 box. The purpose is to prevent the adjustment range of the third annotation box from being too large. Otherwise, the adjusted third annotation box may include the laser point cloud of other annotation boxes, reducing the annotation accuracy.
[0137] It should also be noted that in step 805 of this application embodiment, the method of obtaining the fourth annotation box based on the third annotation box can be described as shrinking the third annotation box according to a preset ratio. This can be achieved by first shrinking the fourth annotation box along the long side, then executing steps 806-808 until the termination condition for repeated execution is met in the long side direction; then, shrinking the fourth annotation box along the short side direction, and then executing steps 806-808 again, until the termination condition for repeated execution is met in the short side direction. This implementation method involves adjusting the position first along the long side direction and then along the short side direction until the third annotation box is optimally positioned. In another implementation method, the fourth annotation box can also be obtained by first shrinking it along the short side direction, then executing steps 806-808 until the termination condition for repeated execution is met in the short side direction; then, shrinking it along the long side direction, and then executing steps 806-808 again, until the termination condition for repeated execution is met in the long side direction. This implementation method involves first adjusting the position along the shorter side, then adjusting it along the longer side, until the third annotation box is optimally positioned. This application does not specify which dimension to adjust first.
[0138] Once both the long and short sides have been adjusted, the third annotation box has been positioned optimally. Therefore, the third annotation box obtained from the last adjustment can be used as the final annotation box for subsequent direct application.
[0139] It should be noted that in some embodiments of this application, if the second comparison result meets the second preset requirements, for example, the number of point clouds in each horizontal axis coordinate of the third distribution histogram and the fourth distribution histogram is equal, it means that the initial third annotation box is in line with the laser point cloud included. In this case, 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 application.
[0140] It should also be noted that in some embodiments of this application, when steps 805-807 need to be repeated multiple times (assuming the number of rounds is m, m≥1), the value of the preset shrinkage ratio q (e.g., q1, q2) can be reduced accordingly in each iteration. That is, the preset shrinkage ratio q in each round is smaller than the previous round to achieve gradual position adjustment. Specifically, the implementation of obtaining the fourth annotation box based on the third annotation box in each round can be as follows: determine the current preset ratio q according to the current round j (1≤j≤m). This preset ratio q can be q1 or q2, depending on which dimension the position adjustment is currently performed. The current preset ratio q is inversely correlated with the value of the current round j. Then, shrink the third annotation box in the current round j according to the current preset ratio q to obtain the fourth annotation box.
[0141] Based on the above embodiments, in order to better implement the above solutions of this application, related equipment for implementing the above solutions is also provided below. See details. Figure 9 , Figure 9This is a schematic diagram of the structure of an electronic device provided in an embodiment of this 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 triggering module 904. The first acquisition module 901 is used to obtain a second annotation frame based on the acquired first annotation frame. The first comparison module 902 is used to compare a first point cloud set and a second point cloud set to obtain a first comparison result. The first point cloud set is a set of point clouds obtained after preprocessing the laser point clouds included in the first annotation frame, and the second point cloud set is a set of point clouds obtained after preprocessing the laser point clouds included in the second annotation frame. The first adjustment module 903 is used to adjust the position of the first annotation frame if the first comparison result does not meet a first preset requirement. The first loop triggering module 904 is used to use the adjusted first annotation frame as the new first annotation frame, triggering 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 met.
[0142] In one possible design, the first acquisition module 901 is specifically used to: expand the acquired first annotation box outward according to a preset ratio to obtain a second annotation box.
[0143] In one possible design, the first loop triggering module 904 triggers the first acquisition module 901, the first comparison module 902, and the first adjustment module 903 to repeatedly execute their respective functions for n rounds, where n≥1. The first acquisition module 901 is further configured to: determine the current preset ratio p based on the current round i of repeated execution, wherein the current preset ratio p is inversely correlated with the value of the current round i, and 1≤i≤n; and expand the first annotation box obtained in the current round i according to the current preset ratio p to obtain the second annotation box.
[0144] In one possible design, the first comparison module 902 is specifically used to: calculate the first distribution histogram of the first point cloud and the second distribution histogram of the second point cloud respectively, wherein 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 the first comparison result.
[0145] In one possible design, the first adjustment module 903 is specifically used to: move the first label box a preset distance when the first comparison result is that the horizontal axis coordinates 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 one possible design, the termination condition until repeated execution is reached includes: until the first comparison result meets the first preset requirement; or, until the number of repeated executions 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 time reaches a second preset value.
[0147] In one possible design, the first loop trigger module 904 is also used to: take the first annotation box obtained from the last adjustment as the final annotation box.
[0148] In one possible design, the first adjustment module 903 is further configured to: take the first annotation box as the final annotation box if the first comparison result meets the first preset requirement.
[0149] In one 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 triggering module 908. The second acquisition module 905 is used to obtain a fourth annotation box based on a third annotation box, wherein the third annotation box is the last acquired first annotation box. The second comparison module 906 is used to compare a third point cloud and a fourth point cloud to obtain a second comparison result, wherein the third point cloud is a set of point clouds obtained after preprocessing the laser point clouds included in the third annotation box, and the fourth point cloud is a set of point clouds obtained after preprocessing the laser point clouds included in the fourth annotation box. The second adjustment module 907 is used to adjust the position of the third annotation box if the second comparison result does not meet a second preset requirement. The second loop triggering module 908 is used to use the adjusted third annotation box as the new third annotation box, triggering 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 met.
[0150] In one possible design, the second acquisition module 905 is specifically used to shrink the third annotation box according to a preset ratio to obtain the fourth annotation box.
[0151] In one possible design, the second loop triggering module 908 triggers the second acquisition module 905, the second comparison module 906, and the second adjustment module 907 to repeatedly execute their respective functions for m rounds, where m ≥ 1. The second acquisition module 905 is further configured to: determine the current preset ratio q based on the current round j of repeated execution, wherein the current preset ratio q is inversely correlated with the value of the current round j, and 1 ≤ j ≤ m; and 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 one possible design, the second comparison module 906 is specifically used to: calculate the third distribution histogram of the third point cloud and the fourth distribution histogram of the fourth point cloud, respectively, wherein the horizontal axis of the distribution histogram is used to characterize the position information of the laser point cloud, and the vertical axis of the distribution histogram is used to characterize the number of laser point clouds; and compare the third distribution histogram with the fourth distribution histogram to obtain the second comparison result.
[0153] In one possible design, the second adjustment module 907 is specifically used to: move the third label box a preset distance when the second comparison result is that the horizontal axis coordinates of the third distribution histogram and the fourth distribution histogram are the same, and the vertical axis values of the third distribution histogram and the fourth distribution histogram are different.
[0154] In one possible design, the second loop trigger module 908 is also used to: use the third annotation box obtained from the last adjustment as the final annotation box.
[0155] In one possible design, the second adjustment module 907 is further configured to: take the third annotation box as the final annotation box if the second comparison result meets the second preset requirement.
[0156] In one possible design, the preprocessing method includes: ground point cloud filtering.
[0157] It should be noted that the information interaction and execution process between the modules / units in the electronic device 900 are based on the same concept as the method embodiments described above in this application. For details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0158] The following describes another electronic device provided in the embodiments of this application. Please refer to [link to relevant documentation]. Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 1000 may be equipped with... Figure 9 The various modules of the electronic device 900 described in the corresponding embodiments are used to implement Figure 9Corresponding to the functionality of the electronic device 900 in the embodiment, specifically, the electronic device 1000 is implemented by one or more servers. The electronic device 1000 can vary significantly due to differences in configuration or performance, and may include one or more central processing units (CPUs) 1022 and memory 1032, and one or more storage media 1030 (e.g., one or more mass storage devices) for storing application programs 1042 or data 1044. The memory 1032 and storage media 1030 can be temporary or persistent storage. The program stored in the storage media 1030 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the electronic device 1000. Furthermore, the CPU 1022 may be configured to communicate with the storage media 1030 and execute the series of instruction operations in the storage media 1030 on the electronic device 1000.
[0159] Electronic device 1000 may also 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 Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0160] In this embodiment, the central processing unit 1022 is used to execute... Figure 1 or Figure 8 The steps executed by the electronic device in the corresponding embodiment are as follows. For example, the central processing unit 1022 can be used to: First, obtain a second annotation box based on the acquired first annotation box. Then, preprocess the laser point clouds included in the first and second annotation boxes respectively to obtain a preprocessed first point cloud set and a second point cloud set, wherein the preprocessing method can be to filter the ground point cloud by the laser point cloud height to obtain the first and second point cloud sets. After obtaining the first and second point cloud sets, the first and second point cloud sets can be compared to obtain a first comparison result. After obtaining the first comparison result of the first and second point cloud sets, it is further determined whether the first comparison result meets the preset requirements (i.e., the first preset requirements), and if the first comparison result does not meet the first preset requirements, the position of the first annotation box is adjusted. Finally, the first annotation box after position adjustment is used as the new first annotation box, and the above steps are repeated until the termination condition for repeated execution is met.
[0161] It should be noted that the specific manner in which the central processing unit 1022 executes the above steps is different from that described in this application. Figure 1 or Figure 8 The corresponding method embodiments are based on the same concept, and the technical effects they bring are the same as those in the above embodiments of this application. For details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0162] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0163] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this 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 computer floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0164] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. 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 one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for optimizing the annotation box of a laser point cloud, characterized in that, The method comprises the following steps: extending the obtained first annotation frame by a preset proportion to obtain a second annotation frame; comparing the first point cloud set and the second point cloud set to obtain a first comparison result, wherein the first point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the first annotation frame, and the second point cloud set is a point cloud set obtained by preprocessing the laser point cloud included in the second annotation frame; in the case that the first comparison result does not meet the first preset requirement, adjusting the position of the first annotation frame, wherein the first comparison result not meeting the first preset requirement includes: the number of point clouds at one or more horizontal axis coordinates of the first distribution histogram of the first point cloud set and the second distribution histogram of the second point cloud set is not equal, or the number of laser point clouds included in the first point cloud set and the second point cloud set is not the same, wherein 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; taking the adjusted first annotation frame as a new first annotation frame, and repeating the above steps until a termination condition of the repeated execution is reached.
2. The method of claim 1, wherein, The number of rounds of repeating the above steps of taking the adjusted first annotation frame as a new first annotation frame is n, and n≥1, and the step of extending the obtained first annotation frame by a preset proportion to obtain a second annotation frame comprises: determining a current preset proportion p according to the current round i of repeated execution, wherein the current preset proportion p is inversely related to the value of the current round i, and 1≤i≤n; extending the first annotation frame obtained in the current round i by the current preset proportion p to obtain a second annotation frame.
3. The method of claim 1, wherein, The step of comparing the first point cloud set and the second point cloud set to obtain a first comparison result comprises: respectively calculating the first distribution histogram of the first point cloud set and the second distribution histogram of the second point cloud set; comparing the first distribution histogram and the second distribution histogram to obtain a first comparison result.
4. The method of claim 3, wherein, The step of adjusting the position of the first annotation frame in the case that the first comparison result does not meet the first preset requirement comprises: in the case that the first comparison result is that the horizontal axis coordinates of the first distribution histogram and the second distribution histogram have the same value, and the first vertical axis value of the first distribution histogram and the second vertical axis value of the second distribution histogram are different, moving the first annotation frame by a preset distance.
5. The method according to any one of claims 1-4, characterized in that, The step of repeating the above steps until a termination condition of the repeated execution is reached comprises: 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 frame obtained after the last adjustment and the center point position of the first annotation frame obtained for the first time reaches a second preset value.
6. The method according to any one of claims 1-4, characterized in that, After the step of taking the adjusted first annotation frame as a new first annotation frame and repeating the above steps until a termination condition of the repeated execution is reached, the method further comprises: taking the first annotation frame obtained after the last adjustment as a final annotation frame.
7. The method according to any one of claims 1-4, characterized in that, The method further comprises: In a case where the first comparison result meets the first preset requirement, the first annotation box is taken as a final annotation box.
8. The method according to any one of claims 1-4, characterized in that, After the steps are repeatedly performed until a termination condition of the repeated performance is reached, the method further comprises: shrinking the third annotation box by a preset ratio to obtain a fourth annotation box, wherein the third annotation box is the first annotation box obtained last time; comparing a third point cloud set and a fourth point cloud set to obtain a second comparison result, wherein the third point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the third annotation box, and the fourth point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the fourth annotation box; in a case where the second comparison result does not meet a second preset requirement, adjusting the position of the third annotation box, the second comparison result not meeting the second preset requirement including: a third distribution histogram of the third point cloud set and a fourth distribution histogram of the fourth point cloud set having different point cloud numbers at one or more horizontal axis coordinates, or the third point cloud set and the fourth point cloud set including different numbers of laser point clouds, taking the adjusted third annotation box as a new third annotation box, and repeatedly performing the above steps until a termination condition of the repeated performance is reached.
9. The method of claim 8, wherein, the number of rounds of repeatedly performing the above steps, in which the adjusted third annotation box is taken as the new third annotation box, is m, and m≥1, and the shrinking of the third annotation box by the preset ratio to obtain the fourth annotation box comprises: determining a current preset ratio q according to a current round j of the repeated performance, the current preset ratio q being inversely related to the current round j, and 1≤j≤m; shrinking the third annotation box in the current round j by the current preset ratio q to obtain the fourth annotation box.
10. The method of claim 8, wherein, the comparing of the third point cloud set and the fourth point cloud set to obtain the second comparison result comprises: respectively calculating a third distribution histogram of the third point cloud set and a fourth distribution histogram of the fourth point cloud set; comparing the third distribution histogram and the fourth distribution histogram to obtain the second comparison result.
11. The method of claim 10, wherein, the adjusting of the position of the third annotation box in a case where the second comparison result does not meet the second preset requirement comprises: in a case where the second comparison result is that the horizontal axis coordinates of the third distribution histogram and the fourth distribution histogram have the same values, and a third vertical axis value of the third distribution histogram and a fourth vertical axis value of the fourth distribution histogram are different, moving the third annotation box by a preset distance.
12. The method of claim 8, wherein, after the repeatedly performing of the above steps, in which the adjusted third annotation box is taken as the new third annotation box, until the termination condition of the repeated performance is reached, the method further comprises: taking the third annotation box obtained last time after the adjustment as a final annotation box.
13. The method of claim 8, wherein, the method further comprises: in a case where the second comparison result meets the second preset requirement, taking the third annotation box as a final annotation box.
14. The method of any one of claims 1-4, wherein, The pre-processing manner comprises: Ground point cloud filtering processing.
15. An electronic device, comprising: Comprise: The first acquisition module is used for expanding the first annotation frame obtained according to a preset proportion to obtain a second annotation frame; The first comparison module is used for comparing the first point cloud set and the second point cloud set to obtain a first comparison result, wherein the first point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the first annotation frame, and the second point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the second annotation frame; The first adjustment module is used for adjusting the position of the first annotation frame in a case where the first comparison result does not satisfy a first preset requirement, and the first comparison result not satisfying the first preset requirement comprises that the number of point clouds at one or more horizontal axis coordinates of a first distribution histogram of the first point cloud set and a second distribution histogram of the second point cloud set is not equal, or the number of laser point clouds included in the first point cloud set and the second point cloud set is not the same, wherein the horizontal axis of the distribution histogram is used to represent the position information of the laser point clouds, and the vertical axis of the distribution histogram is used to represent the number of the laser point clouds; The first cycle triggering module is used for triggering the first acquisition module, the first comparison module and the first adjustment module to repeatedly perform their respective functions with the adjusted first annotation frame as a new first annotation frame until a termination condition of the repeated execution is reached.
16. The apparatus of claim 15, wherein, The number of rounds in which the first cycle triggering module triggers the first acquisition module, the first comparison module and the first adjustment module to repeatedly perform their respective functions is n, and n is greater than or equal to 1, and the first acquisition module is specifically used for: determining a current preset proportion p according to a current round i of the repeated execution, the current preset proportion p and the current round i are in an inverse relationship, and 1 is less than or equal to i and is less than or equal to n; expanding the first annotation frame obtained in the current round i according to the current preset proportion p to obtain a second annotation frame.
17. The apparatus of claim 15, wherein, The first comparison module is specifically used for: calculating a first distribution histogram of the first point cloud set and a second distribution histogram of the second point cloud set respectively; comparing the first distribution histogram and the second distribution histogram to obtain a first comparison result.
18. The apparatus of claim 17, wherein, The first adjustment module is specifically used for: in a case where the first comparison result is that the horizontal axis coordinates of the first distribution histogram and the second distribution histogram have the same value 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 frame by a preset distance.
19. The apparatus of any one of claims 15-18, wherein, The termination condition of the repeated execution comprises: until the first comparison result satisfies the first preset requirement; or, until the number of rounds of the repeated execution reaches a first preset value; or, until the distance between the center point position of the first annotation frame obtained by the last adjustment and the center point position of the first annotation frame obtained for the first time reaches a second preset value.
20. The apparatus of any one of claims 15-18, wherein, The first cycle triggering module is further used for: taking the first annotation frame obtained by the last adjustment as a final annotation frame.
21. The apparatus of any one of claims 15-18, wherein, The first adjustment module is further used for: In a case where the first comparison result meets the first preset requirement, the first annotation box is taken as a final annotation box.
22. The apparatus of any one of claims 15-18, wherein, The electronic device further includes: The second acquisition module is configured to contract the third annotation box by a preset ratio to obtain a fourth annotation box, wherein the third annotation box is the first annotation box obtained last time. The second comparison module is configured to compare the third point cloud set and the fourth point cloud set to obtain a second comparison result, wherein the third point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the third annotation box, and the fourth point cloud set is a point cloud set obtained by preprocessing laser point clouds included in the fourth annotation box. The second adjustment module is configured to, in a case where the second comparison result does not meet a second preset requirement, adjust the position of the third annotation box, the second comparison result not meeting the second preset requirement including that a third distribution histogram of the third point cloud set and a fourth distribution histogram of the fourth point cloud set have different point cloud numbers at one or more horizontal axis coordinates, or the third point cloud set and the fourth point cloud set include different numbers of laser point clouds, wherein a horizontal axis of a distribution histogram is used to represent position information of laser point clouds, and a vertical axis of the distribution histogram is used to represent a number of laser point clouds. The second loop triggering module is configured to take the adjusted third annotation box as a new third annotation box, trigger the second acquisition module, the second comparison module, and the second adjustment module to repeatedly perform their respective functions until a termination condition of the repeated performance is reached.
23. The apparatus of claim 22, wherein, The second loop triggering module triggers the second acquisition module, the second comparison module, and the second adjustment module to repeatedly perform their respective functions for m rounds, where m is greater than or equal to 1, and the second acquisition module is specifically configured to: determine a current preset ratio q according to a current round j of the repeated performance, the current preset ratio q being inversely related to the current round j, where 1≤j≤m; contract the third annotation box in the current round j by the current preset ratio q to obtain a fourth annotation box.
24. The apparatus of claim 22, wherein, The second comparison module is specifically configured to: calculate a third distribution histogram of the third point cloud set and a fourth distribution histogram of the fourth point cloud set, respectively; compare the third distribution histogram and the fourth distribution histogram to obtain a second comparison result.
25. The apparatus of claim 24, wherein, The second adjustment module is specifically configured to: in a case where the second comparison result is that the third distribution histogram and the fourth distribution histogram have the same horizontal axis coordinate values and the third distribution histogram has a third vertical axis value different from a fourth vertical axis value of the fourth distribution histogram, move the third annotation box by a preset distance.
26. The apparatus of claim 22, wherein, The second loop triggering module is further configured to: take the third annotation box obtained last time after the adjustment as a final annotation box.
27. The apparatus of claim 22, wherein, The second adjustment module is further configured to: in a case where the second comparison result meets the second preset requirement, take the third annotation box as a final annotation box.
28. The apparatus of any one of claims 15-18, wherein, The preprocessing manner includes: ground point cloud filtering processing.
29. An electronic device, comprising a processor and a memory, the processor coupled to the memory, and wherein: the memory is configured to store a program; the processor is configured to execute the program in the memory to cause the electronic device to perform the method of any one of claims 1-14.
30. A computer storage medium, comprising, computer readable instructions are stored and the computer readable instructions, when executed by a processor, implement the method of any one of claims 1-14.
31. A computer program product, characterised in that, the computer program product comprises computer readable instructions, which when executed by a processor, implement the method of any one of claims 1-14.
32. A chip comprising a processor and a data interface, characterized in that the processor reads instructions stored on the memory via the data interface and performs the method of any one of claims 1-14.
Citation Information
Patent Citations
Point cloud labeling method and device, storage medium and electronic equipment
CN113689508A
Point cloud data processing method and system
WO2023072055A1