## 2 Methodology
### Tunnel Axis Segmentation
#### 2.2.3 Segmentation of the Tunnel Axis  
We employ an enhanced RANSAC algorithm to partition the central tunnel axis into linear and circular segments. If the conventional RANSAC algorithm is simply used to simultaneously recognize linear and circular segments in data space, over-segmentation often occurs. For example, a circular segment with low curvature might be mistakenly segmented as multiple linear segments. To solve this problem, we transform the question of detecting the linear and circular segments from the original data space into the question of only detecting linear segments in the transformed tangent space, significantly reducing the complexity of segmentation of the tunnel axis. An enhanced RANSAC algorithm is described as follows:  
1. The central axis point clouds are transformed into tangent space (\(d\), \(\theta\)). 2. An optimal linear segment is first detected from (\(d\), \(\theta\)) space, and then the axis point clouds are divided into inliers and outliers. 3. We determine the extent of inliers in tangent space. If any point from outliers is inside the extent of the inliers, the corresponding point is removed from the outliers. 4. The point clouds from the remaining outliers are provided as input. The steps from (\(b\)) to (\(c\)) are executed repeatedly until all of the remaining outliers have been processed. 5. The sequence of linear elements extracted in tangent space is restored according to the sequence of their middle points. Hence, we obtain anchor points by circulating around pairwise neighboring linear segments. More precisely, if a linear segment \(\mathcal{S}_{i}\) is a neighbor with a linear primitive \(\mathcal{S}_{j}\), there is an anchor point whose position is exactly at the intersection of \(\mathcal{S}_{i}\) and \(\mathcal{S}_{j}\). 6. Using these anchor points, the linear and circular segments in data space are simultaneously determined, since the axis points have a one-to-one mapping relationship between data and tangent spaces. It should be aware that we only need two parameters to execute the enhanced RANSAC algorithm: (1) the probability \(P\) that at least one of the selected axis points does not contain an outlier, and (2) the Euclidean distance \(\epsilon\) from a point to the hypothetical linear model that determines the number of points consistent with the linear model in the tangent space. In our case, we set parameter \(P\) to 0.99, which ensures the optimal linear model within a specific number of iterations controlled by \(P\) can be obtained. The other parameter \(\epsilon\) is determined by the definition of the tangent space. We set \(\epsilon\) to 0.01. It is to be  
After segmentation, we use the linear regression model to fit the linear axis model. The polynomial regression model is employed to fit the axis points for nonlinear tunnel segments. The details are described below:  
Generally, the polynomial of degree \(n\) can be written into:  
\[y=a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n}. \tag{2}\]  
As the variable \(x\) is the observation value, we let \(X_{1}=x,X_{2}=x^{2},\ldots,X_{n}=x^{n}\). The nonlinear Equation (2) can be transformed into the linear equation below:  
\[y=a_{0}+a_{1}X_{1}+a_{2}X_{2}+\cdots+a_{n}X_{n}. \tag{3}\]  
Figure 5: Comparisons of tunnel axis segmentation with and without noise. (**a**,**c**) are results of tunnel axis point clouds without noise; (**b**,**d**) are results of the tunnel axis after adding a certain degree of Gaussian noise. Figure 6: The central tunnel axis segmentation of real data. (**a**) the segmented three-dimensional axis is superimposed onto their associated tunnel point clouds; (**b**,**c**) represent the two-dimensional segmented tunnel axis in data space (\(xy\)-plane) and tangent space, respectively. We assume that there are \(m\) points on the nonlinear axis. Based on Equation (3), these points constitute a set of equations:  
\[\left\{