android-Camera.Face

来源:互联网 发布:环境大数据研究中心 编辑:程序博客网 时间:2024/06/06 18:40

Camera.Face

public static class Camera.Face 
extends Object 

java.lang.Object   ↳android.hardware.Camera.Face

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 intid

An unique id per face while the face is visible to the tracker.

publicPointleftEye

The coordinates of the center of the left eye.

publicPointmouth

The coordinates of the center of the mouth.

publicRectrect

Bounds of the face.

publicPointrightEye

The coordinates of the center of the right eye.

public intscore

The confidence level for the detection of the face.

Public constructors

Camera.Face()

Create an empty face.

Inherited methods

From class java.lang.Object

Fields


id

Added in API level 14
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

Added in API level 14
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

Added in API level 14
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

Added in API level 14
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

Added in API level 14
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

Added in API level 14
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

Added in API level 14
Camera.Face ()

Create an empty face.

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 2个月宝宝厌食怎么办 宝宝吃母乳不长体重怎么办 9个月宝宝不长牙怎么办 3个月宝宝过胖怎么办 宝宝长的很慢怎么办 想一个月瘦20斤怎么办 山药弄胳膊上痒怎么办 手碰山药很痒怎么办 手摸了山药很痒怎么办 手切了山药很痒怎么办 山药弄的身上痒怎么办 疣迪去除疣体怎么办 尖锐湿庞出血了怎么办 尿道口周围烂了怎么办 尖锐湿庞复发了怎么办 宝宝脸上长湿疹怎么办如何治疗 孕妇得尖锐湿庞怎么办 痘痘留下的小坑怎么办 花洒固定座坏了怎么办 脚上起水泡烂了怎么办 月经期吃了芒果怎么办 月经量少又黑怎么办 来月经黑色的血怎么办 月经来的是黑色怎么办 来月经有血块是怎么办 月经又少又黑怎么办 来月经发黑又少怎么办 月经血发黑量少怎么办 做人流后肚子胀怎么办 怀孕见红了肚子不痛怎么办 月经来是黑色的怎么办 怀孕了长了痔疮怎么办 怀孕了有外痔疮怎么办 孕妇长痔疮很痛怎么办 孕9个月尿路感染怎么办 旁边有人尿不出来怎么办 外阴破皮了应该怎么办 脸上长脂肪粒怎么办怎么能消除 挤黑头留下的坑怎么办 长痘留下的坑怎么办 鼻子上留下黑印怎么办