Added motiondetector to alpr namespace

This commit is contained in:
Matt Hill
2015-05-15 05:53:29 -04:00
parent 149f1e26e7
commit 60cfe427a6
2 changed files with 23 additions and 9 deletions

View File

@@ -2,6 +2,9 @@
using namespace cv;
namespace alpr
{
MotionDetector::MotionDetector()
{
pMOG2 = new BackgroundSubtractorMOG2();
@@ -63,3 +66,5 @@ cv::Rect MotionDetector::MotionDetect(cv::Mat* frame)
// imshow("Motion detect", fgMaskMOG2);
return expandRect(largest_rect, 0, 0, frame->cols, frame->rows);
}
}

View File

@@ -1,5 +1,11 @@
#ifndef OPENALPR_MOTIONDETECTOR_H
#define OPENALPR_MOTIONDETECTOR_H
#include "opencv2/opencv.hpp"
namespace alpr
{
class MotionDetector
{
private: cv::Ptr<cv::BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
@@ -11,3 +17,6 @@ class MotionDetector
void ResetMotionDetection(cv::Mat* frame);
cv::Rect MotionDetect(cv::Mat* frame);
};
}
#endif // OPENALPR_MOTIONDETECTOR_H