Tracking Path of Moving Object by Color Based Image Segmentation

Codes(using JavaCV) available here (two parts):
Thresholding operation and position detection in an image
Capturing the video frames from webcam

Demo Video 42 Secs.