We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone. I'm sorry for my english but i'm learning for it. I'm using the library SimpleOpenNi and i need to see the difference between two nearly frames. I need to delete background pointing out the moving object. Some one have an idea? I used this code but doesn't work. Ty.
import SimpleOpenNI.*;
SimpleOpenNI kinect;
PImage myImage = createImage(640,480,RGB);
void setup()
{
size(1320, 480);
kinect = new SimpleOpenNI(this);
kinect.enableDepth();
}
void draw()
{
kinect.update();
PImage depthImage = kinect.depthImage();
int[] depthValues = kinect.depthMap();
myImage.loadPixels();
for (int i = 0; i < 640*480; i++) {
if(myImage.pixels[i]!= depthValues[i])
{
myImage.pixels[i] = depthValues[i];
}
}
myImage.updatePixels();
image(myImage, 0, 0);
image(depthImage,640,0);
}
Answers
Try this: