本文整理了Java中android.hardware.Camera.startFaceDetection()
方法的一些代码示例,展示了Camera.startFaceDetection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.startFaceDetection()
方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:startFaceDetection
暂无
代码示例来源:origin: pedroSG94/rtmp-rtsp-stream-client-java
public void enableFaceDetection(FaceDetectorCallback faceDetectorCallback) {
if (camera != null) {
this.faceDetectorCallback = faceDetectorCallback;
camera.setFaceDetectionListener(this);
camera.startFaceDetection();
}
}
代码示例来源:origin: blundell/WoodyFaceDetection
/**
* Use this to detect faces when you have a custom surface to display upon
*
* @param listener the {@link PreLollipopFaceDetectionCamera.Listener} for when faces are detected
* @param holder the {@link android.view.SurfaceHolder} to display upon
*/
@Override
public void initialise(Listener listener, SurfaceHolder holder) {
this.listener = listener;
try {
camera.stopPreview();
} catch (Exception swallow) {
// ignore: tried to stop a non-existent preview
}
try {
camera.setPreviewDisplay(holder);
camera.startPreview();
camera.setFaceDetectionListener(new OneShotFaceDetectionListener(this));
camera.startFaceDetection();
} catch (IOException e) {
this.listener.onFaceDetectionNonRecoverableError();
}
}
内容来源于网络,如有侵权,请联系作者删除!