-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFlameDetector.h
64 lines (53 loc) · 1.32 KB
/
FlameDetector.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// FlameDetector.h
// FlameDetection
//
// Created by liberize on 14-4-5.
// Copyright (c) 2014年 liberize. All rights reserved.
//
#ifndef __FlameDetection__FlameDetector__
#define __FlameDetection__FlameDetector__
#include "common.h"
#include "TargetExtractor.h"
#include "FeatureAnalyzer.h"
#include "FlameDecider.h"
#include "QSound"
struct Target {
static const int TARGET_EXISTING = 0;
static const int TARGET_NEW = 1;
static const int TARGET_LOST = 2;
static const int TARGET_MERGED = 3;
int type;
int times;
int lostTimes;
vector<int> mergeSrc;
Region region;
Feature feature;
bool isFlame;
int flameCount;
bool isSaved;
};
class FlameDetector {
public:
Rect m_Rect;
map<int, Target> mTargetMap;
private:
static const int SKIP_FRAME_COUNT = 20;
Mat mFrame;
TargetExtractor mExtractor;
FeatureAnalyzer mAnalyzer;
FlameDecider mDecider;
int mFrameCount;
int mFlameCount;
bool mTrack;
public:
FlameDetector();
const TargetExtractor& getExtractor() const
{
return mExtractor;
}
const FeatureAnalyzer& getAnalyzer() const { return mAnalyzer; }
const FlameDecider& getDecider() const { return mDecider; }
int detect(const Mat& frame);
};
#endif /* defined(__FlameDetection__FlameDetector__) */