DFACE JAVA SDK  4.0.0
DFace.DfaceDetect Class Reference

class DfaceDetect, a class responsible for face detecting More...

Inheritance diagram for DFace.DfaceDetect:
Collaboration diagram for DFace.DfaceDetect:

Public Member Functions

 DfaceDetect (String modePath, out int err_code)
 DFaceDetect Constructor More...
 
void Dispose ()
 DfaceDetect Destructor More...
 
unsafe Box[] detectionMax (Bitmap bmp, bool square)
 Detect max size face box in a image More...
 
unsafe Box[] detection (Bitmap bmp, bool square)
 Detect all face in a image More...
 
Box[] detectionLimited (Bitmap bmp, bool square)
 Re-detect max size face box in a face image More...
 
void SetMinSize (int setVal)
 Set face detect minimum size More...
 
void SetWorkMode (int workMode)
 Switch face detect precision mode More...
 

Static Public Attributes

static int maxFaceCount = 32
 Max number of face can be detected in one frame, 32 by default More...
 

Detailed Description

class DfaceDetect, a class responsible for face detecting

class DfaceDetectDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_detect([MarshalAs(UnmanagedType.LPStr)] string fileName, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_detect(IntPtr detectHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detectionMax(IntPtr detectHandle, byte* imgData, int w, int h, int c, int format, byte square, int* outRects, float* outScore, float* outPoint, byte* outType, out int faceCount);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detection(IntPtr detectHandle, byte* imgData, int w, int h, int c, int format, byte square, int* outRects, float* outScore, float* outPoint, byte* outType, out int faceCount);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detectionLimited(IntPtr detectHandle, byte* imgData, int w, int h, int c, int format, byte square, int* outRects, float* outScore, float* outPoint, byte* outType, out int faceCount);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void SetMinSize_detect(IntPtr detectHandle, int setValue);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void SetWorkMode_detect(IntPtr detectHandle, int workMode); }

class DfaceRecognizeDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_recognize([MarshalAs(UnmanagedType.LPStr)] string fileName, int accuracy, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_recognize(IntPtr recognizeHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int extractFaceFeatureByImg(IntPtr recognizeHandle, byte* in_imgData, int in_w, int in_h, int in_c, int format, int* in_boxs, byte* out_feature); }

class DfaceCompareDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_compare([MarshalAs(UnmanagedType.LPStr)] string fileName, int accuracy, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_compare(IntPtr compareHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int similarityByFeature_compare(IntPtr compareHandle, int featureLength, byte* in_feature_1, byte* in_feature_2, float* out_simi);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void similarityByFeatureSort(IntPtr compareHandle, byte* feature_1, byte*[] feature_n, int num, long* idx_n, float* out_simi, long* out_idx, int feature_size, int top, float threshold, out int retCount); }

class DfaceInfraredDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_infrared([MarshalAs(UnmanagedType.LPStr)] string fileName, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_infrared(IntPtr infraredHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int liveness_check_ir(IntPtr infraredHandle, int* in_rgb_box, int* in_ir_box, out float out_liveness); }

class DfaceRgbAntiDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_rgbanti([MarshalAs(UnmanagedType.LPStr)] string fileName, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_rbganti(IntPtr rgbAntiHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int liveness_check(IntPtr rgbAntiHandle, byte* in_imgData, int in_w, int in_h, int in_c, int format, int* in_boxs, out float out_liveness); [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void setLevel_rgbanti(IntPtr rgbAntiHandle, int level);

}

class DfaceTrackDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_track([MarshalAs(UnmanagedType.LPStr)] string fileName, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_track(IntPtr trackHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void update_track(IntPtr trackHandle, byte* imgData, int w, int h, int c, int format, int faceCount, int* in_boxs, int* out_boxs, float* out_score, float* out_point, byte* out_type, int* output_length);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool start_track(IntPtr trackHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool stop_track(IntPtr trackHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool restart_track(IntPtr trackHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void setMaxAge(IntPtr trackHandle, int count); }

class DfacePoseDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_pose([MarshalAs(UnmanagedType.LPStr)] string fileName, out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_pose(IntPtr poseHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictMask(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, float* out_mask);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictCoverMouth(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, float* out_cover_mouth);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictCoverEye(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, float* out_cover_eye);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictBlur(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, double* out_blur);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictLight(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, int* out_light);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int predictPose(IntPtr poseHandle, byte* imgData, int w, int h, int c, int format, int* in_box, int in_box_num, int* out_landmarks, double* out_head_pose); }

class DfaceAccreditDll { [DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr create_accredit(out int err_code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void destroy_accredit(IntPtr accreditHandle);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void login(IntPtr accreditHandle, out int code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void logout(IntPtr accreditHandle, out int code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void getVersion(IntPtr accreditHandle, out int code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void getDeviceFingerPrint(IntPtr accreditHandle, [MarshalAs(UnmanagedType.LPStr)] string sn_code, [MarshalAs(UnmanagedType.LPStr)] string filename, out int code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void writeTest([MarshalAs(UnmanagedType.LPStr)] string in_chars, out int code);

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void updateOnline( IntPtr accreditHandle, [MarshalAs(UnmanagedType.LPStr)] string sn_code, out int code );

[DllImport("libdfacesharp.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void updateOfline( IntPtr accreditHandle, [MarshalAs(UnmanagedType.LPStr)] string filename, out int code ); }

Constructor & Destructor Documentation

DFace.DfaceDetect.DfaceDetect ( String  modePath,
out int  err_code 
)

DFaceDetect Constructor

Parameters
modePathDFace Model path

Member Function Documentation

unsafe Box [] DFace.DfaceDetect.detection ( Bitmap  bmp,
bool  square 
)

Detect all face in a image

Parameters
bmpbitmap
squareThe return face box is squared or not, return square box by default
Returns
box array
Box [] DFace.DfaceDetect.detectionLimited ( Bitmap  bmp,
bool  square 
)

Re-detect max size face box in a face image

Parameters
bmpbitmap
squareThe return face box is squared or not, return square box by default
Returns
box array
unsafe Box [] DFace.DfaceDetect.detectionMax ( Bitmap  bmp,
bool  square 
)

Detect max size face box in a image

Parameters
bmpbitmap
squareThe return face box is squared or not, return square box by default
Returns
box array(size is equal 1)
void DFace.DfaceDetect.Dispose ( )

DfaceDetect Destructor

void DFace.DfaceDetect.SetMinSize ( int  setVal)

Set face detect minimum size

Parameters
setValMinimum face size
void DFace.DfaceDetect.SetWorkMode ( int  workMode)

Switch face detect precision mode

Parameters
workModemode(0:precision low(default) 1:precision high)

Member Data Documentation

int DFace.DfaceDetect.maxFaceCount = 32
static

Max number of face can be detected in one frame, 32 by default


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