Skip to content

JSON structure

visor841 edited this page Aug 22, 2015 · 12 revisions

This page details the JSON that Kinect2JSON outputs.

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. Note: The Kinect v1 does not support handstates.

The "joints" array contains the 26 joints the kinect tracks. Note: The Kinect v1 does not support the "Spine Shoulder", both Hand Tips, and both Thumb joints.

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