Skip to content

Abdulrehman1121/Invisibility-Cloak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Green Invisibility Cloak

A Python project that creates a real-time invisibility cloak effect using OpenCV and NumPy. The program detects green-colored fabric and replaces it with a pre-recorded background, giving the illusion of disappearing.

Features

  • Real-time video processing using webcam
  • Detects green cloth as the "cloak"
  • Smooth masking using morphological operations and Gaussian blur
  • Fullscreen display for immersive effect

Requirements

  • Python 3.13
  • OpenCV
  • NumPy

Install dependencies using pip:

pip install opencv-python numpy

Usage

  1. Clone the repository:
git clone https://github.com/your-username/Green-Invisibility-Cloak
  1. Navigate to the project folder:
cd Green-Invisibility-Cloak
  1. Run the program:
python green_invisibility_cloak.py
  1. Make sure you have a green cloth ready for the effect. Press q to quit.

How It Works

  1. Background Capture: The program first captures the static background for a few seconds.
  2. Color Detection: It converts each video frame to HSV color space and detects green color.
  3. Masking: Smooths the mask using morphological operations and Gaussian blur.
  4. Combining Frames: Replaces green regions with the captured background to create the invisibility effect.

License

This project is open-source and available under the MIT License.

✨ Enjoy creating your own green invisibility cloak!

About

Turn a Green cloth into a magical invisibility cloak with Python and OpenCV.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages