Add motion detection to camera server

🔍 New features:
- motion.py: Frame differencing motion detector
- Background thread compares frames continuously
- Configurable threshold, cooldown, sensitivity
- POSTs events + snapshot to collector

📡 New endpoints:
- GET /motion/stats - Detection statistics
- POST /motion/enable - Start detection
- POST /motion/disable - Stop detection

⚙️ Configuration (in .env):
- MOTION_ENABLED: true/false
- MOTION_THRESHOLD: Pixel diff threshold
- MOTION_COOLDOWN: Seconds between events
- COLLECTOR_URL: Where to POST events

Next: Event collector in vixy-mcp 🦊
This commit is contained in:
2025-12-16 16:15:30 -06:00
parent a17c09cac1
commit 6ecdf998c1
5 changed files with 478 additions and 116 deletions

View File

@@ -1,11 +1,14 @@
# Camera Snapshot Server Dependencies
# vixy-vision Server Requirements
# Web framework
fastapi>=0.104.0
uvicorn[standard]>=0.24.0
fastapi>=0.100.0
uvicorn[standard]>=0.22.0
# Camera access
# Camera / CV
opencv-python-headless>=4.8.0
# Configuration
# Config
python-dotenv>=1.0.0
# HTTP client (for posting events to collector)
httpx>=0.24.0