## 3 Materials and Methods
### Target Ship Position Estimation Based on Binocular Imaging
#### 3.2.2 Target Relative Coordinate Estimation Based on Binocular Imaging  
Under ideal conditions, the camera imaging model is assumed to be a central projection linear model. Based on the pinhole imaging model, visual target relative positioning can be achieved. In this process, we need to consider the world coordinate system \(O_{W}-X_{w}Y_{w}Z_{w}\) (which represents the reference coordinate system for the camera and object position), the camera coordinate system \(O_{\mathrm{C}}-X_{\mathrm{C}}Y_{\mathrm{C}}Z_{\mathrm{C}}\) (with the camera optical center as the origin and the optical axis direction as the Z-axis), the image coordinate system \(o_{i}-x_{i}y_{i}\) (corresponding to the camera coordinate system with the origin at the intersection of the image plane and the optical axis of the camera), and the pixel coordinate system \(o_{P}-u_{i}v_{i}\) (a two-dimensional plane with the origin at the top-left corner of the first pixel). These four coordinate systems are interrelated, forming the transformation process from the world coordinate system to the pixel coordinate system, providing the foundation for achieving visual target localization. The relationships among the four coordinate systems and the binocular imaging process are illustrated in Figure 6.  
Figure 5: (a) to (b) illustrate the Driving-Leaves binocular camera before and after calibration and stereo rectification, and (c) to (d) illustrate the Baymax binocular camera before and after calibration and stereo rectification.  
According to the pinhole imaging principle, the transformation relationship between the pixel coordinate system and the world coordinate system is as follows:  
\[Z_{c}\begin{bmatrix}u\\ v\\ 1\end{bmatrix}=\begin{bmatrix}f_{x}&0&c_{x}\\ 0&f_{y}&c_{y}\\ 0&0&1\end{bmatrix}\begin{bmatrix}R&T\end{bmatrix}\begin{bmatrix}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{bmatrix} \tag{10}\]  
where \(\begin{bmatrix}f_{x}&0&c_{x}\\ 0&f_{y}&c_{y}\\ 0&0&1\end{bmatrix}\) is the intrinsic parameter matrix of the camera, which is obtained from the camera calibration above. \(R\) and \(T\) are the rotation matrix and translation vector, respectively.  
Based on the binocular imaging principle (Figure 6) and the similarity of triangle proportions, we can derive the following:  
\[Z_{c}=\frac{fb}{X_{L}-X_{R}}=\frac{fb}{(u_{L}-u_{R})d_{x}}=\frac{bf_{x}}{u_{L} -u_{R}} \tag{11}\]  
Here, \(X_{L}\) and \(X_{R}\) represent the physical dimensions corresponding to the target's \(u_{L}\) and \(u_{R}\) in the pixel coordinate system. \(d_{x}\) denotes the physical size of each pixel on the horizontal axis. \(b\) is the baseline of the binocular camera system.  
Assume that the origin of the world coordinate system is the optical center of the left-eye camera. To transform from the camera coordinate system to the world coordinate system, a counterclockwise rotation around the \(X_{c}\) axis of the camera coordinate system by an angle \(\alpha\) = 90\({}^{\circ}\) (viewed from the positive direction of the \(X_{c}\) axis towards the negative  
Figure 6: Conceptual diagram of the binocular imaging process.  
direction, rotating counterclockwise) is required. The transformation of the coordinate system can be expressed as follows:  
\[Z_{c}\begin{bmatrix}u\\ v\\ 1\end{bmatrix}=\begin{bmatrix}f_{x}&0&c_{x}\\ 0&f_{y}&c_{y}\\ 0&0&1\end{bmatrix}\begin{bmatrix}X_{w}\\ -Z_{w}\\ Y_{w}\end{bmatrix} \tag{12}\]  
\((X_{w},Y_{w},Z_{w})\) are the relative coordinates of the target ship relative to the world coordinate system with the optical center of the left-eye camera as the origin.