xuxiuxi
2017-05-11 109ffe9a777658936a38d0c146579a67c60a0d17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef _PL_SENSETIMEFACETRACK_H_
#define _PL_SENSETIMEFACETRACK_H_
 
#include "PipeLine.h"
#include <vector>
 
struct FacePoint
{
    int x;
    int y;
    
    FacePoint() : x(0), y(0) { }
};
 
struct FaceRect
{
    FacePoint leftTop;
    FacePoint rightBottom;
    
    FaceRect() : leftTop(), rightBottom() { }
};
 
struct SensetimeFaceFeature
{
    FaceRect rect;
    int id;
    float yaw;
    float pitch;
    float roll;
    float eyeDistance;
    std::vector<FacePoint> featurePoints;
    
    SensetimeFaceFeature() : 
        rect(), id(0), yaw(0.0), pitch(0.0), roll(0.0), eyeDistance(0.0), featurePoints()
    {}
};
 
typedef std::vector<SensetimeFaceFeature> st_ff_vect_t;
 
struct SensetimeFaceTrackConfig
{
    int point_size; // 21 / 106
    int point_size_config; // CV_DETECT_ENABLE_ALIGN_21 / CV_DETECT_ENABLE_ALIGN_106
    int detect_face_cnt_limit; // -1
    bool draw_face_rect;
    bool draw_face_feature_point;
    bool generate_face_feature; // for PL_SensetimeFaceFeatureEmit
    
    SensetimeFaceTrackConfig() : 
        point_size(21), point_size_config(-1), detect_face_cnt_limit(-1), 
        draw_face_rect(true), draw_face_feature_point(true), generate_face_feature(false)
    { }
};
 
class PL_SensetimeFaceTrack : public PipeLineElem
{
public:
    PL_SensetimeFaceTrack();
    virtual ~PL_SensetimeFaceTrack();
 
    virtual bool init(void* args);
    virtual void finit();
 
    virtual bool pay(const PipeMaterial& pm);
    virtual bool gain(PipeMaterial& pm);
    
private:
    void* internal;
};
 
PipeLineElem* create_PL_SensetimeFaceTrack();
 
#endif