Automated Time Lapse Photography in Python
February 14, 2008 at 11:32 pm | In Python |Last night at the Utah Python User Group meeting, John Harrison had an awesome game he has made called Marshie Attacks. It combines PyGame, PySight, a projector and lasers. You point the laser at Marshie and the isight camera detects if the laser is on target, and if so, he blows up. Very cool stuff indeed.
His game depends on the Macintosh PySight library for video capture, but is otherwise cross platform. I decided to take a stab at getting images off my webcam in linux. Using gstreamer, it wasn't hard at all.
I don't have a projector, so I can't make a full Linux port Marshie Attacks, yet. This first stab is just to show how to grab images from a v4l2 device in Linux. This program takes time lapse photos, and saves them to disk with a configurable frequency.
Requirements include:
* Python (2.5)
* gstreamer 0.10
* Python Imaging Library
5 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
XML Sitemap


It is worth noting that a projector is not required for development and testing. You can simply point your webcam at your screen. This is very difficult to do with my laptop as the iSight is mounted above the screen, but for most setups this should not be a problem.
Comment by a random John — February 15, 2008 #
I hadn't thought of that. Good idea!
Like you, my camera is integrated into my laptop. I might be able to get my hands on a USB model however…
Comment by ryan — February 15, 2008 #
An external monitor would also work and might be more readily available.
Comment by a random John — February 15, 2008 #
Looks like the Python users group is more fun than a poetry reading.
Comment by Duane — February 16, 2008 #
The Missile Command game is now laser enabled and works on both Linux and Mac. Details and download are here.
Comment by a random John — March 24, 2008 #