Tracking Human Motions in Photographing 29:15 100 Inear-8c 6 gan品80en0a3别0 350 Walk vs.walk Walk vs.jog (a)Sensor data of walking (b)Resultant linear-acc (c)DTW distance Fig.12.DTW distance calculation. that between different types of activities is rather large.Therefore,DTW distance can be used for detecting the periodical change of body movement,that is,do the same activity. Here,we do not recognize what the specific activity is.Instead,we only verify that the body keeps moving periodically.The user can change from one activity (e.g.,walking)to another activity(e.g.,running)in body movement,when he/she keeps doing the same activity(e.g., walking),we can recognize it as body movement. -Step 3:Comparing with previous body movements.For an activity segment Ai,we calculate the DTW distance between A;and the last n,recognized segments in body movement. Therefore,we obtain n,DTW distances for A:.Then,we use a voting mechanism for body movement detection.For a DTW distance,if it is less than Dw,then Ai gets a vote from body movement.Finally,Ai getsn votes from body movement.Ifthen the activity is recognized as body movement.Otherwise,it is treated as a disturbance.We set n=8, Dw 25,and eb =75%by default. Arm Level:Arm level contains two activities,which are lifting up the arm and laying down the arm.According to Figures 9(b)and 6,lifting up or laying down the arm will cause a large variation of linear-acc in x-axis.When we hold the phone as shown in Figure 4(b),the linear-acc of lifting up the arm and laying down the arm is shown in Figures 13(a)and 13(b),respectively.Lifting up and laying down the arm incur different direction changes of linear-acc in x-axis.Thus,we can utilize the difference of direction changes in linear-acc to distinguish the two activities. However,considering that the phone can be held in different gestures,the direction changes of linear-acc may be different.When we hold the phone like Figure 4(c),the linear-acc in x-axis of lifting up/laying down the arm is shown in Figures 13(c)and 13(d).For the same activity(e.g., lifting up the arm),if we hold the phone in different gestures,the direction changes of linear-acc are different,as shown in Figures 13(a)and 13(c).Thus,we cannot map the direction changes(from positive to negative/from negative to positive)of linear-acc to activities(lifting up/laying down the arm)directly.Therefore,we introduce the data of gravity sensor to assist for activity recognition in arm level.In Figure 13(a),the user lifts up the arm,the gravity data in x-axis is positive,while the linear-acc in x-axis changes from positive to negative.It indicates that the signs(i.e.,positive or negative)of the two sensor's data change from same to different,when the user lifts up the arm.Based on Figure 13(b),when the user lays down the arm,the signs of the two sensor's data change from different to same.When the user holds the phone like Figure 4(c),the signs of the two sensor's data still have the above change rule,that is,changing from same to different for lifting up the arm,changing from different to same for laying down the arm. In fact,in addition to the above two gestures shown in Figures 4(b)and 4(c),the phone can also be held in other attitudes.When we lift up the arm and rotate the phone at the same time,the ACM Transactions on Sensor Networks,Vol.13,No.4,Article 29.Publication date:September 2017Tracking Human Motions in Photographing 29:15 Fig. 12. DTW distance calculation. that between different types of activities is rather large. Therefore, DTW distance can be used for detecting the periodical change of body movement, that is, do the same activity. Here, we do not recognize what the specific activity is. Instead, we only verify that the body keeps moving periodically. The user can change from one activity (e.g., walking) to another activity (e.g., running) in body movement, when he/she keeps doing the same activity (e.g., walking), we can recognize it as body movement. —Step 3: Comparing with previous body movements. For an activity segment Ai , we calculate the DTW distance between Ai and the last nt recognized segments in body movement. Therefore, we obtain nt DTW distances for Ai . Then, we use a voting mechanism for body movement detection. For a DTW distance, if it is less than Dw , then Ai gets a vote from body movement. Finally,Ai gets nv votes from body movement. If nv nt ≥ ϵb , then the activity is recognized as body movement. Otherwise, it is treated as a disturbance. We set nt = 8, Dw = 25, and ϵb = 75% by default. Arm Level: Arm level contains two activities, which are lifting up the arm and laying down the arm. According to Figures 9(b) and 6, lifting up or laying down the arm will cause a large variation of linear-acc in x-axis. When we hold the phone as shown in Figure 4(b), the linear-acc of lifting up the arm and laying down the arm is shown in Figures 13(a) and 13(b), respectively. Lifting up and laying down the arm incur different direction changes of linear-acc in x-axis. Thus, we can utilize the difference of direction changes in linear-acc to distinguish the two activities. However, considering that the phone can be held in different gestures, the direction changes of linear-acc may be different. When we hold the phone like Figure 4(c), the linear-acc in x-axis of lifting up/laying down the arm is shown in Figures 13(c) and 13(d). For the same activity (e.g., lifting up the arm), if we hold the phone in different gestures, the direction changes of linear-acc are different, as shown in Figures 13(a) and 13(c). Thus, we cannot map the direction changes (from positive to negative/from negative to positive) of linear-acc to activities (lifting up/laying down the arm) directly. Therefore, we introduce the data of gravity sensor to assist for activity recognition in arm level. In Figure 13(a), the user lifts up the arm, the gravity data in x-axis is positive, while the linear-acc in x-axis changes from positive to negative. It indicates that the signs (i.e., positive or negative) of the two sensor’s data change from same to different, when the user lifts up the arm. Based on Figure 13(b), when the user lays down the arm, the signs of the two sensor’s data change from different to same. When the user holds the phone like Figure 4(c), the signs of the two sensor’s data still have the above change rule, that is, changing from same to different for lifting up the arm, changing from different to same for laying down the arm. In fact, in addition to the above two gestures shown in Figures 4(b) and 4(c), the phone can also be held in other attitudes. When we lift up the arm and rotate the phone at the same time, the ACM Transactions on Sensor Networks, Vol. 13, No. 4, Article 29. Publication date: September 2017