| | |
| | | #include "sample_face_search.h" |
| | | #include <cv_face.h> |
| | | |
| | | #define FDP_FDR_INVALID FDP_FaceDetectResult(0, 0) |
| | | #define FDP_FDR_INVALID FDP_FaceDetectResult(0, 0, 0) |
| | | #define ENABLE_AUTO_CREATE_STFACEDB |
| | | #define ENABLE_SEARCH_IN_NEGATIVE_DBID |
| | | #define ENABLE_SEARCH_IN_NEGATIVE_DBID |
| | |
| | | |
| | | 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; |
| | | } |
| | | }; |
| | | |
| | |
| | | return detect_neg(img); |
| | | } |
| | | |
| | | return FDP_FaceDetectResult(img.db_id, result[0].idx); |
| | | return FDP_FaceDetectResult(img.db_id, result[0].idx, result[0].score * 1000); |
| | | } |
| | | |
| | | return FDP_FDR_INVALID; |
| | |
| | | if (idx <= 1) |
| | | return FDP_FDR_INVALID; |
| | | else |
| | | return FDP_FaceDetectResult(img.db_id, idx); |
| | | 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; |
| | | } |