Hi all,
I have managed to do a small processing sketch with the Kinect library of Daniel Schiffman for retrieving feet blobs. Now I’m trying to rewrite it in openframeworks but I can’t get it works.
The things that I do not understand is what is the difference in between the Processing ‘getRawDepth()’ (http://www.shiffman.net/p5/kinect/) and the Openframeworks ‘getRawDepthPixels()’ functions ? The Processing function returns an array of int but the Openframeworks one returns what exactly, an array containing arrays of 11bit values ?
If yes how could I transform those 11bits into one int values in order to have the exactly same data as the processing getRawDepth() function ?
If it can helps here is how I do it in processing:
int feetHeight = 10;
int margin = 5;
...
void draw(){
....
int[] pixels = kinect.getRawDepth();
for (int i=0; i < kinect.width*kinect.height; i++) {
if (pixels[i] > floor[i]-margin) {
depthImage.pixels[i] = color(0);
}
else if (pixels[i] < floor[i]-margin-feetHeight) {
depthImage.pixels[i] = color(0);
}
else {
depthImage.pixels[i] = color(255);
}
}
depthImage.updatePixels();
....
}
//Calibration-> save the depth values of the floor (with nobody/nothing on it)
if (key == ' ') {
floor = kinect.getRawDepth();
}
Thanks very much for your help!