TSPS JSON Messages

TSPS sends JSON packets every time a TSPS Event occurs.

Fields

  • type
    value: String - "personEntered", "personUpdated", or "personWillLeave"
  • id
    value: Number - unique ID of person
  • age
    value: Number - how long person has been around in frames
  • depth
    value: Number - Normalized (0.0 - 1.0) depth value. Real-world values may vary with cameras; with a Kinect and similar cameras, 1.0 is approximately 5 meters / 15 feet.
  • centroid
    value: Object - Normalized (0.0 - 1.0) point that represents the center of mass of a person. Values are normalized to camera dimensions (i.e. 1.0 = camera width, in pixels)
  • velocity
    value: Object - Normalized (0.0 - 1.0) point that represents the velocity (in pixels/frame). Values are normalized to camera dimensions.
  • boundingrect
    value: Object - Normalized (0.0 - 1.0) rectangle (x, y, width, height) that represents the bounding box of a Person's shape. Values are normalized to camera dimensions.
  • optical flow
    value: (if "track optical flow in blobs" is enabled) - Object - Normalized (0.0 - 1.0) point that represents the average optical flow within a Person's area
  • haarrect
    value: (if "track and send haar" is enabled) - Object - Normalized (0.0 - 1.0) rectangle (x, y, width, height) that represents the location of a Haar-like feature found within a Person's bounding box.
    Note: the values are normalized to the entire camera, not the person's bounding box
  • highest
    value: Number - Object - Normalized (0.0 - 1.0) point representing the brightest point within a Person's bounding box. With a depth camera, this represents the closest point to the camera. Values are normalized to camera dimensions.
  • contours
    value: Array of point Objects - Container of normalized (0.0 - 1.0)  points representing contours of TSPS Person. Values are normalized to camera dimensions.

Example:

{   
"type":"personUpdated",
"id":0,
"age":0,
"depth":0.0,
"centroid":{
"x":0.0,
"y":0.0
},
"velocity":{
"x":0.0,
"y":0.0
},
"boundingrect"{
"x":0.0,
"y":0.0,
"width":0.0,
"height":0.0
},
"opticalflow":{
"x":0.0,
"y":0.0
},
"haarrect":{
"x":0.0,
"y":0.0,
"width":0.0,
"height":0.0
},
"highest":{
"x":0.0,
"y":0.0
},
"contours":[
{"x":0.0,"y":0.0},
...
]
}