public class FaceRecognizerSF
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FR_COSINE |
static int |
FR_NORM_L2 |
Modifier and Type | Method and Description |
---|---|
static FaceRecognizerSF |
__fromPtr__(long addr) |
void |
alignCrop(Mat src_img,
Mat face_box,
Mat aligned_img)
Aligning image to put face on the standard position
|
static FaceRecognizerSF |
create(java.lang.String model,
java.lang.String config)
Creates an instance of this class with given parameters
|
static FaceRecognizerSF |
create(java.lang.String model,
java.lang.String config,
int backend_id)
Creates an instance of this class with given parameters
|
static FaceRecognizerSF |
create(java.lang.String model,
java.lang.String config,
int backend_id,
int target_id)
Creates an instance of this class with given parameters
|
void |
feature(Mat aligned_img,
Mat face_feature)
Extracting face feature from aligned image
|
long |
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 static final int FR_COSINE
public static final int FR_NORM_L2
public static FaceRecognizerSF __fromPtr__(long addr)
public void alignCrop(Mat src_img, Mat face_box, Mat aligned_img)
src_img
- input imageface_box
- the detection result used for indicate face in input imagealigned_img
- output aligned imagepublic static FaceRecognizerSF create(java.lang.String model, java.lang.String config)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelspublic static FaceRecognizerSF create(java.lang.String model, java.lang.String config, int backend_id)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelsbackend_id
- the id of backendpublic static FaceRecognizerSF create(java.lang.String model, java.lang.String config, int backend_id, int target_id)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelsbackend_id
- the id of backendtarget_id
- the id of target devicepublic void feature(Mat aligned_img, Mat face_feature)
aligned_img
- input aligned imageface_feature
- output face featurepublic long getNativeObjAddr()
public double match(Mat _face_feature1, Mat _face_feature2)
_face_feature1
- the first input feature_face_feature2
- the second input feature of the same size and the same type as _face_feature1public double match(Mat _face_feature1, Mat _face_feature2, int dis_type)
_face_feature1
- the first input feature_face_feature2
- the second input feature of the same size and the same type as _face_feature1dis_type
- defining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"Generated on 2021-12-25 08:13:27 / OpenCV 4.5.5