简体   繁体   English

Nexus 4,Nexus 7,Samsung Galaxy 2的相机面部检测getMaxNumDetectedFaces返回0

[英]Camera face detection getMaxNumDetectedFaces returns 0 for Nexus 4, Nexus 7, Samsung Galaxy 2

I'm trying to get face detection working in live preview mode using the hardware-based Camera.faceDetectionListener new in ICS. 我正在尝试使用ICS中基于硬件的Camera.faceDetectionListener在实时预览模式下进行人脸检测。 I have tried with Nexus 4, Nexus 7, and a Samsung Galaxy 10.1 tablet and ALL of these devices return 0 for the front camera when I call getMaxNumDetectedFaces. 我尝试使用Nexus 4,Nexus 7和Samsung Galaxy 10.1平板电脑,当我调用getMaxNumDetectedFaces时,所有这些设备的前置摄像头都返回0。 All of the devices support face unlock, though, so I don't understand why none of them seem to support face detection. 但是,所有设备都支持面部解锁,因此我不明白为什么它们似乎都不支持面部检测。 Has anyone got this working with one of these devices? 有人使用这些设备之一工作过吗?

Supported starting with API 14 (ICS), getMaxNumDetectedFaces returns the max length of the array that contains the results of camera face detection after it is started with startFaceDetection. 从API 14(ICS)开始受支持, getMaxNumDetectedFaces返回以startFaceDetection启动后包含相机面部检测结果的数组的最大长度。 If the value returned is 0, it indicates that the device does not support this method of face detection. 如果返回值为0,则表明设备不支持此面部检测方法。 In this case, face detection must be implemented by some other means (eg, using FaceDetector available since API 1). 在这种情况下,必须通过其他某种方式来实现面部检测(例如,使用自API 1起可用的FaceDetector )。

I checked the value returned by getMaxNumDetectedFaces for both front and back cameras in a few devices: 我检查了一些设备中前后摄像头的getMaxNumDetectedFaces返回的值:

  • Nexus 4: returns 2 for both cameras. Nexus 4:两个相机都返回2。
  • Nexus 5: returns a very large number (5308421) for both cameras. Nexus 5:两个相机都返回非常大的数字(5308421)。
  • Nexus 7: returns 0 for both cameras. Nexus 7:两个相机均返回0。
  • Nexus 10: returns 16 for both cameras Nexus 10:两个相机都返回16
  • Sony Xperia Z1: returns 5 for both cameras. Sony Xperia Z1:两部相机均返回5。

In summary, OEM support for camera face detection is hit and miss. 总而言之,OEM对相机面部检测的支持屡见不鲜。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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