Skip to content

ixiflower/camera-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“· Camera Assistant

A live computer-vision viewer built with Python 3, OpenCV, and Tkinter β€” powered by your phone camera via scrcpy + v4l2loopback.

Python OpenCV Tkinter

Demo pipeline

Phone (USB/ADB) β†’ scrcpy v4l2-sink β†’ /dev/video0 β†’ OpenCV β†’ Tkinter canvas

Features

Toggle Detection
πŸ‘€ Face Blue bounding box + "Face" label
πŸ‘ Eye Amber boxes inside detected faces
😊 Smile Yellow highlight on smiles
🀚 Hand OpenCV skin contour + convexity defects + finger count bar
🧍 Body Purple boxes (full + upper body)
⚑ Edge Canny edge overlay (teal tint)
  • FPS counter displayed at top-left
  • Finger counting via convexity defects β€” YCrCb skin segmentation + contour analysis
  • Smart camera scan β€” only checks existing /dev/video* devices
  • Dark theme β€” Catppuccin Mocha inspired, glassmorphism aesthetic

Requirements

# Arch / pacman
sudo pacman -S python-opencv python-pillow python-numpy v4l2loopback-dkms

# scrcpy (phone camera pipe)
sudo pacman -S scrcpy android-tools

# Load v4l2loopback
sudo modprobe v4l2loopback
Package Why
OpenCV Face/Haar, YCrCb skin mask, contour detection, all CV
tkinter Built-in GUI
pillow Frame β†’ Tkinter canvas

⚠️ No external ML libraries needed β€” hand detection uses pure OpenCV (YCrCb colour-space skin segmentation + convexity-defect finger counting).

You also need v4l2loopback-dkms built for your kernel (pacman handles this).

Usage

1. Add yourself to the video group (one-time):

sudo usermod -a -G video $USER
# Then log out and back in

2. Start the phone camera stream (keep this terminal open):

scrcpy --v4l2-sink=/dev/video0 --video-source=camera \
       --camera-id=0 --camera-size=1920x1080 \
       --camera-fps=30 --no-window

3. Launch the app (new terminal):

python3 camera_assistant.py

Select Camera 0 from the dropdown β†’ click β–Ά Start.

Toggle individual detections on/off while the stream is live.

Controls

Action Button
β–Ά Start / β–  Stop Bottom-left
πŸ”„ Rescan Re-scan camera devices
Face / Eye / Smile / Hand / Body / Edge Checkboxes β€” toggle live

Notes

  • Built for Nothing A142P (Android 16) but works with any phone camera accessible via ADB.
  • The v4l2loopback kernel module creates a virtual video device that scrcpy writes to.
  • Hand detection uses skin-colour HSV masking + convexity defects for finger counting.

About

πŸ“· Phone-as-webcam CV viewer β€” Python 3 + OpenCV + Tkinter with face/hand/finger detection via scrcpy + v4l2loopback

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages