Abstract
The aim of this paper is to propose and initially evaluate our novel algorithm which enables averaging of time-varying sequences of rotations with three degrees of freedom described by quaternions. The methodology is based on Dynamic Time Warping barycenter averaging (DBA) with one minus dot product distance function, Markley’s quaternions averaging method and Gaussian quaternion signal smoothing. The proposed algorithm was successfully applied to generate single, averaged motion capture recording (MoCap) from ten MoCap of mawashi-geri karate kick of black belt Shorin-Ryu karate master. We have used inverse kinematic model. In our experiment mean DTW normalized distance between averaged signal and original signals varied from \(0.713 \cdot 10^{-3}\) for Hips sensor to \(6.153 \cdot 10^{-3}\) for LeftForearm sensor, which were very good results. Also the visualization of the averaged MoCap data showed that the proposed method did not introduce unwanted disturbances and may be usable for that task. That type of averaging has many important applications. For example it can be used to calculate and visualize an average performance of an athlete who performs some activity that he wants to optimize during training. The numerical and visual data may be a very important feedback for coach that supervises the training. Also our method is not limited to MoCap data averaging; it can be applied to average any type of quaternion-based time-varying sequences.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
- Signal averaging
- Preprocessing
- Quaternions
- Dynamic Time Warping barycenter averaging
- Motion capture
- Karate
1 Introduction
In many real-life scenarios time-varying signal analysis requires averaging (or template generation) from samples that come from many measurements [1,2,3,4]. There are several state-of-the art methods which can be used averaging. Among most popular is Kalman Filter (KF) [5] that is used for example in kinematic model synthesis [6,7,8]. Other popular method is DTW barycenter averaging (DBA) [9], which was already used in movements’ analysis [10, 11]. One can use the smoothing ability of KF to average the signals that came from multiple measurements of the same angle. However, in the situation when signals cannot be wrapped optimally linearly, the nonlinearity between signals will be smoothed by the KF. This smoothing might visually damage the recorded content, because it might treat nonlinearity as noise. Due to this we choose DBA approach.
The motivation of this paper was a need to create the averaged karate action templates for future use in athletes’ kinematic analysis. That approach has many important applications. For example it can be applied in computer supervised training to calculate and visualize an average performance of an athlete or to compare it to templates of world class sportsmen’s to find the optimize the action’s technique. The aim of this paper is to propose and initial evaluate our novel algorithm that enables averaging of time-varying sequences of rotations with three degrees of freedom described by quaternions. To our best knowledge the method of this kind has not yet been reported in scientific papers. The methodology is based on DBA with one minus dot product distance function, Markley’s quaternions averaging method [12] and Gaussian quaternion signal smoothing. The proposed algorithm is applied to generate single averaged motion capture (MoCap) recording from ten MoCap of mawashi-geri karate kick of black belt Shorin-Ryu karate master. We have used inverse kinematic model.
2 Materials and Methods
This section presents all algorithms that are used for MoCap signal averaging and smoothing. Due to paper space limitation we did not provide the details of Markley’s and DBA algorithm that can be found elsewhere (in [9, 12] appropriately).
2.1 Quaternion Averaging
For the Quaternion averaging we have utilized Markley’s algorithm [12]. It determines the average norm-preserving quaternion from a set of weighted quaternions. The solution involves an eigenvalue/eigenvector decomposition of a matrix composed of the given quaternions weights matrix.
2.2 Signal Averaging
To average a set of time-varying signals we have used Dynamic Time Warping barycenter averaging (DBA) heuristic algorithm [9] that uses Dynamic Time Warping (DTW) similarity measure. The cost function in DTW for quaternions is defined as:
where x, y are normalized quaternions and \(\circ \) is a dot product. Because we are dealing with quaternions, the barycenter averaging is replaced by Markley’s algorithm from Sect. 2.1.
Signal Averaging Algorithm
2.3 Smoothing Algorithm
It is possible that DBA algorithm introduces in averaged signals the high frequency noises that are visible as rapid Euler angles hops. This is of course result of the DBA heuristic which does not prevent these situations even if input data does not contain that type of noises. Our smoothing algorithm works similarly to typical discrete linear convolution algorithm with Gaussian kernel, however instead of linear combination of signal samples in kernel window and kernel weights, we use Markley’s algorithm from Sect. 2.1 with Gaussian weights.
Smoothing Algorithm
2.4 MoCap Averaging
The averaging algorithm for MoCap data works as follows. As an input it takes a set of MoCap recordings of a single activity. They may vary in length, however they have to use the same kinematic model. In our case we use inverse kinematic model with 16 various features that represents the rotation of body joints with three degrees of freedom in Euler angles (see Fig. 1). The Euler angles are recalculated to quaternions. This step remove problems caused by nonlinearity in Euler angles domain: \([-180, 180)\) for rotation towards X axis, \([-90, 90)\) for Y and \([-180, 180)\) for Z. Also quaternions prevent the gimbal lock phenomena. Signal in each feature of each recording is interpolated to the uniform length with nearest neighbor interpolation. It is obvious that signals among single MoCap recording have same number of frames, however different MoCap recordings may have different frames number. The new length equals the longest signal in the input dataset. After averaging all features, each of the averaged signals is smoothed with algorithm from Sect. 2.3. The obtained averaged and smoothed quaternions are recalculated to Euler angles.
3 Results
To evaluate our novel MoCap averaging algorithm, we have used recording of black belt Shorin-Ryu karate master. The activity we wanted to average was a mawashi-geri kick with a right leg. We have recorded ten repetitions of this kick with a Shadow 2.0 wireless motion capture system. The tracking frequency was 100 Hz with 0.5\(^\circ \) static accuracy and 2\(^\circ \) dynamic accuracy. We have prepared data to be in reverse kinematic model which is presented in Fig. 1. Data was recalculated from Euler angles representation to quaternions and we applied the methodology that was presented in Sect. 2 of this paper. The length of the signals among those ten recordings varied from 226 to 249 frames, due to this the averaged signal had length of 249 frames. We have calculated 100 iterations of DBA method after which results became stable.
In Figs. 2, 3 and 4 we have presented the plots of Euler angles values that describe the rotation in hips measuring point about X, Y and Z axis. The dotted plots are values from input data set (they names begins with Hips in legend of plots). The blue solid line is a result of averaging by algorithm from Sect. 2.2. The red solid line is plot smoothed with algorithm from Sect. 2.3. In Figs. 5, 6 and 7 we have presented the plots of Euler angles values that describe the rotation in RightLeg measuring point about X, Y and Z axis. Dotted plots are values from input data set, solid black lines are results of averaging and red plot are smoothed results from black plot.
We have also prepared visualization of MoCap recordings averaged by our methodology to check if our algorithm did not introduce some visible deviations from expected limbs trajectories. In Fig. 8 we present rendering of important parts of averaged mawashi-geri kick.
To evaluate how similar averaged signals are to the input dataset we have used DTW normalized distance between each time-varying signal (in quaternions) and averaged signal. The normalized distance is defined as a DTW distance divided by the sum of length of two signals between which distance is calculated. In Fig. 9 we present those results in the form of heat map with color-coded values. In Table 1 we present means and standard deviations of that comparison grouped by features (measuring points) names.
4 Discussion
As can be seen in Figs. 2 and 4, the proposed method deals very well with nonlinearity in rotation description caused by periodicity of Euler angles notation. Also two very similar rotations might be composed of two sets of three rotations about X, Y and Z axis that might have quite different values, for example compare signal 9 and 10 in Figs. 2 and 4 to other signals in those figures. Both those problems are solved thanks to applications of quaternions in DBA averaging. The DBA might introduce some high-frequency noises that are clearly visible in Figs. 2, 3, 4, 5, 6 and 7 as peaks of angle values in relatively smooth angles trajectories. Those noises are unwanted phenomena that should not appear in MoCap recordings which operate in frequency 100 Hz even while dealing with such fast body actions like karate. Those errors are introduced because DBA is a heuristic method. As can be seen on all plots, our smoothing method performed by an algorithm described in Sect. 2.3 removes those peaks very well without damaging the overall signal characteristic.
The visualization of MoCap recordings averaged by our methodology was judged by a karate master as very accurate. The averaging did not introduced visible deviations from expected limbs trajectories.
The results presented in Table 1 prove that mean DTW normalized distance between averaged signal and original signals varies from \(6.153 \cdot 10^{-3}\) for LeftForearm sensor to \(0.713 \cdot 10^{-3}\) for Hips sensor, which were very good results. The heat map in Fig. 9 shows that the biggest distance between averaged signals and input data is present in measuring points that describe position of hands, especially LeftForearm. This situation is caused by two facts. The first is that arm position is a bit less important than precise lower body movements in this technique and the professional karate athlete might pay a bit less attention to some small variation in his or her hands placement. The second fact was that we have some small MoCap errors introduced during data acquisition in the region of LeftForearm that resulted in less precise angles measurement.
5 Conclusions
In this paper we have presented the algorithm that enables averaging of multiple MoCap signals of the same full body action which is represented as the set of time-varying signals in inverse kinematic. Basing on discussion in previous section, we can conclude that the proposed method seems to be promising for that task. That type of averaging has many important applications. For example it can be used to calculate and visualize an average performance of an athlete who performs some activity that he or she wants to optimize in training. The numerical and visual data may be a very important feedback for the coach that supervises the training [13]. Also our method is not limited to MoCap data averaging; it can be applied to any type of quaternion-based time-varying sequences.
The next step of our researches will be evaluation of our algorithm on significantly larger dataset.
References
Glowacz, A.: Recognition of acoustic signals of synchronous motors with the use of MoFS and selected classifiers. Meas. Sci. Rev. 15(4), 167–175 (2015). ISSN: 1335–8871. https://doi.org/10.1515/msr-2015-0024
Glowacz, A., Glowacz, W., Glowacz, Z.: Recognition of armature current of DC generator depending on rotor speed using FFT, MSAF-1 and LDA. Eksploatacja i Niezawodnosc - Maintenance and Reliability 17(1), 64–69 (2015). doi:10.17531/ein.2015.1.9
Pięta, A., Lupa, M., Chuchro, M., Piórkowski, A., Leśniak, A.: A model of a system for stream data storage and analysis dedicated to sensor networks of embankment monitoring. In: Saeed, K., Snášel, V. (eds.) CISIM 2014. LNCS, vol. 8838, pp. 514–525. Springer, Heidelberg (2014). doi:10.1007/978-3-662-45237-0_47
Fabijańska, A., Smurzyński, J., Hatzopoulos, S., Kochanek, K., Bartnik, G., Raj-Koziak, D., Mazzoli, M., Skarżynski, P.H., Jȩdrzejczak, W.W., Szkiełkowska, A., Skarżyński, H.: The relationship between distortion product otoacoustic emissions and extended high-frequency audiometry in tinnitus patients. Part 1: normally hearing patients with unilateral tinnitus. Med. Sci. Monit. 18(12), CR765–CRC770 (2012). doi:10.12659/MSM.883606
Kalman, R.E.: A new approach to linear filtering and prediction problems. Trans. ASME J. Basic Eng. 82, 35–45 (1960)
Sul, C.W., Jung, S.K., Wohn, K.: Synthesis of human motion using Kalman filter. In: Magnenat-Thalmann, N., Thalmann, D. (eds.) CAPTECH 1998. LNCS (LNAI), vol. 1537, pp. 100–112. Springer, Heidelberg (1998). doi:10.1007/3-540-49384-0_8
Burke, M., Lasenby, J.: Estimating missing marker positions using low dimensional Kalman smoothing. J. Biomech. 49, 1854–1858 (2016)
Jin, M., Zhao, J., Yu, J.J.G., Li, W.: The adaptive Kalman filter based on fuzzy logic for inertial motion capture system. Measurement 49, 196–204 (2014)
Petitjean, F., Ketterlin, A., Gançarski, P.: A global averaging method for dynamic time warping, with applications to clustering. Pattern Recognit. 44(3), 678–693 (2011). http://dx.doi.org/10.1016/j.patcog.2010.09.013
Laurent, E., Thomas, D., Maike, B., Gavin, M.: Trajectory box plot: a new pattern to summarize movements. Int. J. Geogr. Inf. Sci. 30(5), 835–853 (2016). doi:10.1080/13658816.2015.1081205
Seto, S., Zhang, W., Zhou, Y.: Multivariate time series classification using dynamic time warping template selection for human activity recognition. In: IEEE symposium series on computational intelligence, SSCI 2015, Cape Town, 7–10 December 2015, pp. 1399–1406 (2015). doi:10.1109/SSCI.2015.199
Markley, F.L., Cheng, Y., Crassidis, J.L., Oshman, Y.: Averaging quaternions. J. Guid. Control. Dyn. 30(4), 1193–1197 (2007). doi:10.2514/1.28949
Hachaj, T., Ogiela, M.R., Koptyra, K.: Application of assistive computer vision methods to oyama karate techniques recognition. Symmetry 7(4), 1670–1698 (2015). doi:10.3390/sym7041670
Acknowledgments
This work has been supported by the National Science Centre, Poland, under project number 2015/17/D/ST6/04051.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Hachaj, T., Ogiela, M.R., Piekarczyk, M., Koptyra, K. (2017). Averaging Three-Dimensional Time-Varying Sequences of Rotations: Application to Preprocessing of Motion Capture Data. In: Sharma, P., Bianchi, F. (eds) Image Analysis. SCIA 2017. Lecture Notes in Computer Science(), vol 10269. Springer, Cham. https://doi.org/10.1007/978-3-319-59126-1_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-59126-1_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-59125-4
Online ISBN: 978-3-319-59126-1
eBook Packages: Computer ScienceComputer Science (R0)