Curve Fitting and Ball Tracking
In this project, our purpose was to track the thrown ball in various lighting conditions and fit a curve using various curve fitting techniques including Least Square, Total Least Square, and RANSAC(Random Sampling Consensus).
The very first step was to extract the coordinate of the ball from the given video:
- This was done in the most simple method, which is color thresholding.
- After finding a suitable range of HSV values, it is easy to separate the ball from the background.
- Using this blob of separated out color, we can use the cv2’s findContour function to find the blob of the ball and also the center of the ball. This center can denote the point that we are going to use for curve fitting.
4. Equation of parabola is given by:
5. We will use the standard least square method to extract the three coefficients – a,b and c. Use this equation to plot the curve.
June 4, 2023