# Fast Cylinder Shape Matching Using Random Sample Consensus in Large Scale Point Cloud
## 3 Center Axis Estimation
### Matching and Filtering  
The estimation of the center axis of the cylinder is obtained by matching the candidate group matching the straight line in the set of the center point and the radius obtained repeatedly through the spherical fit described in Section 3.1. Figure 4a depicts the center and radius estimates through spherical fitting, where k is the number of neighboring points to a point in the point cloud and RANSAC fitting is applied to four of these points to obtain the center point and radius. In this paper, the fitting is performed twice at one point, in order to increase the hit ratio. As shown in Figure 4c, first it performs the sphere fitting to six points in nine neighboring points based on one point once. In the result, if 36 neighboring points are searched again in P, the probability of selecting a neighboring point forming a cylinder cross-section at a point inside the cylinder can be increased, as shown in Figure 4d. Repeatedly, it is possible to obtain a central axis candidate set with higher accuracy than a single RANSAC fitting.  
Figure 4: (**a**) Neighboring points and fitting results for spherical fitting. (**b**) Outlier removal through local averaging. (**c**) Sphere fitting using six points in cross-section. (**d**) Neighboring point search. (**e**) Average filter processing result.  
Figure 3: PCA eigenvector estimation.  
Since the center axis candidates thus obtained have many outliers, the outliers are removed by filtering. Filter processing simply means local averaging, and is shown in Figure 4b. Local average (blue points of Figure 4e) can be obtained by repeatedly calculating the average coordinates of the neighboring points of each point in the center axis candidate set (red points) of Figure 4e. In the filtered center axis candidates (blue points), the central axis estimation can be obtained through the eigenvectors shown in Section 3.2.  
In principle, matching is targeted to all point clouds, but is performed on arbitrary data to reduce execution time. This is because the number of points forming the circumference of the cylinder is large, so a similar result can be obtained by matching at a constant interval/ratio. Figure 5 shows the execution time as the matching ratio increases.  
Figure 5: \(Cont\).  
Figure 5a shows that the execution time and matching results linearly increase when the value of \(\epsilon\) increases from 1 to 100 with already segmented data. If it is above a certain level (50%), the center axis estimation result is sufficient to match the cylinder, so it is better to select the appropriate value. Figure 5b shows that the execution time linearly increases as the value of \(\epsilon\) increases when the data is not segmented, but the center axis estimation result is relatively slowed at around 45% (red circle A). Noise also appears to increase. Therefore, the appropriate \(\epsilon\) value should be selected for fast and accurate matching. As a result, if the total number or density of point clouds is high, execution time can be reduced while maintaining relative accuracy through the appropriate \(\epsilon\).  
When the center axis estimation is completed through the appropriate \(\epsilon\) value, the accuracy of the matching cylinder can be confirmed by checking its diameter, as shown in Figure 6. Figure 6a shows the distance between two points with CloudCompare, and Figure 6b shows the result of matching with the proposed method. In Figure 6a, the distance between two points is 0.54 m, and in Figure 6b, scale X and Z of the cylinder is 0.53 m and the diameters are almost equal (1 cm error). The actual cylinder diameter is 20 inches (0.508 m) and there is some error (2 cm).  
Figure 5: Matching execution time and results according to matching increase value: (**a**) segmented data, (**b**) full data.