Table of Contents

Class FaceRecognizer

Namespace
Emgu.CV.Face
Assembly
Emgu.CV.dll

Face Recognizer

public abstract class FaceRecognizer : SharedPtrObject, IDisposable
Inheritance
FaceRecognizer
Implements
Derived
Inherited Members

Constructors

FaceRecognizer()

protected FaceRecognizer()

Fields

_faceRecognizerPtr

The native pointer to the FaceRecognizer object

protected nint _faceRecognizerPtr

Field Value

nint

Methods

DisposeObject()

Release the unmanaged memory associated with this FaceRecognizer

protected override void DisposeObject()

GetLabelInfo(int)

Gets string information by label. If an unknown label id is provided or there is no label information associated with the specified label id the method returns an empty string.

public string GetLabelInfo(int label)

Parameters

label int

The label

Returns

string

The string associated with this label.

Predict(IInputArray)

Predict the label of the image

public FaceRecognizer.PredictionResult Predict(IInputArray image)

Parameters

image IInputArray

The image where prediction will be based on

Returns

FaceRecognizer.PredictionResult

The prediction label

Read(string)

Load the FaceRecognizer from the file

public void Read(string fileName)

Parameters

fileName string

The file where the FaceRecognizer will be loaded from

SetLabelInfo(int, string)

Sets string info for the specified model's label.

public void SetLabelInfo(int label, string strInfo)

Parameters

label int

The label

strInfo string

The string info

Remarks

The string info is replaced by the provided value if it was set before for the specified label.

Train(IInputArrayOfArrays, IInputArray)

Train the face recognizer with the specific images and labels

public void Train(IInputArrayOfArrays images, IInputArray labels)

Parameters

images IInputArrayOfArrays

The images used in the training. This can be a VectorOfMat

labels IInputArray

The labels of the images. This can be a VectorOfInt

Train(Mat[], int[])

Train the face recognizer with the specific images and labels

public void Train(Mat[] images, int[] labels)

Parameters

images Mat[]

The images used in the training.

labels int[]

The labels of the images.

Write(string)

Save the FaceRecognizer to a file

public void Write(string fileName)

Parameters

fileName string

The file name to be saved to