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.
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.
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).
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">
<script>
$("#image").objectdetect("all", {classifier: objectdetect.frontalface}, function(coords) {
...
});
</script>
More examples can be found in the repository.
- The actual library:
- One or more classifier:
- The jQuery plugin:
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.