From 2abba1eed779847b85ef44401f2ae410fba56cd8 Mon Sep 17 00:00:00 2001 From: pans <pans@454eff88-639b-444f-9e54-f578c98de674> Date: 星期三, 04 一月 2017 19:42:20 +0800 Subject: [PATCH] --- RtspFace/demo/src/tools.cpp | 76 +++++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 1 deletions(-) diff --git a/RtspFace/demo/src/tools.cpp b/RtspFace/demo/src/tools.cpp index ff644cc..5f82a83 100644 --- a/RtspFace/demo/src/tools.cpp +++ b/RtspFace/demo/src/tools.cpp @@ -1 +1,75 @@ -#include "tools.h" \ No newline at end of file +#include "tools.h" + +tools::tools() +{ + my_db mydb= {"root","Basic@2017","localhost","demo",3306}; + + dbu = DBuntil(mydb); +} + +tools::~tools() {} + +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) + { + return 0; + } + } + return -1; +} + +int tools::search(char* s_feature,person *p) +{ + p={}; + p->f_id = f_api.do_reasch(s_feature); + if(p->f_id > 0) + { + if(do_search(p) == 0) + { + return 0; + } + } + return -1; +} + +int tools::reg(cv::Mat image,person *p) +{ + if(do_register(image,p) == 0) + { + return 0; + } + return -1; +} + +int tools::do_search(person *p) +{ + dbu.db_search(p); + if(p->p_id != NULL) + { + return 0; + } + return -1; +} + +int tools::do_register(cv::Mat image,person *p) +{ + p={}; + p->f_id = f_api.do_register(image); + if(p->f_id > 0) + { + if(dbu.db_register(p)) + { + return 0; + } + } + return -1; + +} \ No newline at end of file -- Gitblit v1.8.0