How to Make a Webcam Intruder Alarm with Mathematica
blog.wolfram.com
blog.wolfram.com
"...I could use an infinite loop, but that would lock my Mathematica completely. I might want to run overnight computations at the same time, or have other events happen periodically, so instead I program a scheduled interrupt (another new capability) that will suspend any running Mathematica program, run this command, and then return to the program."
Mathematica hasn't previously had a way to manage a long-running process by itself. For a long time this would have been accomplished by calling Mathematica kernel from another program using a linking library. Not very difficult but it still would have been another step. Now it's built in. Cool.
It's based on a technology[2] created by the guy who made Palm.
And here's a guy trying to fool it and mostly failing.[3]
[2] http://www.numenta.com/htm-overview/education/HTM_CorticalLe...
Bonus points for the hilarious example video.
Webcam intruder alarms don't need Mathematica. Here's a hacky Python one I came up with (I don't know Python, but it only took a couple of hours): http://pastebin.com/zXexPwSi
Basically it shrinks each image, turns it monochrome and then compares it with the previous frame, with some allowance for noise. You do need to edit the MONOCHROMATIC_MAX_VARIANCE for day vs night.
I wasn't as interested in the security cam aspect as much as how much Mathematica can do with relatively little code, but I'd like to point out a couple of things about actually using this:
1) Not sure what kind of camera/server you have, but it would probably have to run this not yet released version of the Mathematica kernel, which you would have to buy. If that works, great.
2) If that doesn't work, there is another company called Vitamin D that has released software that works in a similar way. http://www.vitamindinc.com/ A single-camera version is free.
(Fans of On Intelligence author Jeff Hawkins might note that this technology is directly based off of his theory of how the mind works. Cool stuff.)
Without a service plan, they start at $150, and they run busybox.
Ours already do intruder/motion detection on the cameras.