//
|
// Created by pans on 5/2/18.
|
//
|
|
#ifndef VIDEOSTRUCTURE_FACEDATA_HPP
|
#define VIDEOSTRUCTURE_FACEDATA_HPP
|
|
#include <vector>
|
|
struct FaceImageN {
|
int width;
|
int height;
|
int stride;
|
unsigned char *data;
|
};
|
struct FaceFeaWithScore {
|
int left;
|
int top;
|
int width;
|
int height;
|
std::vector<unsigned char> feature;
|
float score;
|
};
|
|
typedef std::vector<FaceFeaWithScore> Features;
|
|
struct FaceResult {
|
long id;
|
std::string uuid;
|
std::string tableName;
|
float confidence;
|
std::string face_img_url;
|
std::string idCard;
|
std::string alarmRet;
|
};
|
|
struct DbAction {
|
long id;
|
std::string tableName;
|
std::string face_img_url; //#todo 以图搜图多底库数据同步
|
long actionNo; // 1 add; 2, remove
|
};
|
|
// sequence<DbAction> DbActions;
|
|
typedef std::vector<FaceResult> FaceResults;
|
typedef std::map<float, FaceResult, std::greater<float>> mapFaceResults;
|
|
|
namespace {
|
|
|
typedef std::vector<unsigned char> Feature;
|
typedef std::vector<unsigned char> Data;
|
|
struct POINT {
|
int x;
|
int y;
|
};
|
|
struct RECT {
|
int left;
|
int top;
|
int right;
|
int bottom;
|
};
|
|
struct FaceAngle {
|
int yaw;
|
int pitch;
|
int roll;
|
float confidence;
|
};
|
|
struct ThftResult {
|
int gender;//1-male,0-female
|
int age;//range[0-100]
|
int race; //[1-white,2-yellow,3-black]
|
int beauty_level;//range[0-100]
|
int smile_level;//range[0-100]
|
};
|
|
struct FacePos {
|
RECT rcFace;
|
POINT ptLeftEye;
|
POINT ptRightEye;
|
POINT ptMouth;
|
POINT ptNose;
|
FaceAngle fAngle;
|
int nQuality;
|
ThftResult property;
|
Data pFacialData;
|
};
|
|
typedef std::vector<FacePos> Faces;
|
|
long getTimeLong() {
|
time_t tt;
|
time(&tt);
|
tt = tt + 8 * 3600; // transform the time zone
|
return tt;
|
}
|
}
|
|
namespace FaceToolData {
|
enum RectSize {
|
horizontal = 10,
|
vertical = 10
|
};
|
|
class CompareData {
|
public:
|
virtual ~CompareData() {}
|
};
|
|
|
class FeatureData : public CompareData {
|
public:
|
FeatureData(int size) : feature(size) {}
|
|
Feature feature;
|
int num;
|
float threshold;
|
std::string tableNameList;
|
};
|
|
struct CompareResult {
|
std::string id;
|
std::string face_img_url;
|
std::string table_Name;
|
float score;
|
};
|
}
|
|
#endif //VIDEOSTRUCTURE_FACEDATA_HPP
|