How chrisoh-zip/invisibility-cloak works
This is a small, single-file Python/OpenCV webcam app: it captures a clean room background, detects saturated red cloth, and composites the background into the detected area in a live preview. The main workflow and its setup, controls, and rendering are implemented in invisibility_cloak.py; it also supports recapture, an optional mask preview, and camera-free self-test. Relationships are based on the shown source and README; no separate runtime modules are present.
Main entry points: invisibility_cloak.py Live App
Components 12
Camera and Background
- Background Capture
invisibility_cloak.py - Median Background
invisibility_cloak.py
Detection and Preview
- Red Detection
invisibility_cloak.py - Mask Cleanup
invisibility_cloak.py - Background Composite
invisibility_cloak.py - Live Preview
invisibility_cloak.py - Mask Preview
invisibility_cloak.py
App Control
- Live App
invisibility_cloak.py - Keyboard Controls
invisibility_cloak.py - Self-test
invisibility_cloak.py
Other components
- User
- Webcam
Connections 13
- User → Live App: starts
README.md - Live App → Webcam: opens and reads
invisibility_cloak.py - Live App → Background Capture: updates frames
invisibility_cloak.py - Background Capture → Median Background: computes
invisibility_cloak.py - Live App → Red Detection: processes frames
invisibility_cloak.py - Red Detection → Mask Cleanup: cleans mask
invisibility_cloak.py - Live App → Background Composite: composites when ready
invisibility_cloak.py - Live App → Live Preview: displays output
invisibility_cloak.py - User → Keyboard Controls: presses keys
README.md - Keyboard Controls → Background Capture: recaptures background
invisibility_cloak.py - Keyboard Controls → Mask Preview: toggles
invisibility_cloak.py - User → Live Preview: views
README.md - Live App → Self-test: runs on request
invisibility_cloak.py