answered Dec 2 '12
There's a great tutorial here that might help you:
http://robots.stanford.edu/cs223b05/notes/CS%20223-B%20T1%20stavens_opencv_optical_flow.pdf