Home

Awesome

js-objectdetect

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 HAAR cascade classifiers used by the OpenCV object detector.

Watch this video for a short demonstration.

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

Examples

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.

The following demos are available (Internet Explorer and iOS not supported):

gesture input Rotating a 3D object via hand gesture

gesture scroll Scrolling a website via hand gesture

glasses Trying out various sunglasses

Classifiers

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. Cascades have to be converted into the js-objectdetect format before usage. The cascade format is similar to that of tracking.js. Converters for old and new style OpenCV xml haarcascades are available.

Performance

The following list provides a runtime and detection performance comparison among current JavaScript face detection libraries. All test results have been acquired by applying either a 24x24 stump-based HAAR cascade or, in case of CCV, a 24x24 SURF cascade classifier with minimum step size on a single scale 80x80 image. Measured times are summed over 100 executions.

Last updated on February 7, 2015

Chrome 40 / FF 35Detections per SecondDetectionsSeconds
js-objectdetect17.5 / 16.950 / 502.86 / 2.96
jsfeat<sup>1</sup>9.4 / 6.330 / 303.18 / 4.75
tracking.js7.7 / 8.9748 / 486.24 / 5.35
Beyond Reality Face<sup>2</sup>7.4 / 1.741 / 415.50 / 23.98
CCV<sup>3</sup>2.2 / 4.48 / 82.22 / 1.80
js-objectdetecttracking.jsjsfeat<sup>1</sup>Beyond Reality Face<sup>2</sup>CCV<sup>3</sup>
DetectionsDetectionsDetectionsDetectionsDetections

<sup>1</sup> also auduno/clmtrackr, camgaze.js. Based on an older version of js-objectdetect.

<sup>2</sup> Proprietary software, tested with v3.0.15. Fails to compile asm module in FF.

<sup>3</sup> also jquery.facedetection, neave/face-detection, wesbos/HTML5-Face-Detection, auduno/headtrackr

Usage

Examples can be found in the repository. For documentation, refer to the JSDoc in the source files.

Download

License

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

Credits

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