declarative gesture spotting using inferred and refined control points

83
1 Declarative Gesture Spotting Using Inferred and Refined Control Points Lode Hoste Brecht De Rooms Beat Signer Department of Computer Science, Vrije Universiteit Brussel (VUB) [email protected] [email protected] [email protected] - - -

Upload: beat-signer

Post on 07-Nov-2014

895 views

Category:

Science


2 download

DESCRIPTION

Presentation given at ICPRAM 2013, International Conference on Pattern Recognition, Barcelona, Spain, February 2013 ABSTRACT: We propose a novel gesture spotting approach that offers a comprehensible representation of automatically inferred spatiotemporal constraints. These constraints can be defined between a number of characteristic control points which are automatically inferred from a single gesture sample. In contrast to existing solutions which are limited in time, our gesture spotting approach offers automated reasoning over a complete motion trajectory. Last but not least, we offer gesture developers full control over the gesture spotting task and enable them to refine the spotting process without major programming efforts. Paper:http://www.academia.edu/2157798/Declarative_Gesture_Spotting_Using_Inferred_and_Refined_Control_Points

TRANSCRIPT

Page 1: Declarative Gesture Spotting Using Inferred and Refined Control Points

1

Declarative Gesture Spotting Using

Inferred and Refined Control Points

Lode Hoste

Brecht De Rooms

Beat Signer

Department of Computer Science, Vrije Universiteit Brussel (VUB)

[email protected]

[email protected]

[email protected]

-

-

-

Page 2: Declarative Gesture Spotting Using Inferred and Refined Control Points

2

Gesture Classification

e.g. Dynamic Time Warping

sample segment

template

Page 3: Declarative Gesture Spotting Using Inferred and Refined Control Points

3

Gesture Classification

e.g. Dynamic Time Warping

sample segment

template

Page 4: Declarative Gesture Spotting Using Inferred and Refined Control Points

4

Gesture Classification

Page 5: Declarative Gesture Spotting Using Inferred and Refined Control Points

5

Gesture Classification

Page 6: Declarative Gesture Spotting Using Inferred and Refined Control Points

6

Gesture Classification

Page 7: Declarative Gesture Spotting Using Inferred and Refined Control Points

7

Gesture Classification

Page 8: Declarative Gesture Spotting Using Inferred and Refined Control Points

8

Gesture Classification

Page 9: Declarative Gesture Spotting Using Inferred and Refined Control Points

9

Gesture Classification

Too Complex

Page 10: Declarative Gesture Spotting Using Inferred and Refined Control Points

10

Gesture Classification

We need gesture spotting

Start?

End?

Page 11: Declarative Gesture Spotting Using Inferred and Refined Control Points

11

Gesture Classification

We need gesture spotting

Start?

End?

reduce amount of work for gesture

classification

Page 12: Declarative Gesture Spotting Using Inferred and Refined Control Points

12

Gesture Spotting

Goal:

- High Recall

- High Precision

Popular techniques:

- Hidden Markov Models

- Continuous Dynamic Programming

Page 13: Declarative Gesture Spotting Using Inferred and Refined Control Points

13

- from one representative sample

Our Declarative Gesture Spotting Approach

1. Automatically infer control points

2. Generate declarative code

- understandable and extensible spotting definitions

3. Call a gesture classification algorithm

- one shot learning

Spotted?

Page 14: Declarative Gesture Spotting Using Inferred and Refined Control Points

14

Automatically Infer Control Points

Z gesture

One representative sample

Page 15: Declarative Gesture Spotting Using Inferred and Refined Control Points

15

Automatically Infer Control Points

Z gesture

One representative sample

- start with the first point

Page 16: Declarative Gesture Spotting Using Inferred and Refined Control Points

16

Automatically Infer Control Points

Z gesture

One representative sample

- search for the smallest angle

- within a given time-frame

- start with the first point

Page 17: Declarative Gesture Spotting Using Inferred and Refined Control Points

17

Automatically Infer Control Points

Z gesture

One representative sample

- search for the smallest angle

- within a given time-frame

- start with the first point

Page 18: Declarative Gesture Spotting Using Inferred and Refined Control Points

18

Automatically Infer Control Points

Z gesture

One representative sample

- search for the smallest angle

- within a given time-frame

- start with the first point

- refine control points (optionally)

Page 19: Declarative Gesture Spotting Using Inferred and Refined Control Points

19

Comprehensible Code Generation

Based on the inferred control points:

Page 20: Declarative Gesture Spotting Using Inferred and Refined Control Points

20

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D) there is a start point

?p1

Based on the inferred control points:

Page 21: Declarative Gesture Spotting Using Inferred and Refined Control Points

21

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D) 3 ?p2 (Point2D) there is a second point ?p1 ?p2

Based on the inferred control points:

Page 22: Declarative Gesture Spotting Using Inferred and Refined Control Points

22

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

temporal constraint:

that comes after the start point

?p1 ?p2

Based on the inferred control points:

Page 23: Declarative Gesture Spotting Using Inferred and Refined Control Points

23

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

spatial constraint:

?p1 ?p2

Based on the inferred control points:

Page 24: Declarative Gesture Spotting Using Inferred and Refined Control Points

24

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

spatial constraint: .. a circular area with centerpoint

x: 185 y:4 (pixels)

?p1 ?p2

185 4

Based on the inferred control points:

Page 25: Declarative Gesture Spotting Using Inferred and Refined Control Points

25

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

spatial constraint:

and radious 76

.. a circular area with centerpoint

x: 185 y:4 (pixels)

?p1 ?p2

185 4

Based on the inferred control points:

Page 26: Declarative Gesture Spotting Using Inferred and Refined Control Points

26

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

?p1 ?p2

185 4

Based on the inferred control points:

Page 27: Declarative Gesture Spotting Using Inferred and Refined Control Points

27

6 ?p3 (Point2D) 7 (test (< ?p2.time ?p3.time)) 8 (test (inside_control_point ?p1 ?p3 15 178 76)) 9 ?p4 (Point2D) 10 (test (< ?p3.time ?p4.time)) 11 (test (inside_control_point ?p1 ?p4 197 175 76))

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

?p1 ?p2

185 4

?p3 ?p4

Based on the inferred control points:

Page 28: Declarative Gesture Spotting Using Inferred and Refined Control Points

28

6 ?p3 (Point2D) 7 (test (< ?p2.time ?p3.time)) 8 (test (inside_control_point ?p1 ?p3 15 178 76)) 9 ?p4 (Point2D) 10 (test (< ?p3.time ?p4.time)) 11 (test (inside_control_point ?p1 ?p4 197 175 76))

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

?p1 ?p2

each point expressed relative to ?p1

?p3 ?p4

Based on the inferred control points:

Page 29: Declarative Gesture Spotting Using Inferred and Refined Control Points

29

6 ?p3 (Point2D) 7 (test (< ?p2.time ?p3.time)) 8 (test (inside_control_point ?p1 ?p3 15 178 76)) 9 ?p4 (Point2D) 10 (test (< ?p3.time ?p4.time)) 11 (test (inside_control_point ?p1 ?p4 197 175 76))

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

?p1 ?p2

?p3 ?p4

temporal constraints:

the points should be ordered

Based on the inferred control points:

Page 30: Declarative Gesture Spotting Using Inferred and Refined Control Points

30

12 => 13 (call DynamicTimeWarping 14 (select-between ?p1.time ?p4.time) 15 (gesture-set “CharacterZ”))

6 ?p3 (Point2D) 7 (test (< ?p2.time ?p3.time)) 8 (test (inside_control_point ?p1 ?p3 15 178 76)) 9 ?p4 (Point2D) 10 (test (< ?p3.time ?p4.time)) 11 (test (inside_control_point ?p1 ?p4 197 175 76))

Comprehensible Code Generation

1 (defrule symbol_z 2 ?p1 (Point2D)

4 (test (< ?p1.time ?p2.time)) 3 ?p2 (Point2D)

5 (test (inside_control_point ?p1 ?p2 185 4 76))

?p1 ?p2

?p3 ?p4

call an external algorithm for classification

Based on the inferred control points:

Page 31: Declarative Gesture Spotting Using Inferred and Refined Control Points

31

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

State 1

template

Page 32: Declarative Gesture Spotting Using Inferred and Refined Control Points

32

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

State 2

template

Page 33: Declarative Gesture Spotting Using Inferred and Refined Control Points

33

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

State 2

template

reset state machine?

Page 34: Declarative Gesture Spotting Using Inferred and Refined Control Points

34

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

State 1

reset state machine?

Page 35: Declarative Gesture Spotting Using Inferred and Refined Control Points

35

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

State 1

Page 36: Declarative Gesture Spotting Using Inferred and Refined Control Points

36

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

State 1

Page 37: Declarative Gesture Spotting Using Inferred and Refined Control Points

37

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

gesture overshot

missed gesture

Page 38: Declarative Gesture Spotting Using Inferred and Refined Control Points

38

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

Page 39: Declarative Gesture Spotting Using Inferred and Refined Control Points

39

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

refused by gesture

classification

Page 40: Declarative Gesture Spotting Using Inferred and Refined Control Points

40

A State Machine is Not Enough

continuous stream

State 1 State 2

State 3 State 4

template

overlapping gesture

missed gesture

refused by gesture

classification

Page 41: Declarative Gesture Spotting Using Inferred and Refined Control Points

41

1 (defrule symbol_z 2 ?p1 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 42: Declarative Gesture Spotting Using Inferred and Refined Control Points

42

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

Incremental Evaluation of Every Possible Combination

Page 43: Declarative Gesture Spotting Using Inferred and Refined Control Points

43

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 44: Declarative Gesture Spotting Using Inferred and Refined Control Points

44

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 45: Declarative Gesture Spotting Using Inferred and Refined Control Points

45

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 46: Declarative Gesture Spotting Using Inferred and Refined Control Points

46

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 47: Declarative Gesture Spotting Using Inferred and Refined Control Points

47

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 48: Declarative Gesture Spotting Using Inferred and Refined Control Points

48

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

4 (test (< ?p1.time ?p2.time)) 5 (test (inside_control_point ?p1 ?p2 185 4 76))

1 (defrule symbol_z 2 ?p1 (Point2D)

RETE engine takes care

of caching intermediate calculations

3 ?p2 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

1 (defrule symbol_z 2 ?p1 (Point2D)

3 ?p2 (Point2D)

Incremental Evaluation of Every Possible Combination

Page 49: Declarative Gesture Spotting Using Inferred and Refined Control Points

49

Incremental Evaluation of Every Possible Combination

?p1

Page 50: Declarative Gesture Spotting Using Inferred and Refined Control Points

50

Incremental Evaluation of Every Possible Combination

?p1

?p1

Page 51: Declarative Gesture Spotting Using Inferred and Refined Control Points

51

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

Page 52: Declarative Gesture Spotting Using Inferred and Refined Control Points

52

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

Page 53: Declarative Gesture Spotting Using Inferred and Refined Control Points

53

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

Page 54: Declarative Gesture Spotting Using Inferred and Refined Control Points

54

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

Page 55: Declarative Gesture Spotting Using Inferred and Refined Control Points

55

?p2

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

Page 56: Declarative Gesture Spotting Using Inferred and Refined Control Points

56

?p2

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

Page 57: Declarative Gesture Spotting Using Inferred and Refined Control Points

57

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

Page 58: Declarative Gesture Spotting Using Inferred and Refined Control Points

58

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

Page 59: Declarative Gesture Spotting Using Inferred and Refined Control Points

59

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

Page 60: Declarative Gesture Spotting Using Inferred and Refined Control Points

60

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1 ?p1

Page 61: Declarative Gesture Spotting Using Inferred and Refined Control Points

61

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1 ?p1

Page 62: Declarative Gesture Spotting Using Inferred and Refined Control Points

62

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

?p3

?p1

Page 63: Declarative Gesture Spotting Using Inferred and Refined Control Points

63

Limit calculations to

a sliding window

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p1

?p3

?p1

Page 64: Declarative Gesture Spotting Using Inferred and Refined Control Points

64

Limit calculations to

a sliding window

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p3

?p1

Page 65: Declarative Gesture Spotting Using Inferred and Refined Control Points

65

Limit calculations to

a sliding window

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 66: Declarative Gesture Spotting Using Inferred and Refined Control Points

66

Limit calculations to

a sliding window

?p2

?p2

?p3

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p3

?p1

Page 67: Declarative Gesture Spotting Using Inferred and Refined Control Points

67

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p1

?p3

?p1

Page 68: Declarative Gesture Spotting Using Inferred and Refined Control Points

68

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 69: Declarative Gesture Spotting Using Inferred and Refined Control Points

69

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 70: Declarative Gesture Spotting Using Inferred and Refined Control Points

70

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 71: Declarative Gesture Spotting Using Inferred and Refined Control Points

71

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

?p2

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 72: Declarative Gesture Spotting Using Inferred and Refined Control Points

72

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

?p2

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 73: Declarative Gesture Spotting Using Inferred and Refined Control Points

73

Limit calculations to

a sliding window

?p2

?p2

?p3 ?p4

?p2

Incremental Evaluation of Every Possible Combination

?p1

?p1

?p1

?p3

?p1

Page 74: Declarative Gesture Spotting Using Inferred and Refined Control Points

74

Extending the ‘Flick Right’ Definition

Reducing false positives using negation

?p1 ?p2 ?p3

Page 75: Declarative Gesture Spotting Using Inferred and Refined Control Points

75

Extending the ‘Flick Right’ Definition

Reducing false positives using negation

?p1 ?p2 ?p3

Page 76: Declarative Gesture Spotting Using Inferred and Refined Control Points

76

Extending the ‘Flick Right’ Definition

?p1 ?p2 ?p3

Page 77: Declarative Gesture Spotting Using Inferred and Refined Control Points

77

(not (and (Point2D (y ?b y) (time ?b time))

Extending the ‘Flick Right’ Definition

… there should not be a point where the …

(test (> (abs (- ?p1.y ?b y)) 245))))

(test (< ?b time ?p3.time))

(test (> ?b time ?p1.time))

?p1 ?p2 ?p3

Page 78: Declarative Gesture Spotting Using Inferred and Refined Control Points

78

(not (and (Point2D (y ?b y) (time ?b time))

Extending the ‘Flick Right’ Definition

… there should not be a point where the …

(test (> (abs (- ?p1.y ?b y)) 245))))

(test (< ?b time ?p3.time))

(test (> ?b time ?p1.time)) … time lies in between ?p1 and ?p3 …

?p1 ?p2 ?p3

Page 79: Declarative Gesture Spotting Using Inferred and Refined Control Points

79

(not (and (Point2D (y ?b y) (time ?b time))

Extending the ‘Flick Right’ Definition

… there should not be a point where the …

(test (> (abs (- ?p1.y ?b y)) 245))))

(test (< ?b time ?p3.time))

(test (> ?b time ?p1.time)) … time lies in between ?p1 and ?p3 …

… for which is greater than 245.

y

y

y

?p1 ?p2 ?p3

Page 80: Declarative Gesture Spotting Using Inferred and Refined Control Points

80

Evaluation 22 77.50 52.10 78.75 56.50 24 83.13 47.16 84.38 52.53 26 90.63 42.40 91.25 46.79 28 93.75 39.47 94.38 43.26 30 97.50 35.37 97.50 39.29 32 98.75 32.78 98.75 36.41

• 16 gestures

• 1760 gesture samples

• 10 subjects

Page 81: Declarative Gesture Spotting Using Inferred and Refined Control Points

81

Visual 3D gesture

definitions

Future Work

Scale / rotational

invariant spotting

Page 82: Declarative Gesture Spotting Using Inferred and Refined Control Points

82

[email protected] [email protected] [email protected]

Summary

• Comprehensible: easy to understand and to correct.

• Extensive spotting: support for real-time continuous streams.

Call classification

• No gesture overshooting: support for overlapping submatches.

• Extensible: allows for expert adjustments.

Auto infer control points Generate Spotting Code

Page 83: Declarative Gesture Spotting Using Inferred and Refined Control Points

83

Lode Hoste, Brecht De Rooms and Beat Signer, Declarative Gesture Spotting Using Inferred and Refined Control Points, Proceedings of ICPRAM 2013, International Conference on Pattern Recognition, Barcelona, Spain, February 2013