# Research on Monocular-Vision-Based Finger-Joint-Angle-Measurement System
## 4 Vision-Based Finger-Joint-Angle-and-Length-Detection Method
### Visual Marker Segmentation Methods  
To obtain a better finger-joint-angle-detection algorithm, this paper uses the HSV color-space-conversion method and the image-threshold-segmentation method to extract the target finger-joint identifier in the image and different edge-detection algorithms to obtain the identifier edge coordinates and then calculates each finger-joint pinch angle by two different finger-joint-angle-detection algorithms. (1) HSV color-space-marker-segmentation extraction with Canny edge detection  
In HSV color space, H denotes color, S denotes shade when S = 0 only grayscale image, and V denotes light and dark, indicating the brightness of the color [22; 23]. The conical  
Figure 4: Finger-joint markers and their method of attachment. Figure 5: Image-acquisition method based on the active multi-angle light-source-detection method. model of HSV color space can be formed by erecting and flattening the central axis of the RGB-color-space 3D coordinates. The RGB-HSV color-space-conversion equations are shown in Equations (3)-(5). \[\mathrm{V=}\mathrm{max(R,G,B)} \tag{3}\]  
\[\mathrm{S=}\left\{ \begin{array}{ll}\frac{\mathrm{V-min(R,G,B)}}{\mathrm{V}}& \mathrm{V\
eq 0}\\ 0&\mathrm{other}\end{array} \right. \tag{4}\]  
\[\mathrm{H=}\left\{ \begin{array}{ll}60(\mathrm{G-B})/(\mathrm{V-min(R,G,B)})& \mathrm{V=R}\\ 120+60(\mathrm{B-R})/(\mathrm{V-min(R,G,B)})&\mathrm{V=G}\\ 240+60(\mathrm{R-G})/(\mathrm{V-min(R,G,B)})&\mathrm{V=B}\end{array} \right. \tag{5}\]  
In Equations (3)-(5), R, G, and B denote the three components of the three-dimensional coordinate axes in the RGB color space. The setting ranges of the three components of HSV are H: 100-130, S: 150-255, V: 130-255. The results of the specified color-region extraction are shown in Figure (b)b. Canny edge detection is currently a commonly used edge-detection algorithm. It was proposed by [PERSON] in 1986 [23]. It is a multi-stage algorithm consisting of image-noise reduction, the computation of the image gradient, non-maximal value suppression, and threshold screening. Its formula for image-gradient calculation for edge detection is shown in Equation (6). \[\left\{ \begin{array}{ll}\mathrm{G=}\sqrt{G_{x}^{2}+G_{y}^{2}}&\\ \theta=\mathrm{atan2}\big{(}G_{y},G_{x}\big{)}\end{array} \right. \tag{6}\]  
The \(\theta\) in Equation (6) represents the gradient angle range of \(-\pi\)\(\sim\)\(\pi\), which can be approximated as four angles, 0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\), representing the horizontal, vertical, and two diagonal directions, respectively. The Canny operator edge-extraction results are shown in Figure (c)c.  
Figure 6: Grayscale conversion of the original image with the histogram. Figure 7: HSV marker segmentation and edge detection. Image thresholding method with edge-contour extraction  
The use of image segmentation to separate the target region from the background region can prevent the need to conduct a blind search on the image and greatly improve the processing efficiency of the image [24; 25]. Threshold segmentation based on the grayscale histogram is simple to compute and is suitable for grayscale images where the target and background are distributed in different grayscale ranges, as shown in Figure 7 for the histogram of the original image. The image-segmentation formula based on different thresholds is shown in Equation (7), where \(T\) is the gray threshold; \(f(x_{i},y_{i})\) is the gray level of the detected image point, and A and \(\overline{A}\) are the set gray level of the current position image. In this study, the gray level of the target image was set as 0, and the gray level of the other images was set as 255. The above operation was performed simultaneously by scanning the image by a line from two directions using a raster scan, which can prevent missing image information for various reasons, as shown in Figure 8a for the image after threshold segmentation.