Gest.js

gest.js is a webcam based gesture recognition library that helps developers make webpages more immersive

View the Project on GitHub hadimichael/gest.js

What is gest.js? Check out this presentation from MelbJS

This is a short presentation I gave at MelbJS that summarises gest.js: http://hadimichael.github.io/gestjs-presentation/

gest.js IN THE WILD

Are you using gest.js? Please get in touch @hadi_michael

EXAMPLES

A simple gest.js demo that displays the gesture direction on screen: http://hadimichael.github.io/gest.js/demos/simple/index.html

Using gest.js to control Nathan Searles' SlidesJS: http://hadimichael.github.io/gest.js/demos/slidesjs/index.html

USAGE

Include the library (gest.js)

You will need to include the 'gest.js' library using something like:

<script type="text/javascript" src="gest.min.js"></script>

Start gesture detection

You can start gest.js by calling: gest.start();

Listen for recognised gestures

Method 1 (recommended)

Use the .options.subscribeWithCallback(...) function to listen for gestures:

gest.options.subscribeWithCallback(function(gesture) {
    //handle gesture .direction .up .down .left .right .error
});

This method is recommended because it will automatically handle cross-browser event handling.

Method 2

You can register an event listener on the document for gest using:

document.addEventListener('gest', function(gesture) {
    //handle gesture .direction .up .down .left .right .error
}, false);

How to handle recognised gestures

On every event, you will be passed a gesture object that contains:

Stop gesture detection

You can stop gest.js at any time by calling: gest.stop();

Using Options

Sensitivity (80 by default)

You can specify the degree of colour change that should be used to determine whether or not a pixel has changed. The specified value should range from 0-100, with 100 implying that the slightest change should be enough. You can specify sensitivity using: gest.options.sensitivity(85);

Skin Filtering (off by default)

To improve recognition in bright lighting conditions, you can enable HSV skin filtering using: gest.options.skinFilter(true);

Debugging (off by default)

In order to view the video stream and enable console.log(…) messages, you will need to toggle debugging using: gest.options.debug(true);

WHAT'S CHANGED

v0.5.0 (latest)

TODO

Acknowledgements

gest.js is an extension of work started by William Wu https://github.com/willy-vvu.

LICENSE (MIT)

Copyright (c) 2013, Hadi Michael (http://hadi.io)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.