android.hardware.Camera.startFaceDetection()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(237)

本文整理了Java中android.hardware.Camera.startFaceDetection()方法的一些代码示例,展示了Camera.startFaceDetection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.startFaceDetection()方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:startFaceDetection

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();
  }
}

相关文章