From 004e5b3424f02b2b413a52d7162594c4cc5c5547 Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 28 六月 2017 14:02:52 +0800
Subject: [PATCH] add compare bin proto

---
 FaceServer/STFaceCache.cpp |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/FaceServer/STFaceCache.cpp b/FaceServer/STFaceCache.cpp
index b527a40..fa5bf46 100644
--- a/FaceServer/STFaceCache.cpp
+++ b/FaceServer/STFaceCache.cpp
@@ -23,6 +23,16 @@
 	STFaceCacheContext() : handle_verify(nullptr), handle_detect(nullptr)
 	{
 	}
+	
+	stface_handles getStFaceHandles()
+	{
+		//return (stface_handles*)this;
+		
+		stface_handles handles;
+		handles.handle_verify = handle_verify;
+		handles.handle_detect = handle_detect;
+		return handles;
+	}
 };
 
 struct STFaceDBContext
@@ -320,3 +330,14 @@
 	else
 		return FDP_FaceDetectResult(img.db_id, idx, 0);
 }
+
+FDP_FaceDetectResult STFaceCache::compare(const STFaceImage& img1, const STFaceImage& img2)
+{
+	stface_ctx_map_t& dbContext(*(stface_ctx_map_t*)_dbContext);
+	STFaceCacheContext& cacheContext(*(STFaceCacheContext*)_cacheContext);
+
+	stface_handles handles(cacheContext.getStFaceHandles());
+	float c = stface_compare(handles, img1, img2);
+	FDP_FaceDetectResult result(0, 0, int(c * 1000));
+	return result;
+}

--
Gitblit v1.8.0