Skip to content

About

All Movement Matters is a zero-dependency, high-performance static web application that brings browser-based computer vision and data analytics to racket sports (with support for Badminton and Tennis).

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

🏸 All Movement Matters — Match Intelligence Engine

All Movement Matters turns match video into movement intelligence in the browser.

Load a clip, run analysis, and review movement metrics, tactical positioning, and exportable telemetry.

What you get

Browser-only · No backend · No build step · Demo video included · CSV / JSON / SVG exports

Input · Dashboard · Exports · Features · Quick Start

Fast path: load video, choose sport and tracking mode, run analysis, then inspect the dashboard and export results.

Input Screen

Input screen

Dashboard Screen

Dashboard screen

Exports Screen

Exports screen

License: MIT HTML5 JavaScript Zero Dependencies No Build Step Prototype

"We don't just predict. We build what prediction needs — Mighty Data."

Live Demo · Core Thesis · Features · Architecture · Data Schema · Future Roadmap


💡 Core Thesis

In the current sports analytics landscape, many tools jump straight to predictions or high-level visual summaries. All Movement Matters takes a different approach: we build what prediction needs — Mighty Data.

By capturing, validating, and projecting raw athletic movement from simple broadcast footage into structured physical metrics in real-time, this engine acts as the foundational data layer. The telemetry gathered here enables high-fidelity game logs, custom performance charts, and direct integration with downstream machine learning and predictive AI models.


✨ Features

Feature Detail
🎬 Instant Playback MP4, AVI, MOV, MKV, WEBM — drag & drop or select with live thumbnail updates
🤖 Dual Tracking Modes High-Fi Preset (for local demo clips) + Live JS CV (lightweight connected-component blob detection)
🏸 Sport Gating Badminton & Tennis supported (Volleyball under development) — with custom court lines and net meshes
📐 Homography Mapping 3×3 perspective matrix mapping video pixels → real-world court coordinates (cm)
⚡ Hawk-Eye Events Curvature velocity analysis to identify player hit contact points (✕) and court bounces (◯)
👥 Player Metrics Real-time distance, speed, average speed, and acceleration tracking
🗺️ Tactical Map Live bird's-eye court representation with player locations, trails, and possession meters
🔥 Dynamic Heatmap Interactive spatial density map colored by team boundaries
📊 Mighty Exports Instant downloads for CSV Telemetry, JSON Session Logs, SVG Heatmaps, and Text Reports

🚀 Quick Start

To run the application locally without any build steps or compilation dependencies:

# 1. Clone the repository
git clone https://github.com/SonaliDuvesh/allMomentMatters.git
cd allMomentMatters

# 2. Start a local static file server
python3 -m http.server 8000

# 3. Open in your browser
open http://localhost:8000

🏗️ Architecture

flowchart TD
    A[User uploads video / clicks Demo] --> B[VideoEngine\nsetVideoSource · validateLoadedVideo]
    B --> C{Tracking mode?}
    C -- Preset/Demo --> D[demo_tracks.js\nPre-computed JSON tracks]
    C -- Live CV --> E[processFrameCV\nBackground subtraction · BFS blobs]
    D & E --> F[processVideoFrame\nMain per-frame dispatcher]
    F --> G[detectTrajectoryEvents\nShot hit & court bounce classifier]
    F --> H[updateDashboardFromPreset / Live\nMetrics · possession · space]
    F --> I[drawOverlay\nCanvas bounding boxes · reticles · HUD flashes]
    F --> J[drawTacticalMap\nMinimap · net post mesh · heatmap · events]
    F --> K[sessionTelemetry buffer\nCSV / JSON export]
    F --> L[addConsoleLog\nReal-time diagnostics log]
Loading

File Structure

allMomentMatters/
├── index.html          # Single-page application shell
├── styles.css          # Design system stylesheet
├── app.js              # Match Intelligence Engine
├── demo_tracks.js      # Pre-computed track data for demo video
├── demo.mp4            # Demo match video file
├── docs/
│   ├── screenshot_input.png
│   ├── screenshot_dashboard.png
│   └── screenshot_exports.png
└── README.md           # This documentation

📸 Visual Docs

The screenshots below are loaded directly in this README:

Match Input screen Dashboard analysis screen Exports and telemetry screen


📐 Camera Calibration & Homography

The engine maps pixel space coordinates [px, py] to court-space coordinates [x_court, y_court] (cm) using a 3x3 homography matrix.

You can compute custom homographies for new camera angles using this simple Python snippet:

import cv2
import numpy as np

# 4 pixel coordinates from the video
src = np.float32([
    [71,  61 ],   # Top-Left
    [579, 122],   # Top-Right
    [61,  270],   # Bottom-Left
    [529, 312],   # Bottom-Right
])

# Real-world badminton court coordinates in cm (1340 x 610)
dst = np.float32([
    [0,    0   ],
    [610,  0   ],
    [0,    1340],
    [610,  1340],
])

H, _ = cv2.findHomography(src, dst)
print("Homography Matrix:")
for row in H:
    print([f"{v:.6f}" for v in row])

📊 Data Exports

The telemetry data can be exported in various formats. Below is the structure of the generated CSV Telemetry:

Column Type Description
frame int Frame index
timestamp_sec float Video time in seconds
p1_x / p1_y int Player 1 pixel position (640×360 ref frame)
p1_court_x / p1_court_y float Player 1 court position (cm)
p2_x / p2_y int Player 2 pixel position
p2_court_x / p2_court_y float Player 2 court position (cm)
shuttle_x / shuttle_y int Shuttlecock/ball pixel position
shuttle_court_x / shuttle_court_y float Shuttlecock/ball court position (cm)

🔮 Future Roadmap

  • Multi-Sport Expansion: Integrate Volleyball, Squash, and Table Tennis layouts.
  • Train Custom AI Models: Use the structured telemetry logs (CSV/JSON outputs) to train custom deep learning models for shot prediction, player fatigue detection, and automatic strategy coaching.
  • Smarter Real-time Filtering: Integrate lightweight neural network inference directly in the browser via ONNX Runtime Web.

Built with ❤️ · All Movement Matters · No backend · No build · Just open and go

About

All Movement Matters is a zero-dependency, high-performance static web application that brings browser-based computer vision and data analytics to racket sports (with support for Badminton and Tennis).

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages