Ask Your Question

Revision history [back]

you can use color detection + Kalman filter

  • transform the video frames into HSV color space using cvtColor
  • find a lower and upper bound of HSV values of the color of your balls
  • use inRange to detect the ball, this gives you a binary image where the ones are the pixels of the ball
  • then you may calculate the average of positions of ball pixels to find the center position of ball

you can then feed the position of ball into Kalman filter tracker.