# A Fully-Automatic Gap Filling Approach for Motion Capture Trajectories
## 6 Discussion
### Framing within State-of-the-Art  
Compared to other approaches in literature, our algorithm presents some advantages. Unlike the approaches presented by [11], [7] or [6], our algorithm does not require any training with additional data prior to filling the gaps. As such, it is readily available to be employed for any trajectory without the need to collect prior data. Moreover, it does not require any manual input such as defining skeleton constraints or rigid bodies: Our approach will discover the best auxiliary and reconstructing markers automatically, based on the available data. Unlike the other approaches tested in this paper, our algorithm is able to fill gaps occurring in any part of the sample, including the beginning and end of the signal, although in these cases the method can only be initialized to run in one single direction. Contrary to the pattern fill method, our algorithm was able to reconstruct all generated gaps.  
While rigid body, pattern fill and spline methods reconstruct a single missing marker at a time, our algorithm reconstructs missing markers simultaneously if they can contribute to each other's reconstruction. The fact that missing markers are jointly optimized constitutes an advantage of our approach, as more information is available at the time of the reconstruction. In this reconstruction, multiple empirical principles are considered, which optimizes the results.  
In this study, we reported the performance of our algorithm considering two simultaneous initializations, i.e., a forward and a backward filling direction, applied to the samples with gaps in the middle. The final reconstruction considered the fusion of the reconstructions performed in both directions, which should optimize the results. By using this approach, we required that the full sequence was available at the time of the gap filling, which is frequently the case for the purpose of motion analysis in health and sports. For filling gaps in the initial and final frames of the trajectory, only one filling direction should be considered. By using the forward gap filling direction, our method is theoretically compatible with the reconstruction of gaps in nearly real-time. In this scenario, the initialization of the algorithm could be performed with a calibration trajectory. Although theoretically feasible, the real-time reconstruction scenario was out of the scope of this work.  
Similar to the rigid body and pattern fill methods, our method depends on a suitable set of auxiliary markers that will support the reconstructions. In rigid body and pattern fill methods, the definition of these markers--i.e., the donor trajectories--depends on the rigid bodies definition; in our algorithm, the definition of the auxiliary markers is more relaxed. In our experiments, the auxiliary markers were obtained from calibration trajectories (fully labelled and with no gaps) in order to ensure the reproducibility of our results. Alternatively, as supported by the results shown in Table 3, the samples with artificially generated gaps can be used to obtain auxiliary markers as the average and standard deviation of inter-markers distance should not differ when gaps are present. Unless the gap ratio is very high, the average and standard deviation of inter-markers distance should be maintained when gaps are present. Although it never occurred in our experiments, it may be possible that no suitable set of auxiliary markers is found in some situations. Considering that MoCap best practices require the inclusion of some redundant markers, if all guidelines are followed, it is very unlikely that auxiliary markers cannot be found. In case it happens, the algorithm can still rely on the predictions of the Kalman filter to reconstruct markers' trajectories, considering only markers' dynamics.