2018
Language: English
Keywords: Poetry, Interaction, Live Feed, Face Recognition
Tech Details: Created in Processing 3.3, using OpenCV face tracking functions. Both of which would need to be installed on a desktop or laptop (with a webcam) to be read/performed. Code below can be copied and pasted:
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
PFont myfont;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);
myfont = createFont("courier",32);
smooth(4);
noStroke();
ellipseMode(CORNER);
background(0);
video = new Capture(this, 320, 240);
opencv = new OpenCV(this, 320, 240);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
video.start();
}
void draw() {
opencv.loadImage(video);
Rectangle[] faces = opencv.detect();
textSize(32);
textAlign(CENTER,CENTER);
pushMatrix();
{
scale(-2.0, 2.0);
}
popMatrix();
for (int i=0; i<faces.length; i++) {
fill(255, 255, 255);
text("to hold one feeling", width-(faces[i].x * 2), faces[i].y * 2, -faces[i].width * 2, faces[i].height * 2);
}
}
void captureEvent(Capture c) {
c.read();
}