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.

4

2 回答 2

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
            }
        }
    }
}
于 2013-04-19T23:02:05.010 回答
0

对不起,我的英语不好。

原因是包装器使用 Kinect SDK 1.0 而您使用 Kinect SDK 1.6。

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

于 2013-04-20T14:57:44.313 回答