Class FaceRecognizerSF
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
stringThe path of the onnx model used for face recognition
config
stringThe path to the config file for compability, which is not requested for ONNX models
backendId
BackendThe id of backend
targetId
TargetThe 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
IInputArrayInput image
faceBox
IInputArrayThe detection result used for indicate face in input image
alignedImg
IOutputArrayOutput 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
IInputArrayInput aligned image
faceFeature
IOutputArrayOutput 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
IInputArrayThe first input feature
faceFeature2
IInputArrayThe second input feature of the same size and the same type as
faceFeature1
disType
FaceRecognizerSF.DisTypeDefining the similarity with optional values
Returns
- double
The distance between two face features.