Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Real-time face detection in HTML5 video using the CCV Javascript Library, with goofy glasses, green screen, hipster, and blur effects.

A quick and easy way to generate markup for mailto links without having to worry about the annoying formatting.
HTML5 Video Face Detection is an open-source browser demo that uses the CCV Javascript face detection library to track faces in a live webcam feed and apply four real-time effects: goofy glasses, green screen, hipster color manipulation, and blur.
This is a demo project (not a production library) that shows how to combine getUserMedia, HTML5 video, and the Canvas API to perform face detection entirely in the browser. It takes a live webcam stream as input and outputs a canvas rendering with an overlay effect positioned on detected faces. The code was created by Wes Bos and is available on GitHub with 468 stars. It relies on the CCV Javascript library, a JavaScript port of the OpenCV face detection algorithm, to locate faces in each video frame.
App.start('glasses'), App.start('green'), App.start('hipster'), or App.start('blur') from the browser console to change the visual output.App.start() effects.The page requests camera access through getUserMedia, then each video frame is drawn to a canvas. The CCV library scans the frame for face locations, and the active effect function draws the corresponding overlay or manipulation (glasses image, green screen keying, pixel shift, or blur) onto the canvas at the detected coordinates.
The demo requires a browser that supports getUserMedia. On Chrome Canary, you must enable the --enable-media-stream flag (or launch with that command-line argument) before the camera feed will work.
Open the page and run App.start() in the developer console. To use a specific effect, pass its name, for example App.start('glasses') for the goofy glasses overlay.
No, it is a demo and tutorial codebase showing how to use the CCV Javascript face detection library. It is not a packaged library or an npm module.
Yes, call App.start('green'). The effect includes hidden minimum and maximum sliders that let you tune the chroma key thresholds, though they are not visible in the default interface.
