0
这是我的code on gistNexus 5 Camera.Face对象为空?
此相机应用是遵循Android Official Guide
我的设备是Nexus 5上与kikat 4.4.2
@Override
public void onFaceDetection(Camera.Face[] faces, Camera camera) {
if (faces.length > 0){
Camera.Face f = faces[0];
Log.v(TAG, ("Detected" + faces.length + "faces,the ID of first face is:" + f.id));
Log.v(TAG, "leftEye : " + f.leftEye);
Log.v(TAG, "mouth : " + f.mouth);
Log.v(TAG, "rect : " + f.rect);
Log.v(TAG, "rightEye: " + f.rightEye);
mCamera.stopFaceDetection();
}
}
以上时检测到人脸的代码的输出是:
Detected 1 faces,the ID of first face is:-1
FaceActivity﹕ leftEye : null
FaceActivity﹕ mouth : null
FaceActivity﹕ rect : Rect(-393, 356 - -213, 676)
FaceActivity﹕ rightEye: null
所以,我想知道我的Nexus 5是否支持FaceDetect?如果不是,它怎么可能实现屏幕锁定与面部解锁?
'Nexus 5 with kikat 4.3.2' ?????你的意思是带有'kikat 4.4.2'的Nexus 5? – Kedarnath
我很抱歉输入错误...但为什么我的问题被拒绝了? – gonjay
我没有downvote你的问题。有人做到了。 – Kedarnath