#ifndef _FACEAPI_H_
|
#define _FACEAPI_H_
|
|
#include <opencv2/opencv.hpp>
|
#include <cv_face.h>
|
#include "time_helper.h"
|
|
class FaceDB;
|
|
class FaceAPI
|
{
|
public:
|
FaceAPI();
|
~FaceAPI();
|
int do_init(char* db_path);
|
//²éѯ ǰ̨µ÷ÓÃ
|
int do_reasch(char* s_feature);
|
int do_reasch(cv::Mat image);
|
//×¢²á ºǫ́ÁíÒ»½ø³Ìµ÷ÓÃ
|
int do_register(cv::Mat image);
|
|
private:
|
|
//µ÷ÓÃËÑË÷
|
int p_img_search(cv_feature_t *p_feature);
|
|
//ת»»º¯Êý
|
int get_char(cv_feature_t *p_feature,char* feature_str);
|
int get_feature(char *feature_str,cv_feature_t *p_feature);
|
|
FaceDB *fdb;
|
cv_feature_t* p_f;
|
};
|
|
|
class FaceDB
|
{
|
public:
|
FaceDB();
|
virtual ~FaceDB();
|
|
//ÈËÁ³ÑéÖ¤
|
cv_handle_t handle_verify;
|
//Êý¾Ý¿â²Ù×÷
|
cv_handle_t handle_db;
|
//¾²Ì¬ÈËÁ³Ê¶±ð
|
cv_handle_t handle_detect;
|
|
//³õʼ»¯
|
bool init(char* db_path);
|
//±£´æÊý¾Ý¿â
|
bool finally();
|
|
//ËÑË÷SDKÊý¾Ý¿â
|
int search_db(cv_feature_t* p_feature );
|
//Ìí¼Ó¼Ç¼
|
int db_add(cv_feature_t* p_feature);
|
|
|
//ÌáÈ¡ÌØÕ÷Öµ
|
cv_feature_t *extract_feature(cv::Mat image_color);
|
|
private:
|
cv_result_t cv_result;
|
char* db_path;
|
|
//¼ÓÔØsdkÊý¾Ý¿â
|
bool db_load();
|
bool db_save();
|
};
|
|
#endif
|