OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
OpenCVForUnity.ObjdetectModule.FaceRecognizerSF Class Reference

DNN-based face recognizer. More...

Inheritance diagram for OpenCVForUnity.ObjdetectModule.FaceRecognizerSF:
OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

IntPtr getNativeObjAddr ()
 
void alignCrop (Mat src_img, Mat face_box, Mat aligned_img)
 Aligning image to put face on the standard position. More...
 
void feature (Mat aligned_img, Mat face_feature)
 Extracting face feature from aligned image. More...
 
double match (Mat face_feature1, Mat face_feature2, int dis_type)
 Calculating the distance between two face features. More...
 
double match (Mat face_feature1, Mat face_feature2)
 Calculating the distance between two face features. More...
 
- 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, int backend_id, int target_id)
 Creates an instance of this class with given parameters. More...
 
static FaceRecognizerSF create (string model, string config, int backend_id)
 Creates an instance of this class with given parameters. More...
 
static FaceRecognizerSF create (string model, string config)
 Creates an instance of this class with given parameters. More...
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

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 (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

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

Detailed Description

DNN-based face recognizer.

model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface

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,
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

◆ 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 
)
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,
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"

◆ match() [2/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"

Member Data Documentation

◆ FR_COSINE

const int OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.FR_COSINE = 0

◆ FR_NORM_L2

const int OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.FR_NORM_L2 = 1

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