a
554325746@qq.com
2020-01-20 b2ab598e535926e22e4a16e35d955345bfa841ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef THFACELIVE_I_H
#define THFACELIVE_I_H
 
/*
* ============================================================================
*  Name     : THFaceLive_i.h
*  Part of  : Face Liveness Detect (THFaceLive) SDK
*  Created  : 7.14.2018 by XXX
*  Description:
*     THFaceLive_i.h -  Face Liveness Detect (THFaceLive) SDK header file
*  Version  : 3.0.0
*  Copyright: All Rights Reserved by XXXX
*  Revision:
* ============================================================================
*/
#include "THFaceImage_i.h"
 
#define THFACELIVE_API extern "C" __attribute__((visibility ("default")))
 
THFACELIVE_API void THFL_SDK_SetDir(const char* modelDir, const char* tmpDir);
/*
 The THFL_SDK_SetDir function will set SDK environment directory,it must be called before THFL_Create
 Parameters:
    modelDir[input],存放 libTHFacelive_*.so文件的目录,如果modelDir为NULL,则使用libTHFaceLive.so所在的目录
    tmpDir[input],临时读写目录,供算法初始化使用,算法必须具有临时目录下的读写权限,如果tmpDir为NULL,则使用默认路径"/tmp/"        
 Return Values:
    No return value.
 Remarks:         
    It must be called before THFL_Create.
*/
 
THFACELIVE_API int    THFL_Create(short nChannelNum);
/*
The THFL_Create function will initialize the algorithm engine module
 
Parameters:
    nChannelNum[intput],algorithm channel num,for multi-thread mode,one thread uses one channel
Return Values:
    If the function succeeds, the return value is valid channel number.
    If the function fails, the return value is negative;
Remarks:
    This function only can be called one time at program initialization.
*/
 
THFACELIVE_API void    THFL_Release();
/*
The THFL_Release function will release the algorithm engine module
 
Parameters:
    No parameter.
Return Values:
    No return value.
Remarks:
    This function only can be called one time at program exit.
*/
 
THFACELIVE_API int    THFL_Detect(short nChannelID, unsigned char* pBuf_color, unsigned char* pBuf_bw, int nWidth, int nHeight, THFI_FacePos*  ptfp_color, THFI_FacePos* ptfp_bw, int nThreshold = 50, float* fScore = NULL);
/*
The THFL_Detect function execute face liveness detection
 
Parameters:
    nChannelID[input],channel ID(from 0 to nChannelNum-1)
    pBuf_color[input],color camera image data buffer,BGR format.
    pBuf_bw[input],black-white camera image data buffer,BGR format.
    nWidth[input],image width.
    nHeight[input],image height.
    ptfp_color[input],face data of color camera image.(THFI_FacePos format,return by THFI_DetectFace of THFaceImage SDK)
    ptfp_bw[input],face data of black-white camera image.(THFI_FacePos format,return by THFI_DetectFace of THFaceImage SDK)
    nThreshold[input],score threshold(sugguest value is 50)
Return Values:
    If the function succeeds, the return value is 0 or 1.(0->fake face,1->live face)
    If the function fails, the return value is negative.
Remarks:
*/
 
THFACELIVE_API int        THFL_Create_Ex(short nChannelNum, int omp_thread_num=2);
/*
The THFL_Create_Ex function will initialize the algorithm engine module with openmp thread num
 
Parameters:
    nChannelNum[intput],algorithm channel num,for multi-thread mode,one thread uses one channel
    omp_thread_num[input],thread num for openmp
Return Values:
    If the function succeeds, the return value is valid channel number.
    If the function fails, the return value is zero or negative;
error code:
    -99,invalid license.
Remarks:
    This function only can be called one time at program initialization.
*/
 
#endif