简体   繁体   English

在GalaxyNexus上使用faceDetection发行

[英]Issue on GalaxyNexus with faceDetection

i am fighting with the Camera API and its FaceDetectionListener. 我正在使用Camera API及其FaceDetectionListener。

When i check my both devices (S3 & galaxy nexus) with 当我检查我的两个设备(S3和银河系)时,

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 S3返回5,Nexus返回35。然后,当我尝试启动Listener时,

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 S3正常工作(并且能够同时检测至少12张脸),但联系获得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. 我现在有点困惑,为什么Nexus会返回35,同时又拒绝启动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. 有人说,当我的设备不支持hardware-faceDetection时,我将返回0。 So i am assuming that my Nexus is capable of doing it!! 因此,我假设Nexus有能力做到!!

Someone got an idea what is going wrong and how i can get the Nexus to detect faces via listener? 有人知道出了什么问题,如何让Nexus通过监听器检测人脸?

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 . 我知道这已经有一段时间没有答案了,但是我从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 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM