Kinect 4 Windows V2 - in the browser

1 minute read

For the older Kinect v1.0 there was a sample included with the Kinect SDK which provided browser compatibility. The general idea is that the Kinect SDK can be used to retrieve the various Kinect data streams i.e., the RGB stream, body tracking data, etc. and from within a console or desktop app a webserver serves up that data for consumption over localhost by a web app running in the browser. This opens up compatibility with various javascript frameworks such as Babylon.js (another option might be to run inside a Windows Store javascript app). The official sample is pretty comprehensive so I thought it might be useful to have something simpler to hand. Anyway, after a bit of searching around I found a few examples for v1.0 but nothing with v2.0 support so I decided to hack one together. This might come in handy at the London Kinect Hackathon on 21st and 22nd March REGISTER here.

I used SuperWebSocket from within a .NET console app to retrieve the Kinect data and broadcast it to any connected web sockets. The socket server code is simple:

color

I used a canvas to render the results in the browser – this shows the response to the web app receiving a web socket message:

body

Code is here https://github.com/peted70/kinectv2-webserver

Comments