02-ago: [proyecto] Sistema vigilancia Tapo con deteccion movimiento/persona + notificacion Telegram/Alexa

This commit is contained in:
minguezsanzjuanjose
2026-08-02 11:02:05 +02:00
parent 3a38e889db
commit 496c2bb9bc
9 changed files with 240 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import cv2
class DetectorMovimiento:
def __init__(self, umbral_pixeles=5000):
self.bg = cv2.createBackgroundSubtractorMOG2(history=500, varThreshold=50)
self.umbral = umbral_pixeles
def hay_movimiento(self, frame) -> bool:
mask = self.bg.apply(frame)
return cv2.countNonZero(mask) > self.umbral