by adrianpark on June 23, 2011
So, moving on from thinking about the Max assignment, I set about figuring out how I might implement such a sketch and then seeing how I might do it in Max.
When learning new tools, I get bored very quickly just following tutorials through from start to finish. Instead, I usually start by quickly scanning through a few tutorials of varying complexity just to get a feel for what is possible. I’m not so concerned with actually understanding how to do things but more with what possibilites and limitations of the tool. I figure out the how later, when I know what I’m trying to achieve.
Back to the task, I very quickly figured it was natural to somehow use face detection and tracking to plot the viewing position relative to my virtual ‘window’. Added bonus: I’ve never done face detection/tracking before so new thing to learn. Yay!
Fellow course mate, Allessandro, pointed me in the direction of Jean-Marc Pelletier’s awesome cv.jit computer vision library for jitter. The library includes an object called cv.jit.faces and the object reference that comes with the download includes an example patch. The documentation states that the object’s output is a “4-plane single row-32″. This, I eventually figured out, is a matrix describing the x and y positions of the top left and bottom right corners of a rectangular bounding box of any face it finds. Once I’d figured out how to grab the first face in the list of faces it finds, I unpacked these coordinates and spat them out as individual send messages to be used elsewhere.
Having tried it out, I was satisfied the result was interesting enough to present in the final Doing exhibition but decided I wanted to work with the implementation and aesthetics a bit more and explore how they might better reflect the theory that had originally led to the idea. That’s the topic of the next post.
Below are a few screen shots of the sketch in action. As I was working on it, I noticed the nice bit of serendipity that, if I left gaps between my pwindows, it created the archetypal window with 4 panes of glass!
Note that the webcam feed is reversed so when my head appears on the right in the image, I’m actually leaning left. I’ve included little diagrams to show my view in relationship to the virtual window.