Loading...
Logo
Processing Forum
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

Copy code
  1. 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();


     
    }

Replies(2)

maybe I should consider usind the depth map as a mask (greyscale values should match ok)