I am working on my final for class and no matter WHAT I do I can't seem to figure this out! Can anyone out there PLEASE help? Your help would be GREATLY appreciated! I feel like I'm so close to figuring it out but just can't seem to get it...
So what I'm trying to do is combine both my equalizer code with the edge detection code. Instead of having the lines/pixels radiate off of the circle, I want it to come off of the edges of the body (vice versa = I'd like the edge detection/difference to show as an equalizer rather than random colored pixels).
Any sort of help or guidance would be GREATLY appreciated. I just want it to all be an amazing showcase where anyone can just come into the frame and do a little dance.
// CAMERA if (cam.available() == true) { prevFrame.copy(cam,0,0,cam.width,cam.height,0,0,cam.width,cam.height); // Before we read the new frame, we always save the previous frame for comparison! prevFrame.updatePixels(); cam.read(); image(cam, 0, 0);
// Begin loop to walk through every pixel for (int x = 0; x < cam.width; x ++ ) { for (int y = 0; y < cam.height; y ++ ) {
int loc = x + y*cam.width; // Step 1, what is the 1D pixel location color current = cam.pixels[loc]; // Step 2, what is the current color color previous = prevFrame.pixels[loc]; // Step 3, what is the previous color
// Step 5, How different are the colors? // If the color at that pixel has changed, then there is motion at that pixel. if (diff > threshold) { // If motion, display black pixels[loc] = color(random(255),random(255),random(255)); } else { // If not, display white pixels[loc] = color(40); } } } updatePixels();