Skip to content

jahnaviisingh/cyber-vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CYBER VISION - GMM BACKGROUND SUBTRACTION

Real-time foreground/background segmentation using Gaussian Mixture Models (GMM)

Based on Stauffer & Grimson (CVPR 1999 / PAMI 2000)


Live demo

Try it now: https://jahnaviisingh.github.io/cyber-vision/


🎯 What it does

This web app uses your camera to detect moving objects in real time β€” just like how security cameras work!

Panel What You See
πŸ“· Original Your live camera feed
βšͺ FG Mask Moving objects in white, background in black
🎨 Foreground Moving objects in original color on black
🏞️ Background Reconstructed static scene (what the camera thinks is "normal")

βš™οΈ HOW IT WORKS

Each pixel is modeled as a mixture of K Gaussian distributions. The algorithm:

  1. Learns what "normal" looks like over time
  2. Compares each new pixel against learned models
  3. Flags pixels that don't match as foreground (movement)
  4. Adapts continuously to lighting changes

Adjustable Parameters β€” Play with them in real time!

Parameter What It Does
Ξ± (Learning Rate) How fast the model adapts to changes
K (Gaussians) How many "layers" of background it remembers
T (Match Threshold) How sensitive the detection is
B (Background Ratio) How many components form the background

πŸ› οΈ TECH STACK

  • Vanilla JavaScript β€” No frameworks, pure implementation
  • HTML5 Canvas β€” Real-time video rendering
  • MediaDevices API β€” Camera access
  • Custom GMM β€” Implemented from scratch (no libraries)

πŸ“š REFERENCES

  • Stauffer, C. & Grimson, W.E.L. (1999). Adaptive Background Mixture Models for Real-Time Tracking. CVPR.
  • Stauffer, C. & Grimson, W.E.L. (2000). Learning Patterns of Activity Using Real-Time Tracking. PAMI.

πŸ‘©β€πŸ’» Author

Jahnavi Singh


πŸ“„ License

MIT

About

GMM Background Subtraction | Real-time foreground detection using Gaussian Mixture Models (Stauffer & Grimson, 1999)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors