Class EyeAspectRatioBaseEyeBlinkDetector
An abstract base class that provides functionality to detect human eye's blink base on eye aspect ratio (EAR).
Inheritance
Implements
Inherited Members
Namespace: FaceRecognitionDotNet.Extensions
Assembly: FaceRecognitionDotNet.dll
Syntax
public abstract class EyeAspectRatioBaseEyeBlinkDetector : EyeBlinkDetector, IDisposable
Constructors
| Improve this Doc View SourceEyeAspectRatioBaseEyeBlinkDetector(Double, Double, Int32[], Int32[])
Initializes a new instance of the EyeAspectRatioBaseEyeBlinkDetector class with the threshold and eye point indices for left and right eyes.
Declaration
protected EyeAspectRatioBaseEyeBlinkDetector(double leftRatioThreshold, double rightRatioThreshold, int[] leftEyePointIndices, int[] rightEyePointIndices)
Parameters
Type | Name | Description |
---|---|---|
System.Double | leftRatioThreshold | The threshold to decide that left eye blinks or not. |
System.Double | rightRatioThreshold | The threshold to decide that right eye blinks or not. |
System.Int32[] | leftEyePointIndices | The indices of left eye location to calculate eye aspect ratio. |
System.Int32[] | rightEyePointIndices | The indices of right eye location to calculate eye aspect ratio. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
Properties
| Improve this Doc View SourceLeftEyePointIndices
Gets the array of the indices of left eye location to be used calculating eye aspect ratio.
Declaration
protected int[] LeftEyePointIndices { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
LeftRatioThreshold
Gets the threshold to decide that left eye blinks or not.
Declaration
public double LeftRatioThreshold { get; }
Property Value
Type | Description |
---|---|
System.Double |
RightEyePointIndices
Gets the array of the indices of right eye location to be used calculating eye aspect ratio.
Declaration
protected int[] RightEyePointIndices { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
RightRatioThreshold
Gets the threshold to decide that right eye blinks or not.
Declaration
public double RightRatioThreshold { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceGetEar(IList<FacePoint>, IList<Int32>)
Return an eye aspect ratio.
Declaration
protected double GetEar(IList<FacePoint> eye, IList<int> eyePointIndices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<FacePoint> | eye | The collection of location corresponding to human eye. |
System.Collections.Generic.IList<System.Int32> | eyePointIndices | The collection of the indices of eye location to be used calculating eye aspect ratio. |
Returns
Type | Description |
---|---|
System.Double | Eye aspect ratio. |
RawDetect(IDictionary<FacePart, IEnumerable<FacePoint>>, out Boolean, out Boolean)
Detects the values whether human eye's blink or not from face landmark.
Declaration
protected override void RawDetect(IDictionary<FacePart, IEnumerable<FacePoint>> landmark, out bool leftBlink, out bool rightBlink)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<FacePart, System.Collections.Generic.IEnumerable<FacePoint>> | landmark | The dictionary of face parts locations (eyes, nose, etc). |
System.Boolean | leftBlink | When this method returns, contains |
System.Boolean | rightBlink | When this method returns, contains |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |