Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Underlying technique of Android's FaceDetector

I'm implementing a face tracker on Android, and as a literature study, would like to identify the underlying technique of Android's FaceDetector.

Simply put: I want to understand how the android.media.FaceDetector classifier works.

A brief Google search didn't yield anything informative, so I thought I'd take a look at the code.

By looking at the Java source code, FaceDetector.java, there isn't much to be learned: FaceDetector is simply a class that is provided the image dimensions and number of faces, then returns an array of faces.

The Android source contains the JNI code for this class. I followed through the function calls, where, reduced to the bare essentials, I learned:

  1. The "FaceFinder" is created in FaceFinder.c:75
  2. On line 90, bbs_MemSeg_alloc returns a btk_HFaceFinder object (which contains the function to actually find faces), essentially copying it the hsdkA->contextE.memTblE.espArrE array of the original btk_HSDK object initialized within initialize() (FaceDetector_jni.cpp:145) by btk_SDK_create()
  3. It appears that a maze of functions provide each other with pointers and instances of btk_HSDK, but nowhere can I find a concrete instantiation of sdk->contextE.memTblE.espArrE[0] that supposedly contains the magic.

What I have discovered, is a little clue: the JNI code references a FFTEm library that I can't find the source code for. By the looks of it, however, FFT is Fast Fourier Transform, which is probably used together with a pre-trained neural network. The only literature I can find that aligns with this theory is a paper by Ben-Yacoub et al.

I don't even really know if I'm set on the right path, so any suggestions at all would undoubtedly help.

Edit: I've added a +100 bounty for anybody who can give any insight.

like image 605
Paul Lammertsma Avatar asked Jul 28 '10 14:07

Paul Lammertsma


People also ask

Which method is used to detect the face in Android?

To detect faces in an image, create an InputImage object from either a Bitmap , media. Image , ByteBuffer , byte array, or a file on the device. Then, pass the InputImage object to the FaceDetector 's process method. For face detection, you should use an image with dimensions of at least 480x360 pixels.


2 Answers

I Found a couple of links too...Not sure if it would help you...

http://code.google.com/p/android-playground-erdao/source/browse/#svn/trunk/SnapFace

http://code.google.com/p/jjil/

http://benosteen.wordpress.com/2010/03/03/face-recognition-much-easier-than-expected/

like image 139
DeRagan Avatar answered Oct 19 '22 19:10

DeRagan


I'm on a phone, so can't respond extensively, but Google keywords "neven vision algorithm" pull up some useful papers...

Also, US patent 6222939 is related.

Possibly also some of the links on http://peterwilliams97.blogspot.com/2008/09/google-picasa-to-have-face-recognition.html might be handy...

like image 25
Stobor Avatar answered Oct 19 '22 21:10

Stobor