android-Camera.Face
来源:互联网 发布:环境大数据研究中心 编辑:程序博客网 时间:2024/06/06 18:40
Camera.Face
public static class Camera.Face
extends Object
This class was deprecated in API level 21.
We recommend using the new android.hardware.camera2
API for new applications.
Information about a face identified through camera face detection.
When face detection is used with a camera, the Camera.FaceDetectionListener
returns a list of face objects for use in focusing and metering.
See also:
Camera.FaceDetectionListener
Summary
Fields
public int
id
An unique id per face while the face is visible to the tracker.
publicPoint
leftEye
The coordinates of the center of the left eye.
publicPoint
mouth
The coordinates of the center of the mouth.
publicRect
rect
Bounds of the face.
publicPoint
rightEye
The coordinates of the center of the right eye.
public int
score
The confidence level for the detection of the face.
Public constructors
Camera.Face()
Create an empty face.
Inherited methods
java.lang.Object
Fields
id
int id
An unique id per face while the face is visible to the tracker. If the face leaves the field-of-view and comes back, it will get a new id. This is an optional field, may not be supported on all devices. If not supported, id will always be set to -1. The optional fields are supported as a set. Either they are all valid, or none of them are.
leftEye
Point leftEye
The coordinates of the center of the left eye. The coordinates are in the same space as the ones for rect
. This is an optional field, may not be supported on all devices. If not supported, the value will always be set to null. The optional fields are supported as a set. Either they are all valid, or none of them are.
mouth
Point mouth
The coordinates of the center of the mouth. The coordinates are in the same space as the ones for rect
. This is an optional field, may not be supported on all devices. If not supported, the value will always be set to null. The optional fields are supported as a set. Either they are all valid, or none of them are.
rect
Rect rect
Bounds of the face. (-1000, -1000) represents the top-left of the camera field of view, and (1000, 1000) represents the bottom-right of the field of view. For example, suppose the size of the viewfinder UI is 800x480. The rect passed from the driver is (-1000, -1000, 0, 0). The corresponding viewfinder rect should be (0, 0, 400, 240). It is guaranteed left < right and top < bottom. The coordinates can be smaller than -1000 or bigger than 1000. But at least one vertex will be within (-1000, -1000) and (1000, 1000).
The direction is relative to the sensor orientation, that is, what the sensor sees. The direction is not affected by the rotation or mirroring ofsetDisplayOrientation(int)
. The face bounding rectangle does not provide any information about face orientation.
Here is the matrix to convert driver coordinates to View coordinates in pixels.
Matrix matrix = new Matrix(); CameraInfo info = CameraHolder.instance().getCameraInfo()[cameraId]; // Need mirror for front camera. boolean mirror = (info.facing == CameraInfo.CAMERA_FACING_FRONT); matrix.setScale(mirror ? -1 : 1, 1); // This is the value for android.hardware.Camera.setDisplayOrientation. matrix.postRotate(displayOrientation); // Camera driver coordinates range from (-1000, -1000) to (1000, 1000). // UI coordinates range from (0, 0) to (width, height). matrix.postScale(view.getWidth() / 2000f, view.getHeight() / 2000f); matrix.postTranslate(view.getWidth() / 2f, view.getHeight() / 2f);
See also:
startFaceDetection()
rightEye
Point rightEye
The coordinates of the center of the right eye. The coordinates are in the same space as the ones for rect
.This is an optional field, may not be supported on all devices. If not supported, the value will always be set to null. The optional fields are supported as a set. Either they are all valid, or none of them are.
score
int score
The confidence level for the detection of the face. The range is 1 to 100. 100 is the highest confidence.
Depending on the device, even very low-confidence faces may be listed, so applications should filter out faces with low confidence, depending on the use case. For a typical point-and-shoot camera application that wishes to display rectangles around detected faces, filtering out faces with confidence less than 50 is recommended.
See also:
startFaceDetection()
Public constructors
Camera.Face
Camera.Face ()
Create an empty face.
- android-Camera.Face
- Camera Face Detection
- Camera Face Detection
- Face To Camera
- com.android.camera.Camera
- Android 4.0 Face Detection
- OpenCV android face detection
- Android camera
- Android Camera
- android camera
- android camera
- Android Camera
- Android Camera
- Android Camera
- Android:Camera
- android camera
- android camera
- android camera
- Android Studio设置鼠标悬停显示文档提示
- Google深度学习笔记 文本与序列的深度模型
- 基础总结篇之三:Activity的task相关
- 写给 Node.js 学徒的 7 个建议
- liger UI tree DATA添加值
- android-Camera.Face
- 学习设计模式前言
- FAQ-junit报错:class path resource
- MyBatis学习总结(六)——调用存储过程
- UITableview顶部视图缩放效果
- HTML属性
- 陀螺仪控制物体
- 【NOIP2013模拟联考5】军训
- 京城游戏人-Day2:一些 C# 与 Unity 基本常识