kinemotion 0.10.12__tar.gz → 0.11.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kinemotion might be problematic. Click here for more details.
- {kinemotion-0.10.12 → kinemotion-0.11.0}/CHANGELOG.md +13 -0
- kinemotion-0.11.0/CLAUDE.md +234 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/PKG-INFO +92 -124
- {kinemotion-0.10.12 → kinemotion-0.11.0}/README.md +91 -123
- kinemotion-0.11.0/docs/CAMERA_SETUP.md +440 -0
- kinemotion-0.11.0/docs/CAMERA_SETUP_ES.md +440 -0
- kinemotion-0.11.0/docs/CMJ_GUIDE.md +451 -0
- kinemotion-0.11.0/docs/REAL_TIME_ANALYSIS.md +838 -0
- kinemotion-0.11.0/docs/TRIPLE_EXTENSION.md +310 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/pyproject.toml +1 -1
- kinemotion-0.11.0/samples/cmjs/README.md +47 -0
- kinemotion-0.11.0/src/kinemotion/__init__.py +31 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/api.py +335 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/cli.py +2 -0
- kinemotion-0.11.0/src/kinemotion/cmj/__init__.py +5 -0
- kinemotion-0.11.0/src/kinemotion/cmj/analysis.py +548 -0
- kinemotion-0.11.0/src/kinemotion/cmj/cli.py +626 -0
- kinemotion-0.11.0/src/kinemotion/cmj/debug_overlay.py +514 -0
- kinemotion-0.11.0/src/kinemotion/cmj/joint_angles.py +290 -0
- kinemotion-0.11.0/src/kinemotion/cmj/kinematics.py +191 -0
- kinemotion-0.11.0/tests/test_cmj_analysis.py +170 -0
- kinemotion-0.11.0/tests/test_cmj_kinematics.py +183 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/uv.lock +1 -1
- kinemotion-0.10.12/CLAUDE.md +0 -1003
- kinemotion-0.10.12/src/kinemotion/__init__.py +0 -14
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.dockerignore +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.github/pull_request_template.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.github/workflows/release.yml +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.gitignore +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.pre-commit-config.yaml +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/.tool-versions +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/CODE_OF_CONDUCT.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/CONTRIBUTING.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/Dockerfile +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/GEMINI.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/LICENSE +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/SECURITY.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/BULK_PROCESSING.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/ERRORS_FINDINGS.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/FRAMERATE.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/IMU_METADATA_PRESERVATION.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/PARAMETERS.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/docs/VALIDATION_PLAN.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/examples/bulk/README.md +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/examples/bulk/bulk_processing.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/examples/bulk/simple_example.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/examples/programmatic_usage.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/__init__.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/auto_tuning.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/filtering.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/pose.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/smoothing.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/core/video_io.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/dropjump/__init__.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/dropjump/analysis.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/dropjump/cli.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/dropjump/debug_overlay.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/dropjump/kinematics.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/src/kinemotion/py.typed +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/__init__.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_adaptive_threshold.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_api.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_aspect_ratio.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_com_estimation.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_contact_detection.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_filtering.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_kinematics.py +0 -0
- {kinemotion-0.10.12 → kinemotion-0.11.0}/tests/test_polyorder.py +0 -0
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
<!-- version list -->
|
|
9
9
|
|
|
10
|
+
## v0.11.0 (2025-11-06)
|
|
11
|
+
|
|
12
|
+
### Documentation
|
|
13
|
+
|
|
14
|
+
- Add camera setup docs
|
|
15
|
+
([`84678d6`](https://github.com/feniix/kinemotion/commit/84678d60261a361c1dce51aec604491ab096f537))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- Add counter movement jump (CMJ) analysis with triple extension tracking
|
|
20
|
+
([`b6fc454`](https://github.com/feniix/kinemotion/commit/b6fc454482b20b11d82fadc51974a554562b60d3))
|
|
21
|
+
|
|
22
|
+
|
|
10
23
|
## v0.10.12 (2025-11-03)
|
|
11
24
|
|
|
12
25
|
### Bug Fixes
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## Repository Purpose
|
|
4
|
+
|
|
5
|
+
Kinemotion: Video-based kinematic analysis for athletic performance using MediaPipe pose tracking.
|
|
6
|
+
|
|
7
|
+
**Supported Jump Types:**
|
|
8
|
+
- **Drop Jump**: Ground contact time, flight time, reactive strength index
|
|
9
|
+
- **Counter Movement Jump (CMJ)**: Jump height, flight time, countermovement depth, triple extension
|
|
10
|
+
|
|
11
|
+
## Quick Setup
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
asdf install # Install Python 3.12.7 + uv
|
|
15
|
+
uv sync # Install dependencies
|
|
16
|
+
uv run kinemotion dropjump-analyze video.mp4 --drop-height 0.40
|
|
17
|
+
uv run kinemotion cmj-analyze video.mp4
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Development:**
|
|
21
|
+
```bash
|
|
22
|
+
uv run pytest # Run all 70 tests
|
|
23
|
+
uv run ruff check --fix && uv run pyright # Lint + type check
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
### Module Structure
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
src/kinemotion/
|
|
32
|
+
├── cli.py # Main CLI (registers subcommands)
|
|
33
|
+
├── api.py # Python API (process_video, process_cmj_video, bulk)
|
|
34
|
+
├── core/ # Shared: pose, smoothing, filtering, auto_tuning, video_io
|
|
35
|
+
├── dropjump/ # Drop jump: cli, analysis, kinematics, debug_overlay
|
|
36
|
+
└── cmj/ # CMJ: cli, analysis, kinematics, joint_angles, debug_overlay
|
|
37
|
+
|
|
38
|
+
tests/ # 70 tests total (61 drop jump, 9 CMJ)
|
|
39
|
+
docs/ # CMJ_GUIDE, TRIPLE_EXTENSION, REAL_TIME_ANALYSIS, etc.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Design**: Each jump type is a sibling module with its own CLI command, metrics, and visualization.
|
|
43
|
+
|
|
44
|
+
### Key Differences: Drop Jump vs CMJ
|
|
45
|
+
|
|
46
|
+
| Feature | Drop Jump | CMJ |
|
|
47
|
+
|---------|-----------|-----|
|
|
48
|
+
| Starting | Elevated box | Floor level |
|
|
49
|
+
| Algorithm | Forward search | Backward search from peak |
|
|
50
|
+
| Velocity | Absolute (magnitude) | Signed (direction matters) |
|
|
51
|
+
| Parameter | `--drop-height` required | No calibration needed |
|
|
52
|
+
| Key Metric | Ground contact time | Jump height from flight time |
|
|
53
|
+
|
|
54
|
+
## Critical Implementation Details
|
|
55
|
+
|
|
56
|
+
### 1. Aspect Ratio Preservation (core/video_io.py)
|
|
57
|
+
|
|
58
|
+
**Always:**
|
|
59
|
+
- Read first actual frame for dimensions: `frame.shape[:2]`
|
|
60
|
+
- Handle SAR (Sample Aspect Ratio) metadata with ffprobe
|
|
61
|
+
- Validate dimensions in `write_frame()` to prevent corruption
|
|
62
|
+
|
|
63
|
+
**Never:**
|
|
64
|
+
- Use `cv2.CAP_PROP_FRAME_WIDTH/HEIGHT` (wrong for rotated videos)
|
|
65
|
+
|
|
66
|
+
### 2. Video Rotation (core/video_io.py)
|
|
67
|
+
|
|
68
|
+
- Extract rotation metadata from ffprobe (`side_data_list`)
|
|
69
|
+
- Apply rotation in `read_frame()` using `cv2.rotate()`
|
|
70
|
+
- Update width/height after 90°/-90° rotations
|
|
71
|
+
|
|
72
|
+
### 3. JSON Serialization
|
|
73
|
+
|
|
74
|
+
**Always convert NumPy types:**
|
|
75
|
+
```python
|
|
76
|
+
"frame": int(self.frame) if self.frame is not None else None
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Never:**
|
|
80
|
+
```python
|
|
81
|
+
"frame": self.frame # WRONG - int64 not JSON serializable
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. CMJ Signed Velocity (cmj/analysis.py)
|
|
85
|
+
|
|
86
|
+
**Critical difference from drop jump:**
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# Drop jump: absolute velocity
|
|
90
|
+
velocities = compute_velocity_from_derivative(positions) # Returns abs()
|
|
91
|
+
|
|
92
|
+
# CMJ: MUST use signed velocity
|
|
93
|
+
velocities = compute_signed_velocity(positions) # Keeps sign
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Why**: CMJ needs to distinguish upward (negative) vs downward (positive) motion for phase detection.
|
|
97
|
+
|
|
98
|
+
### 5. CMJ Backward Search (cmj/analysis.py)
|
|
99
|
+
|
|
100
|
+
**Algorithm:**
|
|
101
|
+
1. Find peak height first (global argmin)
|
|
102
|
+
2. Work backward: takeoff → lowest point
|
|
103
|
+
3. Work forward: landing after peak
|
|
104
|
+
|
|
105
|
+
**Why**: More robust than forward search, avoids false detections from video start.
|
|
106
|
+
|
|
107
|
+
### 6. Frame Dimensions
|
|
108
|
+
|
|
109
|
+
OpenCV vs NumPy ordering:
|
|
110
|
+
- NumPy shape: `(height, width, channels)`
|
|
111
|
+
- OpenCV VideoWriter: `(width, height)` tuple
|
|
112
|
+
|
|
113
|
+
## Common Tasks
|
|
114
|
+
|
|
115
|
+
### Add New Jump Type
|
|
116
|
+
|
|
117
|
+
1. Create `src/kinemotion/newjump/` with cli.py, analysis.py, kinematics.py
|
|
118
|
+
2. Register in `src/kinemotion/cli.py`: `cli.add_command(newjump_analyze)`
|
|
119
|
+
3. Add API functions in `api.py`
|
|
120
|
+
4. Export in `__init__.py`
|
|
121
|
+
5. Add tests
|
|
122
|
+
|
|
123
|
+
### Add Metrics
|
|
124
|
+
|
|
125
|
+
1. Update dataclass (e.g., `CMJMetrics`)
|
|
126
|
+
2. Calculate in `calculate_*_metrics()`
|
|
127
|
+
3. Add to `to_dict()` (convert NumPy types!)
|
|
128
|
+
4. Add tests
|
|
129
|
+
|
|
130
|
+
### Modify Detection
|
|
131
|
+
|
|
132
|
+
**Drop Jump**: Edit `detect_ground_contact()` in dropjump/analysis.py
|
|
133
|
+
**CMJ**: Edit `detect_cmj_phases()` in cmj/analysis.py (backward search)
|
|
134
|
+
|
|
135
|
+
## Testing & Quality
|
|
136
|
+
|
|
137
|
+
### Before Commit
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
uv run ruff check --fix # Auto-fix linting
|
|
141
|
+
uv run pyright # Type check (strict)
|
|
142
|
+
uv run pytest # All 70 tests
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Standards
|
|
146
|
+
|
|
147
|
+
- Pyright strict mode (all functions typed)
|
|
148
|
+
- Ruff (100 char lines)
|
|
149
|
+
- Conventional Commits (see below)
|
|
150
|
+
|
|
151
|
+
## Quick Reference
|
|
152
|
+
|
|
153
|
+
### CLI
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Drop jump (requires --drop-height)
|
|
157
|
+
kinemotion dropjump-analyze video.mp4 --drop-height 0.40
|
|
158
|
+
|
|
159
|
+
# CMJ (no calibration needed)
|
|
160
|
+
kinemotion cmj-analyze video.mp4 --output debug.mp4
|
|
161
|
+
|
|
162
|
+
# Batch
|
|
163
|
+
kinemotion cmj-analyze videos/*.mp4 --batch --workers 4
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Python API
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
# Drop jump
|
|
170
|
+
from kinemotion import process_video
|
|
171
|
+
metrics = process_video("video.mp4", drop_height=0.40)
|
|
172
|
+
|
|
173
|
+
# CMJ
|
|
174
|
+
from kinemotion import process_cmj_video
|
|
175
|
+
metrics = process_cmj_video("video.mp4")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Important Gotchas
|
|
179
|
+
|
|
180
|
+
### Video Processing
|
|
181
|
+
|
|
182
|
+
1. Read first frame for dimensions (not OpenCV properties)
|
|
183
|
+
2. Handle rotation metadata (mobile videos)
|
|
184
|
+
3. Preserve aspect ratio (SAR)
|
|
185
|
+
4. Validate dimensions in write_frame()
|
|
186
|
+
|
|
187
|
+
### CMJ Specific
|
|
188
|
+
|
|
189
|
+
1. **Lateral view required** - Front view won't work (parallax errors)
|
|
190
|
+
2. **Signed velocity** - Critical for phase detection
|
|
191
|
+
3. **Backward search** - Requires complete video (not real-time)
|
|
192
|
+
4. **MediaPipe limitations** - Ankle/knee only 18-27% visible in side view
|
|
193
|
+
|
|
194
|
+
### Type Safety
|
|
195
|
+
|
|
196
|
+
1. Convert NumPy types in `to_dict()`: `int()`, `float()`
|
|
197
|
+
2. Type all functions (pyright strict)
|
|
198
|
+
3. Handle None in optional fields
|
|
199
|
+
|
|
200
|
+
## Documentation
|
|
201
|
+
|
|
202
|
+
**User guides:** docs/CMJ_GUIDE.md, docs/CAMERA_SETUP.md, docs/PARAMETERS.md
|
|
203
|
+
**Technical:** docs/TRIPLE_EXTENSION.md, docs/REAL_TIME_ANALYSIS.md
|
|
204
|
+
|
|
205
|
+
## Commit Format
|
|
206
|
+
|
|
207
|
+
**Required**: [Conventional Commits](https://www.conventionalcommits.org/) - enforced by pre-commit hook
|
|
208
|
+
|
|
209
|
+
**Format**: `<type>(<scope>): <description>`
|
|
210
|
+
|
|
211
|
+
**Types** (triggers version bumps):
|
|
212
|
+
- `feat`: New feature → minor version bump (0.x.0)
|
|
213
|
+
- `fix`: Bug fix → patch version bump (0.0.x)
|
|
214
|
+
- `perf`: Performance improvement → patch
|
|
215
|
+
- `docs`, `test`, `refactor`, `chore`, `style`, `ci`, `build` → no version bump
|
|
216
|
+
|
|
217
|
+
**Examples:**
|
|
218
|
+
```bash
|
|
219
|
+
feat: add CMJ analysis with triple extension tracking
|
|
220
|
+
fix: correct takeoff detection in backward search algorithm
|
|
221
|
+
docs: add triple extension biomechanics guide
|
|
222
|
+
test: add CMJ phase detection tests
|
|
223
|
+
refactor: extract signed velocity to separate function
|
|
224
|
+
chore(release): 0.11.0 [skip ci]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Breaking changes**: Add `!` or `BREAKING CHANGE:` footer
|
|
228
|
+
```bash
|
|
229
|
+
feat!: change API signature for process_video
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## MCP Servers
|
|
233
|
+
|
|
234
|
+
Configured in `.mcp.json`: web-search, sequential-thinking, context7, etc.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kinemotion
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: Video-based kinematic analysis for athletic performance
|
|
5
5
|
Project-URL: Homepage, https://github.com/feniix/kinemotion
|
|
6
6
|
Project-URL: Repository, https://github.com/feniix/kinemotion
|
|
@@ -36,29 +36,43 @@ Description-Content-Type: text/markdown
|
|
|
36
36
|
[](https://github.com/astral-sh/ruff)
|
|
37
37
|
[](https://sonarcloud.io/summary/new_code?id=feniix_kinemotion)
|
|
38
38
|
|
|
39
|
-
A video-based kinematic analysis tool for athletic performance. Analyzes
|
|
39
|
+
A video-based kinematic analysis tool for athletic performance. Analyzes vertical jump videos to estimate key performance metrics using MediaPipe pose tracking and advanced kinematics.
|
|
40
|
+
|
|
41
|
+
**Supported jump types:**
|
|
42
|
+
|
|
43
|
+
- **Drop Jump**: Ground contact time, flight time, reactive strength index
|
|
44
|
+
- **Counter Movement Jump (CMJ)**: Jump height, flight time, countermovement depth, triple extension biomechanics
|
|
40
45
|
|
|
41
46
|
## Features
|
|
42
47
|
|
|
48
|
+
### Core Features
|
|
49
|
+
|
|
43
50
|
- **Automatic pose tracking** using MediaPipe Pose landmarks
|
|
44
|
-
- **Ground contact detection** based on foot velocity and position
|
|
45
51
|
- **Derivative-based velocity** - smooth velocity calculation from position trajectory
|
|
46
52
|
- **Trajectory curvature analysis** - acceleration patterns for refined event detection
|
|
47
|
-
- **Sub-frame interpolation** - precise timing beyond frame boundaries
|
|
48
|
-
- **
|
|
49
|
-
- **Kinematic calculations** for jump metrics:
|
|
50
|
-
- Ground contact time (ms)
|
|
51
|
-
- Flight time (ms)
|
|
52
|
-
- Jump height (m) - with optional calibration using drop box height
|
|
53
|
-
- **Calibrated measurements** - use known drop height for theoretically improved accuracy (⚠️ accuracy claims unvalidated)
|
|
53
|
+
- **Sub-frame interpolation** - precise timing beyond frame boundaries
|
|
54
|
+
- **Intelligent auto-tuning** - automatic parameter optimization based on video characteristics
|
|
54
55
|
- **JSON output** for easy integration with other tools
|
|
55
|
-
- **
|
|
56
|
-
- **Batch processing** - CLI and Python API for parallel processing
|
|
57
|
-
- **Python library API** - use kinemotion programmatically
|
|
58
|
-
- **CSV export** - aggregated results for research
|
|
59
|
-
- **Configurable parameters** for smoothing, thresholds, and detection
|
|
56
|
+
- **Debug video overlays** with visual analysis
|
|
57
|
+
- **Batch processing** - CLI and Python API for parallel processing
|
|
58
|
+
- **Python library API** - use kinemotion programmatically
|
|
59
|
+
- **CSV export** - aggregated results for research
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
### Drop Jump Analysis
|
|
62
|
+
|
|
63
|
+
- **Ground contact detection** based on foot velocity and position
|
|
64
|
+
- **Automatic drop jump detection** - identifies box → drop → landing → jump phases
|
|
65
|
+
- **Metrics**: Ground contact time, flight time, jump height (with drop height calibration)
|
|
66
|
+
- **Reactive strength index** calculations
|
|
67
|
+
|
|
68
|
+
### Counter Movement Jump (CMJ) Analysis
|
|
69
|
+
|
|
70
|
+
- **Backward search algorithm** - robust phase detection from peak height
|
|
71
|
+
- **Flight time method** - force plate standard (h = g×t²/8)
|
|
72
|
+
- **Triple extension tracking** - ankle, knee, hip joint angles
|
|
73
|
+
- **Skeleton overlay** - biomechanical visualization
|
|
74
|
+
- **Metrics**: Jump height, flight time, countermovement depth, eccentric/concentric durations
|
|
75
|
+
- **Validated accuracy**: 50.6cm jump (±1 frame precision)
|
|
62
76
|
|
|
63
77
|
## Validation Status
|
|
64
78
|
|
|
@@ -104,133 +118,77 @@ This will install all dependencies and make the `kinemotion` command available.
|
|
|
104
118
|
|
|
105
119
|
## Usage
|
|
106
120
|
|
|
107
|
-
|
|
121
|
+
Kinemotion supports two jump types with intelligent auto-tuning that automatically optimizes parameters based on video characteristics.
|
|
108
122
|
|
|
109
|
-
###
|
|
123
|
+
### Drop Jump Analysis
|
|
110
124
|
|
|
111
|
-
|
|
125
|
+
Analyzes reactive strength and ground contact time:
|
|
112
126
|
|
|
113
127
|
```bash
|
|
114
128
|
# Drop-height is REQUIRED for accurate calibration
|
|
115
129
|
kinemotion dropjump-analyze video.mp4 --drop-height 0.40
|
|
116
130
|
```
|
|
117
131
|
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --json-output metrics.json
|
|
122
|
-
```
|
|
132
|
+
### Counter Movement Jump (CMJ) Analysis
|
|
123
133
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Create an annotated video showing pose tracking and contact detection:
|
|
134
|
+
Analyzes jump height and biomechanics:
|
|
127
135
|
|
|
128
136
|
```bash
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### Complete Analysis
|
|
137
|
+
# No drop height needed (floor level)
|
|
138
|
+
kinemotion cmj-analyze video.mp4
|
|
133
139
|
|
|
134
|
-
With
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
kinemotion dropjump-analyze video.mp4 \
|
|
138
|
-
--drop-height 0.40 \
|
|
139
|
-
--output debug.mp4 \
|
|
140
|
-
--json-output results.json
|
|
140
|
+
# With triple extension visualization
|
|
141
|
+
kinemotion cmj-analyze video.mp4 --output debug.mp4
|
|
141
142
|
```
|
|
142
143
|
|
|
143
|
-
###
|
|
144
|
-
|
|
145
|
-
Choose analysis quality (automatically adjusts all parameters):
|
|
144
|
+
### Common Options (Both Jump Types)
|
|
146
145
|
|
|
147
146
|
```bash
|
|
148
|
-
#
|
|
149
|
-
kinemotion
|
|
147
|
+
# Save metrics to JSON
|
|
148
|
+
kinemotion cmj-analyze video.mp4 --json-output results.json
|
|
150
149
|
|
|
151
|
-
#
|
|
152
|
-
kinemotion
|
|
150
|
+
# Generate debug video
|
|
151
|
+
kinemotion cmj-analyze video.mp4 --output debug.mp4
|
|
153
152
|
|
|
154
|
-
#
|
|
155
|
-
kinemotion
|
|
153
|
+
# Complete analysis with all outputs
|
|
154
|
+
kinemotion cmj-analyze video.mp4 \
|
|
155
|
+
--output debug.mp4 \
|
|
156
|
+
--json-output results.json \
|
|
157
|
+
--verbose
|
|
156
158
|
```
|
|
157
159
|
|
|
158
|
-
###
|
|
159
|
-
|
|
160
|
-
View what parameters were automatically selected:
|
|
160
|
+
### Quality Presets
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
# Fast (50% faster, good for batch)
|
|
164
|
+
kinemotion cmj-analyze video.mp4 --quality fast
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
# Balanced (default)
|
|
167
|
+
kinemotion cmj-analyze video.mp4 --quality balanced
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Manual parameter override (rarely needed)
|
|
172
|
-
kinemotion dropjump-analyze video.mp4 \
|
|
173
|
-
--drop-height 0.40 \
|
|
174
|
-
--expert \
|
|
175
|
-
--smoothing-window 7 \
|
|
176
|
-
--velocity-threshold 0.015
|
|
169
|
+
# Accurate (research-grade)
|
|
170
|
+
kinemotion cmj-analyze video.mp4 --quality accurate --verbose
|
|
177
171
|
```
|
|
178
172
|
|
|
179
173
|
### Batch Processing
|
|
180
174
|
|
|
181
|
-
Process multiple videos in parallel
|
|
175
|
+
Process multiple videos in parallel:
|
|
182
176
|
|
|
183
177
|
```bash
|
|
184
|
-
#
|
|
178
|
+
# Drop jumps
|
|
185
179
|
kinemotion dropjump-analyze videos/*.mp4 --batch --drop-height 0.40 --workers 4
|
|
186
180
|
|
|
187
|
-
#
|
|
188
|
-
kinemotion
|
|
181
|
+
# CMJ (no drop height needed)
|
|
182
|
+
kinemotion cmj-analyze videos/*.mp4 --batch --workers 4 \
|
|
189
183
|
--json-output-dir results/ \
|
|
190
|
-
--output-dir debug_videos/ \
|
|
191
184
|
--csv-summary summary.csv
|
|
192
|
-
|
|
193
|
-
# Multiple explicit paths (batch mode auto-enabled)
|
|
194
|
-
kinemotion dropjump-analyze video1.mp4 video2.mp4 video3.mp4 --drop-height 0.40
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Batch options:**
|
|
198
|
-
|
|
199
|
-
- `--batch`: Explicitly enable batch mode
|
|
200
|
-
- `--workers <int>`: Number of parallel workers (default: 4)
|
|
201
|
-
- `--output-dir <path>`: Directory for debug videos (auto-named per video)
|
|
202
|
-
- `--json-output-dir <path>`: Directory for JSON metrics (auto-named per video)
|
|
203
|
-
- `--csv-summary <path>`: Export aggregated results to CSV
|
|
204
|
-
|
|
205
|
-
**Output example:**
|
|
206
|
-
|
|
207
|
-
```text
|
|
208
|
-
Batch processing 10 videos with 4 workers
|
|
209
|
-
======================================================================
|
|
210
|
-
|
|
211
|
-
Processing videos...
|
|
212
|
-
[1/10] ✓ athlete1.mp4 (2.3s)
|
|
213
|
-
[2/10] ✓ athlete2.mp4 (2.1s)
|
|
214
|
-
[3/10] ✗ athlete3.mp4 (0.5s)
|
|
215
|
-
Error: No frames could be processed
|
|
216
|
-
|
|
217
|
-
======================================================================
|
|
218
|
-
BATCH PROCESSING SUMMARY
|
|
219
|
-
======================================================================
|
|
220
|
-
Total videos: 10
|
|
221
|
-
Successful: 9
|
|
222
|
-
Failed: 1
|
|
223
|
-
|
|
224
|
-
Average ground contact time: 245.3 ms
|
|
225
|
-
Average flight time: 523.7 ms
|
|
226
|
-
Average jump height: 0.352 m (35.2 cm)
|
|
227
185
|
```
|
|
228
186
|
|
|
229
187
|
## Python API
|
|
230
188
|
|
|
231
|
-
Use kinemotion as a library
|
|
189
|
+
Use kinemotion as a library for automated pipelines and custom analysis.
|
|
232
190
|
|
|
233
|
-
###
|
|
191
|
+
### Drop Jump API
|
|
234
192
|
|
|
235
193
|
```python
|
|
236
194
|
from kinemotion import process_video
|
|
@@ -252,43 +210,53 @@ print(f"Flight time: {metrics.flight_time * 1000:.1f} ms")
|
|
|
252
210
|
### Bulk Video Processing
|
|
253
211
|
|
|
254
212
|
```python
|
|
213
|
+
# Drop jump bulk processing
|
|
255
214
|
from kinemotion import VideoConfig, process_videos_bulk
|
|
256
215
|
|
|
257
|
-
# Configure multiple videos
|
|
258
216
|
configs = [
|
|
259
217
|
VideoConfig("video1.mp4", drop_height=0.40),
|
|
260
218
|
VideoConfig("video2.mp4", drop_height=0.30, quality="accurate"),
|
|
261
|
-
VideoConfig("video3.mp4", drop_height=0.50, output_video="debug3.mp4"),
|
|
262
219
|
]
|
|
263
220
|
|
|
264
|
-
# Process in parallel with 4 workers
|
|
265
221
|
results = process_videos_bulk(configs, max_workers=4)
|
|
266
222
|
|
|
267
|
-
#
|
|
268
|
-
|
|
223
|
+
# CMJ bulk processing
|
|
224
|
+
from kinemotion import CMJVideoConfig, process_cmj_videos_bulk
|
|
225
|
+
|
|
226
|
+
cmj_configs = [
|
|
227
|
+
CMJVideoConfig("cmj1.mp4"),
|
|
228
|
+
CMJVideoConfig("cmj2.mp4", quality="accurate"),
|
|
229
|
+
]
|
|
230
|
+
|
|
231
|
+
cmj_results = process_cmj_videos_bulk(cmj_configs, max_workers=4)
|
|
232
|
+
|
|
233
|
+
for result in cmj_results:
|
|
269
234
|
if result.success:
|
|
270
|
-
print(f"
|
|
271
|
-
else:
|
|
272
|
-
print(f"✗ {result.video_path}: {result.error}")
|
|
235
|
+
print(f"{result.video_path}: {result.metrics.jump_height*100:.1f}cm")
|
|
273
236
|
```
|
|
274
237
|
|
|
275
|
-
|
|
238
|
+
See `examples/bulk/README.md` for comprehensive API documentation.
|
|
239
|
+
|
|
240
|
+
### CMJ-Specific Features
|
|
276
241
|
|
|
277
242
|
```python
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
from kinemotion import VideoConfig, process_videos_bulk
|
|
243
|
+
# Triple extension angles available in metrics
|
|
244
|
+
metrics = process_cmj_video("video.mp4", output_video="debug.mp4")
|
|
281
245
|
|
|
282
|
-
#
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
]
|
|
246
|
+
# Debug video shows:
|
|
247
|
+
# - Skeleton overlay (foot→shin→femur→trunk)
|
|
248
|
+
# - Joint angles (ankle, knee, hip, trunk)
|
|
249
|
+
# - Phase-coded visualization
|
|
250
|
+
```
|
|
288
251
|
|
|
289
|
-
|
|
252
|
+
### CSV Export Example
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
# See examples/bulk/ for complete CSV export examples
|
|
256
|
+
from kinemotion import process_cmj_video
|
|
257
|
+
import csv
|
|
290
258
|
|
|
291
|
-
#
|
|
259
|
+
# ... process videos ...
|
|
292
260
|
with open("results.csv", "w", newline="") as f:
|
|
293
261
|
writer = csv.writer(f)
|
|
294
262
|
writer.writerow(["Video", "GCT (ms)", "Flight (ms)", "Jump (m)"])
|