Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEC-693/793 Applied Computer Vision with Depth Cameras

Similar presentations


Presentation on theme: "EEC-693/793 Applied Computer Vision with Depth Cameras"— Presentation transcript:

1 EEC-693/793 Applied Computer Vision with Depth Cameras
Lecture 18 Wenbing Zhao

2 Outline Repetition Count Finite state machine
Tolerate measurement errors

3 Repetition Count All repetition activities can be described in term a sequence of monotonic segments of one or more features, such as a joint angle, or displacement of a joint (or distance between two joints) Each monotonic segment is delineated by two key poses, which I call them configurations What is the monotonic segment? Angle or displacement keeps increasing or decreasing Finite state machine can be used to identify the key poses and therefore monotonic segments, and the transition between different monotonic segments 3

4 Toe Touch Exercise Consists of two monotonic segments
Hands go down => distance between ankle and hand getting smaller Hands go up => distance between ankle and hand getting larger Hence, we use a single feature Initial pose: we have to start from some pose We use an additional feature for defining the initial pose Unity project: add repetition count to the last Unity app you built for replay You will need to log a few repetition of the toe touch first Modify BackScript.cs 4

5 BackScript.cs: add more member variables
    float MIN_2_HIP = 0.3f;     float MIN_2_ANKLE = 0.3f;     float MAX_THD = 0.5f;     float min2hip = 2.0f;     float min2ankle = 2.0f;     float max2ankle = 0f;     float maxthd = 0.0f;     int correctCount = 0; 5

6 BackScript.cs: call assessToetouch() in DisplayNextFrame()
vid DisplayNextFrame() { // original code …... // before you return, call assessToetouch(); } 6

7 BackScript.cs void assessToetouch() {
Vector3 seg1 = new Vector3();      Vector3 seg2 = new Vector3();      seg1.x = Hand_Left.transform.localPosition.x - Hip_Left.transform.localPosition.x;      seg1.y = Hand_Left.transform.localPosition.y - Hip_Left.transform.localPosition.y;      seg1.z = Hand_Left.transform.localPosition.z - Hip_Left.transform.localPosition.z;      seg2.x = (Hand_Left.transform.localPosition.x - Ankle_Left.transform.localPosition.x);      seg2.y = (Hand_Left.transform.localPosition.y - Ankle_Left.transform.localPosition.y);      seg2.z = (Hand_Left.transform.localPosition.z - Ankle_Left.transform.localPosition.z);               float hand2hip = seg1.magnitude;      float hand2ankle = seg2.magnitude; 7

8 BackScript.cs switch(state) {     case -1:     if(hand2hip < MIN_2_HIP && hand2ankle > MAX_THD)     {          this.state = 0;          min2ankle = hand2ankle;     }    break;    8

9 BackScript.cs case 0:        // hand2ankle should become smaller        if(hand2ankle < min2ankle)            min2ankle = hand2ankle;        if(hand2ankle > min2ankle && hand2ankle-min2ankle > 0.2)        {             if(min2ankle < MIN_2_ANKLE)             {                   // since we reached a min2ANKLE, we have to advanced our state anyway                   // one bad iteration should not make it impossible to continue with a correct iteration later                   this.state = 1;                   max2ankle = hand2ankle;                   min2hip = hand2hip;             }             else             {                  Debug.Log ("rule0 violated: min2ankle wrong: "+min2ankle);                  rule0violated = true;                  this.state = -1;             }        }        break; 9

10 BackScript.cs case 1:             if(hand2ankle > max2ankle)                 max2ankle = hand2ankle;             if(hand2hip < min2hip)                 min2hip = hand2hip;                          if(hand2ankle < max2ankle && max2ankle-hand2ankle > 0.2)  {                 if(max2ankle > MAX_THD && min2hip < MIN_2_HIP) {                     this.state = 0;                     min2ankle = hand2ankle;                                          this.correctCount++;                     counterDisplay.text = "Correct Iteration Count: "+this.correctCount;                     Debug.Log ("Good iteration to: "+this.correctCount);                 }                 else                 {                     Debug.Log ("rule1 violated: min2ankle wrong: "+min2ankle);                     rule0violated = true;                     this.state = -1;                 }             }             break;        } } 10


Download ppt "EEC-693/793 Applied Computer Vision with Depth Cameras"

Similar presentations


Ads by Google