title: Kinect sideways skeleton tracking
body: <p>Currently I am using the Microsoft Kinect for measuring angles between joints. Most measurements are working correctly. Whenever a person is sitting sideways (on a chair) the Kinect won't track the skeleton accurate. To illustrate my problem I've added 3 pictures of the Kinect depthview.</p>
  
  <p><img src="https://i.stack.imgur.com/gstiU.jpg" alt="Seated sideways measurement with skeleton tracking"></p>
  
  <p><img src="https://i.stack.imgur.com/R8Dxk.jpg" alt="Seated sideways measurement without skeleton tracking"></p>
  
  <p><img src="https://i.stack.imgur.com/JYF5f.jpg" alt="Sideways measurement with skeleton tracking"></p>
  
  <p>As you can see 2 out of 3 measurements work "correctly". Whenever I lift my leg, the Kinect stops skeleton tracking correctly. Does anyone have a solution to this problem, or is this just a limitation of the Kinect?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Update 1:</strong>
  The <code>JointTrackingState-Enumeration</code> on these tracked joints shown at screenshot 2 are marked as <code>Inferred</code>, however the depth view is tracking my full body.</p>
  
  <p><strong>Update 2:</strong>
  At screenshot 2 I'm trying to track my front leg, highlighted as green. I know the other leg isn't tracked but this does not matter, I guess.</p>
  
  <p><strong>Update 3:</strong>
  The following code selects a skeleton:</p>
  
  <pre><code>private Skeleton StickySkeleton(Skeleton[] skeletons)
  {
      if (skeletons.Count&lt;Skeleton&gt;(skeleton =&gt; skeleton.TrackingId == _trackedSkeletonId) &lt;= 0)
      {
          _trackedSkeletonId = -1;
          _skeleton = null;
      }
  
      if (_trackedSkeletonId == -1)
      {
          Skeleton foundSkeleton = skeletons.FirstOrDefault&lt;Skeleton&gt;(skeleton =&gt; skeleton.TrackingState == SkeletonTrackingState.Tracked);
  
          if (foundSkeleton != null)
          {
              _trackedSkeletonId = foundSkeleton.TrackingId;
              return foundSkeleton;
          }
      }
  
      return _skeleton;
  }
  </code></pre>
  
  <p>Whenever a skeleton is tracked that data will be used for drawing the joint-points and calculating the angle between joints.</p>
  
  <p><strong>Update 4:</strong>
  I've tested sitting on a 'block', far more simplified than a chair. Unfortunately the Kinect still acts the same.</p>
  
  <p>Below 2 screenshots:</p>
  
  <p><img src="https://i.stack.imgur.com/shTks.png" alt="Sitting on a block 1"></p>
  
  <p><img src="https://i.stack.imgur.com/XkOvP.png" alt="Sitting on a block 2"></p>