I have been experimenting with openFrameworks and openCV lately. This is a short demo of using one video (a live webcam) to control playback of another I recorded earlier. It analyzes the direction and speed of motion to set the playback speed.
The “flow” of movement uses something called block matching, often used in video compression. The interface to use openCVs implementation in openFrameworks is here: https://github.com/kellyegan/bmOpticalFlow