houxiao
2017-07-13 b022b91c0c6fa807424b6c12cc92ac5946838083
RtspFace/PL_SensetimeFaceTrack.h
@@ -2,37 +2,52 @@
#define _PL_SENSETIMEFACETRACK_H_
#include "PipeLine.h"
#include "GraphicHelper.h"
#include <vector>
struct FacePoint
{
   int x;
   int y;
   FacePoint() : x(0), y(0) { }
};
struct FaceRect
{
   FacePoint leftTop;
   FacePoint rightBottom;
   FaceRect() : leftTop(), rightBottom() { }
};
#include <cmath>
struct SensetimeFaceFeature
{
   FaceRect rect;
   PLGH_Rect rect;
   int id;
   float score;
   /* Camera vision vector point to face
    *  * * *
    *  * * *
    *  * * *
    */
   float yaw;
   /* Camera vision vector point to face
    *  * * *
    *  * * *
    *  * * *
    */
   float pitch;
   /* Camera vision vector point to face
    *  * * *
    *  * * *
    *  * * *
    */
   float roll;
   float eyeDistance;
   std::vector<FacePoint> featurePoints;
   PLGH_Path featurePoints;
    bool outOfFrame;
   
   SensetimeFaceFeature() : 
      rect(), id(0), yaw(0.0), pitch(0.0), roll(0.0), eyeDistance(0.0), featurePoints()
      rect(), id(0), score(0.0), yaw(0.0), pitch(0.0), roll(0.0), eyeDistance(0.0), featurePoints(),
        outOfFrame(false)
   {}
    bool test_face_in_cone(float _yaw, float _pitch, float _roll) const
    {
        return  (std::abs(yaw) < _yaw && std::abs(pitch) < _pitch && std::abs(roll) < _roll);
    }
};
typedef std::vector<SensetimeFaceFeature> st_ff_vect_t;
@@ -44,11 +59,30 @@
   int detect_face_cnt_limit; // -1
   bool draw_face_rect;
   bool draw_face_feature_point;
   bool generate_face_feature; // for PL_SensetimeFaceFeatureEmit
   bool generate_face_feature;
   bool generate_face_point;
   int explode_feature_rect_x;
   int explode_feature_rect_y;
    bool clamp_feature_rect; // clamp fr width and height
   int doTrackPerFrame;
   std::string license_file_path;
   std::string license_str;
    float visionConeAngle;
   bool evenWidthHeight;
   
   float score_min;
   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)
      draw_face_rect(true), draw_face_feature_point(true), generate_face_feature(false), generate_face_point(false),
      explode_feature_rect_x(0), explode_feature_rect_y(0),
        clamp_feature_rect(false), doTrackPerFrame(1),
      license_file_path(), license_str(),
        visionConeAngle(90.1), evenWidthHeight(true),
      score_min(0.0f)
   { }
};
@@ -63,6 +97,9 @@
   virtual bool pay(const PipeMaterial& pm);
   virtual bool gain(PipeMaterial& pm);
private:
   static bool pay_breaker_MBFT_YUV(const PipeMaterial* pm, void* args);
   
private:
   void* internal;