## 3 Rigid Transformation of the Coordinate System  
An affine transformation is a transformation model of a two-dimensional plane coordinate system to another two-dimensional plane coordinate system [24]. When the objects  
Figure 4: Tangential distortion diagram. Figure 3: Radial distortion diagram. in the two coordinate systems only have rotation and translation transformations, it is said that there is a rigid transformation relationship between the two coordinate systems [25]. In Euclidean space, suppose a point \(A\left(x,y\right)\) obtains a point \(B\left(x^{\prime},y^{\prime}\right)\) through a rotation \(R\) transform and a translation \(t\) transform, and the two transformations are combined to make  
\[f\left(x^{\prime},y^{\prime}\right)=\mathbf{R}f(x,y)+\mathbf{t} \tag{5}\]  
where \(f\left(x,y\right)\) is the plane before transformation and\(f\left(x^{\prime},y^{\prime}\right)\) is the plane after transformation. Let the rotation angle of the plane about the \(Z\) axis be \(\theta\), and then  
\[\mathbf{R}=\left[ \begin{array}{cc}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{array} \right]\text{, }\mathbf{t}=\left[ \begin{array}{c}t_{x}\\ t_{y}\end{array} \right]\]  
If point \(B\) (\(x^{\prime}\), \(y^{\prime}\)) is subjected to a rotation \(R^{\prime}\) transformation and a translation \(t^{\prime}\) transformation again to obtain point \(C\left(x^{\prime\prime},y^{\prime\prime}\right)\), then the transformation process from point A to point C can be expressed as  
\[f(x^{\prime\prime},y^{\prime\prime})=\mathbf{R}^{\prime}(f(x,y)+\mathbf{t})+\mathbf{t}^{ \prime} \tag{6}\]  
This is obviously not a linear transformation process. As the combination of basic transformation factors increases, the transformation process will become more and more complicated. Considering the convenience of calculation, here introduce the homogeneous coordinates to represent the points in the plane, and then the transformation from point \(A\) to point \(B\) can be expressed as  
\[\left[ \begin{array}{c}x^{\prime}\\ y^{\prime}\\ 1\end{array} \right]=\left[ \begin{array}{cc}\mathbf{R}&\mathbf{t}\\ 0&1\end{array} \right]\left[ \begin{array}{c}x\\ y\\ 1\end{array} \right]=\mathbf{T}\left[ \begin{array}{c}x\\ y\\ 1\end{array} \right] \tag{7}\]  
Equation (6) can be expressed as  
\[\left[ \begin{array}{c}x^{\prime\prime}\\ y^{\prime\prime}\\ 1\end{array} \right]=\left[ \begin{array}{cc}\mathbf{R}^{\prime}&\mathbf{t}^{\prime} \\ 0&1\end{array} \right]\left[ \begin{array}{cc}\mathbf{R}&\mathbf{t}\\ 0&1\end{array} \right]\left[ \begin{array}{c}x\\ y\\ 1\end{array} \right]=\mathbf{T}^{\prime}\mathbf{T}\left[ \begin{array}{c}x\\ y\\ 1\end{array} \right] \tag{8}\]  
In this way, no matter how many times the basic transformation factors are combined, the original coordinate points and the transformed coordinate points are always linear. In terms of mechanical installation of the entire system, it is necessary to ensure that the robot, the plane of the conveyor belt and the optical axis of the camera are parallel to each other. When the \(Z\) axes of the two coordinate systems are parallel, the amount of displacement in the \(Z\) direction is temporarily ignored so that the three-dimensional space coordinate system of the robot coordinate system is compressed to a two-dimensional plane coordinate system, which is convenient for subsequent calculations. As shown in Figure 5, \(O_{C}-\left\{X_{C},Y_{C},Z_{C}\right\}\) represents the image coordinate system and \(O_{R}-\left\{X_{R},Y_{R},Z_{R}\right\}\) represents the robot coordinate system. Since the motion of the robot is a rigid body, and the camera is fixed at the same time, when the \(Z\) axes of the two coordinate systems are parallel, there are only a few rotation transformations and translation transformations in the two spatial coordinate systems (the linear transformation model, according to Equation (8)). Therefore, the transformation model of the image coordinate system to the robot coordinate system can be expressed as  
\[\left[