## 3 Cartographer Algorithm Improvement
### Improved Voxel Filtering for Point-Cloud Preprocessing  
The purpose of point-cloud preprocessing is to simplify and reduce noise on point-cloud data to improve the operation efficiency of the algorithm and reduce the negative impact of noise in the subsequent scan-matching algorithm. Among them, radius filtering is a filtering method for filtering outliers. By setting thresholds for the filtering radius and the number of point clouds, the point clouds that do not meet the threshold conditions within the specified radius can be effectively filtered out. Using radius filtering, the speed  
Figure 4: Flow chart of the improved algorithm.  
of point-cloud preprocessing can be accelerated, and the algorithm's efficiency can be improved. Such optimization measures help optimize the algorithm's performance and make it more efficient and reliable in practical applications. The radius filtering is shown in Figure 5.  
The steps to use the filtering algorithm are as follows:  
1. Import the point cloud.
2. Filter type selection: Select the suitable filter type for the point cloud, commonly radius filter, statistical filter, Gaussian filter, etc. Each filter has different characteristics and applicable scenarios. Analyzing and comparing the advantages and disadvantages of the three filters, the radius filter is selected in this paper.  
3. Parameter setting: According to the characteristics of the point cloud and the effect of filtering needed, set the filter parameters. For example, for the radius filter, you need to determine the radius size of the filter and decide the range of the filter search. In this paper, the parameters of the radius filter are selected after several iterative tests, and the relatively optimal radius of 5 and the minimum number of neighboring points of 100 are chosen.  
4. Apply the filter: Use the filter to perform filtering operations on the point cloud. The filter will be calculated within a certain radius around each point in the point cloud to smooth or remove noise.  
5. Handle boundary points: The point cloud may have boundary points, and you must choose an appropriate handling method. One standard practice is to leave the boundary points untreated, i.e., keep them in their original state; another way treats the boundary points, especially according to the filter type. This paper uses the first approach.  
6. Filtering result output: After the filtering operation, the filtered point-cloud data are obtained, and the point-cloud data can be saved or subsequently analyzed and processed.  
The pseudo-code for radius filtering is as follows (Algorithm 2):  
```
Input: Input point cloud \(P\), radius of filter \(r\) Output: Output \(Q\)
1\(Q\leftarrow\) Empty point cloud;
2 forEachpoint\(p\) in \(P\)do
3\(N\leftarrow\) The set of points in a neighborhood of radius \(r\) around a point \(p\);
4 ifThe number of points in the neighborhood \(N\) is greater than or equal to a threshold valuethen
5\(q\leftarrow\) Calculate the average position of the points in the neighborhood \(N\);
6 Add the point \(q\) to the point cloud \(Q\);
7
8 end if
9
10 end for
```  
**Algorithm 2**Radius filtering.  
A radius filter can effectively remove noise and outliers, making the cloud data smoother and more consistent. The choice of filtering radius is crucial to the filtering effect; too small a radius may not remove all the noise, while too large a radius may lead to data loss or blurring. Therefore, selecting the appropriate radius value according to the specific  
Figure 5: Radius filtering.  
application scenario and the characteristics of the point-cloud data is necessary before applying radius filtering.