## 3 Algorithm and Principle
### Algorithm for HMT Gesture Recognition
#### 3.1.1 Hand Region Segmentation  
In the process of continuous gesture recognition, the motion of fist bobbing should be judged by the height change of the hand region. In addition, the foreground area of the hand should be removed, and only the background part should be reserved for subsequent processing when calculating the velocity of the background feature. Therefore, the recognition and segmentation of the hand region is the important part of the algorithm framework. In this subsection, we will describe the algorithms for hand region segmentation and hand height calculation. In order to improve the efficiency of the algorithm and the recognition velocity of the whole system, we reduced the pixels of the original video frame to 72 \(\times\) 96 pixels from 240 \(\times\) 320 pixels before the hand region segmentation. Since the camera module used in this study is a 175-degree wide-angle camera, the original image has a wide-angle distortion effect, as shown in Figure 5a. Generally, the wide-angle distortion can be corrected by the corresponding correction algorithm [31]. However, the hand region is an important parameter in continuous gesture segmentation and background velocity calculation in this study. Particularly, we didn't use the general wide-angle distortion correction algorithm; instead, we used the pixel reduction method to remove the serious distortion image corner, which results in the pixels being cut down to 54 \(\times\) 73 pixels, as shown in Figure 5b. This method is very suitable for this study. The serious wide-angle distortion can be eliminated conveniently, and the characteristics of the hand region in the middle of the image are highlighted. At the same time, in order to improve the performance of the subsequent processing algorithm, the red-green-blue (RGB) image is transformed into a \(L^{u}\)\({}^{b}\)\({}^{*}\) color space. The transformation result is shown in Figure 5c. Then, we use the simple linear iterative cluster (SLIC) [32] algorithm, which can generate superpixels to further divide the pixel  
Figure 4: The algorithm flow diagram of the continuous HMT gesture recognition. meshes and reduce the computation cost of hand region segmentation. The result of the SLIC is shown in Figure 5d. The lazy snapping algorithm [33] is used to realize the segmentation of the hand region, which is an interactive algorithm for image segmentation. The foreground and background are segmented based on the seed pixels specified by the user. In the original video images, the distinction between the foreground and background is more obvious. Obviously, the middle part of the image is the hand region, while the rest is the environmental background. Therefore, the video image sequence is segmented by giving the initial foreground and background seed pixels. As shown in Figure 5e, the green area is the seed pixels of the foreground \(S_{\text{fore}}(0)\), and the blue area is the seed pixels of the background \(S_{\text{back}}(0)\). As shown in Figure 5f, the hand region segmentation result \(R_{\text{hand}}(i)\) of the current frame can be obtained by giving the \(S_{\text{fore}}(i{-}1)\) and \(S_{\text{back}}(i{-}1)\) of the previous frame. The foreground seed pixels \(S_{\text{fore}}(i)\) for the next gesture segmentation are obtained by combining \(S_{\text{fore}}(0)\) and the erosion of the segmentation result of the hand region of the current frame \(R_{\text{hand}}(i)\). The background seed pixels \(S_{\text{back}}(i)\) for the next gesture segmentation are obtained by subtracting the expansion of the segmentation result of the hand region of the current frame \(R_{\text{hand}}(i)\) from \(S_{\text{back}}(0)\). Therefore, the whole video sequence can obtain the segmentation results of the hand region.