In Computer Vision application background subtraction plays a major role in identifying the object of interest. It is a fundamental and initial level task which plays a major work in detecting and identifying an object. It generates background model from the video sequence to detect foreground object in many computer vision applications such as traffic security, human machine interaction and recognition of objects. In this paperwe propose a system to detect and track the object of interest i.e foreground object from the background video and generate sequence of frames through optical flow algorithm. This helps us to model the background from illumination changes and sudden occlusion etc. The proposed work also calculatesthe distance travelled by the car in pixel/sec unit. The system keeps track of the vehicle whether the vehicles are balanced on the road by calculating the centriod.