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.
- Pixel-wise 3-Gaussian modeling (mean, variance, weight)
- Adaptive background updating
- Foreground mask generation
- Optional output video creation
- Python
- OpenCV
- NumPy
- Upload a video file as
sample_video.mp4 - Run
main.py - View and download
foreground_output.mp4
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. ๐
