https://github.com/kalfasyan/home_surveillance_with_python
Motion detection using OpenCV (Raspberry Pi compatible), alerting through pushbullet, served with flask.
https://github.com/kalfasyan/home_surveillance_with_python
camera computer-vision flask-stream motion-detection pushbullet-api pushbullet-notifications python3 raspberry-pi-camera security-system surveillance-systems
Last synced: 5 months ago
JSON representation
Motion detection using OpenCV (Raspberry Pi compatible), alerting through pushbullet, served with flask.
- Host: GitHub
- URL: https://github.com/kalfasyan/home_surveillance_with_python
- Owner: kalfasyan
- License: mit
- Created: 2018-10-14T08:16:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T23:42:59.000Z (10 months ago)
- Last Synced: 2025-02-05T07:48:08.116Z (5 months ago)
- Topics: camera, computer-vision, flask-stream, motion-detection, pushbullet-api, pushbullet-notifications, python3, raspberry-pi-camera, security-system, surveillance-systems
- Language: Python
- Size: 79.1 KB
- Stars: 10
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Motion Detection, Alerts, Streaming
With this repo you can:
1. Watch your webcam/camera/picamera feed on localhost [(0.0.0.0:5000)](https://0.0.0.0:5000) which is served with flask.
2. Perform motion detection on the camera feed, using opencv.
3. Send alerts / push notifications (via pushbullet) to your phone, desktop or anywhere you have installed pushbullet, with its API.
4. Save the images that triggered the alerts on your disk (marking the exact image region of movement).
## Requirements
I strongly advise you to install a separate virtual environment to avoid dependency hells of python packages.
Check out "Step 8" from [this nice blog post](https://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/).Get an Access token from [Pushbullet](https://www.pushbullet.com/#settings/account)
Make sure you have 'curl' installed:
```sudo apt install curl```
Python 3## Installation
run the install.sh script:
```./install.sh```## Usage
```CAMERA=opencv python3 app.py -c conf.json```
Then open this [address (http://0.0.0.0:5000/)](http://0.0.0.0:5000/) on your browser.
If you run it on raspberry pi (+ enabled camera module, installed picamera package), uncomment line 13 from app.py:
```#from camera_pi import Camera```
and then run:
```python3 app.py -c conf.json```### Thanks to:
[miguelgrinberg](https://github.com/miguelgrinberg/flask-video-streaming) - for the flask streaming part
[Adrian Rosebrock](https://www.pyimagesearch.com/2015/06/01/home-surveillance-and-motion-detection-with-the-raspberry-pi-python-and-opencv/) - for the motion detection part
[pushbullet](https://docs.pushbullet.com) - for the alerts part#### Troubleshooting
You might have to install these libraries if you get errors complaining about them:
```
sudo apt install libhdf5-dev
sudo apt install libhdf5-serial-dev
sudo apt install libqt4-test
sudo apt install libqtgui4
```