# Research on Monocular-Vision-Based Finger-Joint-Angle-Measurement System
## 3 Experimental-Platform Construction
### Light-Source Selection and Solution of the Single-Reflection Matrix  
Industrial cameras are at the core of the vision-inspection system, and their main role is to convert the optical signal into an electrical signal and transmit it to the processing unit. As the most important part of the industrial camera, the light-sensitive element is of two main types: CCD (charge-coupled element) and CMOS (complementary metal oxide semiconductor). Furthermore, CCD technology is more widely used. Industrial cameras have many important parameters, such as resolution, shutter time, external trigger, frame rate, etc. Therefore, the vision-inspection system should take into account the needs of the inspection task to select the most appropriate camera. Depending on the interface type of the camera, it can be divided into USB, GigE, and camera link. Considering the advantages of the data-transmission speed, ease of use, and data-transmission distance, the GigE interface camera in Basler ace was selected. In the inspection system, the choice of industrial lens directly affects the quality of the captured image. The industrial-lens parameters, such as interface type and CCD size, should be matched with the industrial camera. In addition, the aperture of the lens controls the light intake of the industrial camera, which exerts a direct impact on the brightness of the image; the focal length directly affects the size of the field of view, representing the vertical distance from the imaging plane to the center of the lens. Considering these lens characteristics, the lens selected in this study was TEC-V7X. The light source is another important component of the visual inspection system, which is to determine the key to clear and stable imaging. The choice of the light source should highlight the object to be detected. According to the classification of light-emitting devices in the light source, the light source can be divided into fluorescent lamps, LED lamps, halogen lamps, etc., of which LED lamps are the most common. The light source selected for this paper was the ring light source of model R50-26-13, developed by Huakang Technology Company. The transformation of the camera coordinate system, _x-y-z_, into the two-dimensional image coordinate system, _u-v_, is shown in Equation (1). \[\left[ \begin{array}{c}u\\ v\\ 1\end{array} \right]=s \begin{bmatrix}f_{x}&\gamma&u_{0}\\ 0&f_{y}&v_{0}\\ 0&0&1\end{bmatrix} \left[ \begin{array}{cc}r_{1}&r_{2}&t\\ \end{array} \right] \begin{bmatrix}x_{W}\\ y_{W}\\ 1\end{bmatrix}  \tag{1}\]  
Figure 3: Finger-joint-angle-detection platform. where \( \begin{bmatrix}f_{x}&\gamma&u_{0}\\ 0&f_{y}&v_{0}\\ 0&0&1\end{bmatrix} \) is the internal reference matrix of the camera and \( \begin{bmatrix}r_{1}&r_{2}&t\end{bmatrix} \) is the external reference matrix of the camera. This leads to the formula for calculating the single-response matrix of the camera and the conversion formula for converting the pixel coordinates of the image to world coordinates as:  
\[\left\{\begin{array}{l}\mathbf{H}=s \begin{bmatrix}f_{x}&\gamma&u_{0}\\ 0&f_{y}&v_{0}\\ 0&0&1\end{bmatrix} \end{bmatrix} \begin{bmatrix}r_{1}&r_{2}&t\end{bmatrix} =s\mathbf{M} \begin{bmatrix}r_{1}&r_{2}&t\end{bmatrix} \right. \tag{2}\]  
where \(\mathbf{H}\) is the single-response matrix, \(\mathbf{x}\) is the pixel coordinate in the image, and \(\mathbf{X}\) is the world coordinate. The above coordinate-system-conversion Equation (2) is used to obtain the single response matrix \(\mathbf{H}\) from the pixel-coordinate system to one of the plane-coordinate systems (W) in space. Using \(\mathbf{H}\), two points in the pixel-coordinate system can be converted into W. The distance s1 between two points in W is calculated, after which a ruler is used to directly measure the actual distance s2 between the corresponding two points in W. The error result of comparing s1 and s2 is 0.073 mm. However, when the relative distance between W and the camera changes, the error between s1 and s2 becomes dramatically larger.