@Namespace(value="cv") @Properties(inherit=opencv_objdetect.class) public class FaceRecognizerSF extends Pointer
model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
FR_COSINE
enum cv::FaceRecognizerSF::DisType
|
static int |
FR_NORM_L2
enum cv::FaceRecognizerSF::DisType
|
Constructor and Description |
---|
FaceRecognizerSF(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
alignCrop(GpuMat src_img,
GpuMat face_box,
GpuMat aligned_img) |
void |
alignCrop(Mat src_img,
Mat face_box,
Mat aligned_img)
\brief Aligning image to put face on the standard position
|
void |
alignCrop(UMat src_img,
UMat face_box,
UMat aligned_img) |
static FaceRecognizerSF |
create(BytePointer model,
BytePointer config) |
static FaceRecognizerSF |
create(BytePointer model,
BytePointer config,
int backend_id,
int target_id)
\brief Creates an instance of this class with given parameters
|
static FaceRecognizerSF |
create(String model,
String config) |
static FaceRecognizerSF |
create(String model,
String config,
int backend_id,
int target_id) |
void |
feature(GpuMat aligned_img,
GpuMat face_feature) |
void |
feature(Mat aligned_img,
Mat face_feature)
\brief Extracting face feature from aligned image
|
void |
feature(UMat aligned_img,
UMat face_feature) |
double |
match(GpuMat face_feature1,
GpuMat face_feature2) |
double |
match(GpuMat face_feature1,
GpuMat face_feature2,
int dis_type) |
double |
match(Mat face_feature1,
Mat face_feature2) |
double |
match(Mat face_feature1,
Mat face_feature2,
int dis_type)
\brief Calculating the distance between two face features
|
double |
match(UMat face_feature1,
UMat face_feature2) |
double |
match(UMat face_feature1,
UMat face_feature2,
int dis_type) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public static final int FR_COSINE
public static final int FR_NORM_L2
public FaceRecognizerSF(Pointer p)
Pointer(Pointer)
.public void alignCrop(@ByVal Mat src_img, @ByVal Mat face_box, @ByVal Mat aligned_img)
src_img
- input imageface_box
- the detection result used for indicate face in input imagealigned_img
- output aligned imagepublic void alignCrop(@ByVal GpuMat src_img, @ByVal GpuMat face_box, @ByVal GpuMat aligned_img)
public void feature(@ByVal Mat aligned_img, @ByVal Mat face_feature)
aligned_img
- input aligned imageface_feature
- output face featurepublic double match(@ByVal Mat face_feature1, @ByVal Mat face_feature2, int dis_type)
face_feature1
- the first input featureface_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"@opencv_core.Ptr public static FaceRecognizerSF create(@opencv_core.Str BytePointer model, @opencv_core.Str BytePointer 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 device@opencv_core.Ptr public static FaceRecognizerSF create(@opencv_core.Str BytePointer model, @opencv_core.Str BytePointer config)
@opencv_core.Ptr public static FaceRecognizerSF create(@opencv_core.Str String model, @opencv_core.Str String config, int backend_id, int target_id)
@opencv_core.Ptr public static FaceRecognizerSF create(@opencv_core.Str String model, @opencv_core.Str String config)
Copyright © 2024. All rights reserved.