Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FaceCapture

Contains methods to retrieve and process images from the capture source.

Hierarchy

  • FaceCapture

Index

Constructors

constructor

  • throws

    {ClassifierDoesNotExistError} if the classifier provided

    Parameters

    • resources: AppResources

      Common application resources.

    • devicePort: number

      Device port to pass to OpenCV.

    • classifierName: string

      Cascade classifier passed to OpenCV.

    Returns FaceCapture

Properties

captureSource

captureSource: VideoCapture

OpenCV capture source

Private faceClassifier

faceClassifier: CascadeClassifier

Protected resources

resources: AppResources

Common application resources.

Methods

FaceFromImage

  • FaceFromImage(source: Mat): Promise<Mat>
  • Extracts a single face from an image.

    throws

    {NoFacesDetectedError|TooManyFacesError} - If no faces or more than one face is detected.

    Parameters

    • source: Mat

      Image to extract from.

    Returns Promise<Mat>

    • A grayscale image containing the extracted face.

FacesFromImage

  • FacesFromImage(source: Mat): Promise<Mat[]>
  • Extracts faces from a provided image.

    Parameters

    • source: Mat

      Image to extract from.

    Returns Promise<Mat[]>

    • An array of grayscale images containing each face detected.

GetBrightness

  • GetBrightness(image: Mat): Promise<number>
  • Retrieves the brightness of a provided image. Will return a number between 0 and 1.

    Parameters

    • image: Mat

    Returns Promise<number>

ImageFromCamera

  • ImageFromCamera(): Promise<Mat>
  • Takes a frame from the capture source.

    Returns Promise<Mat>

PreprocessFace

  • PreprocessFace(image: Mat): Promise<Mat>
  • Operations that should be run each face image before adding it to the database.

    Parameters

    • image: Mat

      The face image to preprocess.

    Returns Promise<Mat>

ResizeFace

  • ResizeFace(image: Mat): Promise<Mat>
  • Resizes face. All trained/detected images must be the same size.

    Parameters

    • image: Mat

      Face to resize.

    Returns Promise<Mat>

StabilizeContrast

  • StabilizeContrast(image: Mat): Promise<Mat>
  • Applies historgram equalization

    Parameters

    • image: Mat

      Image to apply equalization to.

    Returns Promise<Mat>

Generated using TypeDoc