FaceTracking2DModule Overview
FaceTracking2DModule Overview
FaceTracking2DModule Overview

FaceTracking2DModule

Enables the tracking of faces in two-dimensional space.

Importing this module automatically enables the Face Tracking capability within the project's Properties.

For three-dimensional face tracking, see the FaceTracking module.

Example

//============================================================================
// Create a reference to a detected face, and monitor the number of faces
// in the scene.
//
// Required project capabilities:
// - Face Tracking (auto added on FaceTracking2D module import)
//
//============================================================================


// Load in the required modules
const FaceTracking2D = require('FaceTracking2D');
const Diagnostics = require('Diagnostics');

(async function() { // Enable async/await in JS [part 1]

  // Create a reference to a detected face
   const face = FaceTracking.face(0);

  // Create a reference to the number of tracked faces in the scene
  // and add the signal to the watch view
  const faceCount = FaceTracking.count;
  Diagnostics.watch("Number of tracked faces: ", faceCount);

})(); // Enable async/await in JS [part 2]

Properties

PropertyDescription
count
(get) count: ScalarSignal
(set) (Not Available)


The number of faces currently tracked in the scene, as a ScalarSignal.

Methods

MethodDescription
face
face(index: number): Face2D


Returns a Face2D object from the array of detected faces.
* index - the index of the Face2D object to retrieve from the array.

Classes

ClassDescription
Face2DExposes details of a two-dimensionally tracked face.
For three-dimensional tracking to key points on a detected face, see the Face class instead.

Was this article helpful?