birwatkar123/AI-3D-Body-Movement-Joint-ROM-Analyzer
AI 3D Body Movement & Joint ROM Analyzer
An on-device Android application that tracks a person's body pose in 3D using the camera and analyzes joint angles, Range of Motion (ROM), and repetitions — all processed locally on the phone with no cloud or network dependency.
Important: This is a development project, not a certified medical device. The measurements it produces are not clinically validated and should not be used for medical diagnosis, treatment decisions, or rehabilitation prescriptions.
Download
- APK: `app-debug.apk` — 66.6 MB debug build (minSdk 24 / targetSdk 37)
Install on device:
adb install -r app-debug.apkOn first launch, grant camera permission. Requires a physical device with a camera (an emulator without a camera feed will not produce pose results).
What It Does
- Detects a person's body pose in real time from the camera feed.
- Computes 3D world-landmark joint angles from MediaPipe Pose's world coordinates.
- Tracks Range of Motion (ROM) for a selected joint over the course of a movement.
- Counts repetitions once a movement completes a full cycle.
- Applies angle accuracy filtering and outlier rejection to reduce jitter and unstable estimates.
- Supports calibration and pose quality assessment so users know when tracking is unreliable.
- Works with both the front and back camera, with correct anatomical LEFT/RIGHT handling so bone-side labels remain correct regardless of camera orientation.
- Allows selecting multi-joint for analysis.
Supported Joints
- Knee
- Hip
- Shoulder
- Elbow
- Ankle
Joint definitions, measurement points, and anatomical orientation handling live in JointDefinition.kt and JointType.kt.
Main Technologies
3D World Landmark Angle Measurement
The app uses MediaPipe Pose's world landmarks (real-world 3D coordinates in meters, origin at the hip center) rather than 2D screen-space landmarks. Joint angles are computed from the 3D vectors between the joint and its proximal/distal bones, which makes the measurement more robust to camera distance, perspective, and viewpoint. LEFT and RIGHT anatomical sides are resolved dynamically based on the selected camera so the analysis always refers to the correct limb.
Pose Quality & Filtering
Three complementary mechanisms keep measurements stable:
- Pose quality / visibility checks — landmarks with low detection confidence or visibility are excluded.
- Angle accuracy filtering — consecutive-shock filtering in
AngleStabilityFilter.ktsmooths readings. - Outlier rejection — implausible angle jumps are rejected instead of being fed into the ROM/rep trackers.
On-Device Processing
Everything runs on-device. The MediaPipe Pose Landmarker model is bundled in app/src/main/assets/pose_landmarker.task, and all inference, angle math, and state tracking happen locally. No camera frames or pose data ever leave the device.
Current Development Status
- Working prototype with the features above implemented.
- 67 unit tests passing covering joint-angle math, anatomical left/right handling, angle filtering, outlier rejection, ROM, and repetition trackers.
- Debug APK builds successfully.
- Not yet a medical device, not clinically validated, no regulatory approvals.
Build
Requirements:
- JDK 17 or newer
- Android SDK with API level 37 (or newer) platform tools
- Gradle (wrapper included)
gradlew.bat assembleDebug # Windows
./gradlew assembleDebug # macOS / Linux
./gradlew testDebugUnitTest # unit testsAPK output: app/build/outputs/apk/debug/app-debug.apk
Source
Full source lives on GitHub:
https://github.com/birwatkar123-collab/AI-3D-Body-Movement-Joint-ROM-Analyzer
Limitations
- Not clinically validated. The application is a software prototype; angle and ROM estimates are approximate.
- Results depend on lighting, camera angle, clothing, subject distance, and body types.
- MediaPipe Pose landmarker accuracy decreases for extreme poses, occlusion, or when body parts are out of frame.
- The app is intended as an aid and should not be used as the sole basis for movement assessment.
