The top one is the original detection data and the bottom one is after we implement the KF algorithm. The blue circle is the predicted location and the red one is the original location.
This is the simple version of green ball color threshold detection:
I add the region filter and it preforms better: