Fairly new to processing, but I've got a pretty great sketch running based largely on Daniel Shiffman's kinect library example, Average Point Tracking:
What I'd like to do, however, is take the PImage display from KinectTracker, and have it shown in a second application window. That way I can have one window that shows the raw data the kinect is receiving, and the other window just show my desired output.
I've been looking at this sketch on having multiple application windows:
But for the life of me, I can't seem to mash the two together.. honestly mostly because I don't follow exactly what's happening in the multi application sketch.
I know I need to pull tracker.track(); and tracker.display(); to show up in the second window. But the way the multi application sketch pulls info in to the second window is with s.EXAMPLE(); aaand I can't exactly do s.track.display();
I realize this probably sounds dumb, but if anyone had the time to at least point me in the direction of figuring this out, I'd really appreciate it. You guys have been really awesome in the past.
This is probably the easiest/most obvious answer, but I've been stuck on this for a bit anyway.
I'm playing with Processing + a Kinect, and I'm looking at Daniel Shiffman's released code, specifically the AveragePointTracking example. In it, he grabs the depth map, flips it so it will appear the right way on a screen, and then colors certain pixels red. I understand the majority of the code, but for the life of me I can't figure out how to get it to not flip the image (I'm using a projector, so don't want it flipped).
Here is the code:
void display() {
PImage img = kinect.getDepthImage();
// Being overly cautious here
if (depth == null || img == null) return;
// Going to rewrite the depth image to show which pixels are in threshold
// A lot of this is redundant, but this is just for demonstration purposes
display.loadPixels();
for(int x = 0; x < kw; x++) {
for(int y = 0; y < kh; y++) {
// mirroring image
int offset = kw-x-1+y*kw;
// Raw depth
int rawDepth = depth[offset];
int pix = x+y*display.width;
if (rawDepth < threshold) {
// A red color instead
display.pixels[pix] = color(150,50,50);
}
else {
display.pixels[pix] = img.pixels[offset];
}
}
}
display.updatePixels();
// Draw the image
image(display,0,0);
}
I know the line is red is the area in question. But I can't quite figure out what to set the Offset to equal if I don't want it reversing.
here's a link to his whole code set, if more information is required: