You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,89 @@ videoCamera.track({
44
44
> 2. Run a local server: `grunt server`
45
45
> 3. Go to: `http://localhost:9001` and have fun :)
46
46
47
+
## Structure
48
+
49
+
**tracking.js* : Library's core;
50
+
**color.js* : Module for color tracking;
51
+
**human.js* : Module for human tracking.
52
+
53
+
## Methods
54
+
55
+
There are some handy chainable methods that you can use to achieve your goal, for example:
56
+
57
+
***tracking.VideoCamera()**
58
+
59
+
Requests user's camera using WebRTC's `getUserMedia()`.
60
+
61
+
***tracking.VideoCamera().render()**
62
+
63
+
Shows user's camera using a `<video>` element.
64
+
65
+
***tracking.VideoCamera().hide()**
66
+
67
+
Don't shows user's camera.
68
+
69
+
***tracking.VideoCamera().renderVideoCanvas()**
70
+
71
+
Renders user's camera using a `<canvas>` element.
72
+
73
+
## Parameters
74
+
75
+
When initializing the object `tracking.VideoCamera().track()`, you can optionally specify some parameters, for instance:
76
+
77
+
***type***{string}* : could be `color` or `human`.
78
+
79
+
```
80
+
new tracking.VideoCamera().track({
81
+
type: 'color'
82
+
});
83
+
```
84
+
85
+
### Color tracking
86
+
87
+
***color***{string}* : could be `cyan`, `magenta` or `yellow` (default is `magenta`).
88
+
89
+
```
90
+
new tracking.VideoCamera().track({
91
+
type: 'color',
92
+
color: 'yellow'
93
+
});
94
+
```
95
+
96
+
### Human tracking
97
+
98
+
***data***{string}* : could be `eye`, `frontal_face`, `mouth` or `upper_body` (default is `frontal_face`).
99
+
100
+
```
101
+
new tracking.VideoCamera().track({
102
+
type: 'human',
103
+
data: 'eye'
104
+
});
105
+
```
106
+
107
+
## Events
108
+
109
+
***onFound** : Each time your tracker find something this event will be dispared.
110
+
111
+
```
112
+
new tracking.VideoCamera().track({
113
+
onFound: function(track) {
114
+
// do something
115
+
}
116
+
});
117
+
```
118
+
119
+
***onNotFound** : Each time your tracker doesn't find something this event will be dispared.
120
+
121
+
```
122
+
new tracking.VideoCamera().track({
123
+
onNotFound: function(track) {
124
+
// do something
125
+
}
126
+
});
127
+
```
128
+
129
+
47
130
## About
48
131
49
132
It brings to web elements tracking techniques of a real scene captured by the camera, through natural interactions from object tracking, color markers, among others, allowing the development of interfaces and games through a simple and intuitive API.
0 commit comments