## 3 Algorithm and Principle
### Algorithm for HMT Gesture Recognition
#### 3.1.3 Continuous Gestures Segmentation  
One of the focuses in this study is to recognize a series of continuous HMT gestures correspondingly. In order to realize the recognition and classification of the corresponding gestures, it is necessary to distinguish between the effective gestures and the ineffective gestures in the process of continuous hand motion. Two special rules are defined to distinguish the start point and the end point of an effective gesture: The user should perform the fist bobbing before starting an effective gesture and maintain a motionless state for more than half a second after performing an effective gesture. During the algorithm debugging progress, we obtained total of 1000 gesture samples from five subjects at first, and saved the 1000 gestures as the dataset for a gesture segmentation test. The details of the acquisition of the 1000-gestures dataset will be described in detail in Section 4. The specific algorithm flow is introduced as follows. Due to the instability of the test subjects' movements, nominal motionless during performing gestures is not completely static, but slightly quivering. In order to define the nominal motionless state, we set the maximum velocity threshold \(V_{\text{t}}\). If the velocity mean of a frame's last 0.5 s is smaller than \(V_{\text{t}}\), the hand is considered as being in a motionless state in this frame. Half a second is enough for judging according to the mentioned rule after performing an effective gesture. In order to investigate the optimal threshold of \(V_{\text{t}}\) for gesture segmentation, we conduct segmentation accuracy tests of the 1000-gestures dataset described above based on five motionless states with five different \(V_{\text{t}}\) values from one pixel/image to five pixels/image. The experimental results are shown in Table 1. The best segmentation accuracy can be obtained when \(V_{\text{t}}\) is set as three pixels/image. Thus, the threshold is set as three pixels/image to define the motionless state. As shown in Figure 7, the algorithm flow chart for the segmentation of a triangular trajectory is presented as a sample. Based on the results of the hand region segmentation, we have obtained the variation curve of the height \(H(i)\) of the hand region, which reflects the motion of the fist bobbing. The velocity curve, which reflects the hand motion trajectory, was obtained by the SURF keypoints matching. We defined the effective gesture start rule as follows: when the successive descending edge and rising edge appear in the \(H(i)\) curve, as shown in the interval S1 in Figure 7, the motion of fist bobbing appears. This indicates that the subsequent green interval-1 may have the start point of an effective gesture. If the velocity curve changes so greatly, it wouldn't be considered as a motionless state within interval-1; then, the effective gesture starts, as shown in the pink interval-2, which indicates an effective gesture. The intervals S3, S4, and S5 correspond to the three-step straight line trajectory of the complete triangular trajectory gesture, which make up interval-2. A motionless interval, S2, is allowed between interval S1 and interval S3, which starts after the fist bobbing and continues until the effective gesture begins. We set the time-window width of interval-1 to two seconds, which is experimentally optimized. The start signals of the 1000-gestures dataset mentioned above are tested with seven time-window widths of interval-1 from 1000 ms to 4000 ms with a step of 500 ms, as shown in Table 2, and the best corresponding accuracy of gesture segmentation is obtained when the time-window width is set as 2000 ms (2 s). If the motionless interval S2 is longer than the time-window width of interval-1, the effective gesture interval-2 will not appear. That is to say, gestures that start from two seconds after the fist bobbing will be considered invalid.