Table of Contents

Class FaceRecognizer

Namespace
OpenCvSharp.Face
Assembly
OpenCvSharp.dll

Abstract base class for all face recognition models. All face recognition models in OpenCV are derived from the abstract base class FaceRecognizer, which provides a unified access to all face recongition algorithms in OpenCV.

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

Methods

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

Returns

string

GetLabelsByString(string)

Gets vector of labels by string. The function searches for the labels containing the specified sub-string in the associated string info.

public int[] GetLabelsByString(string str)

Parameters

str string

Returns

int[]

GetThreshold()

threshold parameter accessor - required for default BestMinDist collector

public double GetThreshold()

Returns

double

Predict(InputArray)

Gets a prediction from a FaceRecognizer.

public virtual int Predict(InputArray src)

Parameters

src InputArray

Returns

int

Predict(InputArray, out int, out double)

Predicts the label and confidence for a given sample.

public virtual void Predict(InputArray src, out int label, out double confidence)

Parameters

src InputArray
label int
confidence double

Read(FileNode)

Reads algorithm parameters from a file storage

public override void Read(FileNode fn)

Parameters

fn FileNode

Read(string)

Deserializes this object from a given filename.

public virtual void Read(string fileName)

Parameters

fileName string

SetLabelInfo(int, string)

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

public void SetLabelInfo(int label, string strInfo)

Parameters

label int
strInfo string

SetThreshold(double)

Sets threshold of model

public void SetThreshold(double val)

Parameters

val double

Train(IEnumerable<Mat>, IEnumerable<int>)

Trains a FaceRecognizer with given data and associated labels.

public virtual void Train(IEnumerable<Mat> src, IEnumerable<int> labels)

Parameters

src IEnumerable<Mat>
labels IEnumerable<int>

Update(IEnumerable<Mat>, IEnumerable<int>)

Updates a FaceRecognizer with given data and associated labels.

public void Update(IEnumerable<Mat> src, IEnumerable<int> labels)

Parameters

src IEnumerable<Mat>
labels IEnumerable<int>

Write(FileStorage)

Stores algorithm parameters in a file storage

public override void Write(FileStorage fs)

Parameters

fs FileStorage

Write(string)

Serializes this object to a given filename.

public virtual void Write(string fileName)

Parameters

fileName string