Original
This is a small example of detecting movement with a webcam in javascript. The core concept is comparing frames to each other and detect differences based on a predetermined sensitivity.
For more information read this blog post: benjaminhorn.io
Fork
This fork connects motion-detection-in-javascript by @bejie to some d3 code to move lines a sprotz fan's arms up and down with webcam input. It must be used over a secure origin.