OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.ObjdetectModule.FaceRecognizerSF Class Reference

DNN-based face recognizer. More...

Public Member Functions

void alignCrop (Mat src_img, Mat face_box, Mat aligned_img)
 Aligning image to put face on the standard position.
 
void feature (Mat aligned_img, Mat face_feature)
 Extracting face feature from aligned image.
 
IntPtr getNativeObjAddr ()
 
double match (Mat face_feature1, Mat face_feature2)
 Calculating the distance between two face features.
 
double match (Mat face_feature1, Mat face_feature2, int dis_type)
 Calculating the distance between two face features.
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static FaceRecognizerSF __fromPtr__ (IntPtr addr)
 
static FaceRecognizerSF create (string model, string config)
 Creates an instance of this class with given parameters.
 
static FaceRecognizerSF create (string model, string config, int backend_id)
 Creates an instance of this class with given parameters.
 
static FaceRecognizerSF create (string model, string config, int backend_id, int target_id)
 Creates an instance of this class with given parameters.
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Static Public Attributes

const int FR_COSINE = 0
 
const int FR_NORM_L2 = 1
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Member Function Documentation

◆ __fromPtr__()

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.__fromPtr__ ( IntPtr addr)
static

◆ alignCrop()

void OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.alignCrop ( Mat src_img,
Mat face_box,
Mat aligned_img )

Aligning image to put face on the standard position.

Parameters
src_imginput image
face_boxthe detection result used for indicate face in input image
aligned_imgoutput aligned image

◆ create() [1/3]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string model,
string config )
static

Creates an instance of this class with given parameters.

Parameters
modelthe path of the onnx model used for face recognition
configthe path to the config file for compability, which is not requested for ONNX models
backend_idthe id of backend
target_idthe id of target device

◆ create() [2/3]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string model,
string config,
int backend_id )
static

Creates an instance of this class with given parameters.

Parameters
modelthe path of the onnx model used for face recognition
configthe path to the config file for compability, which is not requested for ONNX models
backend_idthe id of backend
target_idthe id of target device

◆ create() [3/3]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string model,
string config,
int backend_id,
int target_id )
static

Creates an instance of this class with given parameters.

Parameters
modelthe path of the onnx model used for face recognition
configthe path to the config file for compability, which is not requested for ONNX models
backend_idthe id of backend
target_idthe id of target device

◆ Dispose()

override void OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.Dispose ( bool disposing)
protectedvirtual

◆ feature()

void OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.feature ( Mat aligned_img,
Mat face_feature )

Extracting face feature from aligned image.

Parameters
aligned_imginput aligned image
face_featureoutput face feature

◆ getNativeObjAddr()

IntPtr OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.getNativeObjAddr ( )

◆ match() [1/2]

double OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.match ( Mat face_feature1,
Mat face_feature2 )

Calculating the distance between two face features.

Parameters
face_feature1the first input feature
face_feature2the second input feature of the same size and the same type as face_feature1
dis_typedefining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"

◆ match() [2/2]

double OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.match ( Mat face_feature1,
Mat face_feature2,
int dis_type )

Calculating the distance between two face features.

Parameters
face_feature1the first input feature
face_feature2the second input feature of the same size and the same type as face_feature1
dis_typedefining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"

Member Data Documentation

◆ FR_COSINE

const int OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.FR_COSINE = 0
static

◆ FR_NORM_L2

const int OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.FR_NORM_L2 = 1
static

The documentation for this class was generated from the following file: