1

I'm trying to develop a face recognition system for Android, and I opted to use Android 4 as it has the built in face detection API. I'm using a Samsung nexus s and despite being as up to date as possible and a really new model phone the .getMaxNumDetectedFaces() method returns 0.

Am I doing something wrong or can this phone actually just not detect faces? I thought the face detection would be included in the Android software and not the phone specific software.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
Daniel Jonker
  • 844
  • 10
  • 21

1 Answers1

5

There are two different face detection APIs in Android. FaceDetectorListener which depends on getMaxNumDetectedFaces() is hardware dependent so it might not be enabled on phones even if they run the latest version of Android. FaceDetector on the other hand runs in software and is supported since Android 1 so you might try that. Another option is to install OpenCV for Android.

See also, the answers on this question: Android face detection MaxNumDetectedFaces

Community
  • 1
  • 1
Christian
  • 1,830
  • 15
  • 26
  • I will try that thanks. Is OpenCV for Android a ported version of OpenCV? because what I am doing at the moment is importing the c++ OpenCV library as a native library – Daniel Jonker Aug 31 '12 at 01:18
  • 1
    Yeah, it is ported by the OpenCV team specifically for Android. A co-worker is running it and it looked pretty fast. This doesn't help you but apparently if you are running it on a Nexus 7 or Galaxy Nexus it uses hardware acceleration... – Christian Aug 31 '12 at 10:53
  • that is pretty cool, I will have to look at upgrading my app to use it in the future – Daniel Jonker Sep 01 '12 at 03:47