移动端的qt版本人脸流程
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#ifndef THFEATURE_I_H
#define THFEATURE_I_H
 
#include "THFaceImage_i.h"
 
/*
* ============================================================================
*  Name     : THFeature_i.h
*  Part of  : Face Feature (THFeature) SDK
*  Created  : 10.18.2016 by xxx
*  Description:
*     THFeature_i.h -  Face Feature(THFeature) SDK header file
*  Version  : 5.0.0
*  Copyright: All Rights Reserved by XXX
*  Revision:
* ============================================================================
*/
 
#define THFEATURE_API extern "C"
 
struct TH_Image_Data
{
    BYTE* bgr;//MUST BE bgr format buffer,the size is width*height*3 bytes
    int width;//image width
    int height;//image height
};
 
struct EF_Param
{
    int nDeviceID;//device id for GPU device.eg:0,1,2,3.....
    EF_Param()
    {
        nDeviceID = 0;
    }
};
//////API define//////
 
THFEATURE_API short EF_Init(int nChannelNum);
/*
The EF_Init function will initialize the Face Feature(THFeature) algorithm module
 
Parameters:
nChannelNum,the channel number,support for muti-thread,one channel stand for one thread.max value is 32.
Return Values:
If the function succeeds, the return value is valid channel number.
If the function fails, the return value is 0 or nagative;
error code:
-99,invalid license.
-1,open file "feadb.db*" error
-2,check  file "feadb.db*" error
-3,read  file "feadb.db*" error
Remarks:
This function can be called one time at program initialization.
*/
 
THFEATURE_API int EF_Size();
/*
The EF_Size function will return face feature size.
 
Parameters:
No parameter.
Return Values:
If the function succeeds, the return value is face feature size.
If the function fails, the return value is 0 or nagative;
error code:
-99,invalid license.
Remarks:
No remark.
*/
 
THFEATURE_API int EF_Extract(short nChannelID, BYTE* pBuf, int nWidth, int nHeight, int nChannel, THFI_FacePos* ptfp, BYTE* pFeature);
/*
The EF_Extract function execute face feature extraction from one photo
 
Parameters:
nChannelID[input],channel ID(from 0 to nChannelNum-1)
pBuf[input],point to an image buffer,BGR format.
nWidth[input],the image width.
nHeight[input],the image height.
nChannel[input],image buffer channel,must be 3
ptfp[input],the facial data of a face.
pFeature[output],the face feature buffer
Return Values:
If the function succeeds, the return value is 1.
If the function fails, the return value is nagative.
error code:
-99,invalid license.
-1,pBuf,ptfp,pFeature is NULL
-2,nChannelID is invalid or SDK is not initialized
Remarks:
No remark.
*/
 
THFEATURE_API int EF_Extract_M(short nChannelID, BYTE* pBuf, int nWidth, int nHeight, int nChannel, THFI_FacePos* ptfps, BYTE* pFeatures, int nFaceNum);
/*
The EF_Extract_M function execute face feature extraction for muti-faces from one photo
 
Parameters:
nChannelID[input],channel ID(from 0 to nChannelNum-1)
pBuf[input],point to an image buffer,BGR format.
nWidth[input],the image width.
nHeight[input],the image height.
nChannel[input],image buffer channel,must be 3
ptfps[input],the facial data of muti-faces
pFeatures[output],the face feature buffer for muti-faces
nFaceNum[input],the face number
Return Values:
If the function succeeds, the return value is 1.
If the function fails, the return value is 0 or nagative.
error code:
-99,invalid license.
-1,pBuf,ptfps,pFeatures is NULL
-2,nChannelID is invalid or SDK is not initialized
Remarks:
No remark.
*/
 
THFEATURE_API int EF_Extracts(short nChannelID, TH_Image_Data* ptids, THFI_FacePos* ptfps, BYTE* pFeatures, int nNum);
/*
The EF_Extracts function execute face feature extraction for muti-faces from muti-photos
 
Parameters:
nChannelID[input],channel ID(from 0 to nChannelNum-1)
ptids[input],the image data list of muti-photos
ptfps[input],the facial data list of muti-photos(one image data-one facial data)
pFeatures[output],the face feature buffer for muti-faces
nNum[input],the image data number
Return Values:
If the function succeeds, the return value is 1.
If the function fails, the return value is 0 or nagative.
error code:
-99,invalid license.
-1,ptids,ptfp,pFeature is NULL
-2,nChannelID is invalid or SDK is not initialized
Remarks:
No remark.
*/
 
THFEATURE_API float EF_Compare(BYTE* pFeature1, BYTE* pFeature2);
/*
The EF_Compare function execute two face features compare.
 
Parameters:
pFeature1[input],point to one face feature buffer.
pFeature2[input],point to another face feature buffer.
Return Values:
the return value is the two face features's similarity.
Remarks:
No remark.
*/
 
THFEATURE_API void EF_Release();
/*
The EF_Release function will release the Face Feature (THFeature) algorithm module
 
Parameters:
No parameter.
Return Values:
No return value.
Remarks:
This function can be called one time at program Un-Initialization.
*/
 
THFEATURE_API short EF_Init_Ex(int nChannelNum, EF_Param* pParam = NULL);
/*
The EF_Init_Ex function will initialize the Face Feature(THFeature) algorithm module,only for GPU version
 
Parameters:
nChannelNum,the channel number,support for muti-thread,one channel stand for one thread.max value is 32.
pParam,initialize parameter
Return Values:
If the function succeeds, the return value is valid channel number.
If the function fails, the return value is 0 or nagative;
error code:
-99,invalid license.
-1,open file "feadb.db*" error
-2,check  file "feadb.db*" error
-3,read  file "feadb.db*" error
Remarks:
This function can be called one time at program initialization.
*/
 
#endif