A Self-Tuning System for Real-Time Optical Flow Detection