/Motion-Detection-Alert-System-for-Webcam

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.

Primary LanguagePythonMIT LicenseMIT

{E59AA23E-4471-4925-A1A6-D2F4442831FC}# 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 webcam point of view

Screenshot 2024-07-11 163540

Your Telegram bot Alert

Screenshot 2024-11-03 183753

Instructions

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

To access the bot @SecurityAlertBot and START it.

Installation

Clone the Repository

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

Move the file

cd Motion-Detection-Alert-System-for-Webcam

Install Dependencies

pip install -r requirements.txt

Config Your Details

notepad config.env

Ensure start the bot

Start it --> @SecurityAlertBot

Run the Main Program

python WEBCAM_Alert.py

To check on configuration in Telegram

Type [/check] Then check it out.

CCTV Motion Detection Alert System Repository

Check on this repository https://github.com/whitehatboy005/Motion-Detection-Alert-System-for-CCTV

License

This project is licensed under the terms of the MIT license.