{"id":20336712,"url":"https://github.com/arunishrajput/motion-detection","last_synced_at":"2026-05-07T22:36:26.196Z","repository":{"id":246477135,"uuid":"821246078","full_name":"arunishrajput/Motion-Detection","owner":"arunishrajput","description":"Motion Detection using OpenCV and Send Response using Telegram Bot API","archived":false,"fork":false,"pushed_at":"2024-06-28T06:09:07.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T17:19:37.077Z","etag":null,"topics":["motion-detection","opencv","python","telegram-bot-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arunishrajput.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-28T06:03:34.000Z","updated_at":"2024-07-01T02:35:43.000Z","dependencies_parsed_at":"2024-06-28T07:28:25.734Z","dependency_job_id":"d9d9d7c1-fa53-44d7-b097-92272b24df65","html_url":"https://github.com/arunishrajput/Motion-Detection","commit_stats":null,"previous_names":["arunishrajput/motion-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunishrajput%2FMotion-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunishrajput%2FMotion-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunishrajput%2FMotion-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunishrajput%2FMotion-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arunishrajput","download_url":"https://codeload.github.com/arunishrajput/Motion-Detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241859588,"owners_count":20032318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["motion-detection","opencv","python","telegram-bot-api"],"created_at":"2024-11-14T21:06:37.576Z","updated_at":"2026-05-07T22:36:21.156Z","avatar_url":"https://github.com/arunishrajput.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motion Detection with OpenCV and Telegram Notifications\n\nThis project detects motion using OpenCV in Python and sends notifications with photos to a Telegram chat.\n\n## Features\n\n- Motion detection using `OpenCV` and background subtraction.\n- Integration with `Telegram Bot API` for notifications.\n- Adjustable parameters for motion sensitivity and cooldown periods.\n\n## Requirements\n\n- Python 3.6 or higher\n- Requests library (for sending HTTP requests)\n- Telegram Bot API credentials (Bot Token and Chat ID)\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/arunishrajput/motion-detection.git\n   cd motion-detection\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n   Or install the libraries manually:\n\n   ```bash\n   pip install opencv-python requests\n   ```\n\n3. **Setup Telegram Bot:**\n\n   - Create a Telegram bot using [BotFather](https://t.me/BotFather) and note down the `Bot Token`.\n   - Obtain your `Telegram Chat ID` using [userinfobot](https://t.me/userinfobot).\n\n4. **Configuration:**\n\n- Replace placeholders in the script (`TELEGRAM_CHAT_ID` and `TELEGRAM_BOT_TOKEN`) with your actual Telegram credentials.\n\n## Usage\n\n1. **Run the Script:**\n\n   ```bash\n   python main.py\n   ```\n\n2. **Motion Detection:**\n\n   - Adjust `camera` variable (0 for default camera) or specify a video file path.\n\n   - Customize `initial_delay_seconds`, `motion_cooldown_seconds`, and `threshold` as per your requirements.\n\n3. **Exit:**\n\n   - Press Esc key to exit the application.\n\n## Functionality\n\n- **Captures frames from the camera or video file.**\n- **Defines a smaller square area in the frame for motion detection.**\n- **Sends a Telegram notification with a photo when motion is detected.**\n- **Uses background subtraction and contour detection for motion identification.**\n\n## Troubleshooting\n\n- Ensure Python environment and dependencies are correctly installed.\n- Verify Telegram credentials and network connectivity for sending notifications.\n\n## Contribution\n\n- Feel free to fork this repository, create a feature branch, and submit a pull request. Contributions, issues, and feature requests are welcome!\n\n## Acknowledgments\n\n- [OpenCV](https://opencv.org/)\n- [Telegram API Documentation](https://core.telegram.org/bots/api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunishrajput%2Fmotion-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farunishrajput%2Fmotion-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunishrajput%2Fmotion-detection/lists"}