Skip to content
Advertisement

Output of Kinect 2 on browser using Node.js and Javascript

I am trying to show the output of Kinect 2 on the web browser, following a tutorial given here, http://www.webondevices.com/xbox-kinect-2-javascript-gesture-tracking/

I have been able to get the device output as JSON objects in the browser console using this code in server.js

JavaScript

output.html, the page where i want to show the output on a canvas looks like this

JavaScript

the structure of each JSON object showing position of each skeleton tracked is as such

JavaScript

…… there are 24 arrays with similar parameters in the Joints array corresponding to each 24 joints tracked.

To show a skeleton in the browser, i have tried

JavaScript

inside the for loop for each JSON object received

JavaScript

what this outputs is just one square spot on the canvas and another at the left corner of the canvas, which i understand why because that’s the coordinates fed to it. I want to know how to interpret data i get in the Joints array for any joint as a formula and show a tracked spot on the browser so that i can show a skeleton in the browser. I am checking actual tracking results and video output in the Kinect Studio v2.0 Desktop app.

Any suggestion will be appreciated

Advertisement

Answer

This is what successfully generated an output of tracked skeletons on the browser screen. In output.html, sockets.io receives the JSON objects and Javascript is used to create projects with respect to each point on the screen, according to the depthX parameter. In output.html

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement