I was inspired by David Rokeby’s Sorting Daemon (2003), a project which involves heavy use of distortion over the images of people. My project involves a simple digital mechanism (a switch). When the switch is not pressed, the processing program simply projects the image of the person in front of my computer’s webcam. When the switch is pressed, however, the image in front of the camera is condensed into pixels. A koala is projected in front of this image, and the image randomly tints. When the switch is released, the tint remains over the webcam image and the webcam image switches orientation. My concept for the exercise was the idea of being transformed — the koala was chosen for a fun, cute effect, but I think this idea could be taken further, with the viewer “transformed” by some third party.
The most difficult part of the project was making the image switch orientation upon button release. I struggled with the help of the fellows to make a counter which would create a discrepancy every time the button was released (with this discrepancy then used to tell the program to change the orientation of the image).
If I were to continue working on the project, I would hope to make the orientation truly random instead of changing between one of two states every press.
Final product:
Processing code:
import processing.serial.*;
import processing.video.*;
Capture cam;
Serial myPort;
int buttonval;
int time = 0;
PImage img;
color clr;
int bp = 0;
int bp2;
int counter;
void setup() {
size(500, 500);
background(0);
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 0 ], 9600);
cam = new Capture(this, 640, 480);
cam.start();
img = loadImage(“koala.png”);
}
void draw() {
// to read the value from the Arduino
if (cam.available()) {
cam.read();
cam.loadPixels();
}
while ( myPort.available() > 0) {
buttonval = myPort.read();
}
if (buttonval == 0) {
pushMatrix();
translate(width, 0);
scale(-1, 1);
image(cam, 0, 0, width, height);
popMatrix();
if (counter % 2 == 0) {
pushMatrix();
translate(0, height);
scale(1, -1);
image(cam, 0, 0, width, height);
popMatrix();
}
}
if (buttonval == 1) {
int circleSize = 5;
int w = width;
int h = height;
for (int y = 0; y < h; y+=circleSize) {
for (int x = 0; x < w; x+=circleSize) {
int i = x + y*w;
fill( cam.pixels[i] );
ellipse(x, y, circleSize, circleSize);
}
}
image(img, width/4, height/4);
tint(random(255), random(255), random(255), 255);
}
bp = buttonval;
if (bp == 0 && bp2 == 1) {
counter++;
}
bp2 = bp;
println(counter);
//println(buttonval);//This prints out the values from Arduino
cam.updatePixels();
}