You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
2.4 KiB
120 lines
2.4 KiB
#ifndef __BASIC_VIDEO_ANALYZER_HEADER__
|
|
#define __BASIC_VIDEO_ANALYZER_HEADER__
|
|
|
|
#ifndef M_E
|
|
#include <math.h>
|
|
#endif
|
|
#include <opencv2/core/core.hpp>
|
|
#include <opencv2/features2d/features2d.hpp>
|
|
#include <opencv2/opencv.hpp>
|
|
#include <stdio.h>
|
|
#include <vector>
|
|
// #include <opencv2/nonfree/features2d.hpp>
|
|
// #include <opencv2/nonfree/nonfree.hpp>
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
#include <opencv2/stitching/detail/matchers.hpp>
|
|
#undef min
|
|
#undef max
|
|
// #include <opencv2/gpu/gpu.hpp>
|
|
#include <opencv2/video/tracking.hpp>
|
|
|
|
// #ifdef _DEBUG
|
|
// #pragma comment(lib,"opencv_core249d")
|
|
// #pragma comment(lib,"opencv_gpu249d")
|
|
// #pragma comment(lib,"opencv_highgui249d")
|
|
// #else
|
|
// #pragma comment(lib,"opencv_core249")
|
|
// #pragma comment(lib,"opencv_gpu249")
|
|
// #pragma comment(lib,"opencv_highgui249")
|
|
// #endif
|
|
|
|
#include "basicEventHeap.h"
|
|
#include "basicLogCollection.h"
|
|
#include "basicLoggingService.h"
|
|
#include "basicMediaDestination.h"
|
|
#include "basicMediaSource.h"
|
|
#include "basicMutex.h"
|
|
#include "basicThread.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
using namespace cv;
|
|
using namespace std;
|
|
|
|
typedef vector<Point> tContour;
|
|
typedef vector<Point2f> tPoints2F;
|
|
typedef vector<tContour> tContours;
|
|
typedef vector<Vec4i> tHierarhy;
|
|
|
|
typedef enum E_VIDEO_ANALYZER_TYPE
|
|
{
|
|
VA_NO_TYPE = 0,
|
|
VA_BLOB_DETECT = 1,
|
|
VA_VM_DETECT = 2,
|
|
VA_OPTIC_FLOW = 3,
|
|
VA_SURF_DETECT = 4,
|
|
VA_FEAT_DETECT = 5,
|
|
VA_HAAR_DETECT = 6,
|
|
VA_DNN_ANAL = 7
|
|
} VIDEO_ANALYZER_TYPE;
|
|
|
|
class basicVideoAnalyzer : public basicThread, public basicMediaDestination, public basicMediaSource
|
|
{
|
|
private:
|
|
|
|
basicLogCollection * m_pLog;
|
|
basicEventHeap * m_pEventHeap;
|
|
|
|
protected:
|
|
|
|
virtual void m_fThreadProc(void);
|
|
|
|
protected:
|
|
|
|
VIDEO_ANALYZER_TYPE type;
|
|
basicMutex m_mBufferProtectorMutex;
|
|
bool m_bPIP;
|
|
bool m_bDetectionStatus;
|
|
bool m_bDataIsActive;
|
|
|
|
Mat m_oWorkingMat;
|
|
|
|
virtual bool m_fImageAnalyzer(Mat & Picture)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
virtual EVENT_CONTAINER * createVAEvent(bool Status)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
public:
|
|
|
|
basicVideoAnalyzer();
|
|
~basicVideoAnalyzer();
|
|
|
|
bool getDetectionStatus(void)
|
|
{
|
|
return m_bDetectionStatus;
|
|
}
|
|
|
|
virtual void pushFrame(cv::Mat * Frame);
|
|
|
|
virtual void markup(Mat & Picture) {}
|
|
|
|
void setPIP(bool Val)
|
|
{
|
|
m_bPIP = Val;
|
|
}
|
|
|
|
VIDEO_ANALYZER_TYPE getType(void)
|
|
{
|
|
return type;
|
|
}
|
|
};
|
|
|
|
typedef vector<basicVideoAnalyzer *> vectorVA;
|
|
|
|
#endif
|