![]() |
GuardMyPi
Protecting your berries from unauthorised tampering!
|
Contains various methods to unlock the system. More...
#include <guardmypi.h>
Public Member Functions | |
int | loadcascade () |
Loads the hand and face cascades used to unlock the system during daytime hours (7am-8pm) More... | |
int | face (Mat ReferenceFrame, clock_t startTime) |
This method takes the input frame from the camera if the time is between 8am and 9pm. More... | |
int | QRUnlock (Mat frame, clock_t startTime) |
This method is the alternative unlocking method once it is night time. More... | |
int | QRLock (Mat frame) |
This method looks for another QR code whilst the system is in its unlocked state. More... | |
int | Deactivate (Mat frame) |
This method searches for the user to reset the system when it's detected an intruder. More... | |
Public Attributes | |
int | faceflag = 0 |
Flag set by facial recognition. | |
int | intruderflag = 0 |
Intruder flag set by motion detector & face recognition. | |
int | lockflag = 0 |
Lock flag set by QR Lock method. | |
int | QRunlockflag = 0 |
Flag set by the QR Unlock method. | |
int | resetflag = 0 |
Reset flag set when intruder flag is high and by QR Unlock method. | |
int | ID = -1 |
Initial LBPH ID. | |
double | secondsPassed = 0.0 |
Number of seconds passed since the current timestamp. | |
Protected Attributes | |
Mat | gray |
Mat | thresh |
Mat | new_avg |
Mat | diff |
Mat | GrayFrame |
Various members to contain a grayscale, threshold, running average and difference frame. | |
CascadeClassifier | hand_cascade |
Instance of the HAAR cascade object. | |
Scalar | color = Scalar(255, 0, 0) |
CascadeClassifier | face_cascade |
Instance of the HAAR classifier for facial detection. | |
Ptr< LBPHFaceRecognizer > | recogniser = LBPHFaceRecognizer::create(1,8,8,8,123) |
Instance of LBPH algorithm. | |
double | confidence = 0.0 |
Confidence level is altered by the LBPH algorithm of the chances it is the correct face. | |
string | name |
Name of the recognised resident. | |
QRCodeDetector | qrDecoder |
Instance of the QR Code detection object. | |
Mat | bbox |
Mat | rectifiedImage |
Holds the rectified QR Code and position of the QR Code. | |
Contains various methods to unlock the system.
Facial recognition utiises a LBPH algorithm to preict a detected face. QR detection is also implemented using the QRCodeDetector object.
int Unlock::Deactivate | ( | Mat | frame | ) |
This method searches for the user to reset the system when it's detected an intruder.
By essentially setting the intruder flag to 0 and all unlock method flags to high the system enters it's disarmed state
frame | Input frame from the camera feed |
int Unlock::face | ( | Mat | ReferenceFrame, |
clock_t | startTime | ||
) |
This method takes the input frame from the camera if the time is between 8am and 9pm.
It additionally takes the time stamp called immediately before the function. The method looks for a particularly trained face depending on the trained algorithm (*.yml file), which if not detected in less than 10s return 0 and set the intruder flag high alerting the user.
ReferenceFrame | Input frame from the video frame capture |
startTime | Time stamp initially called prior to the methd |
int Unlock::loadcascade | ( | ) |
Loads the hand and face cascades used to unlock the system during daytime hours (7am-8pm)
int Unlock::QRLock | ( | Mat | frame | ) |
This method looks for another QR code whilst the system is in its unlocked state.
Until the camera detects a QR code with a key called "lock" then nothing happens.
frame | Input frame from the camera feed |
startTime | Time stamp initially called prior to the methd |
Condition looking for a QR Code
int Unlock::QRUnlock | ( | Mat | frame, |
clock_t | startTime | ||
) |
This method is the alternative unlocking method once it is night time.
frame | Input frame from the video frame capture |
startTime | Time stamp initially called prior to the methd |