From 3158e2a1713eb9aeef9f7ff6c6f36ebce2790124 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 2 Aug 2012 16:16:50 -0500 Subject: [PATCH 1/2] an old 2009 file i had laying around --- Processing/ucam.processing | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Processing/ucam.processing diff --git a/Processing/ucam.processing b/Processing/ucam.processing new file mode 100644 index 0000000..929dcfb --- /dev/null +++ b/Processing/ucam.processing @@ -0,0 +1,45 @@ +/** + * Getting Started with Capture. + * + * Reading and displaying an image from an attached Capture device. + */ + +import processing.video.*; +import blobDetection.*; + +Capture cam; +Capture isight; + +BlobDetection theBlobDetection; +PImage img; +boolean newFrame=false; + +void setup() { + size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 + + // If no device is specified, will just use the default. + + // To use another device (i.e. if the default device causes an error), + // list all available capture devices to the console to find your camera. + String[] devices = Capture.list(); + println(devices); + println(devices[7]); + + // Change devices[0] to the proper index for your camera. + isight = new Capture(this, width, height, devices[7]); // isight identically named to ext. usb camera? + cam = new Capture(this, width, height, devices[7]); + isight = null; //get rid of isight object since we just use it to help select the external + + // Opens the settings page for this capture device. + //camera.settings(); +} + + +void captureEvent(Capture myCapture) { + cam.read(); +} + +void draw() { + image(cam, 0, 0); +} + From 7bc4d69ba1d794cfca6fe08b10e81fb623d3c23f Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 2 Aug 2012 16:20:53 -0500 Subject: [PATCH 2/2] cleanup excess whitespace --- Processing/ucam.processing | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Processing/ucam.processing b/Processing/ucam.processing index 929dcfb..4f76979 100644 --- a/Processing/ucam.processing +++ b/Processing/ucam.processing @@ -1,30 +1,30 @@ /** * Getting Started with Capture. - * - * Reading and displaying an image from an attached Capture device. - */ - + * + * Reading and displaying an image from an attached Capture device. + */ + import processing.video.*; -import blobDetection.*; +import blobDetection.*; Capture cam; Capture isight; -BlobDetection theBlobDetection; -PImage img; -boolean newFrame=false; +BlobDetection theBlobDetection; +PImage img; +boolean newFrame=false; void setup() { size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 // If no device is specified, will just use the default. - - // To use another device (i.e. if the default device causes an error), + + // To use another device (i.e. if the default device causes an error), // list all available capture devices to the console to find your camera. String[] devices = Capture.list(); println(devices); println(devices[7]); - + // Change devices[0] to the proper index for your camera. isight = new Capture(this, width, height, devices[7]); // isight identically named to ext. usb camera? cam = new Capture(this, width, height, devices[7]);