RaspberryPi OpenCV Camera System

Raspberry Pi & Computer Vision

The $35 dollar Linux computer quickly has become my favorite gadget because there isn’t much you can’t do with it as well as it being an excellent tool for learning to operate in a Linux environment.

Following a tutorial from pyimagesearch, I put together a video surveillance system that :

1. Texts me when the camera detects movement using Twilio. Alternatively, using Apple’s Automater tool an email is sent with the screenshot to my email.

2. Uploads a snapshot of the movement frame into a DropBox directory.


By compiling the OpenCV 3.0 “Open Computer Vision” library in the Pi, along with a few other libraries, we import the functions for manipulating pictures.A DropBox authorization code is hardcoded into a Python script that also contains our directions for the PiCamera, so that the authentication handshake between your device and DropBox is automatic. Finally, Zapier is used to “trigger” a Twilio event in the form a custom text, displaying “Movement detected!”

Note: The tutorial does not expressly cover creating a permanent connection to the DropBox API nor does it include how to setup Twilio. A review of the comments section will lead you in the right direction.

Movement captured screenshot

Screen Shot 2016-10-03 at 1.25.21 PM.png

Screen Shot 2016-09-26 at 9.05.23 PM.png

Screen Shot 2016-09-27 at 3.52.17 PM.png

Setting the bash script to run : cron

Using a crontab job I set the camera to run during any time frame I need it to.

For an easy-to-use cron-job generator use sudo apt-get install gnome-schedule and use the gnome-schedule gui.

Automated alerts

Alerts can come in many different forms, but I chose to use Apple’s Automater tool to send an email with the captured image in the body of the message.

Screen Shot 2016-10-13 at 6.28.24 PM.png


The email I get containing a snapshot(s).

Screen Shot 2016-10-23 at 9.18.01 PM.png

And here using the Twilio API for a basic alert


Written on April 18, 2018