Kinect=001=basic
-
Upload
gary-chang -
Category
Documents
-
view
212 -
download
0
description
Transcript of Kinect=001=basic
KINECTBASIC
01
Draw Depth
import SimpleOpenNI.*;
SimpleOpenNI context;
///////////////////////////////////////////////
void setup(){
}
///////////////////////////////////////////////
void draw(){
}
Of course you need to import library
Create a simpleOpenNI object
import SimpleOpenNI.*;
SimpleOpenNI context;
///////////////////////////////////////////////
void setup(){
context = new SimpleOpenNI (this);
context.enableDepth();
size(context.depthWidth(), context.depthHeight());
}
///////////////////////////////////////////////
void draw(){
}
Initiate the object
Enable the function will be used. (“DepthMap” here)
Window size from
the depthImage
import SimpleOpenNI.*;
SimpleOpenNI context;
///////////////////////////////////////////////
void setup(){
context = new SimpleOpenNI (this);
context.enableDepth();
size(context.depthWidth(), context.depthHeight());
}
///////////////////////////////////////////////
void draw(){
context.update();
image(context.depthImage(),0,0);
}
Update the camera
Display the Depth Map
MY
BEST
Pic
EVER
IDENTIFY
import SimpleOpenNI.*;
SimpleOpenNI context;
///////////////////////////////////////////////
void setup(){
context = new SimpleOpenNI (this);
context.enableDepth();
context.enableUser();
size(context.depthWidth(), context.depthHeight());
}
///////////////////////////////////////////////
void draw(){
context.update();
image(context.userImage(),0,0);
}
Add this line
Change “depthImage” to “userImage”
Now
You
See
Me
In
Color
Multi
Players,
Cool!
Initiate?
import SimpleOpenNI.*;
SimpleOpenNI context;
///////////////////////////////////////////////
void setup(){
context = new SimpleOpenNI (this);
context.enableDepth();
context.enableUser();
if(context.isInit() == false){
println("Maybe your Kinect is not connected");
exit();
return;
}
size(context.depthWidth(), context.depthHeight());
}
///////////////////////////////////////////////
void draw(){
context.update();
image(context.userImage(),0,0);
}
Add these lines
Unplug your Kinect
Image: http://insidetheblack.com/2013/03/04/top-5-best-mtv-unplugged-performances/
Once you
disconnect
your Kinect, it
will tell you.