In a motion capture system, sometimes markers lose their position and there are sections in the trajectories completelly swaped. Any suggestion on how can I identify the start and end points of the swap?
Unfortunately this is a challenge encountered with passive motion systems and where active marker systems such as CODA has a great advantage. I do not have a simple answer for you at this times. Best regards
If I understand well you want to correct the marker trajectory when the system suddenly reconstruct it in a different position.
If the marker shifts position but the system still recognizes it belongs to the same trajectory then you can identify the start and end points of the swap by thresholding the acceleration. At start point the acceleration dramatically peaks up and vice versa it peaks down at the end point. Then replace the marker coordinates compensating the initial shift (it should remain steady). I don't know if there is any specific software that can do it friendly, I usually export the markers and process the trajectories with Matlab or Excel.
If you need to fill the gaps, it is more challenging. In this case you have to predict, interpolate or just "invent" the missing positions (it depends on the kind of motion you have acquired(. I use Vicon Nexus, which is provided with a gap filling function and it works very well until the gap is very narrow 20/50 frames.
I do not know if this can be worthwhile for you, anyway, if you have the markers coordinate you can try to calculate their mobile average with various window size. This will reduce the number of samples that can be used but the trajectories of the markers will be damped and more readable.
If you see the swaping or also jumping of single markers, it is easy and works fine to leave these markers for this sequence and to fill the gabs as Nelson said.
If it is not so obvious just by watching the motion, you should see swaping in the diagrams of velocity or positions and so on. For instance acceleration dramatically peaks up as Ivan said. Then you know about the sequence and can fix the problem on the same way.
Both are manual solutions. I dont know any one running automatically.
Luca, the solution you suggest is a sort of trajectory smoothing (that's what the mobile average actually does), so it can be effective to improve the unaesthetic effect of markers position errors, but it is not valid to correct the data... the result would be a more pleasant but wrong trajectory.
Ivan, you're right. I just suggested a solution to make the swap easier to be read. Francisco asked a method to identify the start and the end of the swap so increasing the readability of the graph can be useful to identify them from a graphical point of view. Obviously It's not a valid method to correct data but It wasn't the intent of my previous answer.
dear alls, i actually use vicon and qualisys systems and effectively in both case swap trajectories and gaps are a big problem. the best advice i can give you is to add markers in order to have a great redundancy in your data. For exemple when ou have to track one rigid body you can only use 3 markers but to avoid gaps and swap you should use at least 6 markers and an optimisation/solidification algorithm (Soderkvist, Cheze...) in matlab for example. Like this you can detect the swap, correct trajectories and fill the gaps, but you will have to make our own software... Concerning the automatic gap filling functions of both software, in my opinion, you should use them for gaps smaller than 5% of capture frequency.
I agree Philip... you can detect swapping via monitoring the acceleration and detecting points in which it changes dramatically. At these moments you could check the marker positions in the previous frame and the current ones and associate each 'new' marker with the closest previous one (that would be the most logical assumption).
If you are collecting data then you should not be interested in filling gaps (as that's not collected but produced data). Anyway, if you have to I would suggest a third order spline interpolator (it worked fine for me). It is posible that you have to remove outliers firstly...
First, thank you all for this nice discussion. We don't have any specific software as the mentioned here, we only have coordinates of the markers. To correct manually a series of trajectories is very time-consuming, and the idea is, as expressed in the question, to identify start and end points of the swap, then swap the data and lastly if there is any gap, to fill it by means of cubic splines. I will try the methods proposed here.
from the previous posts, it seems that the answerers do not know about any automatic procedure which could overcome the problem you are facing. If you still look for such a solution to this problem, you may be interested in the « Motion AutoSorter » software which has been designed specifically for this purpose (http://www.universite-lyon.fr/valorisation/l1192-motion-autosorter-automatic-tracking-data-acquired-by-optoelectronic-system-209675.kjsp?RH=LSTsoft). Let me know if you want more information about it.
I have experience with Qualysis and Vicon systems but have no connection to either company. I know you're looking a solution for already captured data but I thought the following might be useful for future reference:
My preference is to include redundant markers in each segment as Ivan suggested. Following the guidelines laid out by Cappozzo et al. (1997) is a good starting point. (A minimum of four markers placed in a location known to be subject to minimal soft tissue artefact). If you lose a marker you're still going to be able to reconstruct the segment position.
You'll have to think carefully about the movement you're measuring and, if feasible, do some pilot testing to get a feel for how and when markers get swapped. This usually occurs when the markers pass within a short distance of each other, e.g., medial knee markers during mid-stance in gait. Or when markers are placed in close proximity (Oxford foot model can be a headache). Alternatively, the markers may become momentarily occluded which forces the software to guess the identity of each marker. You can avoid the latter by including more markers on the segment. Increasing the number of cameras or optimising the position of existing cameras may help. If your software has automatic marker identification use a large number of trials to train it and include patterns of motion other than those you are interested in.
Qualysis' latest system has the facility to mix active and passive markers (not sure about Vicon) which has the potential to mitigate many of these issues.
Using automatic gap filling for small ranges is fine if you are cautious. However, as Ivan and Luca have discussed, one is effectively inventing data when using these methods. Obviously when the gaps are small the prediction is probably going to be reasonably accurate (method dependant) but ultimately there is no replacement for complete marker trajectory data. This is particularly critical if the data is used to help make clinical decisions.
I prefer to limit automatic gap filling to 5 to 10% of capture rate (for non-clinical data) and capture at high frequency. Regardless, I always visually inspect the filled gaps and discard any trials that have larger gaps.
Hope this wasn't too redundant.
- Martin
Cappozzo, A., A. Cappello, U. D. Croce, and F. Pensalfini. “Surface-Marker Cluster Design Criteria for 3-D Bone Movementreconstruction.” IEEE Transactions on Biomedical Engineering 44, no. 12 (1997): 1165–1174.