|
1 | 1 | # tracking.js |
2 | 2 |
|
3 | | -Change the way you interact with your browser. |
| 3 | +[](https://travis-ci.org/eduardolundgren/tracking.js) |
| 4 | +[](https://david-dm.org/eduardolundgren/tracking.js#info=devDependencies) |
4 | 5 |
|
5 | | -[](https://travis-ci.org/eduardolundgren/tracking.js) |
| 6 | +The *tracking.js* library brings different computer vision algorithms and techniques into the browser environment. By using modern HTML5 specifications, we enable you to do real-time color tracking, face detection and much more with a simple and intuitive interface. |
6 | 7 |
|
7 | | -## Getting Started |
| 8 | +* [Official website](http://trackingjs.com) |
| 9 | +* [Documentation](http://trackingjs.com/docs.html) |
| 10 | +* [API Docs](http://trackingjs.com/api/) |
8 | 11 |
|
9 | | -Import the core library: |
10 | | - |
11 | | -``` html |
12 | | -<script src="tracking.js"></script> |
13 | | -``` |
14 | | - |
15 | | -Import the color module: |
16 | | - |
17 | | -``` html |
18 | | -<script src="tracker/color.js"></script> |
19 | | -``` |
20 | | - |
21 | | -Gets the user's camera: |
22 | | - |
23 | | -``` javascript |
24 | | -var videoCamera = new tracking.VideoCamera().render(); |
25 | | -``` |
26 | | - |
27 | | -Instantiates tracking by color magenta and displays X, Y and Z positions of the detected area in console: |
| 12 | +## Install |
28 | 13 |
|
| 14 | +Install via [Bower](http://bower.io/) or [download as a zip](https://github.com/eduardolundgren/tracking.js/archive/master.zip): |
29 | 15 |
|
30 | | -``` javascript |
31 | | -videoCamera.track({ |
32 | | - type: 'color', |
33 | | - color: 'magenta', |
34 | | - onFound: function(track) { |
35 | | - console.log(track.x, track.y, track.z); |
36 | | - }, |
37 | | - onNotFound: function() {} |
38 | | -}); |
39 | 16 | ``` |
40 | | - |
41 | | -[Check the full code of this Hello World example.](https://github.com/eduardolundgren/tracking.js/blob/master/examples/hello_world.html) |
42 | | - |
43 | | -> **Note:** if you want to run tracking.js examples locally, you're going to need a local server, since `file:///` doesn't work with `getUserMedia()` in some browsers. |
44 | | -
|
45 | | -> 1. Install Grunt and its dependencies: `npm install .` |
46 | | -> 2. Run a local server: `grunt server` |
47 | | -> 3. Go to: `http://localhost:9001` and have fun :) |
48 | | -
|
49 | | -## Structure |
50 | | - |
51 | | -* *tracking.js* : Library's core; |
52 | | -* *color.js* : Module for color tracking; |
53 | | -* *human.js* : Module for human tracking. |
54 | | - |
55 | | -## Methods |
56 | | - |
57 | | -There are some handy classes and chainable methods that you can use to achieve your goal, for example: |
58 | | - |
59 | | -* **new tracking.VideoCamera()** |
60 | | - |
61 | | -Requests user's camera using WebRTC's `getUserMedia()`. |
62 | | - |
63 | | -* **new tracking.VideoCamera().render()** |
64 | | - |
65 | | -Render user's camera using a `<video>` element into the DOM. |
66 | | - |
67 | | -* **new tracking.VideoCamera().hide()** |
68 | | - |
69 | | -Hides the `<video>` rendered into the DOM by `tracking.VideoCamera()`. In order to add information to the scene the `<canvas>` element could be displayed instead of the `<video>`. |
70 | | - |
71 | | -* **new tracking.VideoCamera().renderVideoCanvas()** |
72 | | - |
73 | | -Renders user's camera using a `<canvas>` element. |
74 | | - |
75 | | -## Parameters |
76 | | - |
77 | | -When initializing the object `tracking.VideoCamera().track()`, you can optionally specify some parameters, for instance: |
78 | | - |
79 | | -* **type** *{string}* : could be `color` or `human`. |
80 | | - |
81 | | -``` javascript |
82 | | -new tracking.VideoCamera().track({ |
83 | | - type: 'color' |
84 | | -}); |
| 17 | +bower install tracking.js |
85 | 18 | ``` |
86 | 19 |
|
87 | | -### Color tracking |
| 20 | +## Examples |
88 | 21 |
|
89 | | -* **color** *{string}* : could be `cyan`, `magenta` or `yellow` (default is `magenta`). |
| 22 | +[](#) |
| 23 | +[](#) |
| 24 | +[](#) |
90 | 25 |
|
91 | | -``` javascript |
92 | | -new tracking.VideoCamera().track({ |
93 | | - type: 'color', |
94 | | - color: 'yellow' |
95 | | -}); |
96 | | -``` |
| 26 | +## Features |
97 | 27 |
|
98 | | -### Human tracking |
| 28 | +* [Trackers](http://trackingjs.com/docs.html#trackers) |
| 29 | + * [Color Tracker](http://trackingjs.com/docs.html#color-tracker) |
| 30 | + * [Object Tracker](http://trackingjs.com/docs.html#object-tracker) |
| 31 | +* [Utilities](http://trackingjs.com/docs.html#utilities) |
| 32 | + * [Feature Detection (Fast)](http://trackingjs.com/docs.html#feature-detection) |
| 33 | + * [Feature Descriptor (Brief)](http://trackingjs.com/docs.html#feature-descriptor) |
| 34 | + * [Convolution](http://trackingjs.com/docs.html#convolution) |
| 35 | + * [Gray Scale](http://trackingjs.com/docs.html#gray-scale) |
| 36 | + * [Image Blur](http://trackingjs.com/docs.html#image-blur) |
| 37 | + * [Integral Image](http://trackingjs.com/docs.html#integral-image) |
| 38 | + * [Sobel](http://trackingjs.com/docs.html#sobel) |
| 39 | + * [Viola Jones](http://trackingjs.com/docs.html#viola-jones) |
| 40 | +* [Web Components](http://trackingjs.com/docs.html#web-components) |
| 41 | + * [Color Element](http://trackingjs.com/docs.html#color-element) |
| 42 | + * [Object Element](http://trackingjs.com/docs.html#object-element) |
99 | 43 |
|
100 | | -* **data** *{string}* : could be `eye`, `frontal_face`, `mouth` or `upper_body` (default is `frontal_face`). |
| 44 | +## Browser Support |
101 | 45 |
|
102 | | -``` javascript |
103 | | -new tracking.VideoCamera().track({ |
104 | | - type: 'human', |
105 | | - data: 'eye' |
106 | | -}); |
107 | | -``` |
| 46 | +You can plug *tracking.js* into some well suported HTML elements such as `<canvas>`, `<video>` and `<img>`. |
108 | 47 |
|
109 | | -## Events |
| 48 | + |  |  |  |  |
| 49 | +--- | --- | --- | --- | --- | |
| 50 | +IE 9+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | |
110 | 51 |
|
111 | | -* **onFound** : Each time your tracker find something this event will be fired. |
| 52 | +However, the browser support may vary if you request the user's camera (which relies on [getUserMedia API](http://caniuse.com/#feat=stream)). |
112 | 53 |
|
113 | | -``` javascript |
114 | | -new tracking.VideoCamera().track({ |
115 | | - onFound: function(track) { |
116 | | - // do something |
117 | | - } |
118 | | -}); |
119 | | -``` |
| 54 | +## Roadmap |
120 | 55 |
|
121 | | -* **onNotFound** : Each time your tracker doesn't find something this event will be fired. |
| 56 | +- [ ] Optical flow |
| 57 | +- [ ] Face recognition |
| 58 | +- [ ] Pose estimation |
| 59 | +- [ ] Faster keypoint descriptor (BRIEF) |
| 60 | +- [ ] More trainings (Hand, car plate, etc) |
122 | 61 |
|
123 | | -``` javascript |
124 | | -new tracking.VideoCamera().track({ |
125 | | - onNotFound: function(track) { |
126 | | - // do something |
127 | | - } |
128 | | -}); |
129 | | -``` |
130 | | - |
131 | | -## About |
132 | | - |
133 | | -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. |
| 62 | +## Team |
134 | 63 |
|
135 | | -#### Why? |
136 | | -The concept of Natural Interaction proposes interfaces that understand the intentions of the user so that this convey their intentions intuitively interacting with computer systems in the same way makes day-to-day with people and objects. It is in this direction that the areas of interaction Human-Computer (IHC) and Virtual and Augmented Reality (AR), both in accelerated progression to native environments. |
| 64 | +*tracking.js* is maintained by these people and a bunch of awesome [contributors](https://github.com/eduardolundgren/tracking.js/graphs/contributors). |
137 | 65 |
|
138 | | -#### Who? |
139 | | -Created by Eduardo Lundgren, one of the creators of AlloyUI, involved in many open-source projects, ex-contributor to jQuery and jQuery UI. Graduate in Telecommunications Engineering from UPE and taking a Masters in CS from UFPE. Currently development lead at Liferay. |
| 66 | +[](https://github.com/eduardolundgren) | [](https://github.com/thiago-rocha) | [](https://github.com/zenorocha) | [](https://github.com/mairatma) | [](https://github.com/mairatma) |
| 67 | +--- | --- | --- | --- | --- |
| 68 | +[Eduardo Lundgren](https://github.com/eduardolundgren) | [Thiago Rocha](https://github.com/thiago-rocha) | [Zeno Rocha](https://github.com/zenorocha) | [Pablo Carvalho](https://github.com/pablocp) | [Maira Bello](https://github.com/mairatma) |
140 | 69 |
|
141 | | -## Team |
| 70 | +## License |
142 | 71 |
|
143 | | -* Eduardo Lundgren |
144 | | -* Thiago Pereira |
145 | | -* Zeno Rocha |
| 72 | +[BSD License](https://github.com/eduardolundgren/tracking.js/blob/master/LICENSE.md) © Eduardo Lundgren |
0 commit comments