============================================================ MOVEMENT AND PERSON DETECTION WITHOUT AI
This program detects motion and people in real time using only OpenCV (no AI or deep learning).
It uses:
- Background Subtraction (MOG2) for movement detection
- HOG (Histogram of Oriented Gradients) for person detection
- HSV color filtering to detect yellow vests (security officers)
When a person is detected:
- A green or yellow box is drawn
- A beep sound is played
- A log entry is created and sent to a remote server (via SSH)
- If a yellow vest (agent) is detected, no alert is triggered
- Person detection using HOG filters
- Yellow vest (security officer) recognition
- Movement visualization (blue box)
- Person visualization (green/yellow box)
- Beep and log when someone appears
- Remote logging via Fabric and Paramiko
- No AI or deep learning required
Install the required libraries: pip install opencv-python numpy paramiko fabric
- Reads webcam video in real time
- Detects movement with MOG2
- Detects people with HOG in motion areas
- Checks for yellow vests using HSV
- Logs and beeps if a person (not agent) appears
SEUIL_MOUVEMENT = 1500 # Minimum motion area
VALIDATION_FRAMES = 3 # Frames to confirm detection
FREQUENCE_BIP = 1000 # Beep frequency (Hz)
DUREE_BIP = 300 # Beep duration (ms)
SEUIL_JAUNE = 0.15 # Yellow detection threshold
INTERVALLE_SUPPRESSION = 2 # Log interval (seconds)
detection_log.txt -> Local detection logs
fabric_error_log.txt -> Errors during SSH connection
python detect_person.py
Press 'q' to quit.
- Check your webcam connection
- Update SSH key path and IP address in log_detection()
- Works on Windows (uses winsound)
- Can be adapted for Linux/Mac easily