Kinect – Getting Started – Become The Incredible Hulk

Kinect – Getting Started – Become The Incredible Hulk

..in this article I'll show how to Get Started with Kinect SDK, from there we will move forward to how you can control the Camera Angel using the SDK and finally I'll show how to use the Skeleton Tracking and with a nice example how to become The Incredible Hulk.

Project Information URL: http://www.codeproject.com/KB/dotnet/KinectGettingStarted.aspx

Project Download URL: http://www.codeproject.com/KB/dotnet/KinectGettingStarted.aspx

1

image

6

void SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{

    foreach (SkeletonData data in e.SkeletonFrame.Skeletons)

    {

        //Tracked that defines whether a skeleton is 'tracked' or not. The untracked skeletons only give their position. 

        if (SkeletonTrackingState.Tracked != data.TrackingState) continue;
        //Each joint has a Position property that is defined by a Vector4: (x, y, z, w). 

        //The first three attributes define the position in camera space. The last attribute (w)

        //gives the quality level (between 0 and 1) of the 

        foreach (Joint joint in data.Joints)

        {

            if (joint.Position.W < 0.6f) return;// Quality check 

            switch (joint.ID)

            {

                case JointID.Head:

                    var heanp = getDisplayPosition(joint);
                    Canvas.SetLeft(imgHead, heanp.X);

                    Canvas.SetTop(imgHead, heanp.Y);
                    break;

                case JointID.HandRight:

                    var rhp = getDisplayPosition(joint);
                    Canvas.SetLeft(imgRightHand, rhp.X);

                    Canvas.SetTop(imgRightHand, rhp.Y);

                    break;

                case JointID.HandLeft:

                    var lhp = getDisplayPosition(joint);
                    Canvas.SetLeft(imgLefttHand, lhp.X);

                    Canvas.SetTop(imgLefttHand, lhp.Y);

                    break;
            }
        }
    }
} 

Contact Information:

Follow the Discussion

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.