// Video Difference Engine // // Scott "Jerry" Lawrence // 2003-08-27 boolean newFrame = false; // was there a new frame? float[] prvframe = new float[320*240]; // the previous frame int thresh = 50; // difference threshhold float fadeval = 2/3; // how quickly the video fades // our initialization void setup() { size( 320, 240 ); // screen size noBackground(); // don't clear the backing store with each frame beginVideo( width, height, 30 ); // start up video capture // clear the previous frame color black = color( 0,0,0 ); for( int i=0 ; i= thresh ) { // blit over the pixels if they're above the threshhold pixels[i] = video.pixels[i]; } else { // fade out the ones that are stagnant. pixels[i] = color( red(pixels[i])*fadeval, green(pixels[i])*fadeval, blue(pixels[i])*fadeval ); } prvframe[i] = vidbrt; } newFrame = false; } }