A laser radar grid filtering method and device, electronic equipment and storage medium
By dynamically adjusting the resolution of the lidar grid filtering method using a binary search algorithm, the complexity and instability of manual adjustment in traditional methods are solved, achieving efficient and stable point cloud filtering results.
Patent Information
- Application Number
- CN202211055004.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-08-31
AI Technical Summary
Existing lidar grid filtering methods require manual adjustment of the grid resolution each time the system runs. This is complex and the results vary with point cloud density, affecting filtering accuracy and computational efficiency.
The grid resolution is dynamically adjusted by using a binary search method. By comparing the number of points in the point cloud data with the minimum number of laser points, the optimal grid resolution is determined using a binary search algorithm, which reduces time complexity and maintains filtering accuracy.
It enables automatic adjustment of raster resolution in dynamic environments, reducing operational complexity and computation time, while maintaining the stability and accuracy of filtering effects and adapting to different point cloud density variations.
Smart Images

Figure CN115586508B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lidar data processing technology, and in particular to a lidar grid filtering method, apparatus, electronic device, and storage medium. Background Technology
[0002] Raster filtering is one of the most common filtering methods, mainly used in laser SLAM (Simultaneous Localization and Mapping) algorithms. It is a method to achieve density smoothing and other effects in laser point clouds.
[0003] Laser data preprocessing is a crucial step before the SLAM algorithm's front-end registration process, as the quality of the data directly impacts the algorithm's performance.
[0004] Point cloud filtering is generally a necessary step in the laser point cloud preprocessing workflow. After such processing, features can be extracted and registered more effectively. Common types of point cloud filtering processes include: smoothing irregular point cloud data density, removing outliers due to occlusion, downsampling large amounts of data, and removing noise.
[0005] Common 2D lidar (or laser rangefinder) emits ranging lasers that are distributed at equal angles. This results in a denser distribution of laser points on nearby obstacles and a sparser distribution on distant obstacles. For example... Figure 1 As shown.
[0006] Due to the dynamic physical environment and obstacle distances, the density of laser points in laser ranging varies greatly. High-density laser points can lead to information overload, as positioning accuracy depends only on a small portion of the laser points, and excessively dense laser points require additional memory resources and computational resources for subsequent registration.
[0007] To reduce the difference in laser point density distribution between near and far distances, the two-dimensional space containing a laser frame can be divided into equally sized grids. In this way, all laser points will fall into specific grids. High-density laser points will have multiple points within a grid, while low-density grids may have only one point or none. Downsampling is achieved by retaining some points in the high-density grids. Specifically, a hash set is used, calculating the hash value using the laser point coordinates to ensure that laser points within a grid have the same hash value. This allows for the selection of laser points to be discarded or added based on whether they have the same hash value. The formula for calculating the laser point hash value is as follows:
[0008] Hash i =(x i +dev) / resl×232 +(y i +dev) / resl
[0009] Where resl is the raster filter size, and dev is the offset value that makes xi and yi always positive. Calculations using this formula show that a larger resl (more dense the initial point cloud) results in a sparser point cloud; a smaller resl results in a denser point cloud, but will not exceed the number of points in the original point cloud.
[0010] Raster filtering algorithms can filter densely distributed point clouds, reducing computational and storage requirements. However, if the raster used for filtering is too large or too small, the filtering algorithm will fail to function effectively. If the raster is too large, too many laser points are removed, leaving less data in the point cloud, leading to decreased accuracy during subsequent registration. Current solutions involve manually adjusting the raster filtering resolution before each run until a suitable value is found.
[0011] The above solution has the following problems:
[0012] 1. The operation is complicated. Each time it runs, it needs to be pre-run at different raster resolutions and the appropriate raster size needs to be found based on the results of the pre-run, which increases the workload.
[0013] 2. Secondly, the filtering effect will change as the algorithm runs, because the number of filtered points is directly related to the current point cloud density, and the point cloud density is dynamically changing as the carrier robot passes through the environment. Summary of the Invention
[0014] Based on this, the purpose of this invention is to provide a laser radar grid filtering method, device, electronic device and storage medium. Compared with the traditional adaptive algorithm that selects resolution by traversal, the method reduces the time complexity by binary search without affecting the accuracy of the filtering result.
[0015] In a first aspect, the present invention provides a laser radar grid filtering method, comprising the following steps:
[0016] Acquire laser data collected by the lidar, wherein the laser data includes the number of effective laser points range.size();
[0017] For each frame of laser data, initialize the maximum grid resolution grid_max and the minimum number of laser points min_num;
[0018] Compare the minimum number of laser points min_num with the number of valid laser points in the current frame range.size();
[0019] When range.size() > min_num, perform point cloud filtering on the current frame at the grid resolution of grid_max, obtain the number of points result of the filtered point cloud data, and determine the grid resolution range {grid_low, grid_high} according to the number of points result of the filtered point cloud data;
[0020] Perform point cloud filtering on the current frame at the grid resolution of grid_low, and obtain the new number of points result of the filtered point cloud data;
[0021] Compare the current number of point cloud data points result with the minimum number of laser points min_num;
[0022] When result > min_num, take grid_high > 1.1 * grid_low as the convergence condition for binary search. By means of binary search, if the number of points result of the current frame > min_num, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
[0023] Furthermore, taking grid_high > 1.1 * grid_low as the convergence condition for binary search, by means of binary search, if the number of points result of the current frame is greater than min_num, output the resolution value esl of the current frame at this time, including:
[0024] S071: Define grid_mid = (grid_high + grid_low) / 2, perform point cloud filtering on the current frame at the grid resolution of grid_mid, and obtain the number of points candidate of the filtered point cloud data;
[0025] S072: Compare the current number of point cloud data points candidate with the minimum number of laser points min_num;
[0026] S073: When candidate > min_num, update grid_low = grid_mid, result = candidate;
[0027] S074: When candidate < min_num, update grid_high = grid_mid;
[0028] S075: Compare grid_high and grid_low;
[0029] S076: When grid_high ≤ 1.1 * grid_low, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
[0030] Further, compare grid_high and grid_low; thereafter, it further includes:
[0031] When grid_high > 1.1 * grid_low, repeat steps S071 - S075 until grid_high ≤ 1.1 * grid_low, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
[0032] Further, determining the grid resolution range {grid_low, grid_high} according to the number of points in the filtered point cloud data includes:
[0033] Compare the number of points result in the filtered point cloud data with the minimum laser point number min_num;
[0034] When result < min_num, let grid_high = grid_max, grid_low = grid_high / 2, and obtain the initial grid resolution range {grid_low, grid_high};
[0035] Using grid_low as the grid resolution size, continue to perform point cloud filtering on the current frame, and obtain the new number of points result in the filtered point cloud data;
[0036] Compare the new number of points result in the filtered point cloud data with the minimum laser point number min_num;
[0037] When result > min_num, output the initial grid resolution range {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
[0038] Further, after comparing the number of points result in the filtered point cloud data with the minimum laser point number min_num, it further includes:
[0039] When result > min_num, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
[0040] Further, after comparing the new number of points result in the filtered point cloud data with the minimum laser point number min_num, it further includes:
[0041] When result < min_num, update grid_high = grid_high / 2;
[0042] Compare the size of the new grid_high with the maximum resolution grid_max;
[0043] When grid_high ≥ grid_max / 100, update grid_low = grid_high / 2;
[0044] Perform point cloud filtering on the current frame using grid_low to obtain the number of points result in the new filtered point cloud data;
[0045] Compare the number of points result in the current point cloud data with the minimum number of laser points min_num;
[0046] When result > min_num, output the current {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
[0047] Furthermore, after comparing the new grid_high with the maximum resolution grid_max, it further includes:
[0048] When grid_high < grid_max / 100, output the resolution value esl at this time for the current frame to obtain the dynamically adjusted optimal grid resolution value.
[0049] In a second aspect, the present invention further provides a lidar grid filtering device, including:
[0050] A laser data acquisition module for acquiring the laser data collected by the lidar, where the laser data includes the number of valid laser points range.size();
[0051] An initialization module for initializing the maximum resolution grid_max and the minimum number of laser points min_num of the grid for each frame of laser data;
[0052] A first comparison module for comparing the minimum number of laser points min_num with the number of valid laser points range.size() of the current frame;
[0053] A grid resolution determination module for, when range.size() > min_num, performing point cloud filtering on the current frame at the grid resolution of grid_max to obtain the number of points result in the filtered point cloud data, and determining the grid resolution range {grid_low, grid_high} according to the number of points result in the filtered point cloud data;
[0054] The first filtering module is used to perform point cloud filtering on the current frame at grid_low grid resolution to obtain a new filtered point cloud data point count result.
[0055] The second comparison module is used to compare the current number of points in the point cloud data result with the minimum number of laser points min_num;
[0056] The raster resolution output module is used to output the resolution value esl of the current frame when result>min_num, with grid_high>1.1*grid_low as the convergence condition of binary search. By using binary search, if the number of points in the current frame result>min_num, the module outputs the resolution value esl of the current frame, thus obtaining the dynamically adjusted optimal raster resolution value.
[0057] Thirdly, the present invention also provides an electronic device, comprising:
[0058] At least one memory and at least one processor;
[0059] The memory is used to store one or more programs;
[0060] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of a lidar grid filtering method as described in any of the first aspects of the present invention.
[0061] Fourthly, the present invention also provides a computer-readable storage medium.
[0062] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a lidar grid filtering method as described in any of the first aspects of the present invention.
[0063] This invention provides a laser radar grid filtering method, device, electronic equipment, and storage medium. Compared to traditional adaptive algorithms that select resolution through traversal, this invention reduces time complexity through binary search without affecting the accuracy of the filtering results. In the experimental data between 200 and 300 frames, the number of points in the ordinary grid filtering was less than 100, while the adaptive algorithm reached more than 150, preliminarily demonstrating the stability of the adaptive grid filtering method. The variance of the adaptive filtering algorithm is significantly lower than that of the ordinary filtering algorithm, exhibiting more stable performance, which is beneficial for subsequent front-end registration.
[0064] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0065] Figure 1 This invention provides a schematic diagram of the steps of a lidar grid filtering method.
[0066] Figure 2 This is a schematic flowchart of a lidar grid filtering method in a preferred embodiment of the present invention;
[0067] Figure 3 This is a virtual map from the Institute of Software, Chinese Academy of Sciences, used in one embodiment of the present invention.
[0068] Figure 4 This is a schematic diagram comparing the results of different filtering methods in one embodiment of the present invention;
[0069] Figure 5 This is a schematic diagram of the structure of a lidar grid filter device provided by the present invention. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0071] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0072] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0073] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0074] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0075] To address the problems in the background art, embodiments of this application provide a laser radar grid filtering method, such as... Figure 1 and Figure 2 As shown, the method includes the following steps:
[0076] S01: Obtain the laser data collected by the lidar, wherein the laser data includes the number of effective laser points range.size().
[0077] S02: For each frame of laser data, initialize the maximum grid resolution grid_max and the minimum number of laser points min_num.
[0078] For a single frame of laser data acquired by a lidar, the `grid_max` parameter (i.e., the maximum resolution of the grid) and the minimum number of laser points `min_num` need to be initialized. For example, in the sample program, `grid_max` is set to 0.2m and `min_num` is set to 150. The specific initial values need to be determined according to the accuracy and requirements of the task.
[0079] S03: Compare the minimum number of laser points min_num with the number of valid laser points in the current frame range.size().
[0080] In a single frame of laser data acquired via Laser_scan, the number of valid laser points acquired (range.size()) is recorded. A preliminary comparison is made between min_num and the number of points in the current laser data frame. If the number of laser points is less than min_num, it is determined to be a sparse point cloud frame and is directly returned as the result without proceeding to the next step. Conversely, laser data frames with excessively high point cloud density are entered into the adaptive filtering algorithm of this invention.
[0081] S04: When range.size()>min_num, perform point cloud filtering on the current frame with grid_max grid resolution to obtain the number of filtered point cloud data points result, and determine the grid resolution range {grid_low, grid_high} based on the number of filtered point cloud data points result.
[0082] Preferably, determining the raster resolution range includes the following sub-steps:
[0083] S041: Compare the number of points result of the filtered point cloud data with the minimum number of laser points min_num.
[0084] S042: When result < min_num, set grid_high = grid_max and grid_low = grid_high / 2 to obtain the initial grid resolution range {grid_low, grid_high}.
[0085] When result > min_num, directly output the resolution value esl of the current frame to obtain the dynamically adjusted optimal grid resolution value.
[0086] S043: Use grid_low as the grid resolution size and continue to perform point cloud filtering on the current frame to obtain the number of points result of the new filtered point cloud data.
[0087] S044: Compare the number of points result of the new filtered point cloud data with the minimum number of laser points min_num.
[0088] S045: When result > min_num, output the initial grid resolution range {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
[0089] If the number of points result is greater than min_num, it means that the appropriate resolution size is within the range of grid_low and grid_high, and the algorithm enters the subsequent binary acceleration search process.
[0090] When result < min_num, reduce grid_high by half. As long as grid_high is not less than one percent of the initial grid_max, loop to determine the grid resolution range.
[0091] Specifically, it includes the following sub-steps:
[0092] S0451: Update grid_high = grid_high / 2;
[0093] S0452: Compare the new grid_high with the maximum resolution grid_max;
[0094] S0453: When grid_high < grid_max / 100, output the resolution value esl of the current frame to obtain the dynamically adjusted optimal grid resolution value.
[0095] S0454: When grid_high ≥ grid_max / 100, update grid_low = grid_high / 2;
[0096] S0455: Use grid_low to perform point cloud filtering on the current frame, and obtain the number of points result of the new filtered point cloud data;
[0097] S0456: Compare the current number of points result of the point cloud data with the minimum number of laser points min_num;
[0098] S0457: When result > min_num, output the current {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
[0099] S05: Perform point cloud filtering on the current frame with the grid resolution of grid_low, and obtain the number of points result of the new filtered point cloud data.
[0100] S06: Compare the current number of points result of the point cloud data with the minimum number of laser points min_num.
[0101] S07: When result > min_num, take grid_high > 1.1*grid_low as the convergence condition for binary search. Through the binary search method, if the number of points result of the current frame > min_num, then output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
[0102] S071: Define grid_mid = (grid_high + grid_low) / 2, and perform point cloud filtering on the current frame with the grid resolution of grid_mid, and obtain the number of points candidate of the filtered point cloud data.
[0103] S072: Compare the current number of points candidate of the point cloud data with the minimum number of laser points min_num.
[0104] S073: When candidate > min_num, update grid_low = grid_mid, result = candidate.
[0105] S074: When candidate < min_num, update grid_high = grid_mid.
[0106] S075: Compare grid_high and grid_low.
[0107] S076: When grid_high≤1.1*grid_low, output the resolution value esl of the current frame to obtain the optimal raster resolution value after dynamic adjustment.
[0108] S077: When grid_high > 1.1 * grid_low, repeat steps S071-S075 until grid_high ≤ 1.1 * grid_low, output the resolution value esl of the current frame, and obtain the optimal raster resolution value after dynamic adjustment.
[0109] The conventional approach involves determining the optimal raster resolution for each frame through a traversal method, thereby determining the starting and ending raster resolutions and stride. While theoretically feasible, this algorithm suffers from excessively high time complexity. Assuming the initial number of points in the point cloud is p, and q is determined by the initial resolution grid... start Termination resolution grid end The step size is calculated as follows:
[0110] q = (grid start -grid end ) / step
[0111] grid start grid end Then the time complexity of the traversal method can reach O(p*q). Here, O refers to the upper bound of the algorithm complexity, which represents the upper bound of the worst-case running time of the algorithm.
[0112] Compared to traditional adaptive algorithms that select resolution through traversal, this invention reduces the time complexity to O(p*log q) by using binary search, without affecting the accuracy of the filtering results.
[0113] Experimental verification plan:
[0114] Experimental simulation analysis was conducted using the Gazebo simulation platform under Ubuntu, comparing the algorithm performance of this invention with that of ordinary grid filtering methods. The simulated robot model was described using a URDF (Unified Robot Description Format) file, and its hardware included two drive wheels and one omnidirectional wheel for support. A lidar was mounted on top, with a measurement frequency of approximately 5.5 Hz and 360 laser points per frame. To make its performance closer to the real-world values, the ranging error was increased to follow a normal distribution N ~ (0, 0.02 m). In the simulation experiment, this invention used the open-source map environment of the Institute of Software, Chinese Academy of Sciences (e.g., ...). Figure 3(As shown). Complete laser data is recorded after the simulated robot completes one lap around the map. This data is then processed using a filtering algorithm to obtain the number of points in each frame after filtering. In ordinary grid filtering, the grid size is fixed at 0.15m, while in the adaptive grid filtering method, the maximum grid size reaches 0.2m.
[0115] Evaluation indicators:
[0116] For this filtering algorithm, on the one hand, the number of laser data points in each frame after filtering is selected as an evaluation index. Too few or too many data points will affect the memory consumption and the quality of the subsequent point cloud registration process. On the other hand, the variance of the number of laser points in different trajectories of the simulated robot in the virtual environment is calculated.
[0117]
[0118] Where n is the total number of laser frames for the trajectory, and xi is the total number of laser points in the i-th frame.
[0119] Based on the preliminary results of the filtering process (as shown in the image) Figure 4 Analysis shows that between frames 200 and 300 of the experimental data, the number of points in the ordinary grid filter is less than 100, while the number of points in the adaptive algorithm is more than 150, which initially proves the stability of the adaptive grid filtering method.
[0120] Further quantitative analysis revealed that the robot walked six times along different trajectories in a simulated environment, recording laser measurement data for each instance. The variance of the number of points corresponding to these six sets of data under different algorithms was calculated, yielding the following results:
[0121] Table 1. Variance Table of Ordinary Raster Filtering
[0122]
[0123] Table 2. Variance Table of Adaptive Raster Filtering
[0124]
[0125] It can be seen that the variance of the adaptive filtering algorithm is significantly smaller than that of the ordinary filtering algorithm, and its performance is more stable, which is beneficial for subsequent front-end registration.
[0126] This application also provides a lidar grid filtering device, such as... Figure 4 As shown, the lidar grid filter device 400 includes:
[0127] The laser data acquisition module 401 is used to acquire laser data collected by the lidar, wherein the laser data includes the number of effective laser points range.size();
[0128] Initialization module 402 is used to initialize the maximum resolution grid_max and the minimum number of laser points min_num for each frame of laser data;
[0129] The first comparison module 403 is used to compare the minimum number of laser points min_num with the number of valid laser points in the current frame range.size().
[0130] The grid resolution determination module 404 is used to perform point cloud filtering on the current frame with grid_max grid resolution when range.size()>min_num, to obtain the number of filtered point cloud data points result, and to determine the grid resolution range {grid_low, grid_high} based on the number of filtered point cloud data points result.
[0131] The first filtering module 405 is used to perform point cloud filtering on the current frame at grid_low grid resolution to obtain a new filtered point cloud data point count result.
[0132] The second comparison module 406 is used to compare the current number of points in the point cloud data result with the minimum number of laser points min_num;
[0133] The raster resolution output module 407 is used to output the resolution value esl of the current frame when result>min_num, with grid_high>1.1*grid_low as the convergence condition of binary search. By means of binary search, if the number of points in the current frame result>min_num, the module outputs the resolution value esl of the current frame, and obtains the optimal raster resolution value after dynamic adjustment.
[0134] For the apparatus embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described above are merely illustrative, and 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. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0135] This application also provides an electronic device, including:
[0136] At least one memory and at least one processor;
[0137] The memory is used to store one or more programs;
[0138] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of the lidar grid filtering method as described above.
[0139] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts 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 disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0140] This application also provides a computer-readable storage medium.
[0141] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the aforementioned lidar grid filtering method.
[0142] Computer storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by computing devices.
[0143] This invention provides a laser radar grid filtering method, device, electronic equipment, and storage medium. Compared to traditional adaptive algorithms that select resolution through traversal, this invention reduces time complexity through binary search without affecting the accuracy of the filtering results. In the experimental data between 200 and 300 frames, the number of points in the ordinary grid filtering was less than 100, while the adaptive algorithm reached more than 150, preliminarily demonstrating the stability of the adaptive grid filtering method. The variance of the adaptive filtering algorithm is significantly lower than that of the ordinary filtering algorithm, exhibiting more stable performance, which is beneficial for subsequent front-end registration.
[0144] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A laser radar grid filtering method, characterized in that, It includes the following steps: Obtain the laser data collected by the lidar, where the laser data includes the number of valid laser points range.size(); For each frame of laser data, initialize the maximum resolution grid_max and the minimum number of laser points min_num of the grid; Compare the minimum number of laser points min_num with the number of valid laser points range.size() of the current frame; When range.size() > min_num, perform point cloud filtering on the current frame with the grid resolution of grid_max, obtain the number of points result of the filtered point cloud data, and determine the grid resolution range {grid_low, grid_high} according to the number of points result of the filtered point cloud data; Perform point cloud filtering on the current frame with the grid resolution of grid_low, and obtain the number of points result of the new filtered point cloud data; Compare the current number of points result of the point cloud data with the minimum number of laser points min_num; When result > min_num, take grid_high > 1.1 * grid_low as the convergence condition for binary search. By means of binary search, if the number of points result of the current frame > min_num, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
2. The lidar grid filtering method according to claim 1, characterized in that, Taking grid_high > 1.1 * grid_low as the convergence condition for binary search, by means of binary search, if the number of points result of the current frame is greater than min_num, output the resolution value esl of the current frame at this time, including: S071: Define grid_mid = (grid_high + grid_low) / 2, and perform point cloud filtering on the current frame with the grid resolution of grid_mid, and obtain the number of points candidate of the filtered point cloud data; S072: Compare the current number of points candidate of the point cloud data with the minimum number of laser points min_num; S073: When candidate > min_num, update grid_low = grid_mid, result = candidate; S074: When candidate < min_num, update grid_high = grid_mid; S075: Compare grid_high and grid_low; S07S: When grid_high ≤ 1.1 * grid_low, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
3. The lidar grid filtering method according to claim 2, characterized in that, Compare grid_high and grid_low; After that, it further includes: When grid_high > 1.1 * grid_low, repeat steps S071 - S075 until grid_high ≤ 1.1 * grid_low, output the resolution value esl of the current frame at this time, and obtain the dynamically adjusted optimal grid resolution value.
4. The lidar grid filtering method according to claim 1, characterized in that, Determine the grid resolution range {grid_low, grid_high} according to the number of points in the filtered point cloud data, including: Compare the number of points result in the filtered point cloud data with the minimum number of laser points min_num; When result < min_num, set grid_high = grid_max and grid_low = grid_high / 2 to obtain the initial grid resolution range {grid_low, grid_high}; Use grid_low as the grid resolution size to continue filtering the point cloud of the current frame, and obtain the number of points result in the new filtered point cloud data; Compare the number of points result in the new filtered point cloud data with the minimum number of laser points min_num; When result > min_num, output the initial grid resolution range {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
5. A lidar grid filtering method according to claim 4, characterized in that, After comparing the number of points result in the filtered point cloud data with the minimum number of laser points min_num, it further includes: When result > min_num, output the resolution value esl of the current frame at this time to obtain the dynamically adjusted optimal grid resolution value.
6. The lidar grid filtering method according to claim 4, characterized in that, After comparing the number of points result in the new filtered point cloud data with the minimum number of laser points min_num, it further includes: When result < min_num, update grid_high = grid_high / 2; Compare the size of the new grid_high with the maximum resolution grid_max; When grid_high ≥ grid_max / 100, update grid_low = grid_high / 2; Use grid_low to filter the point cloud of the current frame to obtain the number of points result in the new filtered point cloud data; Compare the current number of points result in the point cloud data with the minimum number of laser points min_num; When result > min_num, output the current {grid_low, grid_high} as the determined grid resolution range {grid_low, grid_high}.
7. A lidar grid filtering method according to claim 6, characterized in that, After comparing the size of the new grid_high with the maximum resolution grid_max, it further includes: When grid_high < grid_max / 100, output the resolution value esl of the current frame at this time to obtain the dynamically adjusted optimal grid resolution value.
8. A lidar grid filtering device, characterized in that, It includes: A laser data acquisition module for acquiring the laser data collected by the lidar, and the laser data includes the number of valid laser points range.size(); An initialization module for initializing the maximum resolution grid_max and the minimum number of laser points min_num of the grid for each frame of laser data; A first comparison module for comparing the minimum number of laser points min_num with the number of valid laser points range.size() of the current frame; The grid resolution determination module is used to perform point cloud filtering on the current frame with grid_max grid resolution when range.size()>min_num, obtain the number of points in the filtered point cloud data result, and determine the grid resolution range {grid_low, grid_high} based on the number of points in the filtered point cloud data result. The first filtering module is used to perform point cloud filtering on the current frame at grid_low grid resolution to obtain a new filtered point cloud data point count result. The second comparison module is used to compare the current number of points in the point cloud data result with the minimum number of laser points min_num; The raster resolution output module is used to output the resolution value esl of the current frame when result>min_num, with grid_high>1.1*grid_low as the convergence condition of binary search. By using binary search, if the number of points in the current frame result>min_num, the module outputs the resolution value esl of the current frame, thus obtaining the dynamically adjusted optimal raster resolution value.
9. An electronic device, characterized in that, include: At least one memory and at least one processor; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a lidar grid filtering method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a lidar grid filtering method as described in any one of claims 1-7.
Citation Information
Patent Citations
Laser point cloud rasterization method
CN113137919A
Point cloud data method and apparatus
US20190018680A1