Skip to content

Sravan-Kumar-dev/Smart-Background-Editor

Repository files navigation

🎨 Smart Background Editor

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.


📸 Project Demo

Original Image

Original

Segmentation Mask

Mask

Background Blur Output

Blur

Background Replacement Output

Replacement


✨ Features

  • 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

🛠️ Technologies Used

Technology Purpose
Python Core Programming
OpenCV Image Processing
MediaPipe Image Segmentation
NumPy Mask Operations
Matplotlib Visualization

📂 Project Structure

Smart_Background_Editor/

├── backgrounds/
│   ├── portrait/
│   └── landscape/
│
├── images/
│
├── models/
│   └── selfie_multiclass_256x256.tflite
│
├── outputs/
│
├── app.py
├── requirements.txt
└── Open_CV_Project.ipynb

⚙️ How It Works

Load Image
    ↓
Detect Orientation
    ↓
Create Segmenter
    ↓
Generate Segmentation Mask
    ↓
Create Binary Mask
    ↓
Choose Effect
    ↓
Blur / Replace Background
    ↓
Preview Result
    ↓
Save Output

🧠 Concepts Learned

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

📘 Repository Contents

Open_CV_Project.ipynb

The complete learning notebook containing:

  • Step-by-step implementation
  • Segmentation experiments
  • Mask generation workflow
  • Concept explanations
  • Intermediate outputs

app.py

The final integrated application version containing:

  • Modular functions
  • Menu-driven workflow
  • Background recommendations
  • Blur and replacement effects

🚀 Future Improvements

  • Real-Time Webcam Background Editing
  • Video Background Replacement
  • Video Background Blur
  • Multiple Segmentation Modes
  • Advanced Deep Learning Models
  • Interactive User Interface

🎯 Project Goal

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.

About

Computer Vision project using OpenCV and MediaPipe for background segmentation, blur effects, and background replacement.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors