| | |
| | | |
| | | tools::~tools() {} |
| | | |
| | | bool tools::init(){ |
| | | my_db mydb= {"root","Basic@2017","localhost","demo",3306}; |
| | | //DBuntil dbu =DBuntil(); |
| | | return dbu.db_init(mydb); |
| | | bool tools::init(my_db mydb,char* db_path_t) |
| | | { |
| | | |
| | | //my_db mydb= {"root","Basic@2017","localhost","demo",3306}; |
| | | if(dbu.db_init(mydb)) |
| | | { |
| | | db_path = db_path_t; |
| | | } |
| | | else |
| | | return false; |
| | | if(!f_api.do_init(db_path_t)){ |
| | | return false; |
| | | } |
| | | else |
| | | return true; |
| | | } |
| | | |
| | | int tools::search(cv::Mat image,person *p) |
| | | { |
| | | //p={}; |
| | | int temp = f_api.do_reasch(image); |
| | | std::cout<<"temp="<<temp<<std::endl; |
| | | p->f_id = temp; |
| | | std::cout<<"p->f_id"<<p->f_id<<std::endl; |
| | | |
| | | if(p->f_id > 0) |
| | | { |
| | | if(do_search(p) == 0) |
| | |
| | | |
| | | int tools::do_search(person *p) |
| | | { |
| | | //if(dbu.myCont == NULL){ |
| | | // std::cout<<"myCont is null"<<std::endl; |
| | | //} |
| | | |
| | | dbu.db_search(p); |
| | | if(p->p_id != NULL) |
| | | { |