An iOS application developed during a 24-hour hackathon (Mar 2025) aimed at combating poor posture during prolonged periods of sitting by providing real-time feedback using the device's front camera. Poor posture can lead to various health issues, and this app serves as a tool to encourage healthier habits.
- Real-Time Pose Estimation: Utilizes the device's front camera (via AVFoundation) and Apple's Vision framework to detect human body pose in real-time.
- Posture Analysis: Analyzes key joint positions to determine posture status (Good / Bad / Body Not Found) based on calculated metrics like:
- Neck Angle Deviation
- Shoulder Slump (using normalization relative to shoulder span - experimental)
- Visual Feedback: Overlays the detected skeleton lines on the camera preview for visual understanding.
- Status Indicator: Displays the current posture status clearly on screen.
- Temporal Smoothing: Implements smoothing algorithms on detected joint data to reduce jitter and improve detection stability.
- Configurable Alerts: Provides immediate feedback via visual and audio alerts when poor posture is detected (haptic feedback can be added).
- Language: Swift
- UI Framework: SwiftUI
- Core Technologies:
- Vision Framework: For Human Body Pose Estimation.
- AVFoundation: For camera input stream management.
- Algorithms: Temporal smoothing for jitter reduction, angle calculations, ratio-based slump detection.
- Xcode (latest version recommended)
- An iOS device with a front-facing camera (required for pose detection)
- Apple Developer Account (if running on a physical device)
- Launch the PostureMaxx app.
- Grant necessary permissions (Camera is essential).
- Position your iOS device upright on a stable surface (e.g., leaning against your monitor or on a stand) so the front camera has a clear view of your upper body while seated.
- Observe the skeleton overlay and the posture status indicator.
- The app will provide alerts if it detects poor posture based on the implemented checks (neck angle, shoulder slump).
- (If implemented) Use the calibration feature to set your personal "good posture" baseline.
- Real-time Performance: Balancing the frame processing rate (
CameraManagerprocessing interval) with device performance was crucial. - Detection Stability: Raw Vision pose data can be jittery. Temporal smoothing was implemented to average joint positions over recent frames, providing a more stable visual output and basis for analysis.
- Normalization for Slump Detection: Detecting shoulder slump reliably required normalization. Initial attempts using
.rootor.leftHip/.rightHipjoints proved difficult due to inconsistent detection in seated positions. The current implementation uses the distance between shoulders as a normalization factor, which is an approximation and may require further tuning or alternative approaches for robustness across different body types and distances.
- More robust normalization techniques for posture metrics.
- Background operation mode.
- Additional posture checks (e.g., forward head posture).
- User-adjustable thresholds and alert settings.
- Posture history tracking and statistics.
- Refined calibration process.
- Haptic feedback implementation.