# A Non-Contact Measurement of Animal Body Size Based on Structured Light
## 2 Materials and Methods
### Camera Calibration  
To achieve the instantaneity, accuracy, and robustness required in obtaining animal body point clouds, this research uses a line-structured light 3D measurement perspective projection model [21], as shown in Figure 2. The projector projects a light plane and intersects the chessboard calibration plate plane (\(XwOwYw\)) at line \(L\). Point \(P\) (\(Xw\), \(Yw\), \(Zw\)) is a point on Line \(L\) in the world coordinate, point \(P\) (\(u\), \(v\)) is the point \(P\) pixel coordinates in the image pixel coordinate, plane \(OXY\) is the camera imaging plane, and point \(Oc\) is the camera optical center. The primary function of this model is to reconstruct pixel points in the image pixel coordinate to points in the world coordinate, and the reconstruction process satisfies the constraint conditions of Equation (1). Matrix **I** is the camera intrinsic matrix, matrix [**R**, **t**] is the extrinsic matrix of a single picture, points (\(Xc\), \(Yc\), \(Zc\)) are point coordinates in the camera coordinate, **R** is the rotation matrix, **t** is a translation vector, and \(d\) is the distortion coefficient.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Introduction** \\ \hline \((u,v)\) & pixel point coordinates in image pixel coordinate \\ (\(Xw\), \(Yw\), \(Zw\)) & point coordinates in world coordinate \\ (\(Xc\), \(Yc\), \(Zc\)) & point coordinates in camera coordinate \\
**I** & camera intrinsic matrix \\
**R,t** & camera extrinsic matrix \\
**R** & rotation matrix \\
**t** & translation vector \\ \(d\) & distortion coefficient \\ \(Ax+By+C=z\) & plane equation \\ (\(xi\), \(yi\), \(zi\)) & chessboard corner point coordinates in world coordinate \\ \(S\) & distance between the corner points and chessboard calibration pattern plane \\ \(n\) & the number of points \\ \(Oc\) & camera optical center \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters Introduction.  
Figure 1: Method Procedure.  
\[d\begin{bmatrix}u\\ v\\ 1\end{bmatrix}=\mathbf{I}\begin{bmatrix}Xc\\ Yc\\ Zc\end{bmatrix}=\mathbf{I}[\mathbf{R},\mathbf{t}]\begin{bmatrix}Xw\\ Yw\\ Zw\\ 1\end{bmatrix} \tag{1}\]  
For obtaining intrinsic matrix \(\mathbf{I}\) and extrinsic matrix \([\mathbf{R},\mathbf{t}]\), we use the [PERSON] calibration method [22]. The [PERSON] calibration method is a camera calibration method proposed by Professor [PERSON] in 2000. This method first uses four pairs of points to solve the homographic relationship between world coordinates and pixel coordinates, which is the product of the intrinsic and extrinsic matrix (or \(\mathbf{I}[\mathbf{R},\mathbf{t}]\)). Then, based on the constraint that column vectors in matrix \(\mathbf{R}\) are orthogonal and all have a norm of one, the intrinsic and extrinsic matrix are solved via the least squares method. Finally, the maximum likelihood estimation method is used to estimate the distortion coefficients and optimize the calibration results. [PERSON]'s calibration method is a cross between traditional and self-calibration methods, but it overcomes the disadvantage of traditional calibration methods that require high-precision calibration objects, only requiring a printed checkerboard. Compared to self-calibration, it also improves accuracy and is easier to operate, which makes [PERSON]'s calibration method widely used in computer vision.