This repo implements a correlation–path analysis of batting kinetics from short monocular video. From each clip we detect 2D keypoints and a bat tip, root‑center and scale‑normalize, smooth and differentiate, estimate a single in‑plane swing axis, and compute time‑lagged correlations among segments. We then extract a single directed chain—the maximum‑weight correlation path—that summarizes how motion flows from the lower body to the bat. The representation is intentionally minimal (one swing axis, one timeline, one chain), grounded in the physics of proximal‑to‑distal sequencing and designed for legibility via economy, directionality, and salience.
Note ffmpeg is required. Optionally, Python 3.8+ for montage.py.
Shots (left→right, top→bottom): hook, down the ground six, square drive, off-drive (camera placed at the back). Skeletons are derived from the above clips with a consistent fps, crop, and duration.
Pose & alignment.
Let
Kinematics. Centered differences approximate velocities/accelerations:
Optionally smooth with a Savitzky–Golay filter before differentiating.
Bat head speed & angular velocity. If
Temporal alignment (DTW). Compare two shots
yielding the correlation paths (*_corrpath.png).
This repo now includes simple Bash and Python tools to concatenate batting clips.
-
scripts/montage.sh
Bash wrapper around ffmpeg. Supports:- linear concatenation from a list file (
-l _tmp/list.txt) - optional normalization (
--normalize 480x270@30) - optional labels (
--label "Cover Drive") - auto-fallback from
-c copyto re-encode
- linear concatenation from a list file (
-
scripts/montage.py
Python wrapper with additional options:- all features from
montage.sh - optional crossfade transitions (
--xfade 0.5)
- all features from

