I’ve been working on developing a method for automatic head-pose tracking, and along the way have come to model facial appearances. I start by initializing a facial bounding box using the Viola-Jones detector, a well known and robust detector used for training objects. This allows me to centralize the face. Once I know where the 2D plane of the face is in an image, I can register an Active Shape Model like so:
After multiple views of the possible appearance variations of my face, including slight rotations, I construct an appearance model.
The idea I am working with is using the first components of variations of this appearance model for determining pose. Here I show the first two basis vectors and the images they reconstruct:
As you may notice, these two basis vectors very neatly encode rotation. By looking at the eigenvalues of the model, you can also interpret pose.
Archived entries for face tracking
Facial Appearance Modeling/Tracking
6DOF Head Tracking
The following demo works with SeeingMachines FaceAPI in openFrameworks controlling a Mario avatar. It also has some really poor gesture recognition (and learning but it’s not shown here), though a threshold on the rotation DOF would have produced better results for the simple task of looking up/down left/right gestures.
interfacing seeingmachines faceapi with openFrameworks to control a 3D mario avatar
This is just with the non-commercial license. The full commercial license (~$3000?) gives you access to lip/mouth tracking and eye-brows, as well as much more flexibility in how to use their api with different/multiple cameras and accessing image data.
Of course, there are other initiatives at producing similar results. Mutual information based template trackers, for instance, seem to be state-of-art. Take a look at recent work by Panin and Knoll using OpenTL:
I imagine a lot of people would like this technology.
“Memory” Video @ AVAF 2010
Please rate, share, and comment!
‘Memory’ is an augmented installation of a neural network by Parag K Mital & Agelos Papadakis.
hand blown glass, galvanized metal chain, projection, cameras; 1.5m x 2.5m x 3m
Ghostly images of faces appear as recorded movie clips within neural-shaped hand-blown glass pieces. As one begins to look at the neurons, they notice the faces as their own, trapped as disparate memories of a neural network.
Filmed and installed for the Athens Video Art Festival in May 2010 in Technopolis, Athens, Greece. The venue is a disused gas factory converted art space.
Also seen at Kinetica Art Fair, Ambika P3, London, UK, 2010; Passing Through Exhibition, James Taylor Gallery, London, UK, 2009; Interact, Lauriston Castle, Edinburgh, UK, 2009.
I’ve recently finished up a project in collaboration with a Glass Artist, Agelos Papadakis. We built a structure of 25 glass neurons the size of a face and chainded them together in a 3x3x5 meter sculpture. We had 2 cameras hidden in the piece tracking peoples faces and a projector then creating visualizations of the recorded faces resembling something like a cloud of neurons firing in different patterns. We presented it first in Edinburgh at Lauriston Castle’s Glasshouse, and then at the Passing Through exhibit in the James Taylor Gallery in Hackney: http://jamestaylorgallery.co.uk/exhibitions/2009/03/passing-through.html
It’s a bit tricky trying to film the piece since it uses projection onto glass. Sadly I’m left with only a few images that try to portray what went on.
Here’s the code, http://ccrma.stanford.edu/~pkmital/share/Memory.zip It makes use of the openframeworks library so you will need to be familiar with how to setup an XCode project with the openframeworks library if you plan on using it.
The original idea was to use glass balls so that’s why all the code says glassBalls instead of say glassNeurons. If you manage to get it running, press ‘d’ to see the live video input. As it collects faces, it fills up the image buffers with each “glassBalls”. Once all the glassBalls are loaded with images of faces, then the visualization begins. Neurons will “fire” and brightness values of each neuron will go up and down based on Gaussian functions and these values are sent to the brightness shader.
It was a bit of a sculptural challenge placing all the glass pieces within view of the projector, avoiding any other glass pieces or chains in the line of sight of it, having it fit within our view of what we wanted, and also within the amount of time we had. We did the projection mapping by just creating the object with a bounding box. Once you moused over an image of a person’s face, you could drag it around, use ‘-’, ‘=’, ‘_’, or ‘+’ to resize it. I used a text file to store (‘w’) and read (‘r’) the positions of the faces in case I had to reload the program. I think memo has some MSAInteractiveObject class now which would be 1000x nicer to use.
Just a note as well, I wrote this against of573. I also ended up extending ofxCvColorImage with a few functions so I’ve just included all of ofxCv* files in the project. There may very well be other functions that I’ve edited and forgotten about so please let me know if you have any problems with it. Have a look through and please let me know what you think!
Working with Agelos Papadakis, this installation will investigate interactivity, agency, and memory within an installation space. Can an art piece evolve and contain the memory of its participants? Is reaction simply a side-effect of art or *the* effect?
More to come… Exhibit in late April.
OpenCV with Processing using Eclipse
My students for the Digital Media Studio Project here at the University of Edinburgh have asked me to present a small workshop on using some aspects of the Processing.org environment. I’ve worked up something and thought I could share it online as well. I’ve setup a google code repository with the necessary files. The code simply highlights what you could find throughout the Processing.org discourse and the OpenCV example files though is more thoroughly commented and organized.
A few notes, I really dislike the Processing IDE. Maybe it’s just because I’ve used IDE’s like VS, Netbeans, Eclipse, XCode etc… and I haven’t really played with Processing enough to have a well founded basis in the functions available. I believe going through a few extra steps to setup an IDE like Eclipse makes the task of programming much easier though at the cost of a bulky editor that may not be so easy to setup at first…
Eclipse is an (Integrated Development Environment) IDE for many coding languages, one of which is Java. Some advantages:
- code completion – automatically see possible choices for all members belonging to a class definition, such as functions and their arguments.
- javadocs – javadoc is a formatting for writing code comments. by following a simple format, javadocs can produce a nice html document outlining all the functions/members/arguments/what to expect etc… – while coding, having the ability to see javadocs is invaluable as memorizing all of the members of a class is often not ideal.
- browsing libraries – along the lines of javadocs, being able to see the definitions of a class are much easier than having to memorize all the functions belonging to something like processing.core.PImage – and with the eclipse environment, you can view the javadocs along with the libraries.
- debug – step through your program and view the stack trace, threads, and all the messy hex numbers.
The biggest disadvantages are that it takes time to setup a project, include files, and write the class definitions, none of which you will have to do in the Processing IDE. Luckily, there is a nice tutorial for setting up Eclipse to use the Processing libraries: http://processing.org/learning/tutorials/eclipse/ – I recommend going through this thoroughly.
OpenCV is an open source, cross-platform library developed by Intel and used widely by researchers in fields such as medical imaging, artificial intelligence, and interactive art. There is a nice port available that includes a minimal though nice set of functions for the Processing and Java environment: http://ubaa.net/shared/processing/opencv/ – This page provides detailed instructions and very nice documentation on setting up the OpenCV environment. If you are on OS X and are looking for the Java Extensions folder, try the folder: /Library/Java/Extensions.