Created
September 27, 2013 12:39
-
-
Save kylemcdonald/6727976 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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