How SwayLab works
Everyone sways a little when standing still. How much, and how fast, says something about balance. SwayLab measures that sway with a webcam.
The pipeline
- Track the body. A pose model (MediaPipe Pose Landmarker) finds 33 body points in every video frame. It runs in a Web Worker inside your browser.
- Estimate the centre of mass. Each body segment gets its share of body mass from a standard table (Dempster, via Winter). The weighted average is the centre of mass.
- Clean the signal. Frames are moved onto an even 30 Hz grid, the average position is removed, and jitter above 5 Hz is filtered out with a zero-phase Butterworth filter.
- Measure the sway. Path length, RMS, speed, range and the 95% ellipse area. All in % of body height, because a webcam has no ruler.
Quality checks
A test only runs while all of these hold. If one fails for more than half a second, the test stops and you repeat it.
- Head, shoulders, hips, knees, ankles and feet are all visible and inside the frame.
- Your body fills at least 35% of the frame height.
- The camera delivers at least 20 frames per second.
- Your hips stay within 15% of body height of where you started.
Every result shows the measured frame rate and the number of dropped frames, so you can judge the recording yourself.
What it cannot do
- It is not a medical device. It does not diagnose, screen for, or predict any condition or fall risk.
- Front-back sway is weak. One camera facing you cannot see depth. The front-back numbers use the pose model's depth guess, and the measured noise on that axis is larger than typical quiet-standing sway. Side-to-side sway is measured directly and is the number to trust.
- Small sway is under-measured. Movements of about one pixel are partly smoothed away by the pose model. The Research page shows by how much.
- No real-world units. Results are in % of body height, not centimetres, and are not comparable to force-plate values.
- No normal ranges. It has not been tested on a population, so it cannot tell you whether your sway is typical.
- Setup matters. Distance, camera angle, light and clothing all change the numbers. Compare only sessions recorded the same way.
Privacy
The pose model and all of its files are served from this site and run on your device. No video, image, pose data or result is uploaded. The site counts page views without cookies and nothing else. Close the tab and your results are gone.
Background
I am Krushal Kalkani. During my MS in Computer Science at Florida Atlantic University I worked on a portable balance system built on a depth camera, and co-authored the paper that validated it against a laboratory motion-capture system:
V. G. Sonar, V. Agrawal, K. Kalkani, J. Hashemi, A. Pandya. "Development, Reliability, and Validity Assessment of a Portable 3D Camera-Based System for Quantifying Postural Sway and Balance." Sensors (MDPI), 2026. doi.org/10.3390/s26133987
SwayLab is a separate, personal project. It shares no code or data with that work. The paper's system had a depth sensor and a lab validation. SwayLab has neither, and this site tries to be exact about what that costs.
Sources
- Pose model: Google MediaPipe Pose Landmarker (full), Apache 2.0.
- Segment masses: D. A. Winter, Biomechanics and Motor Control of Human Movement, 4th ed., Table 4.1.
- Offline study data: D. A. Santos and M. Duarte, "A public data set of human balance evaluations", PeerJ, 2016. PhysioNet, Open Data Commons Attribution License v1.0.