1 | initial version |
You can find the gravity center by computed a mean of all pixels in your blob. Or, you could ask OpenCV doing it for you:
The center of ellipse is your center of gravity, that you can track, maybe using the Kalman filter to smooth motion.
You could also look at OpenCV background subtraction classes here.