![]() |
GuardMyPi
Protecting your berries from unauthorised tampering!
|
GuardMyPi is a home security system centred around the Raspberry Pi 3. It utilises the Pi NoIR Camera to monitor a room or entrance point in a house. Facial recognition software is used to distinguish between house members (including pets) and intruders. If an intruder is detected, a notification is sent to the user via a web application.
Magnus Bell Cochran - 22587 76B@ stude nt.g la.ac .uk
Pedro Hernandez Gelado - 22620 04h@ stude nt.g la.ac .uk
Aidan Porteous - 22456 28p@ stude nt.g la.ac .uk
Project Link: https://github.com/phgelado/guardmypi
This project can be completed within a £50 budget (excluding the Raspberry Pi) with the following components:
Dataplicity is a simple to use, safe and free tool for you to access and control your RaspberryPi remotely, allowing you to setup and start your alarm from anywhere, as well as accessing the camera's live video feed.
Similar to a VPN, but easier to install, it also allows you to access your Pi's local port 80 (http://localhost:80) through a domain, which is where the Pi's live camera feed is streamed to. Installing Dataplicity is very simple! Follow the instructions here: https://www.dataplicity.com/.
The system has to be capable of detecting changes in individual frames. The changes in these frames are what allow computer visual applications to detect motion. However, while consecutive frames are not identical the MotionDetector class applies a Gaussian blur to the data to filter high frequency noise that would irregularly trigger the motion warning and the rest of the system.
Take a frame from a video feed of an empty room:
If a person (or pet) walks into the feed, the detector will find large changes in contours by taking the absolute difference of the two frame's pixel intensities leaving only the regions containing motion:
The detector acts as an event-base trigger invokes methods such as facial recognition and human detection.
In order to let the user unlock the system various methods were added to the Unlock class; Facial Recognition Unlock::face() and QR Detection Unlock::QRUnlock().
Facial recognition is achieved using the LPBH algorithm. By using a pre-trained algorithm with faces including the desired residents. Predicting each face outputs a confidence level and ID number according to the images fed into the trained database. Including a condition with a threshold for a confidence level (currently set to 123) will allow a user to tighten or loosen the strictnes of their recognition process.
After recognising the user within a specified time frame of 10s then the system is disarmed and waits for a QR code to lock and re-arm the system
Another method that is implemented to lock and unlock the system are QR codes that can be easily generated and shown on a mobile phone. When a user would like to leave the house showing a QR Code representing "lock" will then freeze the program for 60s to allow the user to leave before the system is then re-armed.
The object detector is a class with methods of recognising different objects such as pets with potential to incldude methods that recognise other objects such as gestures. Currently the pet detection ObjectDector::detect attempts to recognise a grayhound, but training algorithms can be re run with a bigger database of pets.
Before running the human detection method, the system looks for domestic pets (if applicable) as to not send a false alarm notification to the resident(s) if their pet was captured in the frame. If a pet is detected then no flags are raised and the system continues as normal. Otherwise the human detection method is called.
If a resident of the house is not recognised either using facial recognition nor QR Code detection, then the intruder flag is set high. This invokes both the web streaming service and email notification method, both used to capture feed of any intruder and also alert the user to notify the relevant authorities.