mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 03:46:59 +08:00
Added motiondetector to alpr namespace
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
|
namespace alpr
|
||||||
|
{
|
||||||
|
|
||||||
MotionDetector::MotionDetector()
|
MotionDetector::MotionDetector()
|
||||||
{
|
{
|
||||||
pMOG2 = new BackgroundSubtractorMOG2();
|
pMOG2 = new BackgroundSubtractorMOG2();
|
||||||
@@ -63,3 +66,5 @@ cv::Rect MotionDetector::MotionDetect(cv::Mat* frame)
|
|||||||
// imshow("Motion detect", fgMaskMOG2);
|
// imshow("Motion detect", fgMaskMOG2);
|
||||||
return expandRect(largest_rect, 0, 0, frame->cols, frame->rows);
|
return expandRect(largest_rect, 0, 0, frame->cols, frame->rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,13 +1,22 @@
|
|||||||
|
|
||||||
|
#ifndef OPENALPR_MOTIONDETECTOR_H
|
||||||
|
#define OPENALPR_MOTIONDETECTOR_H
|
||||||
|
|
||||||
#include "opencv2/opencv.hpp"
|
#include "opencv2/opencv.hpp"
|
||||||
|
|
||||||
class MotionDetector
|
namespace alpr
|
||||||
{
|
{
|
||||||
private: cv::Ptr<cv::BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
|
class MotionDetector
|
||||||
private: cv::Mat fgMaskMOG2;
|
{
|
||||||
public:
|
private: cv::Ptr<cv::BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
|
||||||
MotionDetector();
|
private: cv::Mat fgMaskMOG2;
|
||||||
virtual ~MotionDetector();
|
public:
|
||||||
|
MotionDetector();
|
||||||
|
virtual ~MotionDetector();
|
||||||
|
|
||||||
void ResetMotionDetection(cv::Mat* frame);
|
void ResetMotionDetection(cv::Mat* frame);
|
||||||
cv::Rect MotionDetect(cv::Mat* frame);
|
cv::Rect MotionDetect(cv::Mat* frame);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // OPENALPR_MOTIONDETECTOR_H
|
Reference in New Issue
Block a user