We have build a face tracker in flash, that detects your face through your webcam and overlays it with a 3d object.
See it in action:
With better Blender 3D skills we would have made a Johnny Depp mask instead of a freaked out Gollum.
You can try it yourself HERE.
It’s an optimization of Quasimondos version of Ohtsuka Masakazu’s flash port of OpenCV.
What we have done to further optimize it is to use Flash10 specific functionality like using Vectors instead of Arrays. The original Othsuka/Quasimondo version was made for still images so we removed some calculations that became unnecessary while tracking a video. Another optimization was to look at casting between Int and Number (Int’s aren’t always faster if you need to cast them a lot for calculations).
- We will share the code here soon, we just have to prepare it for readability first.
- We will also make a more detailed description on how we did the optimization.
We used Away3D for the 3D rendering and wrote a really simple smoothing algorithm (the tracking results usually jumps around a lot).
For the mouth movement we simply track the sound level and open the mouth when it differs from the regular background noise.
Mario Klingemann
Oh my – did I really leave those arrays in there? I guess back then I was mainly concerned with removing the xml parsing and unzipping. Good job!
Su la maschera! « LiveXtention
[...] la maschera! Dal blog di Moment 77, un video esplicativo per un interessante esperimento: 3d e augmented reality con [...]
Rapport – Test av augmentet reality › Title
[...] Vår nya variant är ca 40-50% snabbare än den existerande. Den går att se och ladda hem kod på: http://www.moment77.se/blog/face-tracker-with-3d-overlay/ I den placerar vi ett låtsas-ansikte i 3D framför det riktiga ansiktet, samt läser av mikrfonen [...]
Martin Lindelöf
That mask looks like saladfingers more than gollum. If you want to I have the time and know blender3d, I could do a mask with animations and export as collada file.