Stay organized with collections
Save and categorize content based on your preferences.
FaceDetector.Face
public
class
FaceDetector.Face
extends Object
A Face contains all the information identifying the location
of a face in a bitmap.
Summary
Constants |
float |
CONFIDENCE_THRESHOLD
The minimum confidence factor of good face recognition
|
int |
EULER_X
The x-axis Euler angle of a face.
|
int |
EULER_Y
The y-axis Euler angle of a face.
|
int |
EULER_Z
The z-axis Euler angle of a face.
|
Public methods |
float
|
confidence()
Returns a confidence factor between 0 and 1.
|
float
|
eyesDistance()
Returns the distance between the eyes.
|
void
|
getMidPoint(PointF point)
Sets the position of the mid-point between the eyes.
|
float
|
pose(int euler)
Returns the face's pose.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
CONFIDENCE_THRESHOLD
public static final float CONFIDENCE_THRESHOLD
The minimum confidence factor of good face recognition
Constant Value:
0.4
EULER_X
public static final int EULER_X
The x-axis Euler angle of a face.
Constant Value:
0
(0x00000000)
EULER_Y
public static final int EULER_Y
The y-axis Euler angle of a face.
Constant Value:
1
(0x00000001)
EULER_Z
public static final int EULER_Z
The z-axis Euler angle of a face.
Constant Value:
2
(0x00000002)
Public methods
confidence
public float confidence ()
Returns a confidence factor between 0 and 1. This indicates how
certain what has been found is actually a face. A confidence
factor above 0.3 is usually good enough.
eyesDistance
public float eyesDistance ()
Returns the distance between the eyes.
getMidPoint
public void getMidPoint (PointF point)
Sets the position of the mid-point between the eyes.
Parameters |
point |
PointF : the PointF coordinates (float values) of the
face's mid-point |
pose
public float pose (int euler)
Returns the face's pose. That is, the rotations around either
the X, Y or Z axis (the positions in 3-dimensional Euclidean space).
Parameters |
euler |
int : the Euler axis to retrieve an angle from
(EULER_X, EULER_Y or
EULER_Z) |
Returns |
float |
the Euler angle of the of the face, for the given axis |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# FaceDetector.Face\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nFaceDetector.Face\n=================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/FaceDetector.Face \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nclass\nFaceDetector.Face\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.media.FaceDetector.Face |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA Face contains all the information identifying the location\nof a face in a bitmap.\n\nSummary\n-------\n\n| ### Constants ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `float` | [CONFIDENCE_THRESHOLD](/reference/android/media/FaceDetector.Face#CONFIDENCE_THRESHOLD) The minimum confidence factor of good face recognition |\n| `int` | [EULER_X](/reference/android/media/FaceDetector.Face#EULER_X) The x-axis Euler angle of a face. |\n| `int` | [EULER_Y](/reference/android/media/FaceDetector.Face#EULER_Y) The y-axis Euler angle of a face. |\n| `int` | [EULER_Z](/reference/android/media/FaceDetector.Face#EULER_Z) The z-axis Euler angle of a face. |\n\n| ### Public methods ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` float` | ` `[confidence](/reference/android/media/FaceDetector.Face#confidence())`() ` Returns a confidence factor between 0 and 1. |\n| ` float` | ` `[eyesDistance](/reference/android/media/FaceDetector.Face#eyesDistance())`() ` Returns the distance between the eyes. |\n| ` void` | ` `[getMidPoint](/reference/android/media/FaceDetector.Face#getMidPoint(android.graphics.PointF))`(`[PointF](/reference/android/graphics/PointF)` point) ` Sets the position of the mid-point between the eyes. |\n| ` float` | ` `[pose](/reference/android/media/FaceDetector.Face#pose(int))`(int euler) ` Returns the face's pose. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### CONFIDENCE_THRESHOLD\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final float CONFIDENCE_THRESHOLD\n```\n\nThe minimum confidence factor of good face recognition\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0.4\n\n\n### EULER_X\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int EULER_X\n```\n\nThe x-axis Euler angle of a face.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### EULER_Y\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int EULER_Y\n```\n\nThe y-axis Euler angle of a face.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### EULER_Z\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int EULER_Z\n```\n\nThe z-axis Euler angle of a face.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\nPublic methods\n--------------\n\n### confidence\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic float confidence ()\n```\n\nReturns a confidence factor between 0 and 1. This indicates how\ncertain what has been found is actually a face. A confidence\nfactor above 0.3 is usually good enough.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `float` | \u003cbr /\u003e |\n\n### eyesDistance\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic float eyesDistance ()\n```\n\nReturns the distance between the eyes.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `float` | \u003cbr /\u003e |\n\n### getMidPoint\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void getMidPoint (PointF point)\n```\n\nSets the position of the mid-point between the eyes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------|\n| `point` | `PointF`: the PointF coordinates (float values) of the face's mid-point \u003cbr /\u003e |\n\n### pose\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic float pose (int euler)\n```\n\nReturns the face's pose. That is, the rotations around either\nthe X, Y or Z axis (the positions in 3-dimensional Euclidean space).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `euler` | `int`: the Euler axis to retrieve an angle from (\u003cvar translate=\"no\"\u003eEULER_X\u003c/var\u003e, \u003cvar translate=\"no\"\u003eEULER_Y\u003c/var\u003e or \u003cvar translate=\"no\"\u003eEULER_Z\u003c/var\u003e) \u003cbr /\u003e |\n\n| Returns ||\n|---------|---------------------------------------------------------------|\n| `float` | the Euler angle of the of the face, for the given axis \u003cbr /\u003e |"]]