-
Notifications
You must be signed in to change notification settings - Fork 54
/
group_classifier.h
45 lines (31 loc) · 1.03 KB
/
group_classifier.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
#ifndef GROUP_CLASSIFIER_H
#define GROUP_CLASSIFIER_H
#include <opencv/cv.h>
#include <opencv/ml.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "region.h"
#include "region_classifier.h"
using namespace cv;
using namespace std;
class GroupClassifier
{
public:
/// Constructor.
/// @param[in] trained_boost_filename
/// @param[in] character_classifier a pointer to CvBoost for character classification
GroupClassifier(char *trained_boost_filename, RegionClassifier *character_classifier);
/// Classify a region. Returns true iif a group of regions is classified as a text group
/// @param[in] regions A pointer to the group of regions indexes to be classified.
/// @param[in] regions A pointer to the whole regions vector.
double operator()(vector<int> *group, vector<Region> *regions);
private:
// Boosted tree classifier
CvBoost boost_;
// Boosted tree classifier for single characters
RegionClassifier *character_classifier_;
// Classification parameter
float decision_threshold_;
};
#endif