Using kinect to display a picture using silhouettte as a mask (what a good idea)
in
Integration and Hardware
•
2 years ago
Hello everydody,
I'm wiiling to show some pictures I've done. I'd like the kinect to recognize when somebody is in front of the screen so the picture would be displayed through the silhouette.
It's pretty easy to get the silhouette according to the depth map parameters on shiffman.kinect.*
...But I'm confused on displaying pixels one by one (updating them etc) so here is my start, hope you can bring some enlightment
I'm wiiling to show some pictures I've done. I'd like the kinect to recognize when somebody is in front of the screen so the picture would be displayed through the silhouette.
It's pretty easy to get the silhouette according to the depth map parameters on shiffman.kinect.*
...But I'm confused on displaying pixels one by one (updating them etc) so here is my start, hope you can bring some enlightment
- import shiffman.kinect.*;
PImage img;
PImage depth;
PImage photo;
PImage myImage;
int index =0;
int taille;
color c ;
float lumi ;
String mazi = "IMGP3717.JPG"; //my picture
void setup() {
size(640, 480);
NativeKinect.init();
myImage = loadImage(mazi);
String path = sketchPath+"/data";
img = createImage(640, 480, RGB);
depth = createImage(640, 480, RGB);
photo = loadImage(mazi);
}
void draw() {
NativeKinect.update();
depth.pixels = NativeKinect.getDepthMap();
depth.updatePixels();
int halfImage = width*height/2;
image(myImage, 0, 0);
loadPixels();
for (int i = 0; i < width*height; i++) {
c = depth.get(x, y);
lumi = brightness(c);
if (lumi>85.0) {
//Then I take up or down some pixel info to the array of pixels
// either I make it black for the silhouette is not on
//either it takes the pixel from the pic and I dont know which array to use
}
}
updatePixels();
}
1