From 5f6f6485349c6c2b4d046f4307a8b8c8b251bdc1 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 03 五月 2017 10:07:13 +0800
Subject: [PATCH]
---
RtspFace/SensetimeFaceAPIWrapper/src/test.cpp | 49 ++++++++++++++++++++++++++++---------------------
1 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp
index 3c804bb..8ae3ba2 100644
--- a/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp
+++ b/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp
@@ -3,6 +3,7 @@
#include <stdio.h>
#include "faceAPI.h"
+#include "tools.h"
using namespace std;
@@ -13,33 +14,39 @@
char *db_path = "./out.db";
char *image_path = argv[1];
char *image_list = "../test_image/imglist";
-
-
-// person p={0,"axsdcc",1};
-
+ my_db mydb= {"root","Basic@2017","localhost","demo",3306};
+
+ person p= {0,"axsdcc",1};
+
cv::Mat bgr_image = cv::imread(image_path);
- if(bgr_image.data != NULL) {
+ if(bgr_image.data != NULL)
+ {
cout<<image_path<<endl;
- } else {
+ }
+ else
+ {
cout<<"image is null"<<endl;
cout<<image_path<<endl;
}
+
+// FaceDB db =FaceDB();
+// db.init(db_path);
+// int id = db.search_db(db.extract_feature(bgr_image));
+ int idx = -11;
+ tools tool=tools();
+ tool.init(mydb,db_path);
+ cout<<"======tools init ==========="<<endl;
+ if(tool.search(bgr_image,&p))
+ {
+ idx=tool.reg(bgr_image,&p);
+ }
- FaceDB db =FaceDB();
- db.init(db_path);
- int id = db.search_db(db.extract_feature(bgr_image));
-// int idx = -11;
-// tools tool=tools();
-// tool.init();
-// cout<<"======tools init ==========="<<endl;
- //idx=tool.reg(bgr_image,&p);
-// tool.search(bgr_image,&p);
- cout<<"id="<<id<<endl;
+ cout<<"id="<<idx<<endl;
cout<<"============================================"<<endl;
-// cout<<"p_id="<<p.p_id<<endl;
-// cout<<"name="<<p.name<<endl;
-// cout<<"f_id="<<p.f_id<<endl;
-
-
+ cout<<"p_id="<<p.p_id<<endl;
+ cout<<"name="<<p.name<<endl;
+ cout<<"f_id="<<p.f_id<<endl;
+
+
return 0;
}
--
Gitblit v1.8.0