Baseball analytics have advanced significantly, but historical footage often lacks real-time pitch data. I wanted to solve this by developing a system that processes old MLB game videos and automatically extracts pitch speed data using computer vision. This allows me to analyze past games and generate insights without relying on manually recorded data.
What I Did • I extracted individual frames from an MLB game video. • I identified the baseball in each frame using image processing techniques. • I tracked the baseball’s movement across consecutive frames. • I calculated the pitch speed based on movement and frame rate. • I built an API that allows users to upload videos and receive processed pitch speed data.
How I Built It
My project consists of multiple stages that work together to analyze MLB videos: 1. Frame Extraction – I split the video into individual frames using OpenCV. 2. Ball Detection – I identified the baseball using color filtering and contour detection. 3. Ball Tracking – I tracked the movement of the ball across frames. 4. Speed Calculation – I estimated the pitch speed by measuring the displacement of the ball. 5. Flask API – I integrated the entire pipeline into a backend service that processes user-uploaded videos.
Challenges I Faced • The baseball sometimes blended with the background, making detection difficult. • Motion blur affected the accuracy of tracking. • Converting pixel-based movement into real-world speed required precise scaling factors.
Accomplishments I’m Proud Of • I successfully built an automated system that detects and tracks a baseball in video footage. • I achieved reliable pitch speed estimation using computer vision. • I developed an API that enables seamless video processing and speed analysis.
What I Learned • I gained a deeper understanding of image processing techniques for object detection. • I learned how to calculate real-world speeds using pixel-based tracking. • I improved my ability to integrate computer vision models into an API-based system.
What’s Next? • I plan to improve ball detection using machine learning models. • I aim to optimize processing speed for real-time applications. • I want to expand the system to analyze additional baseball metrics, such as spin rate and trajectory.
Log in or sign up for Devpost to join the conversation.