Skip to content

Kapture‑VFX: Turn any color into invisibility. Real‑time webcam magic with OpenCV + FastAPI—pick a hue, vanish objects, and craft cinematic illusions in seconds with a sleek, intuitive UI.

Notifications You must be signed in to change notification settings

techminope/kapture-vfx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kapture-vfx

License: MIT Python FastAPI OpenCV Realtime UI GitHub stars

Invisible cloak for your webcam. Pick a color, make it vanish. Powered by OpenCV (CV), FastAPI (backend), and a zero-build modern UI.

Project structure

kapture-vfx/
├─ app/
│  ├─ __init__.py
│  ├─ main.py                 # FastAPI entry (routes + static)
│  ├─ ws.py                   # WebSocket frame handling
│  ├─ cv/
│  │  ├─ __init__.py
│  │  └─ invisibility.py      # Mask building + cloaking
│  └─ services/
│     ├─ __init__.py
│     └─ processor.py         # Base64 encode/decode, color + params
├─ public/
│  └─ index.html              # Tailwind + Vue UI (CDN)
├─ run.sh                     # Dev server launcher
├─ requirements.txt
├─ README.md
└─ LICENSE

Tech stack

  • Backend FastAPI Starlette
  • Computer Vision OpenCV NumPy
  • Frontend Tailwind CSS Vue 3 Font Awesome Hammer.js
  • Realtime WebSocket Uvicorn

Features

  • Real‑time color cloaking with background replacement
  • Color picker + eyedropper from video
  • Live tuning: tolerance, S/V floors, blur, morphology
  • Mask preview, keep‑largest, min‑area, skin‑protect filters
  • Toast notifications and responsive, sleek UI

Requirements

  • Python 3.9+
  • macOS/Linux recommended
  • A webcam and a visually distinct target color

Quick start

cd kapture-vfx
source venv/bin/activate
python3 -m pip install -r requirements.txt
./run.sh

Open http://127.0.0.1:8000/ (or http://127.0.0.1:<your-port>/ if you started the server on a different port).

How to use

  1. Click Start and allow camera access.
  2. Click Reset to capture a clean background (no target color in view).
  3. Pick your target color (eyedropper or color input).
  4. Tune Tolerance / S / V until the Preview mask highlights only the cloak.
  5. Turn Preview off to enable the invisibility effect.

Controls

  • Color/Tolerance: primary selection and hue band width
  • S min / V min: ignore dull/dark pixels
  • Blur / Morph: stability and cleanup
  • Keep largest / Min area / Skin protect: reduce false positives
  • Preview mask: visualize detected pixels (green overlay)

Tips

  • Use even lighting and a matte, saturated cloak color.
  • Re‑capture background after camera/scene changes.
  • If frames “don’t align,” Reset after the camera settles.

Health & endpoints

  • UI: /
  • WebSocket: /ws
  • Health: /health

License

MIT

About

Kapture‑VFX: Turn any color into invisibility. Real‑time webcam magic with OpenCV + FastAPI—pick a hue, vanish objects, and craft cinematic illusions in seconds with a sleek, intuitive UI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 50.4%
  • HTML 49.3%
  • Shell 0.3%