Kinect Stream Saver Application 2

This application allows users to record body, color and depth data streams of Kinect for Windows 2

This application is developed based on a sample called "ColorBasics-D2D C++" developed by Microsoft corporation. (Compatible with SDK 2: K4W v2 Dev Preview)

Noncommercial — You may not use this application for commercial purposes.
>> © The AI & Robotics Research Team (AIRR), Toronto Rehabilitation Institute.
Prepared by Elham Dolatabadi,

The Kinect Stream Saver application is meant to aid research in the general area of mobility monitoring. The AI & Robotics Research Team (AIRR) within the Toronto Rehabilitation Institute (TRI) holds copyright of the dataset.

Instructions for use:

To collect data with the Kinect Stream Saver:

1) Run KinectSources-D2D.exe:

- In the lower right corner of the window:
     Enter subject's name if desired.
     Choose which data streams to collect.
    Press Capture to begin data collection.
     Press Stop to end data collection.

2) The collected data will appear in C:\KinectData.

- LiTimeStamp.binary:
  This file has fields: counter#, frame#, timestamp
  - The counter starts at 1 when the Capture button is pressed and data collection begins.
  - The frame number is from the Kinect API; it starts when KinectExplorer-D2D.exe is launched.
  - The timestamp is in milliseconds, and is useful for recording frame rate. (At present data
    is collected at approximately 30 frames/second, so frames are approx 33 msecs apart.)

- Color images are saved as .bmp files, on each frame.
    . as .bmp files on each frame.
    . as "binary" data stored in a .binary file.

- Depth images are saved either
    . as .bmp files on each frame.
    . as "binary" data stored in a .binary file.

- Skeleton data:
  The program can track up to six skeletons at once. For the first four, all joints are tracked.
  For the last two, only the center of mass is tracked.
  Saving The Joint Positions: one data files is created, named  Joint_Position.binary.

  One hundred fifty rows are written to each skeleton data file for each frame. These 150 rows store
  data for the 25 skeleton joints in the following order for 6 tracked users.

--- "Joint_Position_....binary" File ---
     Each row contains following fields:
       - position (x, y, z); joint tracking state (in joint rows)*        

 * Tracking states: 0=joint is not tracked; 1=joint is inferred; 2=joint is tracked


  i) If a user that is being tracked leaves the field of view and later returns, the Kinect
      does not know it is the same person, so they will be assigned a new skeleton id. This
      can mean that the person's data appears in more than one data file.


Instructions on how to open binary files in MATLAB:



fid = fopen('C:\KinectData\Skel\liTimeStamp.binary');
B = fread(fid,'int64');
n = 1; % No. of columns of T
BB = reshape(B, n,[]);
T = permute(BB,[2,1]);


fid = fopen('C:\KinectData\Skel\Joint_Position.binary');
A = fread(fid,'float');
jointNumber = 25;
tracks = 6;
AAAA = reshape(A, 4,jointNumber,tracks,[]);
SkelJoint = permute(AAAA,[1,2,4,3]);


Color Image

fid = fopen('C\ ... .binary');
Img = fread(fid,'*uint8');
str_byte_No = 4;
ColImg = reshape(Img, str_byte_No,width*height, []);


Depth Image

fid = fopen('C\ ... .binary');
Img = fread(fid,'*ushort');
Img = double(Img);
str_byte_No = 1;
DepImg = reshape(Img, str_byte_No,width*height, []);


Terms of Use:

If your research benefits from the Kinect Stream Saver application provided by IATSL, please cite the following paper in any publications about your work:

 Elham Dolatabadi, Babak Taati, Alex Mihailidis, Vision-based approach for long-term mobility monitoring: Single case study following total hip replacement, Journal of Rehabilitation Research and Development (JRRD),51(7),p.p 1165–1176.


Last edited Mar 3, 2015 at 11:09 PM by edolataabadi, version 5