03 Project
COMPUTER VISION · HUMAN POSE ESTIMATION · SPORTS ANALYTICS
RunRightAI
From Video to Sprint Velocity
“Can computer vision estimate an athlete’s running velocity using an ordinary camera instead of specialized motion-capture equipment?”
RunRightAI explores this question through a video-processing pipeline combining athlete detection, tracking, human pose estimation, and geometric calibration to transform pixel coordinates into ground-plane velocity time series.

Measuring physical movement from ordinary video
Analyzing sprint performance requires understanding how an athlete’s movement changes over time. While specialized motion-capture systems can provide detailed measurements, they require dedicated equipment and controlled environments.
Dedicated Motion Capture
Traditional biomechanics analysis relies on retro-reflective optical markers, calibrated multi-camera arrays (e.g. Vicon, Qualisys), or instrumented force plates. These deliver millimeter-grade ground truth but remain restricted to laboratory conditions, cost thousands of dollars, and cannot be deployed on an open running track with a consumer smartphone or standard tripod camera.
Monocular Video Challenge
Ordinary video offers an accessible alternative, but translating 2D image-space motion into physical measurements introduces fundamental challenges: severe perspective foreshortening, non-linear pixel scale across the field of view, rapid limb occlusions, and bounding-box jitter that pollutes derivative velocity calculations.
A controlled video-analysis experiment
The project was developed around recorded sprint videos captured from a fixed camera. The experimental configuration uses five physical reference markers defining a measured ground-plane region of 10 m × 1.22 m, providing the spatial reference to transform image coordinates into real-world meters.
| Marker | Pixel Coordinates (u, v) | Ground Coordinate (X, Y) | Spatial Role |
|---|---|---|---|
| M1 | (184, 842) | (0.00 m, 0.00 m) | Lane origin / inner boundary |
| M2 | (462, 796) | (2.50 m, 0.00 m) | 2.5m intermediate inner marker |
| M3 | (780, 712) | (5.00 m, 1.22 m) | 5.0m outer lane boundary |
| M4 | (1128, 640) | (7.50 m, 0.00 m) | 7.5m intermediate inner marker |
| M5 | (1512, 574) | (10.00 m, 1.22 m) | 10.0m terminal outer boundary |
Combining detection, tracking, and geometric calibration
The pipeline integrates multiple computer vision stages to track the athlete and extract their running trajectory across video frames.
ATHLETE TRACKING / POSE ESTIMATION: Bounding box association tracks the runner across frames, while MediaPipe Pose localizes joint landmarks. The left-hip keypoint (Landmark #23) serves as the primary center-of-mass proxy, which is projected onto the calibrated track plane to derive displacement.
Athlete Detection & Tracking
YOLOv8 detects people in individual video frames. A proximity-based spatial association algorithm links detections across consecutive frames, assigning a consistent track ID to isolate the sprint athlete from spectators or background movement.
Human Pose Estimation
MediaPipe Pose extracts 33 full-body anatomical landmarks from athlete-centered crops. The normalized landmark coordinates are transformed back into the original 1920×1080 video space to maintain exact geometric alignment with ground markers.
Ground-Plane Calibration
Physical reference cones/markers are detected via fine-tuned YOLOv8 paired with SAHI (Slicing Aided Hyper Inference) to locate small objects accurately. OpenCV computes the 3×3 homography matrix (H) from the five marker correspondences.
Velocity Estimation
The athlete’s left-hip horizontal trajectory, combined with the prototype’s fixed vertical reference, is projected through the homography matrix H. Consecutive transformed world positions produce frame-to-frame displacement (Δd) over time (Δt).
A modular video-processing pipeline
RunRightAI separates athlete detection, tracking, pose estimation, spatial calibration, and motion analysis into dedicated decoupled processing stages.
Generating velocity estimates from video
The research prototype demonstrates an end-to-end workflow for extracting motion information from recorded sprint footage. The centerpiece output is a continuous velocity-time series tracking the athlete’s acceleration and peak sprint speed.
Sprint Velocity vs. Time (10m Measured Segment)
Experimental output projected via 5-marker planar homographyEngineering hurdles & measurement constraints
Transforming computer vision detections into reliable biomechanical metrics revealed several fundamental challenges that distinguish visual prototypes from calibrated measurement instruments.
Consistent Athlete Tracking
Detecting an athlete independently in each frame is insufficient for velocity calculation. Occlusion from rapid limb swings, motion blur at 30 FPS, and bounding-box jitter introduce artificial instantaneous displacement. Temporal smoothing is critical to prevent tracking noise from multiplying quadratically into acceleration errors.
Perspective Distortion & Homography
Planar homography operates under the mathematical assumption that all tracked points lie strictly on a flat 2D plane. However, a sprinter’s hip moves vertically with each stride cycle. This out-of-plane vertical oscillation projects false horizontal displacement when transformed through the ground homography.
Unvalidated Reference Ground Truth
The pipeline calculates mathematically consistent velocity estimates, but its numerical outputs have not been calibrated against laboratory reference hardware (e.g. laser speed guns or synchronized timing gates). The project serves as an exploratory prototype demonstrating feasibility rather than a certified biomechanical device.
Scientific Note on Velocity Accuracy
In accordance with sound engineering standards, we avoid claims of “real-time analysis” or “certified accuracy.” Video inference was executed offline on recorded footage, and physical velocity values represent research estimates subject to camera lens calibration, frame-rate precision, and planar projection approximations.
From computer vision outputs to meaningful measurements
Key architectural takeaways gained while bridging deep learning models with projective geometry.
Machine Learning Needs Geometric Reasoning
Pretrained models like YOLO and MediaPipe excel at pixel-space recognition, but image coordinates alone cannot measure physical mechanics. Rigorous calibration, homography matrices, and camera geometry are essential to convert abstract bounding boxes into metric reality.
Temporal Stability Over Single-Frame Precision
A 95% single-frame detection accuracy is worthless if the identity or bounding-box anchor jitters by 4 pixels every frame. In kinematics, taking the derivative of noisy position signals amplifies high-frequency noise, making tracking smoothness far more critical than raw detection confidence.
Planar Assumptions in 3D Human Motion
Standard planar homography assumes tracked objects touch the ground. Tracking an anatomical landmark located ~1 meter above ground (the hip) introduces perspective parallax that varies with camera height and distance, highlighting the need for 3D body modeling in future iterations.
Pipeline Functionality vs. Real-World Validation
Demonstrating a functional end-to-end code pipeline is only the first step. Validating its reliability for coaches and athletes demands rigorous sensitivity analysis against professional timing gates and high-speed motion capture.
Explore the implementation
The repository contains the modular video processing pipeline, calibration algorithms, experiment notebooks, and sample analysis outputs.
RunRightAI originated as a collaborative research exploration, forked from the foundational repository AyoubFrihaoui/HumanPose-Estimation-in-Sport-Analysis. Mohammed Hachoud specifically designed, developed, and led the 5-marker spatial calibration workflow, SAHI small-object inference integration, image-to-ground-plane homography projection, and numerical velocity-time series estimation pipeline.
Vision & Geometry
YOLOv8 for athlete person detection · MediaPipe Pose for 33-point joint landmark extraction · SAHI for sliced inference on small cones · OpenCV for homography estimation and image perspective warping.
Computation & Plotting
Python 3.10+ · NumPy for vector kinematics and matrix transformations · Pandas for time-series aggregation · Matplotlib & SciPy for Savitzky-Golay filtering and velocity curve rendering.