├── .gitignore ├── LICENSE ├── README.md ├── logo.png ├── requirements.txt ├── rodent.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | output.avi 2 | photos/ 3 | opencv-2.4.9 4 | *.pyc 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Vincent Prouillet 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Find out who/what the fuck is eating my lunch at night 2 | 3 | ![Rodent](/logo.png) 4 | 5 | ## Goal 6 | See title. 7 | Takes picture every time interval (defaults to one picture a second) and make a video of it at the end. 8 | It has a motion detection mode that will detect motion and put a purple rectangle around it (by default it does not do a video at the end but you can call make_video manually if you want to). 9 | 10 | ## Installation 11 | 12 | ```python 13 | pip install -r requirements.txt 14 | ``` 15 | Don't forget to install dependencies (jpg lib and ffmpeg or something that works with opencv, libav for Ubuntu) for OpenCV before installing it, otherwise things won't work. 16 | On Ubuntu: 17 | 18 | ```bash 19 | $ sudo apt-get install libjpeg-dev libavcodec-dev libavformat-dev libswscale-dev 20 | ``` 21 | 22 | OpenCV is not pip installable so either install it from your package manager or follow the instructions for your OS at [the download page](http://opencv.org/downloads.html) (you can install it in a virtualenv by following this post: [Installation of Opencv, numpy, scipy inside a virtualenv](https://medium.com/@manuganji/installation-of-opencv-numpy-scipy-inside-a-virtualenv-bf4d82220313)). 23 | 24 | 25 | ## How to use 26 | ```python 27 | $ python rodent.py 28 | ``` 29 | There are 4 commands: 30 | 31 | - capture: takes a picture from the webcam at a given interval forever or until the time specified in the folder given 32 | - make_video: takes all the pictures in the folder and makes a video out of it (better than watching pictures!) 33 | - automate: does both capture and make_video, I use it for example to record until 15 minutes before I wake up and the video will be ready by the time I get to the kitchen for example 34 | - motion: takes a picture only if it detects a movement 35 | 36 | 37 | ## How it works 38 | Look at the [article on my blog](http://vincent.is/turning-a-laptop-into-cctv/) 39 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Keats/rodent/60844ec55a936e0b6e021d20ff711eb9628dfa9f/logo.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | argparse==1.2.1 2 | ipdb==0.8 3 | ipython==2.2.0 4 | numpy==1.9.0 5 | wsgiref==0.1.2 6 | -------------------------------------------------------------------------------- /rodent.py: -------------------------------------------------------------------------------- 1 | """ 2 | Rodent 3 | 4 | Usage: 5 | rodent.py capture [--until=