Class Face
Represents a detected face and its normalized image rectangle, classification, and optional descriptor.
public sealed class Face : IEquatable<Face>
- Inheritance
-
Face
- Implements
- Inherited Members
- Extension Methods
Constructors
Face(long, Rectangle, FaceMode, FaceQuality, bool, IReadOnlyList<FixedPoint64>)
Initializes a face.
public Face(long faceId, Rectangle rectangle, FaceMode faceMode, FaceQuality faceQuality, bool visible, IReadOnlyList<FixedPoint64> faceDescriptor)
Parameters
faceIdlongThe persistent face identifier.
rectangleRectangleThe normalized face rectangle.
faceModeFaceModeThe detector that found the face.
faceQualityFaceQualityThe face quality classification.
visibleboolWhether the face is visible to consumers.
faceDescriptorIReadOnlyList<FixedPoint64>The optional 128-value face descriptor; descriptors of other lengths are discarded.
Properties
FaceDescriptor
Gets the face descriptor, or null when no valid descriptor is available.
public IReadOnlyList<FixedPoint64> FaceDescriptor { get; }
Property Value
FaceMode
Gets the detector that found the face.
public FaceMode FaceMode { get; }
Property Value
FaceQuality
Gets the face quality classification.
public FaceQuality FaceQuality { get; }
Property Value
HasFaceDescriptor
Gets whether a valid 128-value face descriptor is available.
public bool HasFaceDescriptor { get; }
Property Value
Id
Gets the persistent face identifier.
public long Id { get; }
Property Value
IsFrontFace
Gets whether the face was found by the frontal-face detector.
public bool IsFrontFace { get; }
Property Value
Rectangle
Gets the normalized face rectangle.
public Rectangle Rectangle { get; }
Property Value
Visible
Gets whether the face is visible to consumers.
public bool Visible { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(Face)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Face other)
Parameters
otherFaceAn object to compare with this object.
Returns
FromJsonString(string)
Deserializes a face from JSON.
public static Face FromJsonString(string jsonString)
Parameters
jsonStringstringThe JSON to deserialize.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToJsonString()
Serializes the face to compact JSON.
public string ToJsonString()
Returns
- string
The serialized face.
ToString()
Serializes the face to indented JSON.
public override string ToString()
Returns
- string
The formatted face JSON.