Class FaceRecognizer
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
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
intThe 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
IInputArrayThe 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
stringThe 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
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
IInputArrayOfArraysThe images used in the training. This can be a VectorOfMat
labels
IInputArrayThe 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
Write(string)
Save the FaceRecognizer to a file
public void Write(string fileName)
Parameters
fileName
stringThe file name to be saved to