AI-powered background blur and replacement application built using OpenCV and MediaPipe Image Segmentation.
This project was developed as part of my Computer Vision learning journey to understand image processing, segmentation masks, MediaPipe Tasks API, and real-world OpenCV applications before moving into advanced Deep Learning projects.
- AI-based Image Segmentation using MediaPipe
- Portrait / Landscape Detection
- Background Blur Effect
- Background Replacement Effect
- Orientation-based Background Recommendations
- Output Preview
- Automatic Image Saving
- Menu-Driven Application
- Step-by-Step Learning Notebook Included
| Technology | Purpose |
|---|---|
| Python | Core Programming |
| OpenCV | Image Processing |
| MediaPipe | Image Segmentation |
| NumPy | Mask Operations |
| Matplotlib | Visualization |
Smart_Background_Editor/
├── backgrounds/
│ ├── portrait/
│ └── landscape/
│
├── images/
│
├── models/
│ └── selfie_multiclass_256x256.tflite
│
├── outputs/
│
├── app.py
├── requirements.txt
└── Open_CV_Project.ipynb
Load Image
↓
Detect Orientation
↓
Create Segmenter
↓
Generate Segmentation Mask
↓
Create Binary Mask
↓
Choose Effect
↓
Blur / Replace Background
↓
Preview Result
↓
Save Output
During this project I explored:
- OpenCV Image Processing
- BGR vs RGB Color Spaces
- MediaPipe Tasks API
- Image Segmentation
- Category Masks
- Binary Masks
- NumPy Image Manipulation
- Background Replacement Techniques
- Gaussian Blur
- Function-Based Project Design
The complete learning notebook containing:
- Step-by-step implementation
- Segmentation experiments
- Mask generation workflow
- Concept explanations
- Intermediate outputs
The final integrated application version containing:
- Modular functions
- Menu-driven workflow
- Background recommendations
- Blur and replacement effects
- Real-Time Webcam Background Editing
- Video Background Replacement
- Video Background Blur
- Multiple Segmentation Modes
- Advanced Deep Learning Models
- Interactive User Interface
This project was built primarily for learning and understanding how OpenCV and MediaPipe work together in a practical Computer Vision application.
The focus was on understanding the complete segmentation pipeline rather than building a production-ready product.
This repository documents both the learning journey and the final implementation.
More Computer Vision, MediaPipe, and Deep Learning projects are coming soon.



