PFont font;
import processing.video.*;
Capture video;
void setup() {
size(800, 600);
video = new Capture(this, width, height, 12);
font = loadFont (“Helvetica-25.vlw”);
noStroke();
background(0, 0, 0);
smooth();
}
void draw() {
if (video.available()) {
video.read();
image(video, 0, 0, width, height);
int colorX = 255;
int colorY = 255;
float closestColor = 10000;
video.loadPixels();
int index = 0;
for (int y = 0; y < video.height; y++) {
for (int x = 0; x < video.width; x++) {
color pixelValue = video.pixels[index];
float colorProximity = abs(red(pixelValue)-255)+abs(green(pixelValue)-0)+abs(blue(pixelValue)-0);
if (colorProximity < closestColor) {
closestColor = colorProximity;
closestColor=closestColor-10;
colorY = y;
colorX = x;
}
index++;
}
}
textFont(font, 25);
text(“MONEY”, colorX, colorY+20);
}
}

PFont font;import processing.video.*;
Capture video;
void setup() { size(800, 600); video = new Capture(this, width, height, 12); font = loadFont (“Helvetica-25.vlw”); noStroke(); background(0, 0, 0); smooth();}
void draw() { if (video.available()) {   video.read();   image(video, 0, 0, width, height);   int colorX = 255;   int colorY = 255;    float closestColor = 10000;    video.loadPixels();   int index = 0;   for (int y = 0; y < video.height; y++) {     for (int x = 0; x < video.width; x++) {       color pixelValue = video.pixels[index];       float colorProximity = abs(red(pixelValue)-255)+abs(green(pixelValue)-0)+abs(blue(pixelValue)-0);       if (colorProximity < closestColor) {         closestColor = colorProximity;         closestColor=closestColor-10;          colorY = y;         colorX = x;       }       index++;     }   }   textFont(font, 25);    text(“MONEY”, colorX, colorY+20);    } }

Advertisement