Real-Time Optical Flow Sensor Design and its Application on Obstacle Detection