Skip to content
visor841 edited this page Jul 31, 2015 · 2 revisions

This page details the JSON that SkelScratch reads. If you want details on how to use SkelScratch, look at the "How to use SkelScratch" wiki page

The highest level is the "bodies" array. It contains the up to six bodies the Kinect v2 can track in indexes 0-5.

When no bodies are detected, the JSON looks like this: {"bodies":[]}
Kinect2JSON only outputs tracked bodies.

Each body has four values, an "id" object, an "lhandstate" object, and an "rhandstate" object, and a "joints" array.

The "id" object is the id of the body assigned to it by the kinect.

The "lhandstate" and "rhandstate" objects are numbers representing the handstates of the body from 0-4.

The "joints" array contains the 26 joints the kinect tracks.

Each joint has four values, a "name" object, "x", "y", and "z" objects.

The "name" object is the name of the joint.

The "x", "y", "z" objects are the coordinates of the object in meters from the kinect depth camera similar to a camera space point.

###Javascript Example: Initializing a variable

var jsonObject = null;

Getting the x-coordinate of the head from the first body

jsonObject.bodies[0].joints[3].x

Getting the id of the second body

jsonObject.bodies[1].id

Getting the left handstate of the fifth body

jsonObject.bodies[4].lhandstate

Clone this wiki locally