From 96024c860270477fe9cf387ba855632a3ead08ee Mon Sep 17 00:00:00 2001 From: pansen <pansen626@sina.com> Date: 星期二, 18 十二月 2018 18:08:24 +0800 Subject: [PATCH] add Face tracking demo code --- QiaoJiaSystem/testCodeMod/FaceDefine.h | 105 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 65 insertions(+), 40 deletions(-) diff --git a/QiaoJiaSystem/testCodeMod/FaceDefine.h b/QiaoJiaSystem/testCodeMod/FaceDefine.h index 58bd5a6..cf7431f 100644 --- a/QiaoJiaSystem/testCodeMod/FaceDefine.h +++ b/QiaoJiaSystem/testCodeMod/FaceDefine.h @@ -12,49 +12,74 @@ using std::vector; using std::string; -struct FaceFeatureResult { - vector<unsigned char> feature; - float score; -}; +namespace BasicFace { -struct FaceDetectResult { - FaceDetectResult() : attributes(256), trackingId(-1) {} + typedef vector<unsigned char> Feature; - int id; - int left; - int top; - int width; - int height; - float score; - float yaw; // 姘村钩杞锛岀湡瀹炲害閲忕殑宸﹁礋鍙虫, 鍗曚綅锛岃搴� - float pitch; // 淇话瑙掞紝鐪熷疄搴﹂噺鐨勪笂璐熶笅姝�, 鍗曚綅锛岃搴� - float roll; // 鏃嬭浆瑙掞紝鐪熷疄搴﹂噺鐨勫乏璐熷彸姝�, 鍗曚綅锛岃搴� - float angle; // sqrt(yaw*yaw/3+pitch*pitch/3+roll*roll/3) - vector<char> attributes; - float trackingId; -}; -struct DbSearchResult { - int index; - float confidence; - string dbId; -}; + struct InitParam { + int nDeviceID;//device id for GPU device.eg:0,1,2,3..... -struct FaceSearchResult { - int index; - int left; - int top; - int width; - int height; - float score; - float confidence; - string dbId; -}; + int nImageWidth;//image width of video + int nImageHeight;//image height of video + int nMaxFaceNum;//max face number for tracking + int nSampleSize;//down sample size for face detection + int nDetectionIntervalFrame;//interval frame number of face detection for face tracking -struct FaceImage { - int width; - int height; - int stride; - unsigned char *data; -}; + InitParam() { + nMaxFaceNum = 100; + nSampleSize = 640; + nDeviceID = 0; + nDetectionIntervalFrame = 5; + } + }; + + struct FaceFeatureResult { + Feature feature; + float score; + }; + + struct FaceDetectResult { + FaceDetectResult() : attributes(256), trackingId(-1) {} + + int id; + int left; + int top; + int width; + int height; + float score; + float yaw; // 姘村钩杞锛岀湡瀹炲害閲忕殑宸﹁礋鍙虫, 鍗曚綅锛岃搴� + float pitch; // 淇话瑙掞紝鐪熷疄搴﹂噺鐨勪笂璐熶笅姝�, 鍗曚綅锛岃搴� + float roll; // 鏃嬭浆瑙掞紝鐪熷疄搴﹂噺鐨勫乏璐熷彸姝�, 鍗曚綅锛岃搴� + float angle; // sqrt(yaw*yaw/3+pitch*pitch/3+roll*roll/3) + vector<char> attributes; + long trackingId; + }; + + struct DbSearchResult { + int index; + float confidence; + string dbId; + }; + + struct FaceSearchResult { + int index; + int left; + int top; + int width; + int height; + float score; + float confidence; + string dbId; + }; + + struct FaceImage { + int width; + int height; + int stride; + unsigned char *data; + }; + +} + #endif //TESTCODE_FACEDEFINE_H -- Gitblit v1.8.0