Swimming Motion Simulation & Computer-Vision Tracking System
Designing a scalable camera-tracking and biomechanics simulation for competitive swimming analytics

Project Snapshot
- Unity simulation of swimmer + overhead camera rail for stable tracking footage.
- Control Barrier Functions keep the camera centered and collision-free.
- Designed to feed future CV/ML metrics: stroke rate, speed, lane tracking.
Overview
This research project explores how computer vision and robotics-inspired control systems can enhance real-time swimming analysis. Under supervision from WPI’s Professor Wei Xiao, the goal is to build a complete simulation environment that models a swimmer in a virtual pool, tracks them with a moving overhead camera, applies safety-guaranteed control logic (Control Barrier Functions), and lays the foundation for stroke rate, speed, and biomechanics extraction.
It bridges computer vision, sports science, simulation, and control systems into a practical prototype.
Problem
Swimming is hard to analyze in real time: underwater cameras are expensive and fixed, above-water footage is unstable, and scalable setups are rare. To build sports-tech that works anywhere, we needed to:
- Simulate realistic motion in a virtual pool
- Move a camera smoothly and safely along a rail
- Keep the swimmer perfectly centered
- Prevent camera collisions or overshooting
- Enable future ML pipelines to extract metrics
Approach & Methodology
1. Simulation Environment Setup
- Built a 50m pool environment using Unity
- Constructed a camera rail mirroring Olympic-style tracking
- Configurable pool dimensions, lane width, and camera height
- Added a flexible swimmer object with scripted forward motion
- Tools: Unity Engine, C#, PoolBuilder scripts
2. Swimmer Motion Modeling
Implemented parametric swimmer movement with:
- Adjustable velocity
- Stroke-cycle control
- Buoyancy and body oscillation options
- Repeatable motion for experimental consistency
This keeps data controlled and reliable for CV/ML training.
3. Camera Tracking System (CBF-Based)
- Dynamic camera along a rail using Control Barrier Functions for safety
- Keeps the swimmer centered and prevents endpoint collisions
- Smoothly adjusts speed as the swimmer accelerates
- Uses physics-inspired velocity control and soft braking
- Tools: C#, Unity transforms, CBF controllers, kinematic modeling
4. Integration for Future Computer Vision
Outputs clean, consistent frames suitable for:
- Stroke detection
- Velocity estimation
- Distance-per-stroke measurements
- Lane tracking
- Underwater/above-water hybrid models (future)
Acts as the foundation for quantifiable metrics used by sports scientists.
Outcomes
Technical Deliverables
- Full Unity simulation of swimmer + camera rail
- CBF-based tracking logic with safety constraints
- Configurable pool and environment parameters
- Modular architecture for ML/CV extensions
Impact for Sports Technology
- Scalable alternative to Olympic-level underwater camera systems
- Enables AI biomechanics analysis for swimmers anywhere
- Foundation for future startup work in athlete performance tech
- Valid prototype for research presentations and portfolio demos
Tech Stack
Unity, C#, Motion Scripting, Control Barrier Functions (CBF), Kinematic Modeling, Computer Vision Pipeline Design