git-svn-id: http://192.168.1.226/svn/proxy@74 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | mysql_close(&myCont);
|
| | | }
|
| | |
|
| | | person DBuntil::db_rearch(int f_id)
|
| | | *person DBuntil::db_rearch(int f_id)
|
| | | {
|
| | | person p= {0,""};
|
| | | db_select(f_id,&p);
|
| | | //对结构体赋值
|
| | | return p;
|
| | | return &p;
|
| | | }
|
| | |
|
| | | bool DBuntil::db_select(int f_id,person* per)
|
| | |
| | | DBuntil();
|
| | | DBuntil(my_db mydb);
|
| | | ~DBuntil();
|
| | | person db_rearch(int f_id);
|
| | | *person db_rearch(int f_id);
|
| | |
|
| | | bool db_register(int f_id,person *p);
|
| | |
|
| | |
| | | mysql_close(&myCont);
|
| | | }
|
| | |
|
| | | person DBuntil::db_rearch(int f_id)
|
| | | *person DBuntil::db_rearch(int f_id)
|
| | | {
|
| | | person p= {0,""};
|
| | | db_select(f_id,&p);
|
| | | //对结构体赋值
|
| | | return p;
|
| | | return &p;
|
| | | }
|
| | |
|
| | | bool DBuntil::db_select(int f_id,person* per)
|
| | |
| | |
|
| | | int idx = -11;
|
| | | tools tool=tools();
|
| | | idx=tool->register(bgr_image,p);
|
| | | idx=tool->reg(bgr_image,p);
|
| | | cout<<"idx="<<idx<<endl;
|
| | |
|
| | |
|
| | |
| | | |
| | | int tools::search(cv::Mat image,person *p) |
| | | { |
| | | idx = f_api->do_reasch(image); |
| | | idx = f_api.do_reasch(image); |
| | | if(idx<0) |
| | | { |
| | | p = dbu->db_rearch(int); |
| | | p = dbu.db_rearch(idx); |
| | | if(p != NULL) |
| | | { |
| | | return 0; |
| | |
| | | |
| | | int tools::search(char* s_feature,person *p) |
| | | { |
| | | idx = f_api->do_reasch(s_feature); |
| | | idx = f_api.do_reasch(s_feature); |
| | | if(idx<0) |
| | | { |
| | | p = db_rearch(int); |
| | | p = dbu.db_rearch(idx); |
| | | if(p != NULL) |
| | | { |
| | | return 0; |
| | |
| | | return -1; |
| | | } |
| | | |
| | | int tools::register(cv::Mat image,person *p) |
| | | int tools::reg(cv::Mat image,person *p) |
| | | { |
| | | if(do_register(image,p) == 0){ |
| | | return 0; |
| | |
| | | person tools::do_search(int idx) |
| | | { |
| | | person p; |
| | | p = dbu->db_rearch(int); |
| | | p = dbu.db_rearch(idx); |
| | | return p; |
| | | } |
| | | |
| | | int tools::do_register(cv::Mat image,person *p) |
| | | { |
| | | idx = f_api->do_register(image); |
| | | idx = f_api.do_register(image); |
| | | if(idx<0) |
| | | { |
| | | p->f_id = idx; |
| | | idx = dbu->do_register(idx,p); |
| | | if(idx) |
| | | if(dbu.db_register(idx,p)) |
| | | { |
| | | return 0; |
| | | } |
| | |
| | | ~tools(); |
| | | int search(cv::Mat image,person *p); |
| | | int search(char* s_feature,person *p); |
| | | int register(cv::Mat image,person *p); |
| | | int reg(cv::Mat image,person *p); |
| | | private: |
| | | int do_register(cv::Mat image,person *p); |
| | | person do_search(int idx); |
| | | int idx; |
| | | DBuntil dbu; |
| | | faceAPI f_api; |
| | | } |
| | | }; |
| | | |
| | | #endif |