Table of Contents

Class FaceRecognizerSF

Namespace
Emgu.CV
Assembly
Emgu.CV.dll

DNN-based face recognizer

public class FaceRecognizerSF : SharedPtrObject, IDisposable
Inheritance
FaceRecognizerSF
Implements
Inherited Members

Constructors

FaceRecognizerSF(string, string, Backend, Target)

Creates an instance of this class with given parameters.

public FaceRecognizerSF(string model, string config, Backend backendId, Target targetId)

Parameters

model string

The path of the onnx model used for face recognition

config string

The path to the config file for compability, which is not requested for ONNX models

backendId Backend

The id of backend

targetId Target

The id of target device

Methods

AlignCrop(IInputArray, IInputArray, IOutputArray)

Aligning image to put face on the standard position.

public void AlignCrop(IInputArray srcImg, IInputArray faceBox, IOutputArray alignedImg)

Parameters

srcImg IInputArray

Input image

faceBox IInputArray

The detection result used for indicate face in input image

alignedImg IOutputArray

Output aligned image

DisposeObject()

Release the unmanaged memory associated with this FaceRecognizerSF

protected override void DisposeObject()

Feature(IInputArray, IOutputArray)

Extracting face feature from aligned image.

public void Feature(IInputArray alignedImg, IOutputArray faceFeature)

Parameters

alignedImg IInputArray

Input aligned image

faceFeature IOutputArray

Output face feature

Match(IInputArray, IInputArray, DisType)

Calculating the distance between two face features.

public double Match(IInputArray faceFeature1, IInputArray faceFeature2, FaceRecognizerSF.DisType disType = DisType.Cosine)

Parameters

faceFeature1 IInputArray

The first input feature

faceFeature2 IInputArray

The second input feature of the same size and the same type as faceFeature1

disType FaceRecognizerSF.DisType

Defining the similarity with optional values

Returns

double

The distance between two face features.