Skip to content

Instantly share code, notes, and snippets.

@GalNissim
Last active August 18, 2016 22:22
Show Gist options
  • Select an option

  • Save GalNissim/bce5e7449828e029c458ef446fbfbf11 to your computer and use it in GitHub Desktop.

Select an option

Save GalNissim/bce5e7449828e029c458ef446fbfbf11 to your computer and use it in GitHub Desktop.
/**
* Getting Started with Capture.
*
* Reading and displaying an image from an attached Capture device.
*/
import processing.video.*;
Capture cam;
void setup() {
size(640, 480);
String[] cameras = Capture.list();
// Capture
cam = new Capture(this, 1280, 960); //change "cameras[15]" if you are
cam.start();
println(cameras);
}
void captureEvent(Capture cam) {
cam.read();
}
void draw() {
image(cam, 0, 0, width, height);
println(cam.pixels.length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment