# 3D Reconstruction of a Single Bubble in Transparent Media Using Three Orthographic Digital Images
## 3 3D Bubble Reconstruction
### Bubble Posture Correction  
Bubble posture correction was the pre-work of the method proposed in this paper. There were two major purposes to carry out this step. On the one hand, based on the rotation conditions and geometric information of front contour and side contour around \(x\)-axis and \(y\)-axis, the posture correction improved the measurement accuracy of the azimuth angle around \(z\)-axis. On the other hand, the posture correction, which used the spatial rotation angles of bubble to correct their projection contours, properly reduced the measurement error causing by rotation. Figure 5 illustrates the schematic diagram of posture correction. Since the image processing steps of the front view are similar to those of the side view, as an example, the following statements are used to explain the steps of posture correction for the front view. In the following expressions, \(F\), \(S\), and \(T\) indicate the front view, side view, and top view, respectively.  
The implementation details of bubble posture correction were shown in Figure 5. We considered images of sample No. 7 (As shown in the bubble examples in Section 4.1) to be the example. Firstly, the projected contours were extracted using image processing software MATLAB R2015a. Axis A was assumed to be the shorter axis, which is perpendicular to the longer axis, i.e., axis B. Moreover, the angle between axis A and the vertical direction, i.e., \(\theta_{F}\), was considered to be in the range of 0-90\({}^{\circ}\) (\(0^{\circ}\leq\theta_{F}\leq 90^{\circ}\)). When \(\theta_{F}\) is smaller than 45\({}^{\circ}\), the projected contour of the top view of the bubble is mainly affected by the length of axis B, so axis A is rotated to the vertical direction; on the other hand, when \(\theta_{F}\) is greater than 45\({}^{\circ}\), the projected contour of the top view of the bubble is mostly affected by axis A, so axis A is rotated to the horizontal direction. The rotation formula is given by:  
\[\left(\begin{array}{c}x_{F}^{\prime}\\ z_{F}^{\prime}\end{array}\right)=\left(\begin{array}{cc}\cos\theta_{F}&\sin \theta_{F}\\ -\sin\theta_{F}&\cos\theta_{F}\end{array}\right)\left(\begin{array}{c}x_{F} \\ z_{F}\end{array}\right) \tag{4}\]  
where, \((x_{F},z_{F})\) and \((x_{F}^{\prime},z_{F}^{\prime})\) represent the coordinates of the bubble projection contour before rotation and after rotation, respectively; \(\theta_{F}\) is the angle of rotation. Then, the magnification factor of the front view is calculated by:  
\[\gamma_{F}=s_{F}/S_{F} \tag{5}\]  
where, \(\gamma_{F}\) is the magnification factor of the front view; \(S_{F}\) and \(s_{F}\) represent the maximum width of the front image and that of the corrected front image, respectively. Meanwhile, the coincident steps were  
Figure 4: A 3D schematic of the method proposed in this paper.  
repeated to correct the projected contour of the side image, and the magnification factor of the side view (\(\gamma_{S}\)) was then figured.  
Finally, in order to make the bubble contours conform to physical and geometric relationship, the top projection contour needed to be corrected using the magnification of the front view and side view as follows:  
\[\left(\begin{array}{c}x_{T}^{\prime}\\ y_{T}^{\prime}\end{array}\right)=\left(\begin{array}{cc}x_{T}&0\\ 0&y_{T}\end{array}\right)\left(\begin{array}{c}\gamma_{F}\\ \gamma_{S}\end{array}\right) \tag{6}\]  
where, \((x_{T},y_{T})\) are the coordinates of the uncorrected top view image, and \((x_{T}^{\prime},y_{T}^{\prime})\) denote the coordinates of the corrected top view image. After the top view image was corrected, the angle between the long axis (or the short axis) and the horizontal direction was extracted and that was regarded as the azimuth angle (\(\beta_{T}\)).