Skip to content

404-GeniusNotFound/HarryPotterInvisibleCloak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

# Harry Potter Invisible Cloak 🪄✨

A tiny Python demo that lets you vanish on‑screen when you drape yourself in a plain white cloth. Built with OpenCV + NumPy, tested on macOS & Windows.


📦 Prereqs

  • Python 3.8+ – install from python.org or brew install python.
  • A webcam (built‑in or USB).
  • macOS users: Grant Terminal/VS Code camera permission under System Settings → Privacy & Security → Camera.

⚙️ Setup (one‑time)

# 1. clone the repo
git clone https://github.com/<YOUR_USERNAME>/HarryPotterInvisibleCloak.git
cd HarryPotterInvisibleCloak

# 2. create a project‑local virtualenv
python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

# 3. install deps
pip install -r requirements.txt  # or run: pip install opencv-python numpy

🚀 Run the spell

source .venv/bin/activate        # ensure venv is active
python invisibility_cloak_white.py
  1. Hide from the camera for ~3 seconds while the script captures a clean background.
  2. Step into frame wearing a white cloth – you’ll appear invisible!
  3. Quit with q (while the OpenCV window is focused) or Ctrl + C in the terminal.

🎛️ Tweakables

All magic knobs live at the top of invisibility_cloak_white.py:

Var Default What it does
WHITE_SAT_MAX 30 Upper saturation threshold for “white”.
WHITE_VAL_MIN 200 Minimum brightness to consider a pixel white.
WAIT_SEC_FOR_BG 3 s Background‑capture duration.
FRAME_WIDTH/HEIGHT 640×480 Resize for FPS vs quality trade‑off.

🩹 Troubleshooting

Issue Fix
OpenCV: not authorized to capture video Go to macOS Settings → Privacy & Security → Camera and enable access.
Black/empty window Another app is hogging the webcam → close it and restart script.
White objects in background also vanish Use a colored backdrop or tweak WHITE_* thresholds.
Low FPS Lower FRAME_WIDTH/HEIGHT or ensure plenty of light.

📝 Contributing

PRs welcome! Clone, create a feature branch (git checkout -b feat/cool-idea), commit small chunks, open a PR.


📜 License

MIT – free to remix, abracadabra responsibly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages