This README is designed for the WahidSaeed/MSTeamBlurFilter repository. Since this project uses Python, OpenCV, and MediaPipe to replicate the background blurring effect seen in video conferencing apps, this template focuses on the technical setup and implementation.
Ever wondered how Microsoft Teams or Zoom hides your messy room during a video call? This project explores the mechanics behind background blurring filters using Python, OpenCV, and MediaPipe.
This application uses machine learning to perform real-time Selfie Segmentation. By identifying the person in the video frame, we can separate the foreground from the background and apply a Gaussian blur only to the environment, keeping the user in sharp focus.
- Python: The core programming language.
- OpenCV: Used for real-time computer vision processing and image manipulation.
- MediaPipe: Specifically the "Selfie Segmentation" solution for high-fidelity background separation.
- Real-time Processing: Fast enough to run on a standard webcam feed.
- Dynamic Backgrounds: Demonstrates how to either blur the current background or replace it with a static image (e.g.,
office.jpg). - Precise Masking: Uses ML-based segmentation rather than simple color-keying.
Ensure you have Python 3.x installed. You will need to install the following dependencies:
pip install opencv-python mediapipe
- Clone the repository:
git clone https://github.com/WahidSaeed/MSTeamBlurFilter.git
cd MSTeamBlurFilter
- Run the script:
python main.py
main.py: The main script containing the webcam loop and MediaPipe segmentation logic.office.jpg: A sample background image for replacement testing.README.md: Project documentation.
- Capture: The webcam feed is captured frame-by-frame using OpenCV.
- Segment: MediaPipe processes the frame to create a binary mask (identifying "person" vs. "background").
- Blur: A Gaussian blur filter is applied to the original frame.
- Combine: The mask is used to stitch the sharp user (foreground) back onto the blurred background.
This project is open-source and available under the MIT License.
**Maintained by Wahid Saeed**