![]() |
GuardMyPi
Protecting your berries from unauthorised tampering!
|
Used to analyse incoming feed from the camera for different objects such as Pets etc... More...
#include <guardmypi.h>
Public Member Functions | |
int | loadcascade (String cascadename) |
Loads the classifier with a given cascade file. More... | |
int | detect (Mat ReferenceFrame, double scale_factor, int neighbours, clock_t startTime) |
Performs object detection on the incoming frame for the given cascade file. More... | |
Public Attributes | |
int | flag = -1 |
Flag initially set to -1 for detecting a dog. | |
Protected Attributes | |
CascadeClassifier | cascade |
cascade classifier object | |
Mat | GrayFrame |
grayscale frame for processing | |
Point | pt1 |
Start point/coordinate for the object rectangle. | |
Point | pt2 |
End point/coordinate for the object rectangle. | |
Used to analyse incoming feed from the camera for different objects such as Pets etc...
int ObjectDetector::detect | ( | Mat | ReferenceFrame, |
double | scale_factor, | ||
int | neighbours, | ||
clock_t | startTime | ||
) |
Performs object detection on the incoming frame for the given cascade file.
If the object (in this case a pet) is detected within 10 seconds, a flag is raised. If not, the flag is set to 0.
ReferenceFrame | Input frame from the video frame capture |
scale_factor | Parameter given to detectMultiScale method, specifying how much the image size is reduced at each image scale |
neighbours | Parameter given to detectMultiScale method, specifying how many neighbors each candidate rectangle should have to retain it |
startTime | Initial time stamp used to calculate time passed |
int ObjectDetector::loadcascade | ( | String | cascadename | ) |
Loads the classifier with a given cascade file.
cascadename | File name of cascade XML file |