## 2 System Setup  
In this study, an embedded computer was used as the main controller. A network camera, Microsoft LifeCam Studio 1080P Full-HD (Microsoft Taiwan Corporation, Taipei, Taiwan), and an E-books W6 PC Webcam (Chung Ching Technical Co., Taichung, Taiwan) were used for the image processing, as shown in Figure 1. The Dynamixel MX-28 servo motor produced by Robotis Company (Seoul, Korea) was the main motive force of the robot arm, as shown in Figure 2.  
The motor weight was 72 g, dimensions of 35.6 \(\times\) 50.6 \(\times\) 35.5 (mm), resolution of 0.088\({}^{\circ}\), running degree of 0\({}^{\circ}\)-360\({}^{\circ}\), gear reduction ratio of 193:1, stall torque of 24 kgf-cm (at 12 V, 1.5 A) and a no-load speed of 54 rpm (at 12 V). Figure 3 shows the experimental setup with a smartphone on the test board. Kinematics [15] mainly defines the conversion in the space of Cartesian coordinates \((x,y,z)\) and the mechanical arm with the moving angle \((\theta_{1},\theta_{2},\theta_{3},\theta_{4})\) of the joints. Forward kinematics can be considered as a mapping from the joint space to the operational space with the coordinates of the robot end-effector. Figure 1: (**a**) Microsoft LifeCam Studio 1080P Full-HD and (**b**) E-books W6 PC Webcam. Figure 3: Experimental setup includes the control panel (PC screen), main processor (notebook), Microsoft LifeCam, E-books Webcam, robot arm, tested smartphone, and test bed. Figure 2: (**a**) Dynamixel MX-28 servo motor and (**b**) robot arm. Inverse kinematics is a mapping from the operational space with the coordinates of the robot end-effector to the joint space, so it can be considered as the inverse of forward kinematics. Figure 4 explains the relationship of forward kinematics and inverse kinematics. The presented kinematic model of the arm has four degrees of freedom. The model of the robotic arm is presented in Figure 5. There are four parameters that fully describe the kinematic relationship between every neighboring joint and link in a manipulator. These four parameters are:  
1. Two neighboring joint relations: the link length \(a_{\mathrm{i}}\) and the link twist angle \(\alpha_{\mathrm{i}}\). 2. Two neighboring link relations: the link offset \(d_{\mathrm{i}}\) and the joint angle \(\theta_{\mathrm{i}}\). These parameters are derived from the D-H model, as found from the robot arm as analyzed in Appendix A. Because the views of the camera and robot arm are different, a coordinate transformation process is needed. The coordinate transformation relationship is shown in Figure 6, where \(T_{4}^{\mathrm{c}}\) is the coordinate transformation relationship of the base frame and end-effector, \(T_{\mathrm{s}}^{\mathrm{c}}\) is the coordinate transformation relationship for the camera and end-effector, \(T_{\mathrm{s}}^{\mathrm{0}}\) is the coordinate transformation relationship of the base frame and smartphone and \(T_{\mathrm{s}}^{\mathrm{c}}\) is the coordinate transformation relationship of the camera and smartphone. We needed to collect more than three data, and then use the least squares method to obtain the transformation matrix. Because the \(z\)-axis coordinates are the same, we only needed to use  
Figure 4: Relationship of forward kinematics and inverse kinematics. Figure 5: Kinematic model of robotic arm with four degrees of freedom. \(x\) coordinates and \(y\) coordinates, where \(x_{i}\) and \(y_{i}\) are the pattern matching coordinates, and \(x_{r}\) and \(y_{r}\) are the robot end-effector coordinates. \[ \begin{bmatrix}x_{r}\\ y_{r}\\ 1\end{bmatrix} = \begin{bmatrix}r_{11}&r_{12}&r_{13}\\ r_{21}&r_{22}&r_{23}\\ 0&0&1\end{bmatrix}\begin{bmatrix}x_{i}\\ y_{i}\\ 1\end{bmatrix}  \tag{1}\]  
where \(r_{11}\), \(r_{12}\), \(r_{21}\) and \(r_{22}\) are rotation, and \(r_{13}\) and \(r_{23}\) are translation. From Equation (1), we have:  
\[x_{r}=r_{11}x_{i}+r_{12}y_{i}+r_{13} \tag{2}\]  
\[y_{r}=r_{21}x_{i}+r_{22}y_{i}+r_{23} \tag{3}\]  
From Equations (2) and (3), we have:  
\[x_{r}=