# Error-Resistant Movement Detection Algorithm for the Elderly with Smart Mirror
## 2 Related Work
### Movement Recognition and Pose Estimation  
In [1], the authors introduced an algorithm for quickly judging elderly falls using an algorithm that extracts the target's skeleton with OpenPose, measures the speed of the center of the hip joint, and calculates the angle with the ground.  
The content introduced in [2] is the skeleton-based gait detection algorithm, an algorithm that determines through image input whether a target's gait is abnormal. In this algorithm, the skeleton information for the target is extracted using a depth sensor such as Kinect, and seven angles of skeleton coordinates, excluding the upper body, are feature-extracted. The extracted vectors are converted into codewords using a clustering technique. During detection, if the gait cycle is less than a threshold, it is judged as an anomaly.  
In [17], the authors introduced a pedestrian detection algorithm that uses two consecutive frames to determine the direction of pedestrian movement. It calculates displacement in five directions through comparison with the previous frame, learns the detector based on pattern recognition using Adaboost, and then performs an experiment to detect the motion and appearance of pedestrians.  
In addition, there is a simple method for distinguishing whether the target in the current frame is moving/stopped. It is called the \"frame subtraction method\" [18] and \"two-frame difference method\" [19]. In this paper, it will be called the adjacent frame subtraction method (AFSM) as well. The AFSM simply calculates the difference between two adjacent frames and checks if the difference value is above/below the movement threshold. Those papers used AFSM with their own pre-processing method.  
In [19], the authors performed gray variation as pre-processing and subtracted odd-even frames or background-current frames with the AFSM. In [18], the authors used AFSM as a fundamental detection method, but their objective was to find a better threshold value by using canny-edge detection and the Otsu method [20]. The AFSM itself was not their main point; however, our point is to understand the weakness of the AFSM and to find a better method.  
In [21], an algorithm for crime prevention that quickly detects with a small error the presence and movement of a person were introduced. It stores the static background that CCTV captures continuously and identifies the existence of a specific object when the difference between the static background and the current image frame is less than 95%. The skeleton information of the identified entity is calculated, and when the displacement of the skeleton coordinates in the previous frame is greater than the absolute value of the threshold, the movement and direction are determined. It uses fixed CCTV cameras and skeleton information, and it detects the displacement of the skeleton relative to the previous frame.  
The center gravity method (CGM) is an algorithm proposed [21] for judging whether the movement is less than a threshold using skeleton information. The center gravity coordinates obtained by averaging the coordinates of all skeleton points are calculated, the displacement between previous/current frames of the center coordinates is calculated, and the result of whether the displacement is less than or greater than the threshold is obtained. In that study, the original background removal work and the method for measuring change in the x-coordinate is much faster. We will use only the motion detection method in the experimental section. Figure 1 shows a flowchart of the algorithm.  
Figure 1: Center gravity method. Array cgx_sheet is defined to store the previous and current cgx values. Center gravity point, cgx is defined as an average value of all x-coordinate values at a certain frame. The integer variable cgx_diff is defined to calculate differences between adjacent two frames.