houxiao
2017-08-16 a188ad2e23ef190c8a044b17bc467fa3e2ae0ca5
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
#ifndef _SAMPLE_FACE_SEARCH_H_
#define _SAMPLE_FACE_SEARCH_H_
 
#include <stdint.h>
#include <vector>
 
typedef void* cv_handle_t;
struct cv_feature_t;
 
struct stface_handles
{
    cv_handle_t handle_verify;
    cv_handle_t handle_detect;
    cv_handle_t handle_db;
    
    stface_handles() : handle_verify(nullptr), handle_detect(nullptr), handle_db(nullptr)
    {}
};
 
struct STFaceImage
{
    int32_t db_id;
    int16_t mb_type; // MB_Frame::MBFType
    int16_t width;
    int16_t height;
    uint32_t size;
    const uint8_t* buff;
};
 
struct TopIdxScore
{
    int idx;
    float score;
    
    TopIdxScore(int _idx, float _score) : idx(_idx), score(_score)
    {}
};
 
typedef std::vector<TopIdxScore> top_idx_score_vect_t;
 
cv_feature_t *stface_extract_feature(stface_handles& handles, const char *image_path);
cv_feature_t *stface_extract_feature(stface_handles& handles, const STFaceImage& image);
 
float stface_compare(stface_handles& handles, const STFaceImage& image1, const STFaceImage& image2);
 
int stface_db_add(stface_handles& handles, const char *image_path);
int stface_db_add(stface_handles& handles, const STFaceImage& image);
 
bool stface_db_del(stface_handles& handles, int idx);
 
bool stface_db_save(stface_handles& handles, const char *db_path);
 
bool stface_db_load(stface_handles& handles, const char *db_path);
 
bool stface_db_create(stface_handles& handles, const char *db_path);
 
bool stface_db_gen(stface_handles& handles, char *image_list, char *output_db_path);
 
bool stface_search_db(stface_handles& handles, char *image_path);
bool stface_search_db(stface_handles& handles, const STFaceImage& image, top_idx_score_vect_t& result);
 
bool stface_search_list(stface_handles& handles, char *image_path, char *list_path);
 
void stface_get_help();
 
int stface_main(int argc, char *argv[]);
 
int stface_init_license(const char* lic_path);
 
#endif