# 3D Reconstruction of Celadon from a 2D Image: Application to Path Tracing and VR
## 3 3D Reconstruction from a 2D Celadon Image
### Corner detection  
A non-flawed celadon always has a rim and a base, with four corners in total, two on the rim and the other two on the base. It is essential to accurately identify the corners of the celadon as they help determine the endpoints of the profile polylines in the contour polyline. However, detecting these corners directly from the original data is challenging. We smooth the contour polyline using a \(7\times 7\) Gaussian filter and apply the Shi-Tomasi's [27] method to find its top and bottom corners. These are referential corners used to determine the original contour's corners accurately. The detected corners of the celadon are shown in pink in Figure 2b.  
Figure 2: The flow from 2D celadon image to a 3D model: (**a**) input 2D image; (**b**) detected contour and corners; (**c**) the axis of revolution **A**; (**d**) profile curve \(C\) with **A**; (**e**) generated 3D celadon model.  
**Axis of revolution.** The next step is to determine the axis of revolution **A**  of the celadon using the four corners. The Principal Component Analysis (PCA) creates two eigenvectors that best describe the original contour. We employ this feature to determine the **A**. Specifically, we select one eigenvector closest to the vertical axis, as it is crucial to align the **A** with the vertical axis. To achieve this, we divide the corners into relatively left and right corners and select any set of them. We can find a direction vector of the **A** using the selected corners and the two eigenvectors. It is important to note that the axis of revolution should pass through the average point of the original contour. If the **A** slightly deviates from the vertical axis, we adjust the **A** and the contour to align with the vertical axis, reducing errors. Figure 2c shows the eigenvectors produced by the PCA in the green and red arrows and the **A** in the blue line.  
**Profile polylines.** The contour, corners, and **A** derived in the previous steps extract the profile polylines. The corners serve as endpoints of them. Selecting one profile polyline between them for generating a 3D celadon model is necessary for the following B-spline curve fitting. Figure 2d shows only the **A** and the celadon's right profile curve. Algorithm 1 summarises extracting a profile polyline from an input celadon image.  
```
Input :\(I\) - an input celadon image Output :\(P_{p}\) - a profile polyline of the celadon # Contour detection \(G_{I}\leftarrow\) convertToBinaryThreshold(\(I\), threshold) \(P_{c}\leftarrow\) findContour(\(G_{I}\)) # Corner detection \(G_{a}\leftarrow\) approximateContour(\(P_{c}\)) \(G_{b}\leftarrow\) gaussianFilter(\(G_{a}\), (7, 7)) \(F\leftarrow\) findCorners(\(G_{b}\), \(P_{c}\)) # Derive an axis of revolution \(\textbf{e}_{1}\), \(\textbf{e}_{2}\), \(m\leftarrow\) PCA(\(P_{c}\)) \(\textbf{d}\leftarrow\) getAxisDirection(\(\textbf{e}_{1}\), \(\textbf{e}_{2}\), C) \(\textbf{A}\leftarrow\) makeAxisOfRevolution(\(\textbf{d}\), \(m\)) # Select a profile polyline \(P_{p}\leftarrow\) getProfilePolyline(\(P_{c}\), C, A)
```  
**Algorithm 1**Extract a profile polyline.