Skip to content

MatteoCnda1/Computer-vision-project-without-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Computer-vision-project-without-AI

============================================================ MOVEMENT AND PERSON DETECTION WITHOUT AI

Description:

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

Features:

  • 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

Requirements:

Install the required libraries: pip install opencv-python numpy paramiko fabric


How it works:

  1. Reads webcam video in real time
  2. Detects movement with MOG2
  3. Detects people with HOG in motion areas
  4. Checks for yellow vests using HSV
  5. Logs and beeps if a person (not agent) appears

Main configuration:

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)


Log files:

detection_log.txt -> Local detection logs

fabric_error_log.txt -> Errors during SSH connection


Run the program:

python detect_person.py

Press 'q' to quit.


Notes:

  • 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

============================================================ End of README

About

Real-time motion and person detection using OpenCV, without AI. Detects people with HOG, identifies yellow-vested security officers via HSV, logs events, plays a beep on detection, and can send alerts to a remote server via SSH.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages