Text in silhouette using kinect

edited May 2016 in Kinect

For an interactive installation I want to make a projection of textwithin the user's silhouette, like the video below:

Now I've got this code, buw the problem is that the image gets blurry and I can't see any letters. How can I change this? When I try to change something the sketch won't run.

code:

import SimpleOpenNI.*;
import java.util.*;

SimpleOpenNI context;

int blob_array[];
int userCurID;
int cont_length = 640*480;
String[] sampletext = { "a", "b" , "c", "d", "e", "f", "g", "h" , "i", "j", "k"
}; // sample random text

void setup(){

  size(640, 480);
  context = new SimpleOpenNI(this);
  context.setMirror(true);
  context.enableDepth();
  context.enableUser();

  blob_array=new int[cont_length];
}


void draw() {
  background(-1);
     context.update();
  int[] depthValues = context.depthMap();
  int[] userMap =null;
  int userCount = context.getNumberOfUsers();
  if (userCount > 0) {
  userMap = context.userMap();
  }

 loadPixels();
  for (int y=0; y<context.depthHeight(); y++) {
    for (int x=0; x<context.depthWidth(); x++) {
      int index = x + y * context.depthWidth();
      if (userMap != null && userMap[index] > 0) {

       userCurID = userMap[index];
        blob_array[index] = 255;

         fill(200,0,200);
        text(sampletext[int(random(0,10))],x,y); // put your sample random text
          }
          else {
            blob_array[index]=0;
          }
        }
      }
   }

problem text silhouette

Tagged:

Answers

  • edited January 2014 Answer ✓

    Again I am telling you that I have seen so many post till now about the kinect realted question is forum. It is good to ask question but without trying anything you have posted my code without refering.

    we all are here to help you, not to code for you. so like in your post where you have asked about the volume control when user comes close and we all have helped you so much but now it's your turn.

    For now this problem you have mentioned here just try to change this in line 35 & 36

      for (int y=0; y<context.depthHeight(); y+=30) {
        for (int x=0; x<context.depthWidth(); x+=30) {
    
  • Thanks! it all works now!

    And sorry for the trouble =.='' I want a lot of things in a short time, and I'm sorry to bother you with it ^^

  • edited January 2014 Answer ✓

    It is okay but you need to try otherwise you won't learn anything :) cheers and you can change those values y+=(to any number) and x+=(to any number) according how dense text you want :)

    best of luck

This discussion has been closed.