I did this once for a motion dection algorithm. I used luminescence calculations to determine this. I basically broke the image into a grid of nine (3x3) areas and calculated the luminescene for each section and if it changed signficantly enough then there has been motions. The more sections, the more precise the detection will be. This was written in Visual Basic 4 and was able to do about 10 frames per seconds so you can get decent performance.
I got the luminescence calculation from a classic math/computer science equation book. I should know the title but I'm blanking on it. Andy -- http://mail.python.org/mailman/listinfo/python-list