to calculate optical flow vectors, we should use:
flow = estimateFlow(opticFlow,I)
where I(the input image) is a gray scale image. So first convert your color image to gray scale image. then use the above code.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!