Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Motion Detecting Web Apps with JavaScript

Building Motion Detecting Web Apps with JavaScript

What do my pets do when no one is around? I decided to find out. This talk covers how (and then some).

A webcam and some JavaScript using WebRTC is enough to take snapshots, but the trick is finding the snapshots worth saving. I'll share how to write an image diffing algorithm that creates a visual motion heatmap, which can be used to programmatically recognize when a snapshot has caught something happening. The interesting snapshots are then uploaded to Twitter for remote viewing.

This talk is also available in article form here: http://codersblock.com/blog/motion-detection-with-javascript/.

Demos (and links to source code repos) are here: http://diffcam.com/.

Will Boyd

May 13, 2016
Tweet

More Decks by Will Boyd

Other Decks in Technology

Transcript

  1. R: 252 G: 90 B: 146 R: 59 G: 166

    B: 216 R: 193
 G: 76 B: 70 (abs)
  2. R: 0 G: 0 B: 0 R: 255 G: 255

    B: 255 NO DIFFERENCE MOST DIFFERENCE
  3. ‣ Remote viewing ‣ Accept image uploads ‣ Host images

    ‣ Display feed ‣ Privacy options ‣ Authentication ‣ Sharing ‣ Notifications
  4. ‣ Remote viewing ‣ Accept image uploads ‣ Host images

    ‣ Display feed ‣ Privacy options ‣ Authentication ‣ Sharing ‣ Notifications