Skip to content
Kinect4W 2.0 library for Processing
Branch: master
Clone or download
Pull request Compare This branch is 5 commits ahead, 124 commits behind ThomasLengeling:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Kinect for Windows v2 library for Processing

Version 0.5

Library is curretly on develop, with SDK Version 1409 (9/16/2014)


  • A Kinect for Windows v2 Device (K4W2)
  • Kinect SDK v2
  • Computer with a dedicated USB 3.0 and 64bits
  • Windows 8, 8.1
  • Processing 2.2.1 or greater
  • Update your latest video card driver

Reference and tutorial coming soon

Webpage with tutorial and some couple of useful things.



  • Color1920, color image 1920 x 1080.
  • DepthTest, how to obtain depth information.
  • MaskTest, get only the contour image of the users.
  • PointCloudOGL, point cloud render using opengl.
  • PointCloudDepth, obtain the point cloud as a deph Image, and as a int [] array.
  • SimpleFaceTracking, simple face tracking up 6 users.
  • Skeleton3d, 3d skeleton.
  • SkeletonColor, map color frame to skeleton.
  • SkeletonMaskDepth, map depth frame and mask frame to skeleton.
  • SkeletonTest, simple 6 users skeleton.
  • imageTest, images frame test.

To build the library from source, use this repository ( not always updated ) KinectPV2_BuildLibs


  • Heart rate detection
  • Contour example
  • Color Point Cloud
  • Multiple Devices
  • Kinect Fusion

Simple Device

To include the library into a processing sketh you just need to import it and initialize it.

import KinectPV2.*;
KinectV2 kinect;

void setup() {

  kinect = new KinectV2(this);
  //Start up methods go here


To obtain the color Image, depth Image, infrared Image, bodyIndex Image and long Exposure Image as a PImage you need to active with the following method

 void enableColorImg(boolean toggle);
 void enableDepthImg(boolean toggle);
 void enableInfraredImg(boolean toggle);
 void enableBodyTrackImg(boolean toggle);
 void enableLongExposureInfrared(boolean toggle);
 PImage getColorImage();
 PImage getDepthImage();
 PImage getInfraredImage();
 PImage getBodyTrackImage();
 PImage getLongExposureInfrared();

just initialize in the setup()

  kinect = new KinectV2(this);

get the PImage in the draw()

PImage imgC = kinect.getColorImage();
image(imgC, 0, 0);

If you need to obtain the raw data of each Image as a array of int's you need to active it first.

void activateRawColor(boolean toggle);
void activateRawDepth(boolean toggle);
void activateRawDepthMaskImg(boolean toggle);
void activateRawInfrared(boolean toggle);
void activateRawBodyTrack(boolean toggle);
void activateRawLongExposure(boolean toggle);

to obtain the raw data as a array of intengers (RGB or gray scale)

int [] getRawDepth();
int [] getRawDepthMask();
int [] getRawColor();
int [] getRawInfrared();
int [] getRawBodyTrack();
int [] getRawLongExposure();


MIT License

You can’t perform that action at this time.