GuardMyPi
Protecting your berries from unauthorised tampering!
Public Member Functions | Public Attributes | Protected Attributes | List of all members
ObjectDetector Class Reference

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.
 

Detailed Description

Used to analyse incoming feed from the camera for different objects such as Pets etc...

Member Function Documentation

◆ detect()

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.

Parameters
ReferenceFrameInput frame from the video frame capture
scale_factorParameter given to detectMultiScale method, specifying how much the image size is reduced at each image scale
neighboursParameter given to detectMultiScale method, specifying how many neighbors each candidate rectangle should have to retain it
startTimeInitial time stamp used to calculate time passed

◆ loadcascade()

int ObjectDetector::loadcascade ( String  cascadename)

Loads the classifier with a given cascade file.

Parameters
cascadenameFile name of cascade XML file