Show / Hide Table of Contents

Class EyeAspectRatioBaseEyeBlinkDetector

An abstract base class that provides functionality to detect human eye's blink base on eye aspect ratio (EAR).

Inheritance
System.Object
DisposableObject
EyeBlinkDetector
EyeAspectRatioBaseEyeBlinkDetector
EyeAspectRatioHelenEyeBlinkDetector
EyeAspectRatioLargeEyeBlinkDetector
Implements
System.IDisposable
Inherited Members
DisposableObject.IsDisposed
DisposableObject.ThrowIfDisposed()
DisposableObject.DisposeManaged()
DisposableObject.DisposeUnmanaged()
DisposableObject.Dispose()
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FaceRecognitionDotNet.Extensions
Assembly: FaceRecognitionDotNet.dll
Syntax
public abstract class EyeAspectRatioBaseEyeBlinkDetector : EyeBlinkDetector, IDisposable

Constructors

| Improve this Doc View Source

EyeAspectRatioBaseEyeBlinkDetector(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

leftEyePointIndices or rightEyePointIndices is null.

System.ArgumentException

leftEyePointIndices or rightEyePointIndices does not contain 6 elements.

Properties

| Improve this Doc View Source

LeftEyePointIndices

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[]
| Improve this Doc View Source

LeftRatioThreshold

Gets the threshold to decide that left eye blinks or not.

Declaration
public double LeftRatioThreshold { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

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[]
| Improve this Doc View Source

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 Source

GetEar(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.

| Improve this Doc View Source

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 true, if the left eye blinks; otherwise, false.

System.Boolean rightBlink

When this method returns, contains true, if the right eye blinks; otherwise, false.

Overrides
EyeBlinkDetector.RawDetect(IDictionary<FacePart, IEnumerable<FacePoint>>, out Boolean, out Boolean)
Exceptions
Type Condition
System.ArgumentNullException

landmark is null.

System.ArgumentException

landmark does not contain LeftEye or RightEye.

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX