Use Motion Analysis to analyse image displacement in a frame with respect to the frame before it.
To access the Motion Analysis menu, use:
Batch, then select a node from the Node bin.
Timeline, then use Batch FX (see Creating Batch FX).
Tools, then select from the menu (See Accessing Tools).
This node accepts a front clip, and outputs forward and backward vectors.