ghostxt / simple-openni

Automatically exported from code.google.com/p/simple-openni
0 stars 0 forks source link

putting text in silhouette kinect #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
How can I put text in the projected silhouette? like: 
http://www.youtube.com/watch?v=h5a8UZCgs14&feature=c4-overview-vl&list=PL-UtJb4M
t-OLCuxLfvv__jGOboQ-35ZRw

Here's my code until sofar:

import SimpleOpenNI.*;
SimpleOpenNI context;

PImage cam;
int[] userMap; // YOU FORGOT THIS ONE<-----

void setup() {
  size(640, 480);

  context = new SimpleOpenNI(this);

    // mirror the image to be more intuitive
    context.setMirror(true);

  context.enableDepth();
  context.enableUser();
background(0);

}

void draw() {

  context.update();

 fill(0, 2);
 noStroke();
 rect (0, 0, 640, 480);
 smooth();

  if(context.getNumberOfUsers() > 0) {

    userMap = context.userMap();

    loadPixels();
    for(int i = 0; i < userMap.length; i++) {  // YOU HAD AN o instead of 0

      if (userMap[i] !=0) {
        pixels[i] =color(255);
      }
    }
    updatePixels();
  }
}

void mousePressed(){
 // save image to a file
 // then clear it on the screen
 save("drawing.png");
 background(0);
}

Original issue reported on code.google.com by annieckb...@hotmail.com on 13 Dec 2013 at 2:37