Skip to content

Instantly share code, notes, and snippets.

@kylemcdonald
Created September 27, 2013 12:39
Show Gist options
  • Save kylemcdonald/6727976 to your computer and use it in GitHub Desktop.
Save kylemcdonald/6727976 to your computer and use it in GitHub Desktop.
import processing.video.*;
import gab.opencv.*;
OpenCV opencv;
Capture video;
PVector ploc = new PVector();
PVector loc = new PVector();
void setup() {
size(640, 480);
video = new Capture(this, 640, 480);
video.start();
opencv = new OpenCV(this, 640, 480);
}
void draw() {
// image(video, 0, 0);
stroke(255, 0, 0);
noFill();
line(ploc.x, ploc.y, loc.x, loc.y);
}
void captureEvent(Capture c) {
c.read();
opencv.loadImage(video);
ploc = loc;
loc = opencv.max();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment