From 6cd2711a88cdadcc11a4536b9262c55b836decd0 Mon Sep 17 00:00:00 2001 From: pans <pans@454eff88-639b-444f-9e54-f578c98de674> Date: 星期五, 13 一月 2017 16:29:51 +0800 Subject: [PATCH] --- RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp | 6 +++++- RtspFace/SensetimeFaceAPIWrapper/src/test.cpp | 4 ++-- RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp | 12 ++++++++++++ RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h | 2 +- RtspFace/SensetimeFaceAPIWrapper/src/tools.h | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp index 50c2cf8..e45806d 100644 --- a/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp +++ b/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp @@ -279,15 +279,27 @@ cv_face_t *p_face = NULL; int face_count = 0; cv_result_t st_result = CV_OK; + fprintf(stderr, "cv_face_detect start!\n"); + if (handle_detect != NULL) + { + fprintf(stderr, "handle_detect is not null!\n"); + } + else + { + fprintf(stderr, "handle_detect is null!\n"); + } st_result = cv_face_detect(handle_detect, image_color.data, CV_PIX_FMT_BGR888, image_color.cols, image_color.rows, image_color.step, CV_FACE_UP, &p_face, &face_count); + fprintf(stderr, "cv_face_detect end!\n"); if (face_count >= 1) { + fprintf(stderr, "cv_verify_get_feature end!\n"); st_result = cv_verify_get_feature(handle_verify, (unsigned char *)image_color.data, CV_PIX_FMT_BGR888, image_color.cols, image_color.rows, image_color.step, p_face, &p_feature, NULL); + fprintf(stderr, "cv_verify_get_feature end!\n"); if (st_result != CV_OK) { fprintf(stderr, "cv_verify_get_feature failed, error code %d\n", st_result); diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h b/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h index 2d7326d..5dd5201 100644 --- a/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h +++ b/RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h @@ -5,7 +5,7 @@ #include <cv_face.h> #include "time_helper.h" - +class FaceDB; class FaceAPI { diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp index 593f91f..64a17e5 100644 --- a/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp +++ b/RtspFace/SensetimeFaceAPIWrapper/src/test.cpp @@ -16,7 +16,7 @@ char *image_list = "../test_image/imglist"; my_db mydb= {"root","Basic@2017","localhost","demo",3306}; -// person p={0,"axsdcc",1}; + person p={0,"axsdcc",1}; cv::Mat bgr_image = cv::imread(image_path); if(bgr_image.data != NULL) @@ -38,7 +38,7 @@ 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; diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp index cca460f..5534570 100644 --- a/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp +++ b/RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp @@ -13,10 +13,14 @@ if(dbu.db_init(mydb)) { db_path = db_path_t; - return true; } else return false; + if(!f_api.do_init(db_path_t)){ + return false; + } + else + return true; } int tools::search(cv::Mat image,person *p) diff --git a/RtspFace/SensetimeFaceAPIWrapper/src/tools.h b/RtspFace/SensetimeFaceAPIWrapper/src/tools.h index a1530f9..61ff9b8 100644 --- a/RtspFace/SensetimeFaceAPIWrapper/src/tools.h +++ b/RtspFace/SensetimeFaceAPIWrapper/src/tools.h @@ -22,7 +22,7 @@ char* db_path; person per; DBuntil dbu; - faceAPI f_api; + FaceAPI f_api; }; -- Gitblit v1.8.0