[youtube=http://www.youtube.com/watch?v=xlTyCymEM9g]
Researchers at the University of Liege have developed an algorithm to separate movement from background. They call it ViBe and this patented piece of code comes in at under 100 lines of C. Above you can see the proof of concept shown by hacking the code into CHDK, a Canon PowerShot alternative firmware. The package is available for non-commercial use and might be just the thing you need to get your project to recognize where it needs to serve the beer.
[Thanks Juan via Slashdot]