computer vision in your browser - javascript real-time object detection
Pull request Compare This branch is 42 commits behind mtschirs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


js-objectdetect is a javascript library for real-time object detection.

This library is based on the work of Paul Viola and Rainer Lienhart and compatible to stump based cascade classifiers used by the OpenCV object detector.

All modern browsers including IE 9+, Safari and Opera Mobile are supported.


js-objectdetect is compatible to stump based classifiers used by OpenCV. Classifiers for face, hand and eye detection are already included. More can be found on the web (classifier repository). However, not all classifiers have the same performance and some are quite sensitive to lighting conditions.

face upper body fist hand eye


js-objectdetect can be used for object detection, tracking and, in combination with mordern HTML5 features such as WebRTC, for all sorts of augmented reality applications that run in the browser without any plugin.

glasses gesture

A live demo of the glasses example can be found here (currently Chrome, FF Nightly, Opera Next and Opera Mobile-only due to usage of WebRTC).

Usage - jQuery

The provided jQuery plugin provides a simple interface to the object detection library:

<script src="js/objectdetect.js"></script>
<script src="js/objectdetect.frontalface.js"></script>

<script src="js/jquery.js"></script>
<script src="js/jquery.objectdetect.js"></script>

<img id="image" src="image.png">
    $("#image").objectdetect("all", {classifier: objectdetect.frontalface}, function(coords) {

More examples can be found in the repository.



js-objectdetect is distributed under GPL3. The included classifiers are subject to their own licenses.


Thanks to Audun Mathias Øygard (auduno) for his inspirational headtrackr library, Brandon Jones (toji) for his valuable javascript performance tipps and Nikos (foo123) for his port of JViolaJones on which the canny pruning algorithm is based on.