-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprocessor.h
More file actions
33 lines (28 loc) · 760 Bytes
/
processor.h
File metadata and controls
33 lines (28 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __PROCESSOR_H__
#define __PROCESSOR_H__
extern "C" {
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libavutil/pixfmt.h>
#include <libavutil/imgutils.h>
}
#include <opencv2/video/background_segm.hpp>
class Processor
{
public:
Processor();
~Processor();
int process(AVFrame *frame);
private:
struct SwsContext *mSwsCtx;
AVFrame *mRGBFrame;
uint8_t *mRGBFrameBuffer;
const double mAreaThreshold;
cv::Ptr<cv::BackgroundSubtractor> mpMOG;
cv::Mat mFgMaskMOG;
cv::Mat mMorphOpenKernel;
int allocateConversionCtx(enum AVPixelFormat src_pix_fmt, int src_w, int src_h, int dst_w, int dst_h);
void findForegroundObjects(cv::Mat& mat);
void displayFrame(cv::Mat& mat);
};
#endif