real-time face detection and identification experiment
For the final project in Learning Bit by Bit I chose to further explore face identification, since I felt I didn’t have enough chance to play with the technique in the lab. After going through quite a few ideas, I settled for one of the more simple ones – a system for real-time face detection and recognition that would give me a chance to evaluate the technique. I wanted to get a feel for the speed, accuracy, and sensitivity to environmental conditions of the algorithm as I was somewhat skeptical about it.
Since the system was going to work off of a live video feed, I figured Java/Processing might be a better tool for the job, and so I set out looking for a face identification system built in Java. I was glad to see that someone has apparently done the hard work for me and ported the same pyfaces code we worked with in the lab to java. The code still required a lot of tweaking to adapt it from being an offline command-line utility to something online I could work with. The rest of it was pretty straightforward – an OpenCV for detection and tracking, and Processing for everything else. I tried to match the area considered as face to the same area used in the sample photos.
After a little tweaking (moving the identification code to another thread) I got to play with the system a little bit. My main conclusion: its reliability is highly affected by environmental conditions, such as the background and lighting conditions. When everything is kept constant, however, the results aren’t bad. I haven’t methodically tested the system, but the feeling I got playing with it is that it could definitely work well enough for an art project, provided lighting conditions/background/angles are kept constant. Anything that requires high reliability would probably require looking into combining the eigenfaces with other algorithms.
The bar at the bottom is the confidence (= one minus the distance from the recognized face), and indeed when it fails to recognize a person the confidence is often low, but not always. Also, the picture I used here was not taken under the same lighting conditions etc. and so the success rate isn’t as high as it could have been. You can see that in the success screenshot I had to adjust the contrast/brightness of the video stream to recalibrate the program.
I’m not posting the source code as it’s a bit of a mess right now and I’m still working on it, but feel free to contact me if you want it right now!
final project proposal
For my mechanisms and living art final I’d like to build organically moving kinetic sculptures. To this end and in order to get away from the mechanical feeling that comes with motors, gears, and the like, I’ve decided to employ Flexinol (Nitinol brand name, also known as NiTi/muscle wire, a shape memory alloy [SMA]) as my actuator.
The first sculpture I intend to build is a helical, snake-like sculpture that will have mirrors for scales. These scales will be able to move in one (possibly two) dimension(s). By synchronizing the scales according to different rules, different patterns of movement and light could be created.
In effect, every scale is a self-contained unit consisting of a mirror mounted on a hinge (or some kind of a rod end bearing), to which two Flexinol wires are attached, close to the pivot point as to use the mechanical advantage of the lever in order to increase the range of motion of the mirror. Activating the wire will cause it to contract and pull that side of the mirror downwards, while activating the wire on the other side will reverse that action. This design is easily scalable by adding more wires to allow for more precise tilting action.
The second sculpture is a Buckyball/geodesic dome covered by a flexible polymer (perhaps vinyl/rubber?) . Inside every unit of the dome there will be a mechanism capable of driving an outwards protrusion motion of a rod, thereby creating a porcupine-like impression. The mechanism will consist of, again, a Flexinol wire, this time utilizing a right angle pull and a bias spring in order to triple the stroke length. When contracted, the wire will push the rod outwards and deform the elastic shell. Similarly to the previous sculpture, the combined action of many identical units will be used to create organic patterns of movement.
Here are some rough sketches… unfortunately the scanner was broken so here are some low quality pictures taken with my phone:
The schedule for the project is as follows: I will spend the coming week testing the two mechanisms and finalizing them, which will allow me to order parts and laser-cutting for the Buckyball and potentially also the scale units. The week after that will be dedicated to building, which will leave the final week for testing and troubleshooting. Other than the laser-cutting job(s), most of the components required are readily available or are already in my possession (e.g. Flexinol wire). I expect to budget to be less than $150 (excluding AMS laser-cutting fees).
turtles
Morgen and I presented our mechanisms midterm this week. We tried replicating terrestrial turtle locomotion using legos, which turned out to be harder than we expected. Check out Morgen’s post for the full coverage.
random
This week’s assignment for living art was to make something using randomness. I had a hard time figuring out this one. I toyed around with several ideas, among them implementing Chua’s Circuit and making a cool visualization out of it (didn’t work out because I was missing an inductor), and building a double pendulum (which someone has already done, and quite beautifully). Also, it turns out building a pendulum is NOT as easy as it looks.
Another idea I was toying around with was based on an insight I had about randomness the other day, that any complex enough pattern will seem random if you don’t know the algorithm behind it. To quote Wikipedia yet again:
To an observer who does not know the mechanism, a pseudorandom sequence is unpredictable.
That gave me an idea: make a game similar to the Wisconsin Card Sorting Test, with the rules being mappings between button presses and LEDs lighting up – that is, there will be different mappings (e.g. 1st button lights up 1st LED, 2nd lights 2nd and so on, versus 1st lights 4th, 2nd lights 3rd, and so on) that will be in effect for a limited (and random) time, and then change. I was interested to see whether people will recognize the mapping, and how long would it take them. However, I ended up doing something completely different having decided that this idea did not really require a physical manifestation and could’ve been just as effective as a Processing sketch. I decided to save that for another time, and came back to the quote.
If a sufficiently complex pattern seems random, does that mean that a sufficiently random pattern will seem complex, even planned or intelligent? To examine that, I built a small vehicle that behaved according to a set of simple rules:
- Rotate for a random number of milliseconds.
- Pause for a random number of milliseconds.
- If there is nothing in the way, go forward a random distance.
- If there’s an obstacle in the way and it can’t seem to escape it for a (random) period of time, go backwards a random distance.
- Repeat.
This was the last of several iterations of rules, and I’m pretty satisfied with how it turned out:
intellipods
This week’s assignment was to build a “finite state machine.” I worked on this one with Jason, Tamar and Adib, and we were having a hard time figuring out what to do without constraints. So after several hours of brainstorming (including a visit to a few galleries in Chelsea), we came up with a vague idea. Similar to Todd’s suggestion of each of us making a machine, we wanted to make a few separate state machines that can interact with each other, maybe each having a different number of states. We ended up with Intellipods ™, four pods that have an LED mounted on a disc that spins back and forth in response to signals. The signal is the light coming off another pod, detected by one or more light sensors pointed in different directions. The different pods interact within themselves in unexpected ways, having organic, almost living qualities. Lo and behold:
lego lab
For this week’s assignment for the Mechanisms class we had to play with lego, which is pretty awesome. Too bad almost all the kits are missing a lot of stuff. Anyhow, here are the results of several hours of Neil and I messing around:
rube goldberg egg breaker machine
Yeah, it’s sideways….






