0

I'm using Unity 4.0.1 with kinect sdk 1.6 and developing with c# (imported kinect wrapper),

In the project when user goes out of range or one of bones can not be captured because of user not exactly in the range of kinect I want to display a message.

I've tried "code for detecting humans" in Kinect user Detection

This solution gives compile error like

"Assets/Kinect/KinectModelControllerV2.cs(93,10): error CS0246: The type or namespace name `DepthImageFrame' could not be found. Are you missing a using directive or an assembly reference?"

I've imported Kinect and tried to import DepthImageFrame to chect if it works, but nothing changed.

Community
  • 1
  • 1
togikan
  • 331
  • 6
  • 15
  • Have you directly copied the code from that post or have you developed it yourself? It's not clear what DepthImageFrame is or where it comes from. – Lojko Apr 19 '13 at 22:28
  • The unity tag is for Microsoft Unity. Don't misuse it. – Lex Li May 07 '13 at 09:48

2 Answers2

0

The examples provided in the Kinect for Windows Toolkit and the code located on the Kinect for Windows CodePlex site are full of examples of how to detect players.

Looking at the "Skeleton Basics" example immediately comes to mind, followed by the "Shape Game" example.

A basic flow to detecting players in the SkeletonFrameReady callback follows:

Skeleton[] skeletons = new Skeleton[6];

private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
    using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
    {
        if (skeletonFrame != null)
        {
            skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];
            skeletonFrame.CopySkeletonDataTo(skeletons);
        }
    }

    if (skeletons.Length != 0)
    {
        foreach (Skeleton skel in skeletons)
        {
            if (skel.TrackingState == SkeletonTrackingState.Tracked)
            {
                // `skel` is an actively tracked skeleton
                // do what you wish with it
            }
        }
    }
}
Nicholas Pappas
  • 10,439
  • 12
  • 54
  • 87
0

Sorry for my bad English.

The reason is because the wrapper uses Kinect SDK 1.0 and you use Kinect SDK 1.6.

http://channel9.msdn.com/coding4fun/kinect/Unity-and-the-Kinect-SDK.

mao
  • 1