Inspiration: It's quite silly what my inspiration is. My aunt always said I had bad posture but I believe my posture is undeniably great. Additionally, I wanted to just experiment more with OpenCV because I've programming in Arduino IDE in contribution with peers to build a drone.
What It Does: Plumbline analyzes a pre-recorded side-view video (MP4) and produces an annotated output video that visualizes posture over time.
Specifically, it: Detects body landmarks using MediaPipe Pose
Measures neck and torso inclination relative to vertical
Smooths raw angle measurements to reduce jitter
Classifies posture as GOOD or ADJUST using a hysteresis-based state machine
Tracks how long posture stays in each state
Overlays angles, posture state, timing, and visual guide lines directly onto the video
The final result is an output MP4 that makes posture behavior easy to understand at a glance.
How I Built It: Plumbline is written in Python using:
MediaPipe Pose for landmark detection
OpenCV for video input/output and visualization
Custom geometry and posture logic built from scratch
Key Technical Decisions: Posture is measured using segment inclination relative to vertical, computed with normalized vectors and acos, rather than relying on axis-specific shortcuts.
Two posture metrics are used: Neck inclination: shoulder → ear
Torso inclination: hip → shoulder
A hysteresis + hold-time state machine prevents rapid flickering between posture states.
Exponential Moving Average (EMA) smoothing stabilizes noisy landmark measurements.
Frames with low landmark confidence are skipped to avoid incorrect classifications.
Timing is computed using real elapsed time so posture duration reflects actual video behavior.
The system follows a simple pipeline: MP4 in → analyze frame-by-frame → annotate → MP4 out
Challenges I Ran Into: Jittery landmarks: Raw pose data fluctuates frame-to-frame, which initially caused unstable posture classification.
Posture flicker: Without hysteresis, posture labels changed too frequently.
Angle edge cases: Zero-length vectors and floating-point drift required careful numerical guards.
UI readability: Overlay text had to remain visible across bright and cluttered backgrounds.
Each issue was addressed with smoothing, confidence gating, numerical clamping, and improved visual design.
Accomplishments that I'm Proud Of: Built a stable posture classifier that avoids flicker without over-smoothing.
Designed a system that is easy to understand visually, not just numerically.
Maintained a clear separation between raw measurements and smoothed, decision-making values.
Produced a reproducible pipeline that works entirely on prerecorded video.
Documented design decisions to ensure the project is ethical and original.
What I Learned: Computer vision data needs interpretation layers to be useful.
Small mathematical choices (smoothing, hysteresis) dramatically affect perceived stability.
Ethical reuse means understanding ideas conceptually, then rebuilding systems with your own structure.
Visualization is just as important as correctness when communicating results.
What's Next For Plumbline: Possible future improvements include:
Optional calibration based on a known “good posture” baseline
Support for front-view posture analysis
Exporting per-frame angle data to CSV
Live webcam input for real-time feedback
More advanced joint-based angle definitions
For this release, Plumbline focuses on being clear, stable, and honest.
Attribution:
Plumbline was inspired by an open-source MediaPipe posture analysis project. All logic, structure, and implementation were reimplemented from scratch with original design decisions.
Log in or sign up for Devpost to join the conversation.