Real-Time Person Anonymizer
Background-subtraction person anonymizer in pure OpenCV — no ML model required.
Final.py detects people in a live webcam stream using classical
background subtraction and replaces them with a mosaic or Gaussian blur in real
time. The system learns a static background over a 10-second warmup, then masks
subsequent motion through a five-stage pipeline (foreground diff, morphology
cleanup, contour merging, feathered anonymization). Runs on any laptop CPU with
only OpenCV and NumPy.
Run it
pip install opencv-python numpy
python project/Final.py --camera 1
Documentation
Source files
- Final.py
- Final.sh
- person_blur.py
- Modified_Blur.py
- Modified_Blur_V2.py
- Modified_Blur_V3.py
- Modified_Blur_V3_1.py
- Modified_Blur_V3_2.py