Video of My Work
Code
ARDUINO
void setup() {
Serial.begin(9600);
}
void loop() {
int ad1 = analogRead(A0);
int ad2 = analogRead(A1);
int ad3 = analogRead(A2);
Serial.print(ad1);
Serial.print(“,”);
Serial.print(ad2);
Serial.print(“,”);
Serial.print(ad3);
Serial.println();
delay(100);
}
PROCESSING
PImage photo1;
import processing.serial.*;
String myString = null;
Serial myPort;
int NUM_OF_VALUES = 3;
int[] sensorValues;
void setup() {
size(600, 400);
photo1 = loadImage(“hokusai.jpg”);
setupSerial();
image(photo1, 0, 0);
}
void draw() {
updateSerial();
printArray(sensorValues);
int ad1 = sensorValues[0];
int ad2 = sensorValues[1];
int ad3 = sensorValues[2];
float x= map(ad1,0,1023,0,255);
float y= map(ad2,0,1023,0,255);
float z= map(ad3,0,1023,0,255);
tint(x,y,z);
image(photo1,0,0);
}
void setupSerial() {
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 28], 9600);
myPort.clear();
myString = myPort.readStringUntil( 10 );
myString = null;
sensorValues = new int[NUM_OF_VALUES];
}
void updateSerial() {
while (myPort.available() > 0) {
myString = myPort.readStringUntil( 10 );
if (myString != null) {
String[] serialInArray = split(trim(myString), “,”);
if (serialInArray.length == NUM_OF_VALUES) {
for (int i=0; i<serialInArray.length; i++) {
sensorValues[i] = int(serialInArray[i]);
}
}
}
}
}
Reflection
My work is to use three potentiometers to respectively control the R,G,B of the famous painting called The Great Wave created by Hokusai. For the Arduino part, I used what I learned in class to set three variable value parameters from three potentiometers. The Arduino part went smoothly. For the Processing part, I met some problems. First, I mistakenly put the code photo1 = loadImage(“hokusai.jpg”); to void draw() part so that every time I run the code, the picture didn’t show up. After I fixed this problem, I found that modifying the potentiometers doesn’t work for changing R,G,B of the picture. I read the code in Processing again and again. Finally, I found that I didn’t type the code image(photo1, 0, 0); in void setup() part. Then I modified it. It worked!
After reading Computer Vision for Artist and Designers, I feel like the author mainly focuses on the ability of computer vision to track human activity. According to the argument that “Techniques exist which can create realÂtime reports about people’s identities, locations, gestural movements, facial expressions, gait characteristics, gaze directions, and other characteristics,” in my opinion, my work does not fully conform to the technology of computer vision, because it only changes the nature of existing pictures through user input. It has no such technology for tracking people’s movements. The article inspires me that in the process of creating interactive artworks, we can add more computer functions related to tracking people’s activities to realize the innovation of traditional and modern art.