whitehatboy005 / Motion-Detection-Alert-System

This Python script detects motion in a specified region of interest (ROI) from a webcam feed using OpenCV. When motion is detected, it captures a frame and sends an alert with a photo via the Telegram Bot API to a specified chat ID. This system is useful for security applications where immediate alerts are needed upon unauthorized motion detection.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Motion Detection Alert System with OpenCV and Telegram Bot API

This Python script detects motion in a specified region of interest (ROI) from a webcam feed using OpenCV. When motion is detected, it captures a frame and sends an alert with a photo via the Telegram Bot API to a specified chat ID. This system is useful for security applications where immediate alerts are needed upon unauthorized motion detection.

Features

  • Motion Detection: Monitors a defined ROI for changes using background subtraction with OpenCV.
  • Alert Notification: Sends a photo alert to a Telegram chat using the Telegram Bot API upon detecting motion.
  • Adjustable Parameters: Allows customization of ROI coordinates, background subtraction method, minimum contour area, and alert interval.
  • Real-time Feedback: Displays the video feed with overlaid ROI and detected contours for visual monitoring.
  • Error Handling: Catches exceptions during photo capture and alert sending to ensure robust operation.

Your security camera point of view

Screenshot 2024-07-11 163540

Your Telegram bot Alert

Screenshot 2024-07-11 163715

Installation

Clone the Repository

git clone https://github.com/whitehatboy005/Motion-Detection-Alert-System

Move the file

cd Motion-Detection-Alert-System

Install Dependencies

pip install -r requirements.txt

Config Your Details

notepad config.env

Run the Program

python alert.py

Instructions

To get Chat ID visit @GetMyChatID_Bot Now you will copy the chat Id and config it.

To access the bot @SecurityAlertBot and activate it.

About

This Python script detects motion in a specified region of interest (ROI) from a webcam feed using OpenCV. When motion is detected, it captures a frame and sends an alert with a photo via the Telegram Bot API to a specified chat ID. This system is useful for security applications where immediate alerts are needed upon unauthorized motion detection.


Languages

Language:Python 100.0%