# _Skin Imaging_: A Digital Twin for Geometric Deviations on Manufactured Surfaces
## 3 Skin Imaging of Manufactured Cylindrical Surface
### SG Estimation  
Fitting the best substitute cylinder to the PCs, obtained from surface of the manufactured cylinder, requires estimation of the cylinder's axis orientation and its radius.  
_Initial estimation of cylinder's axis_: Conventional methods to find the axis of a cylinder, such as PCA and Robust PCA [49], can estimate the axis with approximate accuracy but this estimation requires a modification. Figure 4 illustrates the estimated axis for PC of an ideal cylindrical surface with Robust PCA method, which is not a satisfactory estimation and leads to faulty results in the next steps. Applying PCA-based methods on PCs of the cylinder surface, the principal that corresponds to maximum eigenvalue, i.e., \(X_{\text{PCA}}\), is the axis of the cylinder. According to Figure 4, the initial SG does not fit well on the PCs (blue points) and hence some parts of the points have pseudo deviation when they should not. This is clearly obvious in Y-Z view in Figure 4 that the fitted SG does not coincide with the PC in some parts. Figure 5 displays the PC after mapping to PCA coordinate system which again illustrates essentiality of the modification of the SG fitting process. It is noteworthy to say that the PCs are centered in the X-Y plane during mapping.  
Figure 4: Initial cylinder fitting in scanner coordinate system (PC is in blue and SG is in red color).  
_Modification of initial estimated axis_: In order to modify the initial estimation of the axis, the initial fitted cylinder is divided to several small intervals along \(X_{PCA}\) axis, which is the initial estimated axis of the cylinder. By considering the \(Y_{PCA}\)-\(Z_{PCA}\) coordinates of data points inner each interval and fitting the best circle to them, the centers of the fitted circles make a line in space which is the actual axis of the cylinder (Figure 6). Rotating the initial fitted cylinder by the angle between this line and X axis, the modified axis of the cylinder is obtained.  
The initial SG estimation with PCA method, i.e., \(\left[x^{i}_{PCA}\quad y^{i}_{PCA}\quad z^{i}_{PCA}\right]\) in Equation (1) is then multiplied by the rotation matrix (\(\mathbf{R}_{\Theta}\)) obtained through modification process to find the ultimate coordinates of fitted points i.e., \(\left[x^{i}_{SG}\quad y^{i}_{SG}\quad z^{i}_{SG}\right]\) in Equation (2) (namely SG coordinate system). Figure 7 shows the result of mapping PCs to the ultimate coordinate system of fitted cylinder and declares the positive impact of modification procedure.  
\[\left[x^{i}_{SG}\quad y^{i}_{SG}\quad z^{i}_{SG}\right]=\left[x^{i}_{PCA}\quad y ^{i}_{PCA}\quad z^{i}_{PCA}\right]\times\mathbf{R}_{\Theta} \tag{2}\]  
In order to demonstrate the efficiency of the proposed SG estimation for the PC of any cylindrical surface, a PC, in which the axis of the cylinder is not even partially parallel with  
Figure 5: PCs after mapping to PCA coordinate system.  
Figure 6: Modification concept of initial estimated axis of cylinder.  
Figure 7: PCs in SG coordinate system after modification.  
any of the axes of the measurement frame (scanner frame) is considered. Figure 8 shows the fitted cylinder (in red color) to this PC (in blue color) together with the SG frame on the original PC in different views in scanner coordinate system; as expected, the obtained XSG is the axis of the cylinder.  
Radius estimationAfter accurate estimation of the cylinder axis, considering the YSG-ZSG coordinates of all data points the best circle is fitted by a linear least squares approach proposed in [50], which is robust to outliers. Therefore, the radius of the fitted cylinder (R\({}_{\text{C}}\)) is attained.