Friday, November 25, 2005



[this workshop was taken by Ian, and we discussed about narrative minimalism. less is more? as well as he introduced some books, artists, software and websites. on the other hand, i finished the mini assignment for last week. i gave variables which let the user to change the x,y position of the image, and let the user to change the R-G-B values. below is the code and screenshort.]

PImage a;
int x;
int y;
int Rvalue;
int Gvalue;
int Bvalue;

void setup()
size(1200, 900);
a = loadImage("Screen.jpg");
x = 200;
y = 50;
Rvalue = 100;
Gvalue = 200;
Bvalue = 204;

tint(Rvalue, Gvalue, Bvalue);
image(a, x, y);



[this week i basically figured out the slow video problem of my Processing programme. as well as, i made it track the reddest pixel rather then the brightest pixel and depends on what color is being track, the "dot" will fill in that specific color. so, up to this moment, i can track color by type in a color value to the programme. but i still need to improve it to track colors automatically, i will make it track red, green and blue. and i need to improve it to draw continuous lines when i move the tracked objects...]

// Processing code


// Variable for capture device
Capture video;
color trackColor;

void setup()
size(320 , 240);

// Using the default capture device
video = new Capture(this, 320, 240, 12);
trackColor = color(255,0,0); // Start off tracking for red
stroke(trackColor); //color of the stroke or use noStroke()


void captureEvent(Capture camera)

void draw()


// Draw the video image on the background
// Local variables to track the color
float closestDiff = 500.0f;
int closestX = 0;
int closestY = 0;
// Begin loop to walk through every pixel
for ( int x = 0; x < video.width; x++) {
for ( int y = 0; y < video.height; y++) {
int loc = x + y*video.width;
// What is current color
color currentColor = video.pixels[loc];
float r1 = red(currentColor); float g1 = green(currentColor); float b1 = blue(currentColor);
float r2 = red(trackColor); float g2 = green(trackColor); float b2 = blue(trackColor);
// Using euclidean distance to compare colors
float d = dist(r1,g1,b1,r2,g2,b2);
// If current color is more similar to tracked color than
// closest color, save current location and current difference
if (d < closestDiff) {
closestDiff = d;
closestX = x;
closestY = y;

// Draw a circle at the tracked pixel
//End of code

Sunday, November 20, 2005



[today's workshop we talked about interactive arts and different artists works, like group of four artists based in London called Blast Theory, Char Davies, American installation artist Bruce Nauman etc. but personally i am very interest in Daniel Rozin's works, he is basically an interactive artist and most of his work contain video camera. and one of his work called Easel, which is using 3 video camera as a source, then you are able to select different cameras and start painting the same visual on the canvas by a back projection. check this movie clip to find out more ||]

[Easel - 1998]

[Shaking Time Mirror- 2005]

[as well as, Richard demonstrate some basic code of Processing which is really helpful and we were required to finish a mini-assignment for next week. which is to capture a photo by the webcam and then write a programme which is able to change its position and tint.]


[i found an example in, which is able to track the brightest pixel from the webcam and also able to change the trackColor by a mouse click. however, the image in the output window is a bit slow which is quite strange. but i think this is a really good demo as my starting point for the project. in this moment i am still studying how it works, especially the array which gone through all the pixels one by one, because of i will need to know the information it takes and the value, that will help me to develpoe it into what i need. after that, i will start writing my own to track color rather then brightness, and see how can i draw lines by moving the tracked object around.]

Saturday, November 12, 2005



[Paul demostrate how to connect the BX with computer by Processing and how to change the color in the output window by changing the variable resistor. however, because of going to Reading, so i cannot participate the whole workshop]
[code of Processing]

import processing.serial.*;

String buff = "";
int val = 0;
int NEWLINE = 10;
PImage b;

Serial port;

void setup()
size(400, 400);

// Print a list in case COM1 doesn't work out
println("Available serial ports:");

//port = new Serial(this, "COM1", 19200);
// Uses the first available port
port = new Serial(this, Serial.list()[0], 19200);

void draw()
while (port.available() > 0) {
fill(80, 80, 80);
ellipse(val, val, 50, 50);
b = loadImage("trial.jpg");
image(b, 0, val, width, val);


void serialEvent(int serial)
// If the variable "serial" is not equal to the value for
// a new line, add the value to the variable "buff". If the
// value "serial" is equal to the value for a new line,
// save the value of the buffer into the variable "val".
if(serial != NEWLINE) {
buff += char(serial);
} else {
buff = buff.substring(0, buff.length()-1);
// Parse the String into an integer
val = Integer.parseInt(buff)/4;
// Clear the value of "buff"
buff = "";

[code of BX-24]

Sub main()
call delay(0.5) ' start with half-second delay
' returns values between 0 and 1023
' the variable resistor is in pin 18
debug.print cstr(getADC(18))
call delay(0.1) ' one-tenth second delay
end sub


[ Processing Beta 093 was installed this week, i am spending time to play with the examples and trying to understand the codes... i found some codes like //import*;// and //void captureEvent(Capture camera)//, which should be useful for my programme.]

Saturday, November 05, 2005



[assignment 1 presentation: basically my idea came from last year, and i futher develpoed it. it is called || Digiti ||. which is a combine of digital technology and graffiti, which uses a LED, webcam, a programme by Director extra TrackThemColors or Webcam Xtra and a projector. this project is going to read, reconize and draw lines when i move the LED light in front of a little semi-transparent panel, which is also place in front of the webcam, then the webcam will track the movement of the LED and convert it into lines, finally, the projector will project the line drawing back onto the panel, or any other buildings or landmarks. after the presentation, i was recommanded to use Processing, so the next step will be start playing with Processing, a free and open source environment.]


[i did a deeper research on Dan O'Sullivan and Tom Igoe's Physical Computing. beside of the information about micro-controllers and how to build your own circuit to connect your computer and the BX-24, i also found something related to my project. which is || video tracking || and || video by pixel ||. i found it really useful, because i know more about how a webcam work and how the computer see objects under different light conditions. basically, the idea of tracking motion on a computer using a video camera is still not fully perfect, because it is talking about construct vision for a computer by writing a programme. however, the human brain is able to analysis colors, edges, depth under different light sources. for example, we recognize a red danger sign in the daytime and at night, it is the same sign for us. but, for a computer, it will recognize it as a different objects, because the color is changed due to the light conditions.]