pans
2017-01-13 6cd2711a88cdadcc11a4536b9262c55b836decd0
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
#include <iostream>
#include <vector>
#include <stdio.h>
 
#include "faceAPI.h"
#include "tools.h"
 
using namespace std;
 
int main(int argc, char *argv[] )
{
 
    //Îļþ·¾¶
    char *db_path = "./out.db";
    char *image_path = argv[1];
    char *image_list = "../test_image/imglist";
    my_db mydb= {"root","Basic@2017","localhost","demo",3306};
 
    person p={0,"axsdcc",1};
 
    cv::Mat bgr_image = cv::imread(image_path);
    if(bgr_image.data != NULL)
    {
        cout<<image_path<<endl;
    }
    else
    {
        cout<<"image is null"<<endl;
        cout<<image_path<<endl;
    }
 
//    FaceDB db =FaceDB();
//    db.init(db_path);
//    int id = db.search_db(db.extract_feature(bgr_image));
    int idx = -11;
    tools tool=tools();
    tool.init(mydb,db_path);
    cout<<"======tools init ==========="<<endl;
    //idx=tool.reg(bgr_image,&p);
    tool.search(bgr_image,&p);
    cout<<"id="<<idx<<endl;
    cout<<"============================================"<<endl;
    cout<<"p_id="<<p.p_id<<endl;
    cout<<"name="<<p.name<<endl;
    cout<<"f_id="<<p.f_id<<endl;
 
 
    return 0;
}