No announcement yet.

Question about inverse kinematic processing

  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about inverse kinematic processing

    Dear All,
    I have a basic question about inverse kinematic processing. I previously used V3D software for calculating Inverse Kinematics (mainly joint angles), in this software it was possible to filter the marker trajectories (low pass) before calculating the kinematics, so the final results was smooth enough and there was no need to filter the inverse kinematic results.
    Now I am working with Opensim software, so I am not able to filter the trajectories before calculating the inverse kinematics and the results are noisy, I should apply the lowpass filter on the results.
    From a biomechanical point of view, does the results differ when i filter trajectories at first, in compare with the situation that the filtering is applied on angle data after calculating inverse kinematics ?
    ...Any help would be very appreciative.

    Farzaneh Yazdani
    PhD Candidate, SUMS School of Rehabilitation Sciences

  • #2
    Re: Question about inverse kinematic processing


    I will start by saying this is not a basic question and my response may open up a whole debate on the topic. Unfortunately the area around filtering, model/marker design, and error in joint angle data is poorly understood.

    The reason for not filtering 3D marker data to me is relatively straight forward. If you have impacts such as foot strikes then filtering over these with a low pass filter will introduce errors (oscillations) in the marker coordinate data around the point of impact. This will introduce oscillations into the reconstructed foot segment. With large de-acceleration the foot (running and side stepping) the foot can be seen to move below and above ground level as well as backwards and forwards prior to reaching a steady position after impact. This mismatch between the foot segment axes and GRF centre of pressure also produces errors in ankle moments, which propagated through the calculation of knee and hip joint moments of the rigid segment system.
    Another source error in the foot segment location is the global optimization method (3 degrees of freedom at each joint) used in the Inverse Kinematics approach. In a traditional six degree of freedom model the lower leg has the smallest RMS error between static and dynamic segment marker locations (this segment acts most like a rigid body during movement) followed by the foot, pelvis, thigh and worst for markers on the trunk and shoulder girdle. Global optimization does not allow for errors in joint centre location or skin movement artefact. The result is that larger errors in shoulder, trunk and thigh segment locations are imposed on the shank and foot. The ankle joint centre being at the end of the linked chain is subject to random and unpredictable errors in the ankle joint location and consequently foot segment position and orientation. It is for this reason global optimization should never be used in calculating joint angles or joint moments of the legs or arms, especially when the location of the feet or hands is critical.

    The reason for not filtering joint angle data is not so straight forward and requires a greater understanding of axes misalignment and non-linear errors than presently presented in the literature. Errors in thigh axes alignment produce non-linear errors in calculated knee joint abd/add and ext/int rotations; commonly and I think misleadingly referred to as cross-talk. Consequently, correcting thigh axes alignment will correct non-linear errors seen in both calculated knee joint abd/add and ext/int rotations. Axes mis-alignment has two components, a static offset produced in the subject calibration procedure and a dynamic component due to skin movement during movement. When correcting axes misalignment they cannot be considered in isolation, with the static component being the larger of the two in gait. Axes misalignment can be corrected prior to calculating joint rotations in the static calibration procedure and post-hoc via nonlinear correction of joint angle data through a mathematical correction to the proximal or distal segment axes alignment. The trick is being able to identify the static and dynamic components. The key to this is recognising that between sessions the static component is random in the magnitude of the offset but produces characteristic patterns in gait related to the magnitude of the offset; while the dynamic component is varied during the gait cycle but is consistent across trials and session which use the same markers. Global optimization introduces a third unpredictable source of error in axes misalignment for the lower leg and foot segments (as mentioned previously) and therefore makes it unsuited to attempt to assess, identify and correct for axes misalignment. Filtering or removing offsets from joint angle data to correct errors ignores axes misalignment as the source of errors in joint angle data, the interdependency of the calculated joint rotations and the nonlinear nature of the errors, as well as the opportunity to correct for static offsets and dynamic skin movement artifact.

    To answer your question, No - it is not equivalent to smooth 3D marker data or joint angle data. Smoothing 3D marker data effects segment location so it effects everything that follows (predictions of centre of mass, joint centres, joint moments … ), whereas smoothing joint angle data only effects joint angle data.

    So what should I do? My advice: if you are investigating lower limb kinematics or kinetic do not smooth 3D marker data if there are impacts, do not use global optimization, and I would suggest as a minimum to assess and attempt to correct for thigh axes mis-alignment about the thigh longitudinal axes (error in the direction of the knee flex/ext axis) within the static calibration procedure by comparing calculated knee abd/add joint rotations during gait to normal gait patterns (no more than 4 degree adduction in stance and 8 degree abduction in swing) to adjust thigh axes alignment

    I hope this helps
    Allan Carman


    • #3
      Re: Question about inverse kinematic processing

      Dear Allan,
      Thank you for taking the time to answer me, I really do appreciate it.
      According to your advice, I think in my project is more preferred to filter joint kinematics cause I want to accurately detect stance phase and filtering the trajectories may lead to move the events from their actual points.

      Best regards

      Farzaneh Yazdani
      PhD Candidate, SUMS School of Rehabilitation Sciences


      • #4
        Re: Question about inverse kinematic processing

        Like Allan, I usually do not filter 3D marker data.

        Filtering of inverse kinematics results is probably needed to avoid noisy joint moments in the inverse dynamic analysis, but you should always filter as little as possible.

        For a given filter (e.g. second order, 6 Hz) it will not matter much whether you apply it before or after the inverse kinematic analysis. The final result will be almost the same. However, the inverse kinematic analysis will already cancel out some of the noise (by combining multiple markers), so you may be doing more filtering than necessary if you aim for smooth 3D marker trajectories. So it is definitely better to not filter until after inverse kinematics, exactly as Opensim does.

        The debate of global optimization vs. 6-DOF joints is a separate issue, and there is no definitive answer. Opensim does inverse kinematics (global optimization) only and in my opinion that is usually best for analysis of motion and control. Global optimization rejects noise and soft tissue artifact much better than 6-DOF. However, Allan is right that the joint positions (and joint moments) may not be as good. It depends on the quality of the model and the quality of the data. If the data is bad (or incomplete), global optimization can help a lot. But if the kinematic model introduces more error than the error in the 3D marker data, you are better off with 6-DOF analysis.

        Recently a few good papers have been published comparing IK to 6-DOF.

        Ton van den Bogert


        • #5
          Re: Question about inverse kinematic processing

          Dear Ton van den Bogert,
          thank you for taking the time to write this helpful answer.
          could you please provide me your mentioned papers’ references?

          Farzaneh Yazdani
          PhD Candidate, SUMS School of Rehabilitation Sciences


          • #6
            Re: Question about inverse kinematic processing

            Here are a few references.

            [1] compares IK to a "direct" method (Vicon's Plug-in Gait) which is not 6-DOF but an older method.

            [2] does a comparison between IK (here known as "global optimization") and 6-DOF for a particular application.

            It will be hard to give a general conclusion on the performance of IK vs. 6-DOF. It depends on the quality of the model. IK will only improve the kinematic analysis if the model is good enough. It is hard to define what is good enough.

            Also, strengths of both approaches can be combined, an IK model can include 6-DOF joints where needed. In my full-body IK model [3], I used 6-DOF for the "joint" between humerus and thorax, because I wanted to avoid modeling the shoulder mechanism. A bad shoulder model would be worse than assuming 6 DOF.

            1. Kainz H, Modenese L, Lloyd DG, Maine S, Walsh HP, Carty CP (2016) Joint kinematic calculation based on clinical direct kinematic versus inverse kinematic gait models. J Biomech 49(9):1658-69. doi: 10.1016/j.jbiomech.2016.03.052.
            2. Moniz-Pereira V, Cabral S, Carnide F, Veloso AP (2014) Sensitivity of joint kinematics and kinetics to different pose estimation algorithms and joint constraints in the elderly. J Appl Biomech 30(3):446-60. doi: 10.1123/jab.2013-0105.
            3. van den Bogert AJ, Geijtenbeek T, Even-Zohar O, Steenbrink F, Hardin EC (2013) A real-time system for biomechanical analysis of human movement and muscle function. Medical and Biological Engineering and Computing 51:1069-1077.


            • #7
              Re: Question about inverse kinematic processing

              When comparing methods Kainz et al (2016), Moniz-Pereira et al (2014), Duprey et al. (2010) and Duffell etal (2014) have shown that varying methods give different joint kinematics:
              un-constrained (6df) != constrained (3df)
              constrained (3df) != constrained OS-IK (3-1-2 df’s at the hip-knee-ankle);
              Cluster != PiG;
              PiG != OS-IK.
              So which one should be used?

              Increasing the constraints placed on joints has produced greater variations in non-sagital joint kinematics (Kainz et al. 2016; Moniz-Pereira et al. 2014; Duprey et al. (2010) and kinetics (Moniz-Pereira et al. 2014). The inclusion of planar knee joint (OS-IK model 3-1-2 df’s) has consistently produced the largest variations and erroneous patterns of hip and ankle non-sagital rotations when compared to 3df and 6df models (Kainz et al. 2016; Moniz-Pereira et al. 2014; Duprey et al. 2010). With Kainz et al. (2016) reporting approximate increases of about 35%, 50% and 20% in hip abd/add, hip int/ext and ankle flex/ext range of motion (ROM) respectively for the OS-IK model relative to 3df and 6df models in child CP gait. Kainz et al. (2016) did not report the knee non-sagital rotations. While Moniz-Pereira et al. (2014) found that the OS-IK model could not reproduce any hip knee or ankle non-sagital rotation or hip and knee flexion in stance relative to 3df and 6df models. With a 1df knee joint the linked segment model of the leg still has to best match the pelvis, thigh, shank and foot segment locations but without the natural knee abd/add or int/ext rotations or small amounts of translation or errors introduced by skin movement artefact or errors in defining joint centre positions. To do so introduces large errors in hip and ankle joint rotations and moments (Moniz-Pereira et al. 2014; Duprey et al. 2010) to compensate for a 1 df knee joint. This is in addition to the design not being able to describe the non-sagital rotations of the knee. The OS-IK model of 3-1-2 df’s has been consistently shown in these studies to be inadequate to describe hip, knee or ankle kinematic or kinetics in gait and should not be used.

              The results for PiG model in Duffell et al. (2014) and Kainz et al. (2016) are not much better than the OS-IK (3-1-2) model for reproducing gait kinematics. This is in agreement with reliability studies that have also found the PiG method unreliable when describing inter-session knee non-sagittal joint rotations in gait (Desloovere 2010, Scheys 2013). As with the similar VCM model (Schwartz et al. 2004, Charlton et al. 2004, Tsushima et al. 2003, Schache et al. 2006) and Mod-HH (Kadaba et al. 1989, Miller et al. 1996, Gorton et al. 1997, Grownley et al. 1997, Collins et al. 2009, Kaufman et al. 2016) either with or without the KAD. Results presented for normative gait joint angle data using the VCM with KAD (Baker, Cho, Kirtley ) and Mod-HH with wands (Kadaba et al. 1989, Collins et al. 2009, McMulkin & Gorton 2009, Nester et al. 2003) vary widely. Ranging from good (Baker, Collins et al. 2009) to no resemblance (Cho, Kirtley, Kadaba et al. 1989) to non-sagital joint rotations of the knee.

              The use of 3df joints in the legs compared to 6 df joints is less clear through a lack of direct comparisons. Moniz-Pereira et al. (2014) generally found good agreement between the methods, except for knee abd/add pattern during stance and larger ankle abd/add ROM when using a 3df model. When including the trunk in a 3df model, Bogert et al. (2013) were unable to describe normal hip and ankle ext/int rotations with large inter-subject avg StdDev (around 6-7 degs). Although the knee non sagittal rotations were not reported it can be expected that due to the large variations in hip ext/int rotations (and therefore knee flex/ext axis mis-alignment) that the knee non-sagital rotations would suffer large non-linear errors (commonly called cross-talk). It is unclear in Bogert et al. (2013) how much of the errors seen in ankle non-sagital rotations are a factor of the static calibration procedure and dynamic skin movement artefact producing axes-misalignment or in this case with 3df joints, the combined effects of errors in the locations of all proximal segments affecting the location of the ankle joint centre and therefore foot segment location and derived ankle joint rotations.

              If 3df joints are to be used, then I would say use them with caution. Do not use less than 3df at the hips or knee joints; do not include trunk (lumbar, lower thoracic, upper thoracic or shoulder girdle) segments within a 3df per joint lower body model; do not use with large joint ranges of motion or high skin movement artefact or with joints were the joint centre location are not well defined, and; still be wary of the non-sagital knee and ankle joint rotations. A mixed constrained leg model of 3 df’s at the hips, 6 df’s at the knees and 3 df’s at the ankles (3-6-3) might be a viable constrained model option? But certainly not the OS-IK (3-1-2) model.

              Does this mean a 6 df model? Unfortunately no, as 6 df models are not all created equally. They vary in the placement and number of markers used or whether a rigid fixation device was used or whether or not they attempted to correct for axes misalignment and if so what methods were used. The results of these studies do not mean that the unconstrained cluster design is valid or reliable; they just have a smaller ROM and have produced more consistent gait joint angle data than those which have placed limitations on joint degrees of freedom.

              The cluster models presented in Duffell et al. (2014) and Kainz et al. (2016) were quite similar in design. However both studies reported very large inter-subject StdDev in the order of 6 deg for both knee and ankle abd/adds and around 10 degs for hip, knee and ankle ext/int rotations. Meaning the designs were poor and results unreliable. Limitations include; not assessing knee abd/add or attempting to align knee medio-lateral axes to correct axes misalignment and non-linear error, use of three markers instead of four or more (three markers is just least squares and not true cluster with 4 or more markers), poor placement of markers to achieve a distribution along at least two axes, using a rigid fixation device on the thighs, and not using virtual hip, knee and ankle joint centres within the respective segment’s marker clusters.

              As mentioned by Ton in his previous post, 3df vs 6df does very much depend on how the model is constructed and implemented. If done poorly neither will produce usable non-sagital hip, knee and ankle joint rotations. For comparison to the studies mentioned, using a 6df cluster design (6+ markers per segment, including virtual joint centres with least squares), with no filtering of either raw 3D coordinate data or calculated joint angle data, and which assesses and attempts to reduce nonlinear error in joint angle data, the inter-subject pooled StdDev in degrees for normal gait of 30 subjects were:
              Hips, flex/ext = 3.54, abd/add = 1.65, ext/int = 2.95
              Knee flex/ext = 4.11, abd/add = 1.29, ext/int = 1.67
              Ankle flex/ext = 3.58, abd/add = 2.01, ext/int = 2.24

              Something to think about, cheers
              Allan Carman


              • #8
                Re: Question about inverse kinematic processing

                There is a lot to digest in Allan's post, so I will just make a few comments.

                Starting with the last piece of information. An inter-subject SD of 1-2 degrees for non-sagittal rotations is indeed impressive, but probably more a reflection of the study design than the methods that were used for kinematic analysis. As Allen mentioned, in my 2013 paper, the SD values were much larger, but subjects walked at their own preferred speed which introduces variations. Also, most of the inter-subject differences were static offsets between the angle curves. ROM differences were much smaller. In the Kainz paper, CP patients were used, and they had high inter-subject SD values of around 15 degrees which is not unexpected. Interestingly, the OS-IK results had lower inter-subject SD values than the 6 DOF results. This makes sense, because soft tissue artifact contributes to the SD, and OS-IK with the 3-1-2 leg model is more robust against soft tissue artifact. However, I don't think these SD values can help us decide which method or model is better. I expect the method and model choice to produce mostly systematic errors, and not affect the inter-subject SD (other than through robustness, i.e. a lower ratio between number of DOF and the number of markers).

                Allen points out one potential problem in the OS-IK method with the 3-1-2 leg degrees of freedom. The knee has 1 dof (flexion only), and therefore, all internal tibia rotation has to be fully transmitted to hip internal rotation (if knee angle is close to zero). Nothing is absorbed at the knee, while clearly, a real knee has considerable rotational laxity. This explains why Kainz found a few degrees more hip internal rotation with OS-IK than with 6-DOF, indeed an increase of 50%. But it remains to be seen which one is closer to the truth. Due to soft tissue artifact, some thigh markers do not follow internal rotation of the femur very well. So a 6 DOF analysis may underestimate hip internal rotation, because it is only based on pelvis and thigh markers, nothing from below the knee is used. Bone pin studies showed that the soft tissue artifact for internal rotation at the knee is larger than the actual internal rotation that takes place during walking [1]!. So assuming zero internal rotation in the knee (as in the OS-IK 3-1-2 model) is not a bad assumption at all, and may actually get you closer to the true internal rotation in the hip joint. We don't know. This question can be answered by labs that can do optical motion capture and stereo-fluoroscopy at the same time. Please do!

                If you were looking at a sports motion, or abnormal gait, where the knee internal rotation is much larger than the soft tissue artifact, the 3-1-2 model would certainly be worse than a model with extra DOFs at the knee. So it really depends on the motion being studied.

                It also depends on how good the model is. You can make a good 3-1-2 model or a bad 3-1-2 model. OS-IK is performed after model scaling and this may not produce the best possible subject-specific skeleton model. Kainz reports 9 mm RMS IK tracking error (with max of 21 mm!) and this is much larger than what I had in my 2013 paper. I don't think I reported it, but I typically get about 3 mm. I don't scale an existing model, but build a subject model from scratch, using the subject's marker data during standing. So the OS-IK results of Kainz may not be representative of IK and the 3-1-2 leg model in general.


                [1] Reinschmidt et al. (1997) Knee and ankle joint complex motion during walking: skin vs. bone markers. Gait and Posture 6: 98-109.