From 6b69abb97aa9a16b2a875b778a3929cd898dd5c1 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 19 四月 2017 15:43:56 +0800
Subject: [PATCH]
---
RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
index ad8166d..a8be726 100644
--- a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
+++ b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
@@ -6,19 +6,29 @@
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)
@@ -54,10 +64,6 @@
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)
{
@@ -68,10 +74,11 @@
int tools::do_register(cv::Mat image,person *p)
{
- p= {};
+ //p= {};
p->f_id = f_api.do_register(image);
if(p->f_id > 0)
{
+ fprintf(stderr, " tools::do_register %d\n",p->f_id);
if(dbu.db_register(p))
{
return 0;
--
Gitblit v1.8.0