OpenCV for Unity 3.0.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.12.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)
 Aligns detected face with the source input image and crops it.
 
void feature (Mat aligned_img, Mat face_feature)
 Extracts face feature from aligned image.
 
IntPtr getNativeObjAddr ()
 
double match (Mat face_feature1, Mat face_feature2)
 Calculates the distance between two face features.
 
double match (Mat face_feature1, Mat face_feature2, int dis_type)
 Calculates 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 framework, MatOfByte bufferModel, MatOfByte bufferConfig)
 Creates an instance of this class from a buffer containing the model weights and configuration.
 
static FaceRecognizerSF create (string framework, MatOfByte bufferModel, MatOfByte bufferConfig, int backend_id)
 Creates an instance of this class from a buffer containing the model weights and configuration.
 
static FaceRecognizerSF create (string framework, MatOfByte bufferModel, MatOfByte bufferConfig, int backend_id, int target_id)
 Creates an instance of this class from a buffer containing the model weights and configuration.
 
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
 C++: enum DisType (cv.FaceRecognizerSF.DisType)
 
const int FR_NORM_L2 = 1
 C++: enum DisType (cv.FaceRecognizerSF.DisType)
 

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 )

Aligns detected face with the source input image and crops it.

Parameters
src_imginput image
face_boxthe detected face result from the input image
aligned_imgoutput aligned image

◆ create() [1/6]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string framework,
MatOfByte bufferModel,
MatOfByte bufferConfig )
static

Creates an instance of this class from a buffer containing the model weights and configuration.

Parameters
frameworkName of the framework (ONNX, etc.)
bufferModelA buffer containing the binary model weights.
bufferConfigA buffer containing the network configuration.
backend_idThe id of the backend.
target_idThe id of the target device.
Returns
A pointer to the created instance of FaceRecognizerSF.

◆ create() [2/6]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string framework,
MatOfByte bufferModel,
MatOfByte bufferConfig,
int backend_id )
static

Creates an instance of this class from a buffer containing the model weights and configuration.

Parameters
frameworkName of the framework (ONNX, etc.)
bufferModelA buffer containing the binary model weights.
bufferConfigA buffer containing the network configuration.
backend_idThe id of the backend.
target_idThe id of the target device.
Returns
A pointer to the created instance of FaceRecognizerSF.

◆ create() [3/6]

static FaceRecognizerSF OpenCVForUnity.ObjdetectModule.FaceRecognizerSF.create ( string framework,
MatOfByte bufferModel,
MatOfByte bufferConfig,
int backend_id,
int target_id )
static

Creates an instance of this class from a buffer containing the model weights and configuration.

Parameters
frameworkName of the framework (ONNX, etc.)
bufferModelA buffer containing the binary model weights.
bufferConfigA buffer containing the network configuration.
backend_idThe id of the backend.
target_idThe id of the target device.
Returns
A pointer to the created instance of FaceRecognizerSF.

◆ create() [4/6]

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() [5/6]

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() [6/6]

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 )

Extracts 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 )

Calculates 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_typedefines how to calculate the distance between two face features with optional values "FR_COSINE" or "FR_NORM_L2"

◆ match() [2/2]

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

Calculates 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_typedefines how to calculate the distance between two face features with optional values "FR_COSINE" or "FR_NORM_L2"

Member Data Documentation

◆ FR_COSINE

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

C++: enum DisType (cv.FaceRecognizerSF.DisType)

◆ FR_NORM_L2

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

C++: enum DisType (cv.FaceRecognizerSF.DisType)


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