forked from kimphg/FireDetector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlameDecider.h
56 lines (45 loc) · 1.11 KB
/
FlameDecider.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
//
// FlameDecider.h
// FlameDetection
//
// Created by liberize on 14-5-20.
// Copyright (c) 2014年 liberize. All rights reserved.
//
#ifndef __FlameDetection__FlameDecider__
#define __FlameDetection__FlameDecider__
#include "common.h"
struct Target;
class Feature;
class FlameDecider {
public:
Rect m_Rect;
private:
static const string SVM_DATA_FILE;
#ifdef TRAIN_MODE
static const string SAMPLE_FILE;
static const int MIN_SAMPLE_COUNT = 1000;
static const int FRAME_GAP = 5;
#endif
Mat mFrame;
CvSVM mSVM;
#ifdef TRAIN_MODE
bool mSampleEnough;
int mFlameCount;
int mNonFlameCount;
vector<Feature> mFeatureVec;
vector<bool> mResultVec;
int mFrameCount;
#endif
#ifdef TRAIN_MODE
void userInput(const map<int, Target>& targets);
void svmStudy();
void train(const map<int, Target>& targets);
#else
bool svmPredict(const Feature& feature);
int judge(map<int, Target>& targets);
#endif
public:
FlameDecider();
int decide(const Mat& frame, map<int, Target>& targets);
};
#endif /* defined(__FlameDetection__FlameDecider__) */