コード例 #1
0
    /// initializer. called after LoadFromFile is called
    public void Init(JointFeature pf)
    {
        if (m_posts == null)
        {
            throw new Exception("the PostureDetector members should be initialized first.");
        }
        m_postFeature    = pf;
        m_fsm            = new FSM(PostureCount, m_intervals, m_intvThres);
        m_fsm.m_thresMul = m_thresMulTimeIntv;
        m_isPostDet      = new bool[PostureCount];
        m_postFeature.RegisterJoints(m_jointIdx);

        // more initialization for the relative joint matcher
        for (int i = 0; i < PostureCount; i++)
        {
            for (int j = 0; j < m_posts[i].JointCount; j++)
            {
                m_posts[i][j].m_thresMul = m_thresMulPerPost[i] * m_thresMulPerJoint[j];
                JointMatcherR jmr = m_posts[i][j] as JointMatcherR;
                if (jmr != null)
                {
                    jmr.SetLastPostJoint(this, i, j);
                }
            }
            m_posts[i].Init(pf);             // should be called after m_posts[i][j].m_thresMul is initialized
        }
    }
コード例 #2
0
    /// Use this for initialization
    public void Start()
    {
        Pause           = false;
        UseRealtimeData = true;
        m_postFeature   = new JointFeature(m_skReader.m_jointData);
        int loaded = LoadGestureTemplates();

        Debug.Log(string.Format("{0} gesture templates loaded.", loaded));
    }
コード例 #3
0
 // called in GestureDetector::Init
 // the initialization of public members should be done by deserialzation of .xml files or externally+manually
 public void Init(JointFeature pf)
 {
     if (m_jointMatcher == null)
     {
         throw new Exception("the JointMatcher members should be initialized first.");
     }
     m_jointScores = new float[JointCount];
     for (int i = 0; i < JointCount; i++)
     {
         m_jointMatcher[i].Init(pf);
     }
 }
コード例 #4
0
 public TemplateTrainer(SkeletonRecorder skRecorder, JointFeature pf)
 {
     m_skRecorder  = skRecorder;
     m_postFeature = pf;
 }
コード例 #5
0
 public UITemplateTrainer(SkeletonRecorder skRecorder, JointFeature postFeature)
 {
     m_skRecorder = skRecorder;
     m_tpTrainer  = new TemplateTrainer(skRecorder, postFeature);
 }
コード例 #6
0
 // called in PostureDetector::Init
 // the initialization of public members should be done by deserialzation of .xml files or externally+manually
 public void Init(JointFeature pf)
 {
     m_jointFt   = pf.m_jointVec;
     m_realThres = m_thresMul * m_templateThreshold;
 }