## 2 Three-Dimensional Reconstruction Model  
In order to study the effect of refraction on 3D reconstruction of markers, the process of light beam emitted from the marker to the camera is considered: the light emitted from marker reaches the water surface and be bent due to the different refractive index of water and air, then reaches the camera imaging plane through camera lens. The refraction process follows [PERSON]'s law:  
\[n_{air}\sin\theta_{air}=n_{water}\sin\theta_{water} \tag{1}\]  
where \(n_{air}\) and \(n_{water}\) are the refractive indices of air and water respectively, \(\theta_{air}\) and \(\theta_{water}\) represents the angles of incidence and refraction respectively. The fish swims generally at the bottom of tank, which means the fluctuations in the water surface are small and can be ignored. Therefore, the model can be simplified into a refraction model that is shown in Figure 1.  
Where the \(P_{c}\) is the position of the camera light spot, \(P_{m}\) is the actual position of the marker point, and \(P_{w}\) and \(P_{p}\) are, respectively, the intersections of light and water and imaging plane. Calibrated by camera, the \(P_{c}(x_{c},y_{c},z_{c})\) is known. The \(P_{p}\big{(}x_{p},y_{p},z_{p}\big{)}\) can be obtained by using Equation (2) based on its 2D coordinates \(\big{(}u_{p},v_{p}\big{)}\) on the imaging plane and the camera parameters. \[\left[ \begin{array}{c}x_{p}\\ y_{p}\\ z_{p}\\ 1\end{array} \right]=\left[ \begin{array}{cc}R_{3\times 3}&t_{3\times 1}\\ 0&1\end{array} \right]^{-1}\!\!K^{-1}\alpha\left[ \begin{array}{c}u_{p}\\ v_{p}\\ 1\end{array} \right] \tag{2}\]  
where the \(R_{3\times 3}\) and \(t_{3\times 1}\) are, respectively, orthogonal rotation matrix and translation matrix, all of which are the external parameters of camera. The \(K\) and \(\alpha\) are the intrinsic parameters of camera. Meanwhile, the height of water surface is known and \(P_{w}\) is on the extension line of \(P_{c}P_{p}\), according to [PERSON]'s law and the following equations  
\[\sin\theta_{air}=\frac{\left| \begin{array}{c}P_{w}^{\rightarrow}P_{c}\times Z _{axis}^{\rightarrow}\\ \left|P_{w}^{\rightarrow}P_{c}\right|\big{|}Z_{axis}^{\rightarrow}\end{array} \right|}{ \left| \begin{array}{c}P_{w}^{\rightarrow}P_{c}\times\widetilde{Z_{axis}} ^{\rightarrow}\\ \left|P_{w}^{\rightarrow}P_{c}\right|\big{|}Z_{axis}^{\rightarrow}\end{array} \right|} \tag{3}\]  
\[\sin\theta_{water}=\frac{\left| \begin{array}{c}P_{w}^{\rightarrow}P_{m} \times\widetilde{Z_{axis}}^{\rightarrow}\\ \left|P_{w}^{\rightarrow}P_{m}\right|\big{|}\big{|}\big{|}Z_{axis}^{ \rightarrow}\end{array} \right|}{\left| \begin{array}{c}P_{w}^{\rightarrow}P _{m}\times\widetilde{Z_{axis}}^{\rightarrow}\\ \left|P_{w}^{\rightarrow}P_{m}\right|\big{|}\big{|}Z_{axis}^{\rightarrow} \end{array} \right|} \tag{4}\]  
Figure 1: Refraction model. We can obtain  
\[(1-\gamma)\Big{[}(x_{w}-x_{m})^{2}+(y_{w}-y_{m})^{2}\Big{]}=\gamma(z_{w}-z_{m})^{2} \tag{5}\]  
where  
\[\gamma=\left(\frac{n_{\text{air}}}{n_{\text{water}}}\right)^{2}\frac{\left(x_{w} -x_{c}\right)^{2}+\left(y_{w}-y_{c}\right)^{2}}{\left(x_{w}-x_{c}\right)^{2}+ \left(y_{w}-y_{c}\right)^{2}+\left(Z_{w}-Z_{c}\right)^{2}} \tag{6}\]  
Because the focal points of \(P_{c}\), \(P_{w}\), \(P_{m}\) and \(P_{p}\) projected on water surface are coplanar, the Equation (7) is satisfied. \[\left| \begin{array}{ccc}0&0&z_{c}\\ x_{m}-x_{w}&y_{m}-y_{w}&z_{m}-z_{w}\\ x_{w}-x_{c}&y_{w}-y_{c}&z_{w}-z_{c}\end{array} \right|=0 \tag{7}\]  
That is  
\[(x_{m}-x_{w})(y_{w}-y_{c})=(x_{w}-x_{c})(y_{m}-y_{w}) \tag{8}\]  
Combining the Equations (5) and (8), and assuming that the horizontal plane is above the object, that is \(z_{w}-z_{m}\geq 0\), the equations of unknown parameters of \(x_{m}\), \(y_{m}\) and \(z_{m}\) can be expressed as a matrix and shown in Equation (9). \[\left\{\begin{array}{ccc}\left[