# Error-Resistant Movement Detection Algorithm for the Elderly with Smart Mirror
## 4 Movement Detection Algorithm for the Elderly in Smart Mirror
### Traditional Movement Detection Method and Its Limitation: Slow Movements  
Figure 4 shows skeleton point of arm, natural error in stationary state (a), normal movement (b), slow movement (c), and movement detection methods (d). The moved distance in (b) and (c) is the same, but the speed is different. In Figure 4d, the threshold value for the movement detection algorithm is shown in the upper right box. Each shape represents a locus of each point through a 3 and 6-frame trajectory. Each line represents joint displacement. Displacement greater than the threshold is shown in solid line while displacement less than the threshold is shown dotted. The traditional method of distinguishing circumstances between Figure 4a,b is simple. Using AFSM, we compare the amount of movement and determine whether it is less/greater than the threshold. In Figure 4a, the points generated from standing still have very small displacements. On the other hand, in Figure 4b, the displacement of each moving point is very large. That is, if the movement distance (displacement) of each point is smaller than the threshold, it can be determined that the subject is in a stopping state, and if it is larger, it can be determined that the subject is in a moving state. In many studies, even if the goal of the algorithm is different (movement detection, fall detection), adjacent frames are compared. Scenarios and formulas are given below in Figure 5. This simple method has often been used in combination with other pre-processing methods, such as in [18; 19; 21]. Displacement of joint at each frame (\(\left|\overrightarrow{P_{K}P_{K+1}}\right|\) ) is compared with threshold to return boolean value whether it is less or more, through frame depth. As we use the majority result of recent  
Figure 3: Detection errors can be divided into two types. (**a**): Whole point error is an error in which all point coordinates are wrong. All joint points of the target in (**a**) are detected in the wrong place. (**b**): Partial point error is an error in which the coordinates of a single point or a couple of points are wrong. The wrist point of the target in (**b**) is detected in the wrong place, while the other joint points are detected at a tolerable place. frames for handling detection error, the variable 'Moved' and 'Stopped' is counted based on the method's return value. \[\forall k\text{ in }0\leq k<RF, \begin{cases}\text{Moved}\longleftarrow\text{ Moved}+1,&\text{if }\left|\overrightarrow{P_{K}P_{K+1}}\right|\geq\text{ threshold}\\ \text{Stopped}\longleftarrow\text{Stopped}+1,&\text{if }\left|\overrightarrow{P_{K}P_{K+1}} \right|<\text{threshold}\end{cases}  \tag{1}\]  
\[\text{Movement at current frame }\longleftarrow \begin{cases}\text{True},&\text{if Moved }\geq\text{ Stopped}\\ \text{False},&\text{if Moved }<\text{Stopped}\end{cases}  \tag{2}\]  
We can use the maximum of the natural error extracted from the ideal stationary video as the threshold value of the equation (Equation (3)). An ideal stationary video is a video in which the posture of the target is clearly fixed and there is no detection error (Equation (4)). Examples of detection errors include the presence of a single point in an abnormal location or the detection of another object in the background as a human. Under these conditions, the natural error is a set that have elements as the size of all \(\left|\overrightarrow{P_{K}P_{K+1}}\right|\) in the stationary video. However, calculating the threshold in this way is inappropriate, as detection may occur for every target. Furthermore, simply increasing the threshold could be a solution for dealing with natural error. However, this would cause another problem for slow motions. We will explain such a case next.