Recitation 9: Media Controller by Ian (You Xu)

During this recitation, I intend to make a form of distortion of the capture of the live camera. Therefore, I referred to the caption sample code, processing website, and hooked up a potentiometer to achieve this goal.

  1. Green tint and low frame rate

When I was trying to run the sample code of capture, the screen has a green tint and refreshes very slow.

Green tint

Since the same code usually works in others’ devices, I was very confused. I thought it might because my computer – Surface Pro – has multiple cameras that work for different functions. I referred to the Processing website for capture: https://processing.org/reference/libraries/video/Capture.html and displayed all the available cameras for me to choose.

cameras

However, I tried nearly all of them, and no one worked. I looked it up online and found there is an “issue” under Processing’s Github repository https://github.com/processing/processing-video/issues/72. Many people who are using Surface with Windows 10 are encountering the same problem, and they do not have the solution to it. They believe it is the software problem of Windows 10 on Surface. Therefore, temporarily, I cannot fix it.

  1. Moving

By applying the sample code of capture to the serial communication sample code, I easily get the data from the potentiometer to the processing and use it to adjust the position of the capture. I use this step as a test of applying video function to serial communication. Again, one problem I found is that I need to be careful about the background refresh in the draw loop. This time, I do not want the previous images to leave on the screen, so I decided to draw the background in every loop.

  1. Scaling

I checked the capture mirror sample code and found out that it uses a “scale” function to make it the mirror effect. It gives me the insight to use the input from the potentiometer to control the scaling index. At first, I simply add “scale(sensorValues[0]);” to the code. However, I found out that the data from the potentiometer is ranging from 0 to 1023. It may scale the capture over 100 times bigger, which is too big.

Too big Scaling

Then, I realized I need to map it into a reasonable range first. I choose 0 to 2 here where 0 to 1 is shrinking, and 1 to 2 is amplification.

  1. Translate

However, this is still not what I expected. I want the capture always in the middle of the screen. Then I recalled another function “translate” that I used before to define that new origin. This required me to do math calculations. And I figure it out by geometric operation.

  1. Two dimensions

It works well. So, the final step is to hook up another potentiometer and make one of them scaling the x-axis and another to scale the y-axis.

2 potentiometer

Reflection

In the article “Computer Vision for Artists and Designers: Pedagogic Tools and Techniques for Novice Programmers” (Levin). it describes “new practitioners with an abundance of new application ideas, and the incorporation of computer vision techniques into the design vocabularies of novel artworks, games, home automation systems, and other areas.” I found two projects that use the capture function to build an authentic, interactive experience with users where they can see themselves. They are Cheese and LIMBOTIME. Therefore, I think to capture in the interactive project can increase the inclusiveness for the audience to engage their intention and communication with the project, which is correspondent to my definition of interaction that addresses the constant impact and inclusive communication environment. My work in this recitation would entertain the audience that they can see the distorted face in whatever dimension by interacting with the potentiometer. The only pity is the green tint bug that I am unable to fix.

Code: https://github.com/xuyou1999/InterLab_Fall_19/tree/master/Recitation_9_Code

Works Cited

Levin, Golan. “Computer vision for artists and designers: pedagogic tools and techniques for novice programmers.” AI & SOCIETY 20.4 (2006): 462-482.

Leave a Reply