Skip to content

sanvisharma850/mog-motion-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฅ Adaptive Background Mixture Model (MoG) for Real-Time Motion Tracking

This project implements a Gaussian Mixture Model (GMM)-based background subtraction system to detect moving objects in a video. It's built from scratch using NumPy and OpenCV.

๐Ÿ’ก Features

  • Pixel-wise 3-Gaussian modeling (mean, variance, weight)
  • Adaptive background updating
  • Foreground mask generation
  • Optional output video creation

๐Ÿ› ๏ธ Tech Stack

  • Python
  • OpenCV
  • NumPy

๐Ÿ–ผ๏ธ Example Output

image

๐Ÿ“ฆ How to Run

  1. Upload a video file as sample_video.mp4
  2. Run main.py
  3. View and download foreground_output.mp4

๐Ÿ“š Learnings

Built from ground-up with help from OpenAIโ€™s ChatGPT, this project taught me the math behind background subtraction, pixel-by-pixel modeling, and the value of debugging every cv2.error. ๐Ÿ˜„

About

Adaptive Background Mixture Models (MoG) for real-time motion detection and foreground tracking using OpenCV and NumPy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages