Skip to content

Repository files navigation

Automated Ergonomic Analysis Using Computer Vision

Real-time pose detection and risk annotation demo

A real-time, sensorless ergonomic posture assessment system that uses MediaPipe Pose Estimation to detect skeletal keypoints from video and classify worker posture risk according to the Mahale Industrial Posture Standard.

Traditional ergonomic assessments (REBA, RULA, OWAS) rely on manual, subjective, snapshot-based observation. This project automates that process — continuously, objectively, and without wearable sensors — making it practical for real industrial deployment.

Features

  • Pose detection — 33 body landmarks extracted per frame via MediaPipe (CPU-friendly, no GPU required).
  • Three biomechanical indicators:
    • Waist Flexion Angle (forward bending)
    • Trunk Rotation Angle (body twisting)
    • Arm Height Position (hand elevation relative to shoulder/waist)
  • Automated risk classification into Level 1 (High Risk), Level 2 (Moderate Risk), Level 3 (Easy/Safe).
  • Real-time on-screen annotation of angles and risk levels.
  • CSV data logging of every frame's measurements for offline analysis.
  • Visualizations — risk-distribution pie charts and posture time-series trend graphs.

Risk Classification (Mahale Industrial Posture Standard)

Metric Level 1 (High Risk) Level 2 (Moderate Risk) Level 3 (Easy/Safe)
Waist Flexion > 30° 15°–30° 0°–15°
Trunk Rotation ≥ 45° 15°–45° 0°–15°
Arm Height Above shoulder Shoulder height Waist height

System Architecture

Video Input  →  Pose Estimation (MediaPipe)  →  Angle Calculations
    →  Risk Classification (Mahale Standard)  →  Output Visualization
    →  Data Logging (CSV)

Project Structure

automated-ergonomic-analysis/
├── src/
│   └── ergonomic_analysis.py   # Main pipeline: detection, angles, risk, CSV, charts
├── docs/
│   ├── project_report.pdf      # Full minor project report
│   └── presentation.pptx       # Project presentation slides
├── results/                    # Generated CSVs and charts land here
├── data/                       # Place input videos here
├── requirements.txt
└── README.md

Installation

git clone https://github.com/<your-username>/automated-ergonomic-analysis.git
cd automated-ergonomic-analysis
pip install -r requirements.txt

Usage

Run on a pre-recorded video:

python src/ergonomic_analysis.py --video data/your_video.mp4

Run on a live webcam feed:

python src/ergonomic_analysis.py --webcam

Run headless (no preview window, e.g. on a server):

python src/ergonomic_analysis.py --video data/your_video.mp4 --no-display

Results are written to results/posture_results.csv, and two charts (risk_distribution.png, posture_trends.png) are generated automatically after processing.

Requirements

  • Python 3.8+
  • OpenCV
  • MediaPipe
  • NumPy / Pandas
  • Matplotlib

See requirements.txt for exact versions.

Hardware Recommendations

Component Minimum Spec
Processor Intel i5 / AMD Ryzen 5 or higher
RAM 8 GB (16 GB recommended)
GPU Optional — MediaPipe is CPU-optimized
Camera HD Webcam / Mobile Camera / CCTV feed

Sample Results

In a sample 1,384-frame industrial task recording:

Metric Level 1 Level 2 Level 3
Waist Flexion 0% 10.9% 89.1%
Trunk Rotation 0.5% 4.5% 95.0%
Arm Height 0% 4.0% 96.0%

The worker maintained predominantly safe posture throughout, with only brief, isolated high-rotation moments — indicating the workstation layout is ergonomically sound overall.

Risk distribution pie charts for waist flexion, rotation, and arm height

Future Scope

  • Multi-worker tracking in shared workspaces
  • 3D depth accuracy via stereo/depth cameras (Intel RealSense, Kinect)
  • Real-time audio/visual corrective feedback ("Avoid Twisting", "Stand Upright")
  • ML-based posture/fatigue prediction
  • Integration with industrial safety dashboards
  • Mobile and edge deployment

References

Full literature review and citation list available in docs/project_report.pdf.

License

This project is released under the MIT License.

About

Real-time ergonomic posture risk analysis using MediaPipe pose estimation and computer vision.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors