Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Last active August 29, 2015 14:20
Show Gist options
  • Save atduskgreg/26ead6194d7b4e09f926 to your computer and use it in GitHub Desktop.
Save atduskgreg/26ead6194d7b4e09f926 to your computer and use it in GitHub Desktop.
import processing.video.*;
import gab.opencv.*;
import org.opencv.core.Core;
OpenCV opencv;
Capture video;
void setup(){
video = new Capture(this, 640, 480);
opencv = new OpenCV(this, 640, 480);
video.start();
size(opencv.width, opencv.height);
}
void draw(){
opencv.loadImage(video);
println(Core.mean(opencv.getGray()).val[0]);
image(opencv.getOutput(), 0, 0);
}
void captureEvent(Capture c) {
c.read();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment