3

I'm building an android camera app, and using the FaceDetectionListener. My app has no problems on XperiaZ - LgoptimusBlack- GalaxyNexus4 and some other devices. But with the Google Nexus 7 it gave's me an error:

    java.lang.IllegalArgumentException: invalid face detection type=0

When i call

   params.getMaxNumDetectedFaces()

it gave's me 0 that means that my camera hardware can recognize 0 faces during the preview with the FaceDetectionListener. I've tried to use the FaceUnlocker of the Nexus7, and it works perfectly , that means that it's not a camera hardware. I googled about it and read the same problem without any answer. I've tried some internet samples with the facedetection, but it's the same problem on the Nexus7!!!

bob
  • 31
  • 4
  • mine is returning 35 faces for the galaxy nexus. though it is leading to the same Exception... I guess it has something to do with the order of initialising components. – bofredo Nov 04 '13 at 15:57

1 Answers1

0

It's unfortunately a Platform issue. Adding try{ }catch( ){ } blocks won't work. Certain devices may simply require a SW upgrade to get fixes.

In the meantime, for those devices not having platform fixes yet you may want to wrap the FaceDetector API: http://developer.android.com/reference/android/media/FaceDetector.html

(Bitmap based YES but can work out the task to identify the location of a face though).

Eduardo Gomez
  • 425
  • 3
  • 12