![]() |
GuardMyPi
Protecting your berries from unauthorised tampering!
|
Analyses video feed by using background subtraction with a running average to detect motion changes. More...
#include <guardmypi.h>
Public Member Functions | |
Mat | ProcessContours (Mat camerafeed) |
Takes the incoming frame and performs background subtraction using previous frames. More... | |
Public Attributes | |
Mat | avg |
Running average of the camerafeed. | |
int | flag = 0 |
Flag variable to invoke ObjectDetector thread t2. | |
Protected Attributes | |
Mat | frame_diff |
Difference output between frames. | |
Mat | grayscale |
Grayscaled version of the camera frame. | |
Mat | frame_thresh |
Threshold frame. | |
Mat | scaled_avg |
8-bit Absolute value frame | |
vector< vector< Point > > | cnts |
Vector of points of detected contours. | |
Rect | rect |
Up-right rectangle to highlight detected contours. | |
Point | pt1 |
Start point/coordinate for the contour rectangle. | |
Point | pt2 |
End point/coordinate for the contour rectangle. | |
Analyses video feed by using background subtraction with a running average to detect motion changes.
Mat MotionDetector::ProcessContours | ( | Mat | camerafeed | ) |
Takes the incoming frame and performs background subtraction using previous frames.
Performs background subtraction to detect changes in the frame i.e. motion. Subsequently, alters the flag variable equal to 1 if motion is detected to invoke the object detector in a new thread
camerafeed | frame captured from PiCamera or Webcam |