Last night, Robert Nyman hosted yet another successful Geekmeet in Stockholm. I got one of the lightning talk slots and decided to skip my planned presentation and instead show some of my experiments with slit-scan photography. The presentation slides (in swedish) are available (8 Mb PDF) here. For more pictures see the set Slit-scan I over at flickr.
The processing code for time lapse captures through the iSight camera with a static centered slit looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| import processing.video.*;
Capture cameraSource;
int capwidth = 1280;
int capheight = 1024;
int outwidth = 1024;
int currentColumn = 0;
boolean keepDrawing = false; boolean isDone = false;
void setup() {
size(outwidth, capheight);
cameraSource = new Capture(this, capwidth, capheight, 30);
cameraSource.crop(capwidth/2, 0, 1, capheight);
}
void captureEvent(Capture cameraSource) {
if(cameraSource.available()) { cameraSource.read(); }
}
void keyPressed() {
keepDrawing = true; isDone = false;
}
void draw() {
if(keepDrawing) {
if(currentColumn<=width) {
image(cameraSource, currentColumn, 0); currentColumn++;
} else {
keepDrawing = false;
isDone = true;
saveImage();
currentColumn = 0;
}
}
}
void saveImage() { //yeah I know...
String d = String.valueOf(day());
String m = String.valueOf(month());
String y = String.valueOf(year());
String h = String.valueOf(hour());
String mn = String.valueOf(minute());
String s = String.valueOf(second());
save("scan" + y + m + d + "-" + h + mn + s + ".png");
}
|