Reputation: 5131
So I know that android Ice Cream Sandwich supports face detection. So i recently upgraded my asus transformer to a tablet that has face detection unlock enabled and that works great. Now when i go to write a program using face detection, when i try to find the max number of faces supported I always get 0 and my app always crashes when i try to begin tracking faces. Why is this if my tablet clearly supports face detection? Am i doing something wrong? The code I'm using to check if face detection is supported is posted below:
Camera.Parameters params = mCamera.getParameters();
System.out.println("Max num faces is!!!! :" + params.getMaxNumDetectedFaces());
And the full code I'm using can be found here: https://docs.google.com/file/d/0B2Nu5U2Cz81qZExGQ25sWVdRd21IOExUUTZsZzFoZw/edit
Upvotes: 2
Views: 2766
Reputation: 12367
Face detection is not face recognition. Face detection is done via something like Haar cascade and determines presence of faces in picture. This feature can be contained in android camera application, but must not - API is there but it says that it supports max 0 faces ( means, nothing, go away, we just satisfied inteface)
Face unlock works differently - it does not need to locate face, so it can use some pattern matching techniques to recognize it.
Here is reading pointer for face detection:
http://www.richardnichols.net/2011/01/java-facial-recognition-haar-cascade-with-jjil-guide/
And you can implement it yourself via camera preview feature even if you camera software sdoes not support this
Upvotes: 4