## 2 Materials and Methods
### Accuracy Evaluation of Postures and Movement Exercises  
The accuracy, specificity and sensitivity were calculated based on formulas described in the article [25].  
\begin{table}
\begin{tabular}{l l} \hline \hline
**No.** & **Posture Exercises (Initial Posture-Final Posture)** \\ \hline
1 & Hands down–hands outstretched \\
2 & Hands down–hands up \\
3 & Hands at the sides–right hand up \\
4 & Hands at the sides–left hand up \\
5 & Hands at the sides–hands to the head \\
6 & Hands on the belt–right knee up \\
7 & Hands on the belt–left knee up \\
8 & Hands at the sides–hands forward \\
9 & Hands down–hands forward \\
10 & Hands up–hands forward \\
11 & Hands forward–right hand to the side \\
12 & Hands forward–left hand to the side \\
13 & Hands down–hands forward–hands up–hands outstretched \\ \hline \hline \end{tabular}
\end{table}
Table 4: Test exercises.  
Figure 4: Postures: (a) hands forward; (b) left knee up; (c) right knee up; (d) both hands to the head; (e) left hand to the side; and (f) right hand to the side.  
The classification of postures was made by comparing the recorded posture descriptors (\(D_{i}\)) with a reference database (\(D_{j}\)). The distance \(Er_{i}\) for each pose \(i\) between the reference and reordered posture could be calculated as:  
\[Er_{i}=dist\Big{(}D_{i},D_{j}\Big{)}, \tag{3}\]  
A descriptor is composed of two parameters (angles and vectors), and thus two types of errors were calculated: the total error of the length of vectors and the total error of angles.  
The first was calculated using absolute differences between them  
\[ErVec_{i}=\sum_{k=1}^{17}\big{|}D_{i}(k)-D_{j}(k)\big{|}, \tag{4}\]  
where \(D_{i}(k)\), \(k\) = between 1 and 17--parameters that are responsible for the length of the vectors. The total error angles for postures \(i\) were calculated using the formula  
\[ErAngle_{i}=\sum_{k=18}^{40}\big{|}D_{i}(k)-D_{j}(k)\big{|}, \tag{5}\]  
where \(D_{i}(k)\), \(k\) = between 18 and 40--parameters responsible for the values of angles.  
Based on those types of errors, three algorithms for the posture classifications assessment were developed. To classify the posture, the results should be equal to or almost equal to the reference database, so that the algorithm can define the correct posture classification from the data set collected. This was achieved by setting a threshold for the three algorithms:  
* Algorithm 1: vector length error (A1)
* Algorithm 2: angle error (A2)
* Algorithm 3: multiplication of angle errors by vector errors (A3)  
To evaluate the most accurate algorithm for posture detection, the classification database was made using the descriptions of either \"correct\" or \"incorrect\" postures. In our study, all subjects were young and healthy, therefore it was enough to use two people for the posture reference database. However, the reference database would be more complex if participants had some disabilities and varied in age group.  
To justify the accuracy of exercise movement classification, the database, with a set of sequenced postures in the correct order, was made, as shown in the examples in Figure 5.  
Matlab was used for data collection, analysis.  
Figure 5: Example of a movement exercise: (**a**) combination of two postures; and (**b**) a more complex movement exercise with a set of postures in sequential order.