This work is licensed under a Creative Commons Attribution 3.0 Unported License.
I used this project as an opportunity to experiment with a number of new technologies.
Part of WebRTC is support for accessing user hardware. Using getUserMedia(), I can display the user's webcam and allow them to grab a frame for processing.
With the File API, I can get drag-and-dropped images into a canvas all on the client side using FileReader.
The k-means calculation takes a few moments and normally this locks up the browser and stops the animation. Using Web Workers, I can do these calculations in the background.