How do I make this full screen or at least increase the dimensions?

edited October 2015 in Kinect

I'll try and keep this short and snappy. I have this code that will give me a simple black silhouette on Processing 2.0 using the Kinect unfortunately it's stuck at 640 x 480. I know this is because the Kinect can only detect things at this size but I really need to make the dimensions and size of this larger. Maybe not necessarily full screen but at least 1280x720.

I am a beginner of a beginner at all this and it is actually just for a graphic design project at uni that I'm doing it. So try and keep it basic so my simple mind can understand.

import SimpleOpenNI.*;
SimpleOpenNI context;

int[] userMap;
PImage rgbImage;
PImage userImage;
color pixelColor;

void setup() {
  size(640, 480);
  context = new SimpleOpenNI(this);
  context.enableRGB();
  context.enableDepth();
  context.enableUser();
  userImage = createImage(width, height, RGB);
}

void draw() {
  background(255,255,255);

  context.update();
  rgbImage=context.rgbImage();


  userMap=context.userMap();
  for(int y=0;y<context.depthHeight();y++){
    for(int x=0;x<context.depthWidth();x++){
      int index=x+y*640;
      if(userMap[index]!=0){
          pixelColor=rgbImage.pixels[index];
        userImage.pixels[index]=color(0,0,0);
      }else{
        userImage.pixels[index]=color(255);
      }


    }
  }
  userImage.updatePixels();
  image(userImage,0,0);
}

I'd also like to mention that I am using a v1 Kinect.

Any help would be so, so appreciated.

Dan

Sign In or Register to comment.