Search code examples
kinectkinect-sdkkinect.toolbox

Recorded Skeleton Data


The following is code I have used to try to record skeleton frame data

using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
{
    if (skeletonFrame == null)
       return;
    this.Recorder.Record(skeletonFrame);
}

if the code above is run, what information is recorded? If I were to save this information to an external file, what would I see?

Would there be coordinate information and a specific timestamp associated with each coordinate information?


Solution

  • Are you looking at recording the X, Y, Z data of the skeleton into a text file? It is generally easier to record the information separately in readable format. If you are looking at doing the aforementioned then this may help:

    //save the XYZ of the skeleton data, but also save the XZ of depth data
            private void saveCoordinates(Skeleton skeleton, string textFile)
            {
            StreamWriter coordinatesStream = new StreamWriter(newPath + "\\" + textFile);
    
                foreach (Joint joint in skeleton.Joints)
                {
    
    
    
                    coordinatesStream.WriteLine(joint.JointType + ", " + joint.TrackingState + ", " + joint.Position.X + ", " + joint.Position.Y + ", " + joint.Position.Z);
    
                }
                coordinatesStream.Close();
    
            }