Raspberry Pi Motion tracking in Python Pt. 1
What I did discover is that a lot of the example code I found was targetted at more powerful things than the Pi and runs at a snail's pace.
I now have some Python/OpenCV code that will do >25fps from a USB webcam on the Pi if you keep the source image small.
Ideally you need to overclock the Pi for best performance but if you only use a 160x120 source image it's still fine at 700Mhz.
To keep power use and heat down the script drops the FPS deliberately when nothing is moving and then ramps up when something happens. I'm not sure if this is 100% necessary but it feels like something you should do and the temperature definitely stays down a bit.