import processing.video.*; Capture myWebcam; int[] hist; void setup() { size(200, 200); hist = new int[256]; myWebcam = new Capture(this, "IIDC FireWire Video", width, height, 4); } void draw() { if (myWebcam.available()) { // Reads the new frame myWebcam.read(); } image(myWebcam, 0, 0); // Calculate the histogram for (int i=0; i maxval) { maxval = hist[i]; } } // Normalize the histogram to values between 0 and "height" for (int i=0; i