none
Record movements using Kinect RRS feed

  • Question

  • Hello. I am developing a Kinect application and I am wondering if there are existing Kinect APIs that supports recording movements of a Skeleton.

    I have already searched regarding recording of movements but I only found gesture recognition, I want to record the points performed and be used for comparing real time movements.

    I am a complete beginner in Kinect development. Thanks for your replies :)

    Friday, August 10, 2012 3:48 PM

All replies

  • (Assuming you're planning to write managed code. If you're working in native C++, things will be different.)

    What you want to do is handle the SkeletonFrameReady event. Once your app has located an available sensor, do this:

                    // Turn on the skeleton stream to receive skeleton frames
                    this.sensor.SkeletonStream.Enable();
    
                    // Add an event handler to be called whenever there is new color frame data
                    this.sensor.SkeletonFrameReady += this.SensorSkeletonFrameReady;
    
                    // Start the sensor!
                    try
                    {
                        this.sensor.Start();
                    }
                    catch (IOException)
                    {
                        this.sensor = null;
                    }

    Then, implement SensorSkeletonFrameReady:

    private Skeleton[] skeletons;
    private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) { using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame()) { if (skeletonFrame != null) { if (this.skeletons == null)
    {
    this.skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength]; }
    skeletonFrame.CopySkeletonDataTo(this.skeletons); } } foreach (Skeleton skeleton in this.skeletons)
    {
    if (skeleton.TrackingState == SkeletonTrackingState.Tracked)
    { // Do something interesting with skeleton here... }
    }
    }

    This gives you each tracked skeleton. Write its properties to a file, or do whatever else you want with it.


    John | K4W Dev


    Tuesday, August 14, 2012 9:41 PM
  • Thank you Mr. Elsbree for you reply. I'll try that! THANKS! :)
    Thursday, August 16, 2012 11:51 PM