$search
00001 00009 #ifndef _MODEL_ENTRY_H_ 00010 #define _MODEL_ENTRY_H_ 00011 00012 #include <blort/TomGine/tgMathlib.h> 00013 #include <blort/Tracker/TrackerModel.h> 00014 #include <blort/Tracker/Distribution.h> 00015 #include <blort/Tracker/Predictor.h> 00016 #include <blort/Tracker/Filter.h> 00017 00018 namespace Tracking{ 00019 00020 enum quality_state{ 00021 ST_OK, 00022 ST_OCCLUDED, 00023 ST_LOST, 00024 ST_LOCKED, 00025 }; 00026 00027 enum confidence_state{ 00028 ST_GOOD, 00029 ST_FAIR, 00030 ST_BAD, 00031 }; 00032 00033 enum movement_state{ 00034 ST_FAST, 00035 ST_SLOW, 00036 ST_STILL, 00037 }; 00038 00040 class ModelEntry 00041 { 00042 private: 00043 void poseDiff(float &t, float &a); 00044 void speed(); 00045 00046 float max(float a, float b){ return (((a) > (b)) ? (a) : (b)); } 00047 float abs(float a){ return ((a>=0.0f) ? a : (-a)); } 00048 00049 00050 00051 public: 00052 ModelEntry(); 00053 ModelEntry(const TomGine::tgModel& m); 00054 ~ModelEntry(); 00055 00056 void setInitialPose(const TomGine::tgPose &p, float lpf_delay=0.0f, float lpf_delay_z=0.0f); 00057 void filter_pose(); 00058 void evaluate_states( const Particle &variation, unsigned rec, 00059 float c_th_base=0.6f, float c_th_min=0.3f, float c_th_fair=0.5f, 00060 float c_mv_not=0.01f, float c_mv_slow=0.05f, float c_th_lost=0.1f); 00061 00062 std::string label; 00063 00064 float t, a, t_max, a_max, c_edge, c_th, c_lost, abs_a, abs_t; 00065 00066 movement_state st_movement; 00067 confidence_state st_confidence; 00068 quality_state st_quality; 00069 00070 TrackerModel model; 00071 Distribution distribution; 00072 Predictor* predictor; 00073 Texture* mask; 00074 Particle pose; 00075 Particle pose_prev; 00076 Particle lpf_pose; 00077 Particle initial_pose; 00078 00079 float speed_angular; 00080 float speed_translational; 00081 00082 float confidence_color; 00083 float confidence_edge; 00084 00085 int id; 00086 unsigned num_convergence; 00087 unsigned hypothesis_id; 00088 std::vector<float> past_confidences; 00089 unsigned num_particles; 00090 unsigned num_recursions; 00091 00092 bool bfc; 00093 bool lock; 00094 bool mask_geometry_edges; 00095 00096 mat4 modelviewprojection; 00097 TomGine::tgVector3 vCam2Model; 00098 00099 private: 00100 Predictor* del_predictor; 00101 SmoothFilter m_lpf_pose_tx; 00102 SmoothFilter m_lpf_pose_ty; 00103 SmoothFilter m_lpf_pose_tz; 00104 SmoothFilter m_lpf_pose_qx; 00105 SmoothFilter m_lpf_pose_qy; 00106 SmoothFilter m_lpf_pose_qz; 00107 SmoothFilter m_lpf_pose_qw; 00108 00109 public: 00110 SmoothFilter m_lpf_a; 00111 SmoothFilter m_lpf_t; 00112 SmoothFilter m_lpf_cs; 00113 SmoothFilter m_lpf_cl; 00114 00115 }; 00116 00117 } // namespace Tracking 00118 00119 #endif