What is Skin Detector
Skin Detector is an attempt at writing a vector accelerated (both altivec and SSE) algorithm to detect human faces based on well known properties of the human skin.

First build

Pasted Graphic 3

It is based on the assumption that human skin fits a color, hue and saturation envelope which varies little across multiple races. While there are many other approaches to this subject, such as template matching or feature detection, the sole purpose of this project was to implement the detection algorithm in vector accelerated code. I hope to have the time to improve it with features such as eye, mouth and nose detection inside a human-skin candidate area to determine whether a human face is present. This, combined with a face vector template database, could allow subject identification across a variety of orientations.

Can i check it out?
Sure, you can download the sandbox here, but be advised that several light balancing and camera gain compensations are hardcoded, so you may not be able to see it's magic.

The next sandbox will have scrollers to adjust what should be adjusted and auto compenations for what should not be adjusted. Untill that happens, you'll just have to wait.

See it in action

Picture 3 Picture 1
Left: PowerBook Ti 1GHz and QuickCam 4000 / Right: iMac G5 20" and built-in iSight
(First tech preview - download version - uses all masks except for HE)

1) Click here - Download tech preview. Manually adjust threshold values to match skin. Auto-calibration was added after this compile.
2) Click here - First attempt at locking my skin tone under artificial light.
3) Click here - Using offscreen blur, erode and pixellate masks to improve tracking. Shaved hair and face :)

What about the source
The source is a mess. It's not fully documented nor properly segmented into classes and selectors. Most of the altivec stuff is NOT packed in a separate library of utilities (such as vector accelerated arc-tangents, base-10 and natural logarithms). I do plan on releasing the source but only when i get it cleaned up.

What technologies does it use?
Cocoa, Objective-C and plain old C. It used the Accelerate framework which provides a common API to both SSE (Intel) and Altivec (PowerPC) SIMD units. I haven't figured out if all of the framework's functions are available in both units or if some of them are exclusive to either unit, because i haven't had the time to read the docs and i don't have an Intel machine with a video grabber and a legit OS X to test if my code runs on SSE.

Beware: This application does NOT CHECK for a vector unit when lauched. It assumes there is one.
UPDATE: Optimized algorithm to run on 70% CPU load on PPC G4@1Ghz. No need for Vector unit for now!