Connecting to the Kinect remotely with the Kinect Service

Sign in to queue

Description

So this week we've learned about the Kinect and how to develop with it, we've read about the updated APIs and even some deployment tips.

Today, let's look at a new Coding4Fun Kinect project and one that could open up some very interesting ways to build awesome apps.

Image the Kinect (and PC) in one room and your app in another (room, building, state, country). Say something that can run on the machine that has the Kinect connected to it but send the camera, depth, skeleton and audio to an app running on another computer or device, like a Windows Phone 7...

You don't need to imagine, because there's the...

Coding4Fun Kinect Service

The Coding4Fun Kinect Service allows you to stream Kinect color, depth, skeleton, and audio from one PC to another PC or a Windows Phone via sockets. Both server and client libraries are available to send and receive the data. Please review the included WPF and Windows Phone samples for a quick explanation of how to use the libraries. Also check out the Documentation tab for more information and sample usage.

This project requires the Kinect for Windows SDK v1.0. If you want to learn how to use the Kinect for Windows SDK, head over to the Channel 9 and view the Quickstart series.

...

Project Information URL: http://kinectservice.codeplex.com/

Project Download URL: http://kinectservice.codeplex.com/releases/view/81291

Project Source URL: http://kinectservice.codeplex.com/SourceControl/list/changesets

Runs with v1? Yes

image

Here's the C# Solution;

image

And the VB (yes, there's a full VB.Net version) Solution;

image

Here's a snip of code from the C# Phone Sample;

void client_ColorFrameReady(object sender, ColorFrameReadyEventArgs e)
{
    if(e.ColorFrame.BitmapImage != null)
        this.Color.Source = e.ColorFrame.BitmapImage;
}

void client_DepthFrameReady(object sender, DepthFrameReadyEventArgs e)
{
    if(_outputBitmap == null)
    {
        this._outputBitmap = new WriteableBitmap(
            e.DepthFrame.ImageFrame.Width, 
            e.DepthFrame.ImageFrame.Height);

        this.Depth.Source = this._outputBitmap;
    }

    byte[] convertedDepthBits = this.ConvertDepthFrame(e.DepthFrame.DepthData, e);

    Buffer.BlockCopy(convertedDepthBits, 0, _outputBitmap.Pixels, 0, convertedDepthBits.Length);
    _outputBitmap.Invalidate();
}

void client_AudioFrameReady(object sender, AudioFrameReadyEventArgs e)
{
    _kinectSound.SubmitBuffer(e.AudioFrame.AudioData);

    if(_kinectSound.State != SoundState.Playing)
        _kinectSound.Play();
}

private void client_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
    Skeleton skeleton = (from s in e.SkeletonFrame.Skeletons
                             where s.TrackingState == SkeletonTrackingState.Tracked
                             select s).FirstOrDefault();

    if(skeleton == null)
        return;

    SetEllipsePosition(headEllipse, skeleton.Joints[(int)JointType.Head]);
    SetEllipsePosition(leftEllipse, skeleton.Joints[(int)JointType.HandLeft]);
    SetEllipsePosition(rightEllipse, skeleton.Joints[(int)JointType.HandRight]);
}

Contact Information:

The Discussion

Add Your 2 Cents