Thanks VIVEK_N,
One of my problems is solved.Let me explain my full objective.pls help me how to go about it.My objective is to find the centroid of four markers,present in an image individually .This i find by making the user click on a point on the four markers, i create four rectangular subsets of the original image and find centroid of each image and then superimpose them on the full imge after making coordinate shifts required.But this is fine for a static image..Now i need to implement it dynamically for a video in which each frame will have different centroid due to shift in marker position.Now , how do i track the centroid as the video is runnin by timin the program in such a way the centroid keeps shifting as frames run..pls help..
Im attachin what i hav done with static images