git-svn-id: http://192.168.1.226/svn/proxy@72 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | int DBuntil::db_add(int f_id,person *per)
|
| | | bool DBuntil::db_add(int f_id,person *per)
|
| | | {
|
| | | //
|
| | | sprintf( sql, "INSERT INTO user_info(NAME, img) VALUES('%s', NULL)" , per->name );
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | int DBuntil::db_register(int f_id,person *per)
|
| | | bool DBuntil::db_register(int f_id,person *per)
|
| | | {
|
| | | if(db_add(f_id,per)){
|
| | | return true;
|
| | |
| | | ~DBuntil();
|
| | | person db_rearch(int f_id);
|
| | |
|
| | | int db_register(int f_id,person *p);
|
| | | bool db_register(int f_id,person *p);
|
| | |
|
| | | private:
|
| | |
|
| | | int db_add(int f_id,person *per);
|
| | | bool db_add(int f_id,person *per);
|
| | | int db_update();
|
| | | int db_select(int f_id,person *per);
|
| | | bool db_select(int f_id,person *per);
|
| | |
|
| | | char sql[1024];
|
| | | int res;
|
| | |
| | | #include "tools.h" |
| | | |
| | | tools::tools() {} |
| | | |
| | | tools::~tools() {} |
| | | |
| | | int tools::search(cv::Mat image,person *p) |
| | | { |
| | | idx = f_api->do_reasch(image); |
| | | if(idx<0) |
| | | { |
| | | p = f_db->db_rearch(int); |
| | | if(p != NULL) |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | int tools::search(char* s_feature,person *p) |
| | | { |
| | | idx = f_api->do_reasch(s_feature); |
| | | if(idx<0) |
| | | { |
| | | p = db_rearch(int); |
| | | if(p != NULL) |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | int tools::register(cv::Mat image,person *p) |
| | | { |
| | | do_register(image,p); |
| | | } |
| | | |
| | | person tools::do_search(int idx) |
| | | { |
| | | person p; |
| | | p = f_db->db_rearch(int); |
| | | return p; |
| | | } |
| | | |
| | | int tools::do_register(cv::Mat image,person *p) |
| | | { |
| | | idx = f_api->do_register(image); |
| | | if(idx<0) |
| | | { |
| | | idx = f_db->do_register(idx,p); |
| | | if(idx) |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | return -1; |
| | | |
| | | } |
| | |
| | | #include "DBuntil.h" |
| | | #include "faceAPI.h" |
| | | |
| | | class faceAPI; |
| | | class DButil; |
| | | class faceAPI f_api; |
| | | class DButil f_db; |
| | | |
| | | class tools |
| | | { |
| | |
| | | ~tools(); |
| | | int search(cv::Mat image,person *p); |
| | | int search(char* s_feature,person *p); |
| | | int register(cv::Mat image,person *p); |
| | | private: |
| | | int do_register(cv::Mat image,person *p); |
| | | person do_search(int idx); |
| | | int idx; |
| | | } |
| | | |
| | | #endif |