Real-time camera app with computer vision features using OpenCV and MediaPipe.
- 📹 Real-time camera feed with customizable resolution
- 🖐️ Hand landmark detection using MediaPipe (21 points per hand)
- 🎨 Six image processing modes: grayscale, blur, edge detection, binary threshold, and Sobel gradients
- ⌨️ Interactive controls for real-time mode switching
- 💾 Frame capture with timestamp naming
- 📊 FPS monitoring with overlay display
- 🪞 Mirror mode (horizontally flipped) by default
Option 1: Automatic Setup
./setup.shOption 2: Manual Setup
# Requires Python 3.11 (for MediaPipe compatibility)
brew install python@3.11
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt# Navigate to the parent directory of sight
cd /path/to/your/Projects/
source sight/venv/bin/activate
python -m sight.camera_app --camera-index 0 --width 1280 --height 720Or use the setup script for a fresh installation:
cd sight
./setup.sh
# Then run from parent directory:
cd ..
source sight/venv/bin/activate
python -m sight.camera_app| Key | Action |
|---|---|
q |
Quit the application |
m |
Cycle through processing modes |
h |
Toggle hand landmark detection |
s |
Save current frame to output/ directory |
- None - Original camera feed
- Grayscale - Black and white conversion
- Blur - Gaussian blur effect
- Edges - Canny edge detection with overlay
- Binary - Adaptive threshold (black/white)
- Sobel - Sobel gradient edge detection
- --camera-index, -c: camera device index (default 0)
- --width, -W: frame width (default 1280)
- --height, -H: frame height (default 720)
- --mode, -m: initial processing mode
- --no-flip: disable horizontal flip (mirror)
- --no-fps: hide FPS overlay
- --hands / --no-hands: enable/disable Mediapipe hands
- --hand-max: max number of hands (default 2)
- --hand-det: min detection confidence (default 0.6)
- --hand-track: min tracking confidence (default 0.6)
- Python 3.11 (required for MediaPipe compatibility)
- macOS/Linux/Windows (tested on macOS)
- Webcam or compatible camera device
- OpenGL support for MediaPipe hand tracking
opencv-python- Computer vision and camera capturemediapipe- Hand landmark detectionnumpy- Array operations- Additional dependencies listed in
requirements.txt
Camera Permission Issues (macOS)
- Go to System Preferences → Privacy & Security → Camera
- Enable camera access for your terminal application
MediaPipe Installation Issues
- Ensure you're using Python 3.11 (not 3.13)
- Try reinstalling with:
pip install --upgrade mediapipe
No Camera Found
- Try different camera indices:
--camera-index 1,--camera-index 2 - Check if other applications are using the camera