## 3 Our Approach to Estimation of Robot Pose and Pipe Diameter (EPD)
### Analysis of Residual Asymmetry in C-EPD  
In this section, we present the C-EPD scheme, which uses a canonical ellipse residual function to evaluate how well measurement points fit the elliptical model of the pipe. We mathematically analyze the residual asymmetry caused by the uneven treatment of random depth errors, leading to the potential overestimation of pipe diameter. The canonical ellipse form, widely used to model elliptical shapes, is expressed as follows:  
\[\frac{\hat{g}_{P}^{2}}{(D_{\text{max}}/2)^{2}}+\frac{\hat{\varepsilon}_{P}^{2} }{(D_{\text{min}}/2)^{2}}=1 \tag{5}\]  
In the C-EPD framework, the residual function \(r_{c}(\mathbf{\hat{x}}_{i,P},\mathbf{\beta})\) measures the deviation of the point \(\mathbf{\hat{x}}_{i,P}\) from the elliptic surface and is given by  
\[r_{c}(\mathbf{\hat{x}}_{i,P},\mathbf{\beta})=\frac{\hat{g}_{i,P}^{2}}{(D_{\text{max}} /2)^{2}}+\frac{\hat{\varepsilon}_{i,P}^{2}}{(D_{\text{min}}/2)^{2}}-1 \tag{6}\]  
The optimal C-EPD transformation parameters \(\mathbf{\beta}_{C-EPD}^{*}\) minimize the objective function in (4), as follows:  
\[\mathbf{\beta}_{C-EPD}^{*}=\arg\min_{\forall\mathbf{\beta}}\sum_{i=1}^{N}r_{c}^{2}( \mathbf{\hat{x}}_{i,P},\mathbf{\beta}). \tag{7}\]  
We analyze the residual asymmetry of the canonical ellipse function, focusing on its sensitivity to random depth errors. Given identical magnitudes of random errors, positive-error points tend to yield higher residuals than negative-error points. This imbalance introduces systematic overestimation of pipe diameters during optimization. We now explain and mathematically prove this asymmetry using a conceptual framework. Figure 2 illustrates the canonical residual function in a scaled coordinate system where the ellipse is transformed into a unit circle. The transformation to a unit circle is a non-uniform scaling transformation where the scaling factors are different in each scaling direction. In general, the non-uniform scaling transformation distorts distances and shapes, e.g., from an ellipse to a circle. However, it preserves the relative distance along the same scaling direction. In Figure 2, the ground-truth, positive-error, and negative-error points lie in the same scaling direction; therefore, the relative error magnitudes between them are preserved. The scaling operation does not alter the order of the residual errors introduced by the random depth errors, ensuring that the asymmetry remains consistent. Additionally, by converting the ellipse to a circle, the effect of different eccentricities (varying shapes and degrees of elongation of the ellipse) is neutralized. This transformation enables a clearer visualization and interpretation of how positive- and negative-error points influence  
residual computations, emphasizing the estimation bias introduced by asymmetric error treatment in the canonical residual function. The scaled coordinate system maintains the geometric relationship by normalizing the axes based on the major-axis length (\(D_{\text{max}}\)) and minor-axis length (\(D_{\text{min}}\)). A point, \(\hat{x}_{i,P}\), in the PCS is transformed to \(\tilde{x}_{i,P}\) in the scaled coordinate system as follows:  
\[\tilde{x}_{i,P}=\mathbf{T}\hat{x}_{i,P}, \tag{8}\]  
where the transformation to the scaled system is defined by the matrix  
\[\mathbf{T}= \begin{bmatrix}1&0&0\\ 0&\frac{2}{D_{\text{max}}}&0\\ 0&0&\frac{2}{D_{\text{min}}}\end{bmatrix} . \tag{9}\]  
In the scaled system, the ellipse is represented as a unit circle, and the residual function simplifies to  
\[r_{c}(\tilde{x}_{i,P},\mathbf{\beta})=\tilde{y}_{i,P}^{2}+\tilde{z}_{i,P}^{2}-1. \tag{10}\]  
Multiplying this equation by \(\pi\) gives  
\[\pi r_{c}(\tilde{x}_{i,P},\mathbf{\beta})=\pi(\tilde{y}_{i,P}^{2}+\tilde{z}_{i,P}^ {2})-\pi, \tag{11}\]  
where the first term represents the area of the circle passing through the point \(\tilde{x}_{i,P}\), and the second term represents the area of the unit circle.