From bd64063bd5f2adfdedc7caa609f6554a78c79ab0 Mon Sep 17 00:00:00 2001
From: pans <pans@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 13 一月 2017 15:10:49 +0800
Subject: [PATCH] 

---
 RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
index ad8166d..cca460f 100644
--- a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
+++ b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
@@ -6,19 +6,25 @@
 
 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;
+		return true;
+	}
+	else
+		return false;
 }
 
 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 +60,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)
 	{

--
Gitblit v1.8.0