A wildlife detection camera with Raspberry Pi. Either motion sensing based on the video stream (using OpenCV) or a PIR can be used to make wildlife images and videos.
Hardware (yes, some of it has newer and better versions) that is used to test this project:
Before you can run the script, two things have to be done:
- Install the dependencies
- Enable I2C support
The above steps are performed by the install.sh script. First clone the repository, then run the script:
git clone https://github.com/opieters/wcamerachmod +x install.shsudo ./install.sh
Finally, you need to reboot your Raspberry Pi to make sure all new settings are in effect.
After installing all packages (assuming there are no errors) and reboot, test the I2C: sudo i2cdetect -y 1. If you have connected your display (Adafruit CharLCD + I2C expander), you should see one address in use (replace 1 by 0 if you have the very first Raspberry Pi B model with 256MB RAM).
Users who want to compile OpenCV themselves, should run the install2.sh script with is based on this tutorial but otherwise performs the same actions. Please mind that OpenCV is installed in a virtualenv for convenience.
Open raspi-config, select Advanced Options (9) and enable I2C. Alternatively, use this guide.
Before attempting to record anything, make sure you activated the camera in raspi-config and correctly connected the camera module to the Raspberry Pi board.
Setup access point mode using this guide, but do not apply the at boot settings. These will be performed by the script.
If you are using the EDIMAX wifi dongle, update Hostapd with the version in this guide (you can skip everything else in this guide). Be sure to chance the driver settings in the /etc/hostapd/hostapd.conf file to driver=rtl871xdrv. Otherwise this will not work.
Run the script using python wcamera.py and use the provided UI on the character LCD and mobile UI.
Currently, OpenCV 2 is used, which does not officially support Python3. Moving towards OpenCV 3 will resolve this issue, but OpenCV 3 is still very new and thus OpenCV 2 was preferred.
© 2015-2016 Olivier Pieters, MIT license.