Skip to content

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.

Notifications You must be signed in to change notification settings

whitehatboy005/Motion-Detection-Alert-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages