hello, community!
here I lean to you, hoping for some help, as this is really important for me, this should be a part of my BA diploma work in visual arts. I wanted to extract numbers form camera feed (in any way possible) and then assign them to certain characters to have a certain "language" of what's being captured. Here's what I humbly came up with, I have a few problems now, I can't manage to make the text not overlap, also, when I use "println()" instead of "print()" processing crashes. What's even more interesting, all processing sketches (if there are more of them open) crash as well.
I'm sincerely hoping that some of you might have some suggestions as the thing is becoming more and more pressing and stressful. Cheerio!
import processing.video.*;
Capture cam;
void setup() {
background(0);
size(600, 400);
//fill(255);
//frameRate(1);
cam = new Capture(this, 640, 480, 30);
cam.start();
//printArray(Capture.list());
}
void draw() {
fill(random(255));
background(0);
if (cam.available()) {
cam.read();
loadPixels();
for (int i=0; i<cam.pixels.length; i++) {
int n = int(brightness(cam.pixels[i]));
print(n);
//text(n, width/2, height/2);
String[] chars = {"love", "steam", "summation"};
text(chars[int(map(n, 0, 255, 0, 2))], width/2, 50);
text(n, 200, 80);
}
}
}