kinemotion 0.10.12__tar.gz → 0.11.1__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.

Files changed (71) hide show
  1. {kinemotion-0.10.12 → kinemotion-0.11.1}/CHANGELOG.md +21 -0
  2. kinemotion-0.11.1/CLAUDE.md +234 -0
  3. {kinemotion-0.10.12 → kinemotion-0.11.1}/PKG-INFO +92 -124
  4. {kinemotion-0.10.12 → kinemotion-0.11.1}/README.md +91 -123
  5. kinemotion-0.11.1/docs/CAMERA_SETUP.md +440 -0
  6. kinemotion-0.11.1/docs/CAMERA_SETUP_ES.md +440 -0
  7. kinemotion-0.11.1/docs/CMJ_GUIDE.md +451 -0
  8. kinemotion-0.11.1/docs/REAL_TIME_ANALYSIS.md +838 -0
  9. kinemotion-0.11.1/docs/TRIPLE_EXTENSION.md +310 -0
  10. {kinemotion-0.10.12 → kinemotion-0.11.1}/pyproject.toml +1 -1
  11. kinemotion-0.11.1/samples/cmjs/README.md +47 -0
  12. kinemotion-0.11.1/src/kinemotion/__init__.py +31 -0
  13. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/api.py +330 -0
  14. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/cli.py +2 -0
  15. kinemotion-0.11.1/src/kinemotion/cmj/__init__.py +5 -0
  16. kinemotion-0.11.1/src/kinemotion/cmj/analysis.py +532 -0
  17. kinemotion-0.11.1/src/kinemotion/cmj/cli.py +621 -0
  18. kinemotion-0.11.1/src/kinemotion/cmj/debug_overlay.py +514 -0
  19. kinemotion-0.11.1/src/kinemotion/cmj/joint_angles.py +290 -0
  20. kinemotion-0.11.1/src/kinemotion/cmj/kinematics.py +191 -0
  21. kinemotion-0.11.1/tests/test_cmj_analysis.py +158 -0
  22. kinemotion-0.11.1/tests/test_cmj_kinematics.py +184 -0
  23. {kinemotion-0.10.12 → kinemotion-0.11.1}/uv.lock +1 -1
  24. kinemotion-0.10.12/CLAUDE.md +0 -1003
  25. kinemotion-0.10.12/src/kinemotion/__init__.py +0 -14
  26. {kinemotion-0.10.12 → kinemotion-0.11.1}/.dockerignore +0 -0
  27. {kinemotion-0.10.12 → kinemotion-0.11.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  28. {kinemotion-0.10.12 → kinemotion-0.11.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  29. {kinemotion-0.10.12 → kinemotion-0.11.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  30. {kinemotion-0.10.12 → kinemotion-0.11.1}/.github/pull_request_template.md +0 -0
  31. {kinemotion-0.10.12 → kinemotion-0.11.1}/.github/workflows/release.yml +0 -0
  32. {kinemotion-0.10.12 → kinemotion-0.11.1}/.gitignore +0 -0
  33. {kinemotion-0.10.12 → kinemotion-0.11.1}/.pre-commit-config.yaml +0 -0
  34. {kinemotion-0.10.12 → kinemotion-0.11.1}/.tool-versions +0 -0
  35. {kinemotion-0.10.12 → kinemotion-0.11.1}/CODE_OF_CONDUCT.md +0 -0
  36. {kinemotion-0.10.12 → kinemotion-0.11.1}/CONTRIBUTING.md +0 -0
  37. {kinemotion-0.10.12 → kinemotion-0.11.1}/Dockerfile +0 -0
  38. {kinemotion-0.10.12 → kinemotion-0.11.1}/GEMINI.md +0 -0
  39. {kinemotion-0.10.12 → kinemotion-0.11.1}/LICENSE +0 -0
  40. {kinemotion-0.10.12 → kinemotion-0.11.1}/SECURITY.md +0 -0
  41. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/BULK_PROCESSING.md +0 -0
  42. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/ERRORS_FINDINGS.md +0 -0
  43. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/FRAMERATE.md +0 -0
  44. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/IMU_METADATA_PRESERVATION.md +0 -0
  45. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/PARAMETERS.md +0 -0
  46. {kinemotion-0.10.12 → kinemotion-0.11.1}/docs/VALIDATION_PLAN.md +0 -0
  47. {kinemotion-0.10.12 → kinemotion-0.11.1}/examples/bulk/README.md +0 -0
  48. {kinemotion-0.10.12 → kinemotion-0.11.1}/examples/bulk/bulk_processing.py +0 -0
  49. {kinemotion-0.10.12 → kinemotion-0.11.1}/examples/bulk/simple_example.py +0 -0
  50. {kinemotion-0.10.12 → kinemotion-0.11.1}/examples/programmatic_usage.py +0 -0
  51. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/__init__.py +0 -0
  52. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/auto_tuning.py +0 -0
  53. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/filtering.py +0 -0
  54. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/pose.py +0 -0
  55. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/smoothing.py +0 -0
  56. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/core/video_io.py +0 -0
  57. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/dropjump/__init__.py +0 -0
  58. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/dropjump/analysis.py +0 -0
  59. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/dropjump/cli.py +0 -0
  60. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/dropjump/debug_overlay.py +0 -0
  61. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/dropjump/kinematics.py +0 -0
  62. {kinemotion-0.10.12 → kinemotion-0.11.1}/src/kinemotion/py.typed +0 -0
  63. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/__init__.py +0 -0
  64. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_adaptive_threshold.py +0 -0
  65. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_api.py +0 -0
  66. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_aspect_ratio.py +0 -0
  67. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_com_estimation.py +0 -0
  68. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_contact_detection.py +0 -0
  69. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_filtering.py +0 -0
  70. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_kinematics.py +0 -0
  71. {kinemotion-0.10.12 → kinemotion-0.11.1}/tests/test_polyorder.py +0 -0
@@ -7,6 +7,27 @@ 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.1 (2025-11-06)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **cmj**: Remove unused parameters and fix code quality issues
15
+ ([`72a1e43`](https://github.com/feniix/kinemotion/commit/72a1e43ec107e5b1c132efb10a08a09ea2864ae4))
16
+
17
+
18
+ ## v0.11.0 (2025-11-06)
19
+
20
+ ### Documentation
21
+
22
+ - Add camera setup docs
23
+ ([`84678d6`](https://github.com/feniix/kinemotion/commit/84678d60261a361c1dce51aec604491ab096f537))
24
+
25
+ ### Features
26
+
27
+ - Add counter movement jump (CMJ) analysis with triple extension tracking
28
+ ([`b6fc454`](https://github.com/feniix/kinemotion/commit/b6fc454482b20b11d82fadc51974a554562b60d3))
29
+
30
+
10
31
  ## v0.10.12 (2025-11-03)
11
32
 
12
33
  ### 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.10.12
3
+ Version: 0.11.1
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
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
37
37
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=feniix_kinemotion&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=feniix_kinemotion)
38
38
 
39
- A video-based kinematic analysis tool for athletic performance. Analyzes side-view drop-jump videos to estimate key performance metrics: ground contact time, flight time, and jump height. Uses MediaPipe pose tracking and advanced kinematics.
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 for improved accuracy
48
- - **Automatic drop jump detection** - identifies box drop landing → jump phases
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
- - **Optional debug video** with visual overlays showing contact states and landmarks
56
- - **Batch processing** - CLI and Python API for parallel processing of multiple videos
57
- - **Python library API** - use kinemotion programmatically in your own code
58
- - **CSV export** - aggregated results for research and analysis
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
- **Note**: Drop jump analysis uses foot-based tracking with fixed velocity thresholds. Center of mass (CoM) tracking and adaptive thresholding (available in `core/` modules) require longer videos (~5+ seconds) with a 3-second standing baseline, making them unsuitable for typical drop jump videos (~3 seconds). These features may be available in future jump types like CMJ (countermovement jump).
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
- **NEW:** Kinemotion now features **intelligent auto-tuning**! Just specify your drop box height and the tool automatically optimizes all parameters based on video frame rate and tracking quality.
121
+ Kinemotion supports two jump types with intelligent auto-tuning that automatically optimizes parameters based on video characteristics.
108
122
 
109
- ### Basic Analysis
123
+ ### Drop Jump Analysis
110
124
 
111
- Analyze a video with automatic parameter selection:
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
- ### Save Metrics to File
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
- ### Generate Debug Video
125
-
126
- Create an annotated video showing pose tracking and contact detection:
134
+ Analyzes jump height and biomechanics:
127
135
 
128
136
  ```bash
129
- kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --output debug.mp4
130
- ```
131
-
132
- ### Complete Analysis
137
+ # No drop height needed (floor level)
138
+ kinemotion cmj-analyze video.mp4
133
139
 
134
- With all outputs:
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
- ### Quality Presets
144
-
145
- Choose analysis quality (automatically adjusts all parameters):
144
+ ### Common Options (Both Jump Types)
146
145
 
147
146
  ```bash
148
- # Fast analysis (quick, less precise - good for batch processing)
149
- kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --quality fast
147
+ # Save metrics to JSON
148
+ kinemotion cmj-analyze video.mp4 --json-output results.json
150
149
 
151
- # Balanced (default - best for most use cases)
152
- kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --quality balanced
150
+ # Generate debug video
151
+ kinemotion cmj-analyze video.mp4 --output debug.mp4
153
152
 
154
- # Accurate (research-grade, slower - maximum precision)
155
- kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --quality accurate
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
- ### See Auto-Selected Parameters
159
-
160
- View what parameters were automatically selected:
160
+ ### Quality Presets
161
161
 
162
162
  ```bash
163
- kinemotion dropjump-analyze video.mp4 --drop-height 0.40 --verbose
164
- ```
163
+ # Fast (50% faster, good for batch)
164
+ kinemotion cmj-analyze video.mp4 --quality fast
165
165
 
166
- ### Expert Mode (Advanced Users)
166
+ # Balanced (default)
167
+ kinemotion cmj-analyze video.mp4 --quality balanced
167
168
 
168
- Override auto-tuned parameters if needed:
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 from the command line:
175
+ Process multiple videos in parallel:
182
176
 
183
177
  ```bash
184
- # Process multiple videos with glob pattern
178
+ # Drop jumps
185
179
  kinemotion dropjump-analyze videos/*.mp4 --batch --drop-height 0.40 --workers 4
186
180
 
187
- # Save all results to directories
188
- kinemotion dropjump-analyze videos/*.mp4 --batch --drop-height 0.40 \
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 in your Python code for automated pipelines and custom analysis:
189
+ Use kinemotion as a library for automated pipelines and custom analysis.
232
190
 
233
- ### Single Video Processing
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
- # Check results
268
- for result in results:
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"{result.video_path}: {result.metrics.jump_height:.3f} m")
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
- ### Export Results to CSV
238
+ See `examples/bulk/README.md` for comprehensive API documentation.
239
+
240
+ ### CMJ-Specific Features
276
241
 
277
242
  ```python
278
- import csv
279
- from pathlib import Path
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
- # Process directory of videos
283
- video_dir = Path("athlete_videos")
284
- configs = [
285
- VideoConfig(str(v), drop_height=0.40, quality="balanced")
286
- for v in video_dir.glob("*.mp4")
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
- results = process_videos_bulk(configs, max_workers=4)
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
- # Export to CSV
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)"])