Reflection on My Essay
In this recitation, the project I created is to use the potentiometer to control the speed of the videos presented in Processing. This interaction is fairly simple from the surface. However, this interaction can be a initial step of some really complicated projects of “Computer Vision”. In Golan Levin’s article, he referred to “Computer Vision” as “a broad class of algorithms that allow computers to make intelligent assertions about digital images and videos”. The most representative example of “Computer Vision” in the contemporary world, as mentioned in the article, is the tracking of human behaviors, including facial expressions, verbal language and body language. Then, the quantitative variables taken from the human behaviors are intellectually identified and processed by the computers in order to achieve multiple functions and generate innovative interactions. My recitation project also contains this process. The behaviors of mine controlling the potentiometer create changes of variables that can lead to the outcome of the changing of certain parameters in the visual representations(here is the speed of the video). The similarity between the definition of “Computer vision” and my project is that the visual representations on the computers respond to human behaviors. The difference is that for those typical example of “Computer Vision” like tracking, the computer continuously respond to human behavior with autonomy and without the intervene of human beings. While in my project, the computer will not respond until you actively engage in the computational system (here the linkage is the potentiometer, which can be seen as a appetix of the system). Thus, as I illustrated, my project is the initial and primitive model of the “Computer Vision”.
This article inspired me a lot for my final projects. Before reading that, I didn’t realize that the direct identification of human behaviors without the assistance of medium, such as keyboard, mouse or joystick can be that difficult. This inspired me to think more about the distinctions between human and computers with a focus on the huge differences of language and ways of expressions. For my final project, I planned to use mouse and keyboard as the major equipment for conducting interaction. After reading this article, now I am thinking about a more direct and thus more interactive way of interaction between my projects and users. I will keep on figuring a better solution out in the future three weeks.
Codes of My Project
Code for Arduino:
void setup() {
Serial.begin(9600);
}
void loop() {
int sensor1 = analogRead(A0);
// keep this format
Serial.print(sensor1);
//Serial.print(“,”); // put comma between sensor values
Serial.println(); // add linefeed after sending the last sensor value
// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(100);
}
Code for Processing:
import processing.serial.*;
import processing.video.*;
Movie myMovie;
String myString = null;
Serial myPort;
int NUM_OF_VALUES = 1; /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
int[] sensorValues; /** this array stores values from Arduino **/
void setup() {
background(0);
size(480, 480);
myMovie = new Movie(this, “1.mp4”);
myMovie.loop();
setupSerial();
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw() {
updateSerial();
printArray(sensorValues);
// use the values like this!
// sensorValues[0]
// add your code
image(myMovie, 0, 0);
float newSpeed = map(sensorValues[0], 0, 1023, 0.1, 5);
myMovie.speed(newSpeed);
//
}
void setupSerial() {
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 7 ], 9600);
// WARNING!
// You will definitely get an error here.
// Change the PORT_INDEX to 0 and try running it again.
// And then, check the list of the ports,
// find the port “/dev/cu.usbmodem—-” or “/dev/tty.usbmodem—-”
// and replace PORT_INDEX above with the index number of the port.
myPort.clear();
// Throw out the first reading,
// in case we started reading in the middle of a string from the sender.
myString = myPort.readStringUntil( 10 ); // 10 = ‘\n’ Linefeed in ASCII
myString = null;
sensorValues = new int[NUM_OF_VALUES];
}
void updateSerial() {
while (myPort.available() > 0) {
myString = myPort.readStringUntil( 10 ); // 10 = ‘\n’ Linefeed in ASCII
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]);
}
}
}
}
}