i am fighting with the Camera API and its FaceDetectionListener.

When i check my both devices (S3 & galaxy nexus) with

Camera.Parameters params = mCamera.getParameters();
int faceCount = params.getMaxNumDetectedFaces();

the S3 returns a 5 and the Nexus returns a 35. Then when i try starting the Listener with

mCamera.startFaceDetection();

the S3 works fine (and is able to detect at least 12 faces at the same time), but the nexus gets an IllegalArgumentException -> invalid face detection type=0

I am a bit confused right now, why is the Nexus returning a 35 and at the same time it is refusing to start the faceDetectionListener. I have seen a few other posts, but they ain't explaining my issue. There, people say that i will get returned a 0 when my device can't support the hardware-faceDetection. So i am assuming that my Nexus is capable of doing it!!

Someone got an idea what is going wrong and how i can get the Nexus to detect faces via listener?

有帮助吗?

解决方案

I know this has remained unanswered for a while but I found a solution to this error from https://code.google.com/p/google-glass-api/issues/detail?id=282.

"I received this error when I started face detection before I started the camera preview. You should:

  1. Attach the listener
  2. Start the preview
  3. Start face detection"

This seemed to get rid of the error for now.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top