prevFrame.copy(video,0,0,video.width,video.height,0,0,video.width,video.height); // Before we read the new frame, we always save the previous frame for comparison!
prevFrame.updatePixels();
video.read();
}
//initialsing time
int sec = second(); // values from 0- 59
int m = minute(); // Values from 0 - 59
int h = hour(); // Values from 0 - 23
int d = day(); // Values from 1 - 31
int mo = month(); // Values from 1 - 12
int year = year(); // 2003, 2004, 2005, etc.
loadPixels();
video.loadPixels();
prevFrame.loadPixels();
// Begin loop to walk through every pixel
for (int x = 0; x < video.width; x ++ ) {
for (int y = 0; y < video.height; y ++ ) {
int loc = x + y*video.width; // Step 1, what is the 1D pixel location
color current = video.pixels[loc]; // Step 2, what is the current color
color previous = prevFrame.pixels[loc]; // Step 3, what is the previous color