Yoti.FCM 0.1.0-beta1

This is a prerelease version of Yoti.FCM.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Yoti.FCM --version 0.1.0-beta1
NuGet\Install-Package Yoti.FCM -Version 0.1.0-beta1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Yoti.FCM" Version="0.1.0-beta1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Yoti.FCM --version 0.1.0-beta1
#r "nuget: Yoti.FCM, 0.1.0-beta1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Yoti.FCM as a Cake Addin
#addin nuget:?package=Yoti.FCM&version=0.1.0-beta1&prerelease

// Install Yoti.FCM as a Cake Tool
#tool nuget:?package=Yoti.FCM&version=0.1.0-beta1&prerelease

Yoti Face Capture

Face capture user control.


The package uses C++ libraries so the machines that run the face capture will need to install the Microsoft Visual C++ Redistributable packages.


  1. Add the package dependency in your project.

  2. Add the reference xmlns:yotiFCM="clr-namespace:Yoti.FCM;assembly=Yoti.FCM" in the view that will integrate the user control.

  3. Render the user control:

    <yotiFCM:FaceCapture FaceDetected="<FaceCapture_FaceDetectedHandler>" />

This is the properties list for the FaceCapture:

Property name Type Default value Range Description
FaceDetected EventHandler<FacesDetectedEventArgs> null Event that the face capture will trigger each time it detects a face.
OnError EventHandler<ExceptionEventArgs> null Event to handle all inner exceptions from the face capture.
ReadyToCapture EventHandler null Event to handle when the camera is ready to start the streaming and capture a face.
ProbabilityThreshold float 0.95F 0.85 - 0.97 Face probability score threshold used to check if a face is real.
CroppingRelativeMargin float 0.5F 0.2 - 1.0 Relative margin to be applied when the face detector crops the resulting image.
GrayScaleThreshold float 23.0F 20.0 - 30.0 Image grayscale threshold.
MultiFaceAreaThreshold int 200 180 - 250 Minimum area size from which a face will be checked when the frame has multiple faces.
FaceOverlapingThreshold float 0.3F 0.2 - 0.35 Threshold where the multi-face validator will returns an error if there is another face in the result face area.
LowBrightnessThreshold float 50.0F 40 - 60 Lower brightness value that is considered to be valid.
HighBrightnessThreshold float 200.0F 180 - 210 Higher brightness value that is considered to be valid.
MinMainFaceArea int 25000 20000 - 60000 Min main face size in pixels.
MinRelativeAreaAroundFace float 0.3F 0.25 - 0.4 Min distance from the edges relative to the face.
OutputFormat ImageFormat ImageFormat.JPEG Format to encode the output Image (JPEG, PNG).
OutputQuality ImageQuality ImageQuality.High JPEG compression quality (High, Medium, Low).
NumberStableFrames int 4 1 - 12 NumberStableFrames is the consecutive valid frames of a face needed to consider it valid.
StabilityConfidenceThreshold float 0.9F 0.8 - 0.95 StabilityConfidenceThreshold is the required stability score for each frame with the previous.
Crop bool true If the final image result will be a cropped version of the webcam frame where the focus will be on the main face.
Debug bool false If the face capture will render the face debug information.
FaceDetectionTickerInterval int 160 100 - 500 The interval that the face capture will use to detect a face in the webcam frame.
WebcamIndex int? 0 The webcam index that the face capture will use to get the stream frames.

Note: FaceCapture implements the interface IFaceCapture:

/// <summary>
/// Represents an entity that is able to detect a face from a stream like a webcam.
/// </summary>
public interface IFaceCapture
    /// <summary>
    /// Event that the face capture will trigger each time it detects a face.
    /// </summary>
    event EventHandler<FacesDetectedEventArgs> FaceDetected;

    /// <summary>
    /// Event to handle all inner exceptions from the face capture.
    /// </summary>
    event EventHandler<ExceptionEventArgs> OnError;

    /// <summary>
    /// Event to handle when the camera is ready to start the streaming and capture a face.
    /// </summary>
    event EventHandler ReadyToCapture;

    /// <summary>
    /// Starts the webcam stream and the face detection.
    /// </summary>
    void Play();

    /// <summary>
    /// Stops the webcam stream and the face detection.
    /// </summary>
    void Stop();

Other controls

Webcam selector

The package exports the method Yoti.FCM.WebcamStream.WebcamInfo.GetWebcamDevices() to get all webcam devices that are available. It also provides a user control to select a webcam:

<controls:WebcamSelector Width="300" Height="24" SelectionChanged="WebcamSelector_SelectionChanged" />

The properties for the webcam selector are the following:

Property name Type Default value Description
SelectedIndex int? 0 The current webcam index.
SelectionChanged EventHandler<WebcamSelectionEventArgs> null The event that the webcam selector will trigger when the user changes the webcam selected.
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 277 4/17/2023
1.0.0 267 2/8/2023
0.1.0-beta2 157 12/2/2022
0.1.0-beta1 171 11/7/2022

Face detection WPF user control package creation.