photobooth style?
in
Contributed Library Questions
•
2 years ago
hey, i'm trying to get these images to capture and show every 5 seconds or so but i'm not sure what's the best way to do it.
each smaller capture will be taken every 5 seconds on when the user moves (using absDiff) then displayed on a clockwise direction from the top left.
so instead of keyPressed, what should i use?
import hypermedia.video.*;
OpenCV opencv;
int savedTime;
int interval = 3000; //x seconds
void setup() {
size(640,480);
opencv = new OpenCV(this);
opencv.capture(320,240);
savedTime = millis();
}
void draw() {
opencv.read();
opencv.flip(OpenCV.FLIP_HORIZONTAL);
image(opencv.image(), 160,120);
image( opencv.image(OpenCV.MEMORY), 0,0, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 160,0, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 320,0, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 480,0, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 0, 120, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 0, 240, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 0, 360, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 160, 360, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 320, 360, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 480, 360, 160, 120 );
//image( opencv.image(OpenCV.MEMORY), 480, 240, 160, 120 );
// image( opencv.image(OpenCV.MEMORY), 480, 120, 160, 120 );
/*if (millis() >savedTime+interval) {
opencv.remember();
}
println(savedTime);
}
void keyPressed() {
opencv.remember(); // store the actual image in memory
}
1