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
labelint
Returns
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
strstring
Returns
- int[]
GetThreshold()
threshold parameter accessor - required for default BestMinDist collector
public double GetThreshold()
Returns
Predict(InputArray)
Gets a prediction from a FaceRecognizer.
public virtual int Predict(InputArray src)
Parameters
srcInputArray
Returns
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
srcInputArraylabelintconfidencedouble
Read(FileNode)
Reads algorithm parameters from a file storage
public override void Read(FileNode fn)
Parameters
fnFileNode
Read(string)
Deserializes this object from a given filename.
public virtual void Read(string fileName)
Parameters
fileNamestring
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
SetThreshold(double)
Sets threshold of model
public void SetThreshold(double val)
Parameters
valdouble
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
srcIEnumerable<Mat>labelsIEnumerable<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
srcIEnumerable<Mat>labelsIEnumerable<int>
Write(FileStorage)
Stores algorithm parameters in a file storage
public override void Write(FileStorage fs)
Parameters
fsFileStorage
Write(string)
Serializes this object to a given filename.
public virtual void Write(string fileName)
Parameters
fileNamestring